@kabmo-labs/kabmo 0.61.0 → 0.62.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/README.md +53 -49
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +1157 -825
- package/dist/client/static/js/{Body-ab8wswhm.js → Body-z6kstvk6.js} +3 -3
- package/dist/client/static/js/{CsvGrid-czssywvz.js → CsvGrid-f73c0s4e.js} +2 -2
- package/dist/client/static/js/{DocxView-ke0dwdmt.js → DocxView-a1pb7nsb.js} +3 -3
- package/dist/client/static/js/{DrawioView-a1whhy84.js → DrawioView-r61gcg24.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-dr32dwjy.js → HtmlPreview-vt7j0b05.js} +1 -1
- package/dist/client/static/js/ImageView-4nhr5dtm.js +1 -0
- package/dist/client/static/js/LayoutWrapper-vwhy0vhj.js +2 -0
- package/dist/client/static/js/MergeDiffView-f4h9ss71.js +1 -0
- package/dist/client/static/js/Modal-cadmjkak.js +60 -0
- package/dist/client/static/js/{PdfView-2kdn91f9.js → PdfView-mppt2gkd.js} +1 -1
- package/dist/client/static/js/SessionsView-vvsaw9f0.js +1 -0
- package/dist/client/static/js/{SheetView-ettr9pdw.js → SheetView-5s9zfx9g.js} +9 -9
- package/dist/client/static/js/{SvgPreview-hzcejjry.js → SvgPreview-ff78xn3e.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-kdmv4y72.js → abnfDiagram-O67JEVCF-p29sh3w2.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-83w3kytq.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-qyrwaq0x.js → architectureDiagram-NJMV4G6O-nbpdyea3.js} +3 -3
- package/dist/client/static/js/{astro-yphdvdty.js → astro-qtfmc8x7.js} +1 -1
- package/dist/client/static/js/bash-wcy12qjx.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-tszxy2g7.js → blockDiagram-BEXU5L5S-t8xbexa6.js} +6 -6
- package/dist/client/static/js/c-vvantfth.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-0ye36hhv.js → c4Diagram-YGBWAQC7-9fwf2zxk.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-szgk1shv.js → classDiagram-v2-NBCMYWYE-nbapgqbs.js} +4 -4
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-0s9s4mmv.js → cose-bilkent-JH36ORCC-k54mmydp.js} +1 -1
- package/dist/client/static/js/cpp-5x63r6g0.js +1 -0
- package/dist/client/static/js/css-j2j6f03w.js +1 -0
- package/dist/client/static/js/css-qk59j6rj.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-80z02zrj.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-664g28ze.js → cynefinDiagram-VND7K2PF-qdg32wah.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-ga4rp1jx.js → dagre-6A5THRUB-qzshg1vs.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-aagj46ty.js → diagram-22UHCM2B-197hemfa.js} +11 -11
- package/dist/client/static/js/{diagram-3UASUU5V-20qk6whk.js → diagram-3UASUU5V-236gnjr6.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-1vg1tfca.js → diagram-ATOU4E4O-vjgpyaaq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-90d6jrqs.js → diagram-CDSNMT55-ywvzcx7z.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-8je4z8m1.js → diagram-MLGK6HIB-9ey7ev7j.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-0kzpexsj.js → diagram-MPIPVDR6-vrqbb6r7.js} +2 -2
- package/dist/client/static/js/{dockerfile-5nrbr0ef.js → dockerfile-4nked309.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-47yg36zx.js → ebnfDiagram-ZINNZB2B-hvnkevqy.js} +1 -1
- package/dist/client/static/js/{elixir-3nwnd9yw.js → elixir-3jvh6v4k.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-5hqp6r2d.js → elk-276RUBZZ-nej6yy1c.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-bt9te7r0.js → erDiagram-OPXOYQCR-ww453xcy.js} +5 -5
- package/dist/client/static/js/{erlang-p5c4n3t0.js → erlang-4fz73a1q.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-y9pq2709.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-e6v7513q.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-kzc13swm.js → ganttDiagram-FUAMR5RP-abc5wy70.js} +3 -3
- package/dist/client/static/js/gitGraph-4MIJSDKK-fzaf9azs.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-bjf8aa3j.js → gitGraphDiagram-X574FWY7-4acqzj2h.js} +7 -7
- package/dist/client/static/js/graphql-hpkvdvk7.js +1 -0
- package/dist/client/static/js/html-x12gb1wk.js +1 -0
- package/dist/client/static/js/{index-v88m5sva.js → index-0g82ph6h.js} +2 -2
- package/dist/client/static/js/{index-1fmjhm2d.js → index-0w1jzang.js} +5 -5
- package/dist/client/static/js/{index-kj70d2q9.js → index-1svt0cdw.js} +2 -2
- package/dist/client/static/js/{index-m24sebb0.js → index-1tb4py5v.js} +2 -2
- package/dist/client/static/js/index-2gt9krtj.js +4 -0
- package/dist/client/static/js/index-2x9m7s1a.js +1 -0
- package/dist/client/static/js/index-3fvqmz3m.js +4 -0
- package/dist/client/static/js/{index-k9yf2txw.js → index-42wvbkm5.js} +2 -2
- package/dist/client/static/js/index-477vtt51.js +2 -0
- package/dist/client/static/js/{index-ca6tmamh.js → index-4px56qaz.js} +2 -2
- package/dist/client/static/js/{index-excgtjhx.js → index-5anvw7xg.js} +36 -36
- package/dist/client/static/js/index-5nb9k2ph.js +1 -0
- package/dist/client/static/js/{index-97sw4d9n.js → index-615je3km.js} +2 -2
- package/dist/client/static/js/{index-jz4012t5.js → index-66qxrh5n.js} +1 -1
- package/dist/client/static/js/{index-a145x0w2.js → index-7kct1sz1.js} +2 -2
- package/dist/client/static/js/{index-hwv7bfxc.js → index-8e0d8y30.js} +2 -2
- package/dist/client/static/js/{index-s4j2ghmx.js → index-90bq56xw.js} +2 -2
- package/dist/client/static/js/{index-wsy6y5em.js → index-b1gzh60t.js} +11 -11
- package/dist/client/static/js/{index-10vzyga1.js → index-bypkmjrz.js} +2 -2
- package/dist/client/static/js/{index-n8r7r86r.js → index-c1vd63yd.js} +2 -2
- package/dist/client/static/js/index-c9f0hejv.js +3 -0
- package/dist/client/static/js/{index-2dmew334.js → index-cgqj15g0.js} +2 -2
- package/dist/client/static/js/{index-mtav0rpf.js → index-cts5re1t.js} +2 -2
- package/dist/client/static/js/index-dxc14kmm.js +1 -0
- package/dist/client/static/js/{index-krdz5vby.js → index-dxyjxhm1.js} +2 -2
- package/dist/client/static/js/{index-zr3965k9.js → index-edpyqz9f.js} +1 -1
- package/dist/client/static/js/{index-h7agc069.js → index-eesepb70.js} +2 -2
- package/dist/client/static/js/{index-r38e0rya.js → index-evh437bz.js} +2 -2
- package/dist/client/static/js/index-ey6v4t5b.js +1 -0
- package/dist/client/static/js/{index-025s3fp8.js → index-fsd7n336.js} +2 -2
- package/dist/client/static/js/{index-yfcy4cf6.js → index-h7a7fqag.js} +2 -2
- package/dist/client/static/js/{index-11qn05g9.js → index-hffgwnvz.js} +2 -2
- package/dist/client/static/js/index-j734ev6q.js +482 -0
- package/dist/client/static/js/{index-9g2nzgpx.js → index-jcbp1d9d.js} +6 -6
- package/dist/client/static/js/index-jg5h18sm.js +2 -0
- package/dist/client/static/js/{index-bq9f0mxp.js → index-jtdve6xw.js} +7 -7
- package/dist/client/static/js/{index-kyr612aa.js → index-k0bqrb1y.js} +1 -1
- package/dist/client/static/js/{index-bdtftrym.js → index-kegevd10.js} +2 -2
- package/dist/client/static/js/{index-fr6wsqk8.js → index-kqcfxkch.js} +2 -2
- package/dist/client/static/js/{index-sr14vwn5.js → index-kv1xnem9.js} +2 -2
- package/dist/client/static/js/{index-xy0m8te9.js → index-m54ctmxr.js} +1 -1
- package/dist/client/static/js/index-mgzbypt5.js +314 -0
- package/dist/client/static/js/{index-85jfn1fz.js → index-mh52531j.js} +2 -2
- package/dist/client/static/js/{index-776n5n29.js → index-mhz5ywa4.js} +5 -5
- package/dist/client/static/js/{index-3j2he86h.js → index-nnwdbg3t.js} +2 -2
- package/dist/client/static/js/{index-3x7cbxwq.js → index-nxd6z7f9.js} +2 -2
- package/dist/client/static/js/{index-dabnbvbc.js → index-pjrbt77c.js} +2 -2
- package/dist/client/static/js/index-r7h4pm42.js +2 -0
- package/dist/client/static/js/index-ratrdgc9.js +2 -0
- package/dist/client/static/js/{index-475dc6h9.js → index-rhmvh9w5.js} +2 -2
- package/dist/client/static/js/{index-twwsn91p.js → index-sqzjwy9h.js} +2 -2
- package/dist/client/static/js/{index-z5s9tmj8.js → index-tckzkw0f.js} +2 -2
- package/dist/client/static/js/index-tza9h3q6.css +1 -0
- package/dist/client/static/js/{index-qccydkze.js → index-vhjfr093.js} +2 -2
- package/dist/client/static/js/{index-653x8zdq.js → index-w0j96eyy.js} +8 -8
- package/dist/client/static/js/{index-24a40rw8.js → index-ws04kxy9.js} +1 -1
- package/dist/client/static/js/{index-a3bpmw2r.js → index-x1yqmzpr.js} +2 -2
- package/dist/client/static/js/{index-fb2fjndj.js → index-x2f7wykb.js} +6 -6
- package/dist/client/static/js/index-y8405hdg.js +10 -0
- package/dist/client/static/js/{index-sx83ans2.js → index-yxk7dgnb.js} +2 -2
- package/dist/client/static/js/{index-bkn6jtn1.js → index-zavecxak.js} +2 -2
- package/dist/client/static/js/{index-vn59zz0k.js → index-zg7q3kcb.js} +2 -2
- package/dist/client/static/js/{index-enm77k5z.js → index-zhn9vv3z.js} +2 -2
- package/dist/client/static/js/{index-vgcw01yk.js → index-zy963qbh.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-t7pbg7rt.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-jy5zvvj8.js → infoDiagram-VRGFBTTK-9pe7w3r5.js} +2 -2
- package/dist/client/static/js/ini-522adp5a.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-pfky1nnf.js → ishikawaDiagram-OU5B5YK6-38arfrx5.js} +2 -2
- package/dist/client/static/js/java-z0rgs7v6.js +1 -0
- package/dist/client/static/js/javascript-fv87f565.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mvaf7rfh.js → journeyDiagram-ZHPQQLJL-kcwzjgtz.js} +4 -4
- package/dist/client/static/js/json-1czq1ped.js +1 -0
- package/dist/client/static/js/jsx-1fch2jyr.js +1 -0
- package/dist/client/static/js/{julia-rpd1y9vh.js → julia-pzzxbptm.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-hw2xwe6e.js → kanban-definition-PNTS6WVX-nmegwy9w.js} +15 -15
- package/dist/client/static/js/lua-nn8bpjev.js +1 -0
- package/dist/client/static/js/markdown-38tqrgkn.js +1 -0
- package/dist/client/static/js/{mermaid.core-hsw87hmq.js → mermaid.core-3aae27b9.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-wfe4d846.js → mindmap-definition-NLK3R4M7-zsaq4e65.js} +12 -12
- package/dist/client/static/js/one-dark-pro-trnff03z.js +1 -0
- package/dist/client/static/js/one-light-ck31ptqs.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-rwac7scq.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-cvnmxgst.js → pegDiagram-GJSIUBJH-2b6whj1p.js} +1 -1
- package/dist/client/static/js/{perl-kmtz9dnv.js → perl-zdkbbjd2.js} +1 -1
- package/dist/client/static/js/{php-bttrsbxy.js → php-ktaxff6g.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-gjz20apz.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-0n3gz7sv.js → pieDiagram-5QR66LMP-y09ar7vz.js} +3 -3
- package/dist/client/static/js/properties-kncqeqhn.js +1 -0
- package/dist/client/static/js/python-gx8ggmyh.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-9qqh6xvv.js → quadrantDiagram-O4NWA36T-mapfzs06.js} +3 -3
- package/dist/client/static/js/r-x8rftkm3.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-akwdknab.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-m5v4rfhx.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-k2gmqcjb.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zdsfjf4.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-e98evqb6.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-5f3x3762.js → railroadDiagram-XR7U4H2S-70qy7qdh.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-a68bv6kh.js → requirementDiagram-PLB6GJNP-2vb2gp3e.js} +3 -3
- package/dist/client/static/js/{ruby-dve3y59w.js → ruby-ytqv3pqz.js} +1 -1
- package/dist/client/static/js/{rust-qjhdt4b0.js → rust-6sddyxnt.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ry7xcphh.js → sankeyDiagram-IPEJSGJF-9jd8ebrn.js} +3 -3
- package/dist/client/static/js/{sass-emxqt5p2.js → sass-dvbra5b6.js} +1 -1
- package/dist/client/static/js/{scss-4j4t3r6y.js → scss-sy7w8916.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-mekzzhet.js → sequenceDiagram-PO4LG4MO-w7z84f80.js} +7 -7
- package/dist/client/static/js/{sizeCapture-INFHLROL-pvc16ame.js → sizeCapture-INFHLROL-q8w7ehgx.js} +1 -1
- package/dist/client/static/js/sql-99y0qnag.js +1 -0
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-3ytxby83.js → stateDiagram-v2-GCMORJYK-4978hapr.js} +3 -3
- package/dist/client/static/js/{svelte-dbsx1ehx.js → svelte-xvs3fkza.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-c2zfp416.js → swimlanes-2SLR337P-eshg5fjy.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-914e28hd.js +8 -0
- package/dist/client/static/js/timeline-definition-EJHVYXUP-5h5q357k.js +120 -0
- package/dist/client/static/js/treeView-Q6P3EWNA-fkm3a7gx.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-hm4ktxjf.js +1 -0
- package/dist/client/static/js/tsx-phngprp0.js +1 -0
- package/dist/client/static/js/typescript-m62a7zr2.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-sz6b7bnv.js → usecaseDiagram-POWQR4AR-4j69y3zx.js} +20 -20
- package/dist/client/static/js/vennDiagram-UO4OBE2U-pa9p5jpw.js +34 -0
- package/dist/client/static/js/{vue-hyr58df9.js → vue-p4g4avm3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-3y2rvdmy.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-xvtyvde9.js → wardleyDiagram-VNRHLVJA-hjddd656.js} +3 -3
- package/dist/client/static/js/xml-59n0cjn6.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-jcs20s84.js → xychartDiagram-PMCCYNJV-8ng5m849.js} +4 -4
- package/dist/client/static/js/yaml-9fw908s4.js +1 -0
- package/dist/client/tailwindcss-oxide.linux-x64-gnu-c0fa36dv.node +0 -0
- package/dist/client/tailwindcss-oxide.linux-x64-musl-kr04sh0e.node +0 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/app.tsx +2 -5
- package/marketplace/plugins/command-runner/src/panel/CustomForm.tsx +35 -52
- package/marketplace/plugins/command-runner/src/panel/Groups.tsx +6 -5
- package/marketplace/plugins/command-runner/src/panel/Header.tsx +18 -54
- package/marketplace/plugins/command-runner/src/panel/Output.tsx +3 -7
- package/marketplace/plugins/command-runner/src/panel/Row.tsx +19 -38
- package/marketplace/plugins/command-runner/src/panel/index.tsx +1 -4
- package/marketplace/plugins/git-forge/package.json +2 -2
- package/marketplace/plugins/git-forge/src/app.tsx +2 -0
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +8 -15
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +35 -66
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +7 -13
- package/marketplace/plugins/git-forge/src/panel/List.tsx +28 -56
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +7 -9
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +21 -31
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +26 -40
- package/marketplace/plugins/git-forge/src/panel/index.tsx +0 -1
- package/marketplace/plugins/github-actions/package.json +2 -2
- package/marketplace/plugins/github-actions/src/app.tsx +2 -0
- package/marketplace/plugins/github-actions/src/panel/Actions.tsx +9 -17
- package/marketplace/plugins/github-actions/src/panel/LogView.tsx +4 -13
- package/marketplace/plugins/github-actions/src/panel/Row.tsx +4 -5
- package/marketplace/plugins/github-actions/src/panel/RunView.tsx +8 -15
- package/marketplace/plugins/github-actions/src/panel/index.test.tsx +3 -2
- package/marketplace/plugins/github-actions/src/panel/index.tsx +31 -37
- package/marketplace/plugins/kanban/package.json +2 -2
- package/marketplace/plugins/kanban/src/app.tsx +2 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +88 -98
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +6 -10
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +22 -18
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +59 -70
- package/marketplace/plugins/kanban/src/panel/index.tsx +37 -52
- package/marketplace/plugins/kanban/src/panel/use-board.ts +2 -0
- package/marketplace/plugins/session-info/package.json +2 -2
- package/marketplace/plugins/session-info/src/app.tsx +6 -3
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/KillConfirm.test.tsx +6 -4
- package/marketplace/plugins/stats/src/KillConfirm.tsx +26 -76
- package/marketplace/plugins/stats/src/ProcessTable.tsx +8 -6
- package/marketplace/plugins/stats/src/RefreshButton.tsx +7 -5
- package/marketplace/plugins/stats/src/app.tsx +11 -9
- package/package.json +10 -10
- package/src/cli/lib/commands/plugin.js +8 -5
- package/src/client/bootstrap.d.ts +5 -0
- package/src/client/chat-title-overlay.test.ts +53 -0
- package/src/client/components/auth/login-screen/index.tsx +31 -3
- package/src/client/components/common/SignOutButton.tsx +4 -5
- package/src/client/components/common/account-badge/index.tsx +31 -0
- package/src/client/components/common/footer-version/index.tsx +40 -0
- package/src/client/components/common/fullscreen-viewer/fullscreen-viewer.test.tsx +24 -0
- package/src/client/components/common/fullscreen-viewer/index.tsx +22 -31
- package/src/client/components/common/header-controls/MoreMenu.tsx +5 -56
- package/src/client/components/common/header-controls/index.test.tsx +2 -6
- package/src/client/components/common/header-controls/index.tsx +9 -25
- package/src/client/components/common/header-controls/phone-row.test.tsx +3 -16
- package/src/client/components/common/shell-update-button/index.tsx +2 -2
- package/src/client/components/common/zoom-pan-stage/index.tsx +54 -50
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +4 -5
- package/src/client/components/layout/desktop-layout/index.tsx +2 -4
- package/src/client/components/layout/left-bar/index.tsx +25 -3
- package/src/client/components/layout/rail-toggle.test.tsx +112 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.accent.test.tsx +81 -0
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +11 -3
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +36 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +42 -61
- package/src/client/components/layout/session-sidebar/FooterHost.tsx +5 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +30 -10
- package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +4 -0
- package/src/client/components/layout/session-sidebar/modern/index.tsx +8 -1
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +25 -4
- package/src/client/components/layout/session-title-bar/index.tsx +13 -5
- package/src/client/components/layout/top-bars.test.tsx +4 -2
- package/src/client/components/mobile/LayoutWrapper.tsx +3 -1
- package/src/client/components/mobile/RightSidebar.tsx +12 -3
- package/src/client/components/mobile/SessionSidebar.tsx +6 -2
- package/src/client/components/mobile/drawer-layout.test.tsx +7 -3
- package/src/client/components/mobile/drawer-strip.tsx +9 -2
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +29 -9
- package/src/client/components/mobile/mobile-main-view/Header.tsx +43 -12
- package/src/client/components/mobile/mobile-right-sidebar/Chrome.tsx +12 -1
- package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +1 -0
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +9 -1
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +4 -2
- package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +1 -1
- package/src/client/components/mobile/mobile-session-sidebar/Footer.tsx +48 -46
- package/src/client/components/mobile/mobile-session-sidebar/Header.tsx +18 -1
- package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +4 -0
- package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +4 -6
- package/src/client/components/mobile/right-drawer-nav.test.tsx +53 -1
- package/src/client/components/settings/Band.tsx +5 -2
- package/src/client/components/settings/Modal.tsx +8 -5
- package/src/client/components/settings/Sidebar.tsx +5 -3
- package/src/client/components/settings/apply-side-effects.ts +5 -0
- package/src/client/components/settings/categories/AccountSettings.tsx +266 -0
- package/src/client/components/settings/categories/ProjectSettings.tsx +2 -0
- package/src/client/components/settings/categories/account-settings/Dialogs.tsx +223 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +3 -4
- package/src/client/components/settings/categories/appearance-settings/ChromeStyleSection.tsx +66 -39
- package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +7 -4
- package/src/client/components/settings/categories/project-settings/DetailsForm.tsx +14 -1
- package/src/client/components/settings/categories/project-settings/ProjectSharing.tsx +130 -0
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +5 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/SessionSkeleton.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +9 -2
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.test.ts +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/expansion.ts +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +34 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/styles.test.tsx +4 -1
- package/src/client/components/workspace/editor/Tab.tsx +19 -26
- package/src/client/components/workspace/editor/Tabs.test.ts +13 -7
- package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -0
- package/src/client/components/workspace/git-panel/commit-modal/floating.test.ts +46 -0
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +2 -0
- package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +4 -5
- package/src/client/components/workspace/panel-tabs/TabChip.tsx +40 -39
- package/src/client/components/workspace/panel-tabs/TabStrip.connected.test.tsx +76 -58
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +9 -9
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +14 -1
- package/src/client/components/workspace/panel-tabs/index.tsx +1 -1
- package/src/client/components/workspace/plugin-panel/catalog.tsx +22 -5
- package/src/client/components/workspace/plugin-panel/chrome.test.tsx +89 -0
- package/src/client/components/workspace/plugin-panel/chrome.tsx +62 -0
- package/src/client/data/settings/omp-schema.json +40 -4
- package/src/client/floating-phone.test.ts +189 -0
- package/src/client/floating.css +205 -2
- package/src/client/floating.test.ts +43 -0
- package/src/client/glass.css +47 -0
- package/src/client/hooks/chat/omp/index.ts +6 -5
- package/src/client/hooks/chat/omp/prompt-send.test.ts +18 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +26 -8
- package/src/client/hooks/chat/omp/session-list.tsx +20 -8
- package/src/client/hooks/chat/timeline/deferred-model.ts +13 -5
- package/src/client/hooks/chat/timeline/index.ts +2 -0
- package/src/client/hooks/chat/timeline/send-props.ts +14 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send-switch.test.ts +92 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +37 -7
- package/src/client/hooks/chat/timeline/send.test.ts +11 -2
- package/src/client/hooks/chat/timeline/send.ts +62 -42
- package/src/client/hooks/editor/image-generation.ts +24 -0
- package/src/client/hooks/editor/resolve-viewer.test.ts +26 -20
- package/src/client/hooks/editor/resolve-viewer.ts +14 -5
- package/src/client/hooks/editor/use-file-editor.test.ts +34 -0
- package/src/client/hooks/editor/use-file-editor.ts +6 -2
- package/src/client/hooks/settings/accounts.ts +162 -0
- package/src/client/hooks/ui/auth.ts +58 -3
- package/src/client/hooks/ui/border-style.test.ts +5 -4
- package/src/client/hooks/ui/border-style.ts +3 -2
- package/src/client/hooks/ui/mobile-chrome-style.ts +68 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +1 -2
- package/src/client/hooks/ui/navbar-controls.ts +0 -3
- package/src/client/hooks/ui/zoom-gesture.ts +104 -0
- package/src/client/lib/desktop/titlebar.test.ts +21 -0
- package/src/client/lib/desktop/titlebar.ts +34 -0
- package/src/client/lib/plugins/bootstrap.test.ts +20 -0
- package/src/client/lib/plugins/bootstrap.tsx +10 -15
- package/src/client/lib/plugins/kit-components.test.tsx +119 -0
- package/src/client/lib/plugins/kit-components.tsx +79 -0
- package/src/client/lib/plugins/kit.ts +8 -0
- package/src/client/lib/plugins/slots.test.ts +34 -0
- package/src/client/lib/plugins/slots.ts +31 -4
- package/src/client/lib/plugins/stylesheets.ts +10 -11
- package/src/client/lib/ui/pinch.test.ts +74 -0
- package/src/client/lib/ui/pinch.ts +104 -0
- package/src/client/lib/ui/safe-area.test.ts +25 -0
- package/src/client/lib/ui/safe-area.ts +23 -0
- package/src/client/main.tsx +8 -1
- package/src/client/tailwind.css +54 -1
- package/src/server/index.ts +2 -0
- package/src/server/lib/assets/shell-attributes.server.ts +12 -4
- package/src/server/lib/assets/shell-attributes.test.ts +19 -18
- package/src/server/lib/auth/client-address.test.ts +2 -2
- package/src/server/lib/auth/guard.test.ts +2 -2
- package/src/server/lib/auth/guard.ts +81 -97
- package/src/server/lib/auth/handover-guard.test.ts +1 -1
- package/src/server/lib/auth/rate-limit.test.ts +2 -2
- package/src/server/lib/auth/token.test.ts +1 -1
- package/src/server/lib/auth/workspace-gate.server.ts +34 -0
- package/src/server/lib/bundler/css.test.ts +16 -0
- package/src/server/lib/connect/devices.server.test.ts +12 -0
- package/src/server/lib/connect/devices.server.ts +63 -19
- package/src/server/lib/connect/pairing.server.ts +5 -3
- package/src/server/lib/connect/status.server.ts +2 -2
- package/src/server/lib/db/schema.test.ts +3 -3
- package/src/server/lib/db/schema.ts +6 -0
- package/src/server/lib/harness/update-spawn.server.test.ts +97 -0
- package/src/server/lib/harness/update-spawn.server.ts +10 -0
- package/src/server/lib/models/provider-icon-override.server.test.ts +140 -0
- package/src/server/lib/models/provider-icon-override.server.ts +197 -0
- package/src/server/lib/models/provider-icon-store.server.ts +8 -0
- package/src/server/lib/models/provider-icon.server.ts +31 -6
- package/src/server/lib/omp/session/artifacts.server.test.ts +11 -7
- package/src/server/lib/omp/session/artifacts.server.ts +21 -17
- package/src/server/lib/panels/build.server.ts +19 -2
- package/src/server/lib/panels/css.server.test.ts +141 -0
- package/src/server/lib/panels/css.server.ts +255 -0
- package/src/server/lib/panels/plugin-ui-contract.test.ts +64 -0
- package/src/server/lib/panels/registry-stylesheet.server.test.ts +69 -0
- package/src/server/lib/panels/scan.server.ts +13 -7
- package/src/server/lib/panels/source-warnings.server.test.ts +65 -0
- package/src/server/lib/panels/source-warnings.server.ts +71 -0
- package/src/server/lib/realtime/topics/catalog.server.ts +3 -0
- package/src/server/lib/realtime/topics.server.ts +14 -0
- package/src/server/lib/sessions/last-opened-client.server.ts +1 -1
- package/src/server/lib/workspace/access.server.ts +108 -0
- package/src/server/lib/workspace/project-patch.server.ts +4 -2
- package/src/server/lib/workspace/register-folder.server.ts +19 -5
- package/src/server/lib/workspace/session-access.server.ts +55 -0
- package/src/server/lib/workspace/tenancy-schema.server.ts +40 -0
- package/src/server/plugins/ssr.ts +19 -3
- package/src/server/routes/accounts/index.ts +8 -0
- package/src/server/routes/accounts/management.test.ts +174 -0
- package/src/server/routes/accounts/management.ts +166 -0
- package/src/server/routes/auth/login.ts +22 -8
- package/src/server/routes/auth/logout.ts +1 -1
- package/src/server/routes/auth/password.ts +40 -33
- package/src/server/routes/auth/revoke.test.ts +1 -1
- package/src/server/routes/auth/revoke.ts +26 -8
- package/src/server/routes/auth/routes.test.ts +3 -3
- package/src/server/routes/auth/state.ts +14 -7
- package/src/server/routes/connect/devices.ts +7 -4
- package/src/server/routes/connect/pair.ts +4 -3
- package/src/server/routes/connect/status.ts +4 -2
- package/src/server/routes/connect/tunnels.ts +2 -1
- package/src/server/routes/folders/batch-delete.ts +12 -0
- package/src/server/routes/folders/clone.ts +7 -2
- package/src/server/routes/folders/create.ts +3 -1
- package/src/server/routes/folders/folder.ts +44 -4
- package/src/server/routes/folders/index.ts +3 -0
- package/src/server/routes/folders/shares.ts +62 -0
- package/src/server/routes/index.ts +2 -0
- package/src/server/routes/panels/build.ts +1 -1
- package/src/server/routes/panels/css.test.ts +22 -0
- package/src/server/routes/panels/css.ts +5 -7
- package/src/server/routes/realtime/ws.ts +16 -1
- package/src/server/routes/sessions/list.ts +3 -2
- package/src/server/routes/settings/projects.ts +46 -7
- package/src/server/routes/settings/provider-icon.ts +18 -0
- package/src/shared/lib/chat/timeline/tool-render-mode.test.ts +2 -2
- package/src/shared/lib/chat/timeline/tool-render-mode.ts +6 -3
- package/src/shared/lib/icons/tint-hues.generated.ts +38 -37
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +27 -1
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +1 -1
- package/src/shared/lib/realtime/protocol.ts +16 -0
- package/src/shared/lib/settings/defaults.ts +2 -1
- package/src/shared/lib/settings/sections.ts +1 -1
- package/src/shared/lib/theme/border-style.test.ts +11 -9
- package/src/shared/lib/theme/border-style.ts +7 -7
- package/src/shared/lib/theme/chrome-style.test.ts +15 -0
- package/src/shared/lib/theme/chrome-style.ts +16 -1
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/settings/state.ts +6 -5
- package/src/test-support/file-editor.test-util.ts +25 -6
- package/tsconfig.json +21 -0
- package/dist/client/static/js/ImageView-zf4kh5wp.js +0 -1
- package/dist/client/static/js/LayoutWrapper-dncbzcea.js +0 -2
- package/dist/client/static/js/MergeDiffView-btdx9yb9.js +0 -1
- package/dist/client/static/js/Modal-5cxfw2rv.js +0 -60
- package/dist/client/static/js/SessionsView-vbn0nvx4.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-sxrkxwbq.js +0 -1
- package/dist/client/static/js/bash-bcbct9gc.js +0 -1
- package/dist/client/static/js/c-fn9jz26e.js +0 -1
- package/dist/client/static/js/cpp-a1q64mke.js +0 -1
- package/dist/client/static/js/css-b92azee8.js +0 -1
- package/dist/client/static/js/css-sn00sq6v.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-g1xwa8b9.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-05p61bka.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-500fcx2a.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-z1yehwys.js +0 -1
- package/dist/client/static/js/graphql-8d8bn59j.js +0 -1
- package/dist/client/static/js/html-6hdrwtz2.js +0 -1
- package/dist/client/static/js/index-0kcnghxn.js +0 -4
- package/dist/client/static/js/index-2zhmmtye.js +0 -2
- package/dist/client/static/js/index-4vtc4xct.js +0 -481
- package/dist/client/static/js/index-5srvxsht.js +0 -2
- package/dist/client/static/js/index-6c1s0v4b.js +0 -1
- package/dist/client/static/js/index-cvm2ha01.js +0 -1
- package/dist/client/static/js/index-d11mbz2q.js +0 -4
- package/dist/client/static/js/index-fen0x3qh.js +0 -1
- package/dist/client/static/js/index-gwgh27h3.js +0 -314
- package/dist/client/static/js/index-hxy1sadd.js +0 -2
- package/dist/client/static/js/index-pg87cgpy.js +0 -2
- package/dist/client/static/js/index-q1a40v20.js +0 -3
- package/dist/client/static/js/index-qmvstmvh.js +0 -1
- package/dist/client/static/js/index-t6nqy2n5.css +0 -1
- package/dist/client/static/js/index-wf5j0009.js +0 -10
- package/dist/client/static/js/index-y6zbkh4p.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-dqyaxjc1.js +0 -1
- package/dist/client/static/js/ini-g6a5xsaw.js +0 -1
- package/dist/client/static/js/java-n596am4c.js +0 -1
- package/dist/client/static/js/javascript-zc1qnyyp.js +0 -1
- package/dist/client/static/js/json-7k70qbkj.js +0 -1
- package/dist/client/static/js/jsx-sndenqrc.js +0 -1
- package/dist/client/static/js/lua-djd3g9q5.js +0 -1
- package/dist/client/static/js/markdown-r2tpvxpn.js +0 -1
- package/dist/client/static/js/one-dark-pro-ckq5capv.js +0 -1
- package/dist/client/static/js/one-light-a908z398.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-7jxzax4z.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-wc9wxr7f.js +0 -1
- package/dist/client/static/js/properties-brn72zdk.js +0 -1
- package/dist/client/static/js/python-g9mghwgm.js +0 -1
- package/dist/client/static/js/r-e247x4mw.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-kwj5padj.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-h8sdx3w5.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-2wmwx246.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-h4cdgw3y.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-q7m0tfd0.js +0 -1
- package/dist/client/static/js/sql-0kar81jy.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-9gm67sq4.js +0 -8
- package/dist/client/static/js/timeline-definition-EJHVYXUP-xtvv4za2.js +0 -120
- package/dist/client/static/js/treeView-Q6P3EWNA-yv9640h3.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-7kpzjg21.js +0 -1
- package/dist/client/static/js/tsx-gjxfjnbk.js +0 -1
- package/dist/client/static/js/typescript-bm89v3gk.js +0 -1
- package/dist/client/static/js/vennDiagram-UO4OBE2U-56q0qs51.js +0 -34
- package/dist/client/static/js/wardley-WFR3VGLG-mggay64p.js +0 -1
- package/dist/client/static/js/xml-b7824nx0.js +0 -1
- package/dist/client/static/js/yaml-kqqktdv1.js +0 -1
- package/src/server/lib/auth/client-address.ts +0 -89
- package/src/server/lib/auth/config.ts +0 -133
- package/src/server/lib/auth/rate-limit.ts +0 -146
- package/src/server/lib/auth/token.ts +0 -220
|
@@ -20,15 +20,16 @@ import { json, NO_STORE_HEADERS } from '@kabmo-labs/kabmo-http';
|
|
|
20
20
|
import type { ActionFunctionArgs } from '@kabmo-labs/kabmo-http';
|
|
21
21
|
import { methodNotAllowed, parseJsonBody } from '@/server/lib/route-adapter';
|
|
22
22
|
import { loadAuthConfig } from '@/server/lib/auth/guard';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
23
|
+
import { getAccount, publicAccounts } from '@kabmo-labs/kabmo-auth/server/accounts';
|
|
24
|
+
import { verifyPassword } from '@kabmo-labs/kabmo-auth/server/config';
|
|
25
|
+
import { isSecureRequest, issueSessionToken, sessionCookieHeader, sessionCookieName, SESSION_TTL_MS, TRUSTED_DEVICE_TTL_MS } from '@kabmo-labs/kabmo-auth/server/token';
|
|
26
|
+
import { clientAddressFor } from '@kabmo-labs/kabmo-auth/server/client-address';
|
|
26
27
|
import {
|
|
27
28
|
checkLoginRateLimit,
|
|
28
29
|
clearLoginRateLimit,
|
|
29
30
|
recordLoginFailure,
|
|
30
31
|
RATE_LIMIT_MAX_ATTEMPTS,
|
|
31
|
-
} from '
|
|
32
|
+
} from '@kabmo-labs/kabmo-auth/server/rate-limit';
|
|
32
33
|
|
|
33
34
|
const LOCKED_BODY = { error: 'Invalid password', locked: true } as const;
|
|
34
35
|
|
|
@@ -56,10 +57,20 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
56
57
|
);
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
const parsed = await parseJsonBody<{ password?: unknown; trustDevice?: unknown }>(request);
|
|
60
|
+
const parsed = await parseJsonBody<{ password?: unknown; trustDevice?: unknown; accountId?: unknown }>(request);
|
|
60
61
|
const candidate = parsed.ok && typeof parsed.body?.password === 'string' ? parsed.body.password : '';
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
const requestedAccountId = parsed.ok && typeof parsed.body?.accountId === 'string' ? parsed.body.accountId : '';
|
|
63
|
+
const accounts = publicAccounts();
|
|
64
|
+
const accountId = requestedAccountId || (accounts.length === 1 ? accounts[0]?.id ?? 'root' : '');
|
|
65
|
+
if (!accountId) {
|
|
66
|
+
return json({ error: 'Choose an account to sign in', code: 'account_required' }, { status: 400, headers: rateHeaders });
|
|
67
|
+
}
|
|
68
|
+
const account = getAccount(accountId);
|
|
69
|
+
if (!account) {
|
|
70
|
+
return json(LOCKED_BODY, { status: 401, headers: rateHeaders });
|
|
71
|
+
}
|
|
72
|
+
const passwordHash = account.role === 'root' ? config.passwordHash : account.passwordHash;
|
|
73
|
+
if (!passwordHash || !candidate || !(await verifyPassword(candidate, passwordHash))) {
|
|
63
74
|
const afterFailure = recordLoginFailure(clientKey);
|
|
64
75
|
if (!afterFailure.allowed) {
|
|
65
76
|
return json(
|
|
@@ -76,8 +87,11 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
76
87
|
const ttlMs = trustDevice ? TRUSTED_DEVICE_TTL_MS : SESSION_TTL_MS;
|
|
77
88
|
const token = issueSessionToken({
|
|
78
89
|
sessionSecret: config.sessionSecret,
|
|
79
|
-
credentialKey: config.credentialKey,
|
|
90
|
+
credentialKey: account.role === 'root' ? config.credentialKey : account.credentialKey ?? '',
|
|
80
91
|
ttlMs,
|
|
92
|
+
...(account.role === 'member'
|
|
93
|
+
? { accountId: account.id, epoch: account.sessionEpoch }
|
|
94
|
+
: {}),
|
|
81
95
|
});
|
|
82
96
|
|
|
83
97
|
return json(
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { json, NO_STORE_HEADERS } from '@kabmo-labs/kabmo-http';
|
|
20
20
|
import type { ActionFunctionArgs } from '@kabmo-labs/kabmo-http';
|
|
21
21
|
import { methodNotAllowed } from '@/server/lib/route-adapter';
|
|
22
|
-
import { clearSessionCookieHeader, isSecureRequest, sessionCookieName } from '
|
|
22
|
+
import { clearSessionCookieHeader, isSecureRequest, sessionCookieName } from '@kabmo-labs/kabmo-auth/server/token';
|
|
23
23
|
|
|
24
24
|
export async function action({ request, params }: ActionFunctionArgs) {
|
|
25
25
|
if (request.method !== 'POST') return methodNotAllowed({ request, params });
|
|
@@ -4,31 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* `POST /api/auth/password` — change the
|
|
7
|
+
* `POST /api/auth/password` — change the signed-in account's password.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The change is IN MEMORY, which is what the design allows: nothing on disk can
|
|
15
|
-
* hold a password, so there is nothing durable to update. It lasts until the
|
|
16
|
-
* process exits; the next start gets its password from `--ui-password` or
|
|
17
|
-
* `KABMO_UI_PASSWORD` again. The response says so, because a user who
|
|
18
|
-
* believes they changed a stored password would be surprised by a restart.
|
|
19
|
-
*
|
|
20
|
-
* Every OTHER session is revoked by the change: a token carries a fingerprint of
|
|
21
|
-
* the password hash, so the new hash invalidates the whole set. This browser gets
|
|
22
|
-
* a replacement cookie, which is the difference between "password changed" and
|
|
23
|
-
* "password changed, and you are now at the login screen".
|
|
9
|
+
* Root's password is ephemeral: the new value lives for this process and the
|
|
10
|
+
* next start takes `--ui-password` again. A member's password is persisted as
|
|
11
|
+
* argon2id and its session epoch advances, so every other cookie for that
|
|
12
|
+
* account stops verifying while the browser that asked receives a fresh one.
|
|
24
13
|
*/
|
|
25
14
|
|
|
26
15
|
import { json, NO_STORE_HEADERS } from '@kabmo-labs/kabmo-http';
|
|
27
16
|
import type { ActionFunctionArgs } from '@kabmo-labs/kabmo-http';
|
|
28
17
|
import { methodNotAllowed, parseJsonBody } from '@/server/lib/route-adapter';
|
|
29
|
-
import { verifyPassword } from '
|
|
30
|
-
import { loadAuthConfig, replaceActivePassword } from '@/server/lib/auth/guard';
|
|
31
|
-
import {
|
|
18
|
+
import { verifyPassword } from '@kabmo-labs/kabmo-auth/server/config';
|
|
19
|
+
import { authenticatedAccount, loadAuthConfig, replaceActivePassword } from '@/server/lib/auth/guard';
|
|
20
|
+
import { getAccount, rootAccount, setMemberPassword } from '@kabmo-labs/kabmo-auth/server/accounts';
|
|
21
|
+
import { issueSessionToken, isSecureRequest, readSessionCookie, sessionCookieHeader, sessionCookieName, sessionRemainingMs, SESSION_TTL_MS } from '@kabmo-labs/kabmo-auth/server/token';
|
|
32
22
|
|
|
33
23
|
/** Shortest accepted password. Below this the argon2 cost stops being the weak link. */
|
|
34
24
|
export const MIN_PASSWORD_LENGTH = 8;
|
|
@@ -40,6 +30,15 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
40
30
|
if (!config) {
|
|
41
31
|
return json({ error: 'UI authentication is not enabled' }, { status: 400, headers: NO_STORE_HEADERS });
|
|
42
32
|
}
|
|
33
|
+
// The route is behind the gate; this fallback exists for the direct-handler
|
|
34
|
+
// contract and for a caller that already proved the credential (the password
|
|
35
|
+
// is re-verified below).
|
|
36
|
+
const session = authenticatedAccount(request) ?? {
|
|
37
|
+
id: rootAccount().id,
|
|
38
|
+
name: rootAccount().name,
|
|
39
|
+
role: 'root' as const,
|
|
40
|
+
epoch: 0,
|
|
41
|
+
};
|
|
43
42
|
|
|
44
43
|
const parsed = await parseJsonBody<{ currentPassword?: unknown; newPassword?: unknown }>(request);
|
|
45
44
|
if (!parsed.ok) {
|
|
@@ -48,8 +47,12 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
48
47
|
|
|
49
48
|
const currentPassword = typeof parsed.body?.currentPassword === 'string' ? parsed.body.currentPassword : '';
|
|
50
49
|
const newPassword = typeof parsed.body?.newPassword === 'string' ? parsed.body.newPassword : '';
|
|
51
|
-
|
|
52
|
-
if (!
|
|
50
|
+
const account = getAccount(session.id);
|
|
51
|
+
if (!account) {
|
|
52
|
+
return json({ error: 'Account not found' }, { status: 404, headers: NO_STORE_HEADERS });
|
|
53
|
+
}
|
|
54
|
+
const currentHash = account.role === 'root' ? config.passwordHash : account.passwordHash;
|
|
55
|
+
if (!currentHash || !(await verifyPassword(currentPassword, currentHash))) {
|
|
53
56
|
return json({ error: 'Current password is incorrect' }, { status: 401, headers: NO_STORE_HEADERS });
|
|
54
57
|
}
|
|
55
58
|
if (newPassword.length < MIN_PASSWORD_LENGTH) {
|
|
@@ -62,35 +65,39 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
62
65
|
return json({ error: 'New password must differ from the current one' }, { status: 400, headers: NO_STORE_HEADERS });
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
// Read BEFORE the change: the
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
// how a 7-day session silently became a 12-hour one.
|
|
68
|
+
// Read BEFORE the change: the presented token stops verifying the moment the
|
|
69
|
+
// credential key rotates, so reading afterwards downgraded a 7-day session.
|
|
70
|
+
const credentialKey = account.role === 'root' ? config.credentialKey : account.credentialKey ?? '';
|
|
69
71
|
const ttlMs = sessionRemainingMs(readSessionCookie(request), {
|
|
70
72
|
sessionSecret: config.sessionSecret,
|
|
71
|
-
credentialKey
|
|
73
|
+
credentialKey,
|
|
74
|
+
...(account.role === 'member' ? { accountId: account.id, epoch: account.sessionEpoch } : {}),
|
|
72
75
|
}) ?? SESSION_TTL_MS;
|
|
73
76
|
|
|
74
|
-
|
|
77
|
+
if (account.role === 'root') {
|
|
78
|
+
await replaceActivePassword(newPassword);
|
|
79
|
+
} else if (!(await setMemberPassword(account.id, newPassword, config.sessionSecret))) {
|
|
80
|
+
return json({ error: 'Could not apply the new password' }, { status: 500, headers: NO_STORE_HEADERS });
|
|
81
|
+
}
|
|
82
|
+
|
|
75
83
|
const updated = loadAuthConfig();
|
|
76
|
-
|
|
84
|
+
const nextAccount = getAccount(account.id);
|
|
85
|
+
if (!updated || !nextAccount) {
|
|
77
86
|
return json({ error: 'Could not apply the new password' }, { status: 500, headers: NO_STORE_HEADERS });
|
|
78
87
|
}
|
|
79
88
|
|
|
80
|
-
// The user's own choice at the login screen, carried across the reissue.
|
|
81
89
|
const token = issueSessionToken({
|
|
82
90
|
sessionSecret: updated.sessionSecret,
|
|
83
|
-
credentialKey: updated.credentialKey,
|
|
91
|
+
credentialKey: nextAccount.role === 'root' ? updated.credentialKey : nextAccount.credentialKey ?? '',
|
|
84
92
|
ttlMs,
|
|
93
|
+
...(nextAccount.role === 'member' ? { accountId: nextAccount.id, epoch: nextAccount.sessionEpoch } : {}),
|
|
85
94
|
});
|
|
86
95
|
|
|
87
96
|
return json(
|
|
88
97
|
{
|
|
89
98
|
success: true,
|
|
90
99
|
sessionsRevoked: true,
|
|
91
|
-
|
|
92
|
-
// password lives for this process only.
|
|
93
|
-
persistsUntilRestart: true,
|
|
100
|
+
persistsUntilRestart: nextAccount.role === 'root',
|
|
94
101
|
},
|
|
95
102
|
{
|
|
96
103
|
headers: {
|
|
@@ -21,7 +21,7 @@ import path from 'node:path';
|
|
|
21
21
|
import { action as revoke } from '@/server/routes/auth/revoke';
|
|
22
22
|
import { loader as authState } from '@/server/routes/auth/state';
|
|
23
23
|
import { initAuth, loadAuthConfig } from '@/server/lib/auth/guard';
|
|
24
|
-
import { issueSessionToken, TRUSTED_DEVICE_TTL_MS } from '
|
|
24
|
+
import { issueSessionToken, TRUSTED_DEVICE_TTL_MS } from '@kabmo-labs/kabmo-auth/server/token';
|
|
25
25
|
|
|
26
26
|
const DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'omc-auth-revoke-'));
|
|
27
27
|
const PASSWORD = 'correct-horse-battery';
|
|
@@ -21,37 +21,55 @@
|
|
|
21
21
|
import { json, NO_STORE_HEADERS } from '@kabmo-labs/kabmo-http';
|
|
22
22
|
import type { ActionFunctionArgs } from '@kabmo-labs/kabmo-http';
|
|
23
23
|
import { methodNotAllowed } from '@/server/lib/route-adapter';
|
|
24
|
-
import { loadAuthConfig, revokeAllSessions } from '@/server/lib/auth/guard';
|
|
25
|
-
import {
|
|
24
|
+
import { authenticatedAccount, loadAuthConfig, revokeAllSessions } from '@/server/lib/auth/guard';
|
|
25
|
+
import { getAccount, rootAccount, bumpMemberEpoch } from '@kabmo-labs/kabmo-auth/server/accounts';
|
|
26
|
+
import { issueSessionToken, isSecureRequest, readSessionCookie, sessionCookieHeader, sessionCookieName, sessionRemainingMs, SESSION_TTL_MS } from '@kabmo-labs/kabmo-auth/server/token';
|
|
26
27
|
|
|
27
28
|
export async function action({ request, params }: ActionFunctionArgs) {
|
|
28
29
|
if (request.method !== 'POST') return methodNotAllowed({ request, params });
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
const before = loadAuthConfig();
|
|
32
|
+
if (!before) {
|
|
31
33
|
return json({ error: 'UI authentication is not enabled' }, { status: 400, headers: NO_STORE_HEADERS });
|
|
32
34
|
}
|
|
35
|
+
const root = rootAccount();
|
|
36
|
+
const session = authenticatedAccount(request) ?? { id: root.id, name: root.name, role: 'root' as const, epoch: 0 };
|
|
37
|
+
const current = getAccount(session.id);
|
|
38
|
+
if (!current) {
|
|
39
|
+
return json({ error: 'Account not found' }, { status: 404, headers: NO_STORE_HEADERS });
|
|
40
|
+
}
|
|
33
41
|
|
|
34
42
|
// Read BEFORE the rotation: revoking rotates the signing secret, so the
|
|
35
43
|
// presented token stops verifying the moment it happens — reading afterwards
|
|
36
44
|
// always answered "unusable" and fell back to the default, which is how a
|
|
37
45
|
// 7-day session silently became a 12-hour one.
|
|
38
|
-
const
|
|
46
|
+
const credentialKey = current.role === 'root' ? before.credentialKey : current.credentialKey ?? '';
|
|
39
47
|
const ttlMs = sessionRemainingMs(readSessionCookie(request), {
|
|
40
48
|
sessionSecret: before.sessionSecret,
|
|
41
|
-
credentialKey
|
|
49
|
+
credentialKey,
|
|
50
|
+
...(current.role === 'member' ? { accountId: current.id, epoch: current.sessionEpoch } : {}),
|
|
42
51
|
}) ?? SESSION_TTL_MS;
|
|
43
52
|
|
|
44
|
-
|
|
53
|
+
let persisted = true;
|
|
54
|
+
if (current.role === 'root') {
|
|
55
|
+
const outcome = await revokeAllSessions();
|
|
56
|
+
persisted = outcome.persisted;
|
|
57
|
+
} else {
|
|
58
|
+
await bumpMemberEpoch(current.id);
|
|
59
|
+
}
|
|
60
|
+
|
|
45
61
|
const updated = loadAuthConfig();
|
|
46
|
-
|
|
62
|
+
const next = getAccount(current.id);
|
|
63
|
+
if (!updated || !next) {
|
|
47
64
|
return json({ error: 'Could not revoke sessions' }, { status: 500, headers: NO_STORE_HEADERS });
|
|
48
65
|
}
|
|
49
66
|
|
|
50
67
|
// The user's own choice at the login screen, carried across the reissue.
|
|
51
68
|
const token = issueSessionToken({
|
|
52
69
|
sessionSecret: updated.sessionSecret,
|
|
53
|
-
credentialKey: updated.credentialKey,
|
|
70
|
+
credentialKey: next.role === 'root' ? updated.credentialKey : next.credentialKey ?? '',
|
|
54
71
|
ttlMs,
|
|
72
|
+
...(next.role === 'member' ? { accountId: next.id, epoch: next.sessionEpoch } : {}),
|
|
55
73
|
});
|
|
56
74
|
|
|
57
75
|
return json(
|
|
@@ -29,9 +29,9 @@ import { action as changePassword, MIN_PASSWORD_LENGTH } from '@/server/routes/a
|
|
|
29
29
|
import { action as logout } from '@/server/routes/auth/logout';
|
|
30
30
|
import { loader as authState } from '@/server/routes/auth/state';
|
|
31
31
|
import { initAuth, loadAuthConfig, revokeAllSessions } from '@/server/lib/auth/guard';
|
|
32
|
-
import { verifyPassword } from '
|
|
33
|
-
import { issueSessionToken, SESSION_TTL_MS, TRUSTED_DEVICE_TTL_MS } from '
|
|
34
|
-
import { resetLoginRateLimits } from '
|
|
32
|
+
import { verifyPassword } from '@kabmo-labs/kabmo-auth/server/config';
|
|
33
|
+
import { issueSessionToken, SESSION_TTL_MS, TRUSTED_DEVICE_TTL_MS } from '@kabmo-labs/kabmo-auth/server/token';
|
|
34
|
+
import { resetLoginRateLimits } from '@kabmo-labs/kabmo-auth/server/rate-limit';
|
|
35
35
|
|
|
36
36
|
const DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'omc-auth-routes-'));
|
|
37
37
|
const PASSWORD = 'correct-horse-battery';
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
import { json, NO_STORE_HEADERS } from '@kabmo-labs/kabmo-http';
|
|
17
17
|
import type { LoaderFunctionArgs } from '@kabmo-labs/kabmo-http';
|
|
18
|
-
import { loadAuthConfig } from '@/server/lib/auth/guard';
|
|
19
|
-
import {
|
|
18
|
+
import { loadAuthConfig, authenticatedAccount } from '@/server/lib/auth/guard';
|
|
19
|
+
import { publicAccounts } from '@kabmo-labs/kabmo-auth/server/accounts';
|
|
20
20
|
|
|
21
21
|
export async function loader({ request }: LoaderFunctionArgs) {
|
|
22
22
|
const config = loadAuthConfig();
|
|
@@ -25,10 +25,17 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
|
|
25
25
|
return json({ required: false, authenticated: true }, { headers: NO_STORE_HEADERS });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
28
|
+
if (authenticatedAccount(request)) {
|
|
29
|
+
return json({ required: true, authenticated: true }, { headers: NO_STORE_HEADERS });
|
|
30
|
+
}
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
// One account needs no picker. Omitting the list also keeps the pre-account
|
|
33
|
+
// response shape for every install that has never created a member.
|
|
34
|
+
const accounts = publicAccounts();
|
|
35
|
+
return json(
|
|
36
|
+
accounts.length > 1
|
|
37
|
+
? { required: true, authenticated: false, accounts }
|
|
38
|
+
: { required: true, authenticated: false },
|
|
39
|
+
{ headers: NO_STORE_HEADERS },
|
|
40
|
+
);
|
|
34
41
|
}
|
|
@@ -20,22 +20,25 @@ import { listPairedDevices, revokeDevice, touchDevice } from '@/server/lib/conne
|
|
|
20
20
|
import { bearerToken } from '@kabmo-labs/kabmo-session/relations/agent-token.server';
|
|
21
21
|
import { verifyDeviceToken } from '@/server/lib/connect/devices.server';
|
|
22
22
|
import type { ConnectRouteKind } from '@/shared/lib/connect/types';
|
|
23
|
+
import { authenticatedAccount, isAuthEnabled } from '@/server/lib/auth/guard';
|
|
23
24
|
|
|
24
25
|
const ROUTE_KINDS: readonly ConnectRouteKind[] = ['cloudflare', 'lan', 'tailscale'];
|
|
25
26
|
|
|
26
|
-
export async function loader() {
|
|
27
|
-
|
|
27
|
+
export async function loader({ request }: { request: Request }) {
|
|
28
|
+
const accountId = isAuthEnabled() ? authenticatedAccount(request)?.id : undefined;
|
|
29
|
+
return json({ devices: await listPairedDevices(accountId) }, { headers: NO_STORE_HEADERS });
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export async function action({ request }: ActionFunctionArgs) {
|
|
31
33
|
const url = new URL(request.url);
|
|
34
|
+
const accountId = isAuthEnabled() ? authenticatedAccount(request)?.id : undefined;
|
|
32
35
|
|
|
33
36
|
if (request.method === 'DELETE') {
|
|
34
37
|
const id = url.searchParams.get('id') ?? '';
|
|
35
38
|
if (!id) return json({ error: 'Expected ?id=' }, { status: 400, headers: NO_STORE_HEADERS });
|
|
36
|
-
const revoked = await revokeDevice(id);
|
|
39
|
+
const revoked = await revokeDevice(id, accountId);
|
|
37
40
|
if (!revoked) return json({ error: 'No such device' }, { status: 404, headers: NO_STORE_HEADERS });
|
|
38
|
-
return json({ ok: true, devices: await listPairedDevices() }, { headers: NO_STORE_HEADERS });
|
|
41
|
+
return json({ ok: true, devices: await listPairedDevices(accountId) }, { headers: NO_STORE_HEADERS });
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
if (request.method === 'POST') {
|
|
@@ -23,7 +23,8 @@ import { connectIdentity } from '@/server/lib/connect/identity.server';
|
|
|
23
23
|
import { connectStatus } from '@/server/lib/connect/status.server';
|
|
24
24
|
import { createPairing, attachPairingQr, consumePairing } from '@/server/lib/connect/pairing.server';
|
|
25
25
|
import { mintDeviceToken, touchDevice, DEVICE_COOKIE } from '@/server/lib/connect/devices.server';
|
|
26
|
-
import { isSecureRequest } from '
|
|
26
|
+
import { isSecureRequest } from '@kabmo-labs/kabmo-auth/server/token';
|
|
27
|
+
import { authenticatedAccount } from '@/server/lib/auth/guard';
|
|
27
28
|
import { qrMatrix } from '@/server/lib/connect/qr.server';
|
|
28
29
|
import { qrPng } from '@/server/lib/connect/qr-png.server';
|
|
29
30
|
import { encodePairingFragment, encodePairingPayload, PAIRING_VERSION } from '@/shared/lib/connect/payload';
|
|
@@ -74,7 +75,7 @@ export async function action({ request }: ActionFunctionArgs) {
|
|
|
74
75
|
|
|
75
76
|
const name = typeof body?.name === 'string' ? body.name : 'Device';
|
|
76
77
|
const platform = typeof body?.platform === 'string' ? body.platform : 'unknown';
|
|
77
|
-
const device = await mintDeviceToken({ name, platform });
|
|
78
|
+
const device = await mintDeviceToken({ name, platform, accountId: consumed.accountId });
|
|
78
79
|
|
|
79
80
|
const route = ROUTE_KINDS.find((kind) => kind === body?.route);
|
|
80
81
|
const rttMs = typeof body?.rttMs === 'number' && Number.isFinite(body.rttMs) ? Math.round(body.rttMs) : null;
|
|
@@ -126,7 +127,7 @@ export async function action({ request }: ActionFunctionArgs) {
|
|
|
126
127
|
);
|
|
127
128
|
}
|
|
128
129
|
|
|
129
|
-
const pairing = createPairing(candidates);
|
|
130
|
+
const pairing = createPairing(candidates, authenticatedAccount(request)?.id ?? 'root');
|
|
130
131
|
const payload = {
|
|
131
132
|
v: PAIRING_VERSION as 1,
|
|
132
133
|
pairingId: pairing.pairingId,
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
import { json, NO_STORE_HEADERS } from '@kabmo-labs/kabmo-http';
|
|
15
15
|
import { connectStatus } from '@/server/lib/connect/status.server';
|
|
16
|
+
import { authenticatedAccount, isAuthEnabled } from '@/server/lib/auth/guard';
|
|
16
17
|
|
|
17
|
-
export async function loader() {
|
|
18
|
-
|
|
18
|
+
export async function loader({ request }: { request: Request }) {
|
|
19
|
+
const accountId = isAuthEnabled() ? authenticatedAccount(request)?.id : undefined;
|
|
20
|
+
return json(await connectStatus(accountId), { headers: NO_STORE_HEADERS });
|
|
19
21
|
}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import { json, NO_STORE_HEADERS, type ActionFunctionArgs } from '@kabmo-labs/kabmo-http';
|
|
19
19
|
import { connectStatus, currentPort } from '@/server/lib/connect/status.server';
|
|
20
|
+
import { authenticatedAccount, isAuthEnabled } from '@/server/lib/auth/guard';
|
|
20
21
|
import { findTailscale, startServe, stopServe } from '@/server/lib/connect/tailscale.server';
|
|
21
22
|
import {
|
|
22
23
|
cloudflaredAlive,
|
|
@@ -93,7 +94,7 @@ export async function action({ request }: ActionFunctionArgs) {
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
const status = await connectStatus();
|
|
97
|
+
const status = await connectStatus(isAuthEnabled() ? authenticatedAccount(request)?.id : undefined);
|
|
97
98
|
return json(
|
|
98
99
|
failure ? { ok: false, error: failure, status } : { ok: true, status },
|
|
99
100
|
{ status: failure ? 400 : 200, headers: NO_STORE_HEADERS },
|
|
@@ -25,6 +25,8 @@ import { deleteWorkspaceFolder } from '@/shared/lib/workspace/project-settings';
|
|
|
25
25
|
import { syncDiscoveryRootsWatch } from '@/server/lib/omp/config/roots-watch.server';
|
|
26
26
|
import { emitRealtimeSignal } from '@kabmo-labs/kabmo-realtime-signals';
|
|
27
27
|
import { WORKSPACE_BATCH_LIMIT } from '@/shared/lib/sessions/batch-limits';
|
|
28
|
+
import { authenticatedAccount } from '@/server/lib/auth/guard';
|
|
29
|
+
import { ownedFolderRow } from '@/server/lib/workspace/access.server';
|
|
28
30
|
|
|
29
31
|
export async function batchDeleteFolders({ request }: ActionFunctionArgs) {
|
|
30
32
|
if (request.method !== 'POST') {
|
|
@@ -45,10 +47,20 @@ export async function batchDeleteFolders({ request }: ActionFunctionArgs) {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
const db = await getDb();
|
|
50
|
+
const accountId = authenticatedAccount(request)?.id ?? 'root';
|
|
48
51
|
const removed: string[] = [];
|
|
49
52
|
const refused: { id: string; error: string; code?: string }[] = [];
|
|
50
53
|
|
|
51
54
|
for (const id of ids) {
|
|
55
|
+
const exists = await db.get('SELECT id FROM workspace_folders WHERE id = ?', [id]);
|
|
56
|
+
if (!exists) {
|
|
57
|
+
refused.push({ id, error: 'Workspace not found', code: 'not_found' });
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (!(await ownedFolderRow(db, accountId, id))) {
|
|
61
|
+
refused.push({ id, error: 'Only the owner can delete this workspace', code: 'forbidden' });
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
52
64
|
// `deleteWorkspaceFolder` answers false for an id that is not a folder, and
|
|
53
65
|
// takes the id as a bound parameter — there is no path built from it here.
|
|
54
66
|
const deleted = await deleteWorkspaceFolder(db, id);
|
|
@@ -43,6 +43,7 @@ import { getDb } from '@/server/db.server';
|
|
|
43
43
|
import { pathExists } from '@kabmo-labs/kabmo-omp/paths';
|
|
44
44
|
import { runGit } from '@kabmo-labs/kabmo-git/runner/git-run';
|
|
45
45
|
import { expandHome } from '@/server/routes/folders/create';
|
|
46
|
+
import { authenticatedAccount } from '@/server/lib/auth/guard';
|
|
46
47
|
import { defaultFolderName, registerWorkspaceFolder } from '@/server/lib/workspace/register-folder.server';
|
|
47
48
|
import { isGitUrl, repoSlug } from '@/shared/lib/git/url';
|
|
48
49
|
import { isMockMode } from '@kabmo-labs/kabmo-runtime-flags';
|
|
@@ -99,8 +100,12 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
99
100
|
// already cost a full download is the kind of failure a user cannot undo
|
|
100
101
|
// without deleting the directory by hand.
|
|
101
102
|
const db = await getDb();
|
|
103
|
+
const ownerAccountId = authenticatedAccount(request)?.id ?? 'root';
|
|
102
104
|
const name = rawName || defaultFolderName(target);
|
|
103
|
-
const dup = await db.get(
|
|
105
|
+
const dup = await db.get(
|
|
106
|
+
'SELECT id FROM workspace_folders WHERE lower(name) = lower(?) AND owner_account_id = ?',
|
|
107
|
+
[name, ownerAccountId],
|
|
108
|
+
);
|
|
104
109
|
if (dup) {
|
|
105
110
|
return json(
|
|
106
111
|
{ error: 'A workspace with this name already exists', code: 'duplicate_name' },
|
|
@@ -117,7 +122,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
117
122
|
return json({ error: reason, code: 'clone_failed' }, { status: 400 });
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
const result = await registerWorkspaceFolder(db, { name, projectPath: target });
|
|
125
|
+
const result = await registerWorkspaceFolder(db, { name, projectPath: target, ownerAccountId });
|
|
121
126
|
if (!result.ok) {
|
|
122
127
|
// The clone succeeded, so the directory is left in place — it is a real
|
|
123
128
|
// repository the user can add by hand. Only the row is refused.
|
|
@@ -30,6 +30,7 @@ import { methodNotAllowed } from '@/server/lib/route-adapter';
|
|
|
30
30
|
import { resolve } from 'path';
|
|
31
31
|
import { homedir } from 'os';
|
|
32
32
|
import { getDb } from '@/server/db.server';
|
|
33
|
+
import { authenticatedAccount } from '@/server/lib/auth/guard';
|
|
33
34
|
import { defaultFolderName, registerWorkspaceFolder } from '@/server/lib/workspace/register-folder.server';
|
|
34
35
|
|
|
35
36
|
/** `~` and `~/x` expanded against the OS home, then made absolute. */
|
|
@@ -75,7 +76,8 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
const db = await getDb();
|
|
78
|
-
const
|
|
79
|
+
const ownerAccountId = authenticatedAccount(request)?.id ?? 'root';
|
|
80
|
+
const result = await registerWorkspaceFolder(db, { name, projectPath, ownerAccountId });
|
|
79
81
|
if (!result.ok) {
|
|
80
82
|
return json({ error: result.error, code: result.code }, { status: 400 });
|
|
81
83
|
}
|
|
@@ -6,6 +6,8 @@ import { deleteWorkspaceFolder, parseFolderSettingsPatch, updateWorkspaceFolder
|
|
|
6
6
|
import { revealInFileManager } from '@/server/lib/fs/reveal';
|
|
7
7
|
import { syncDiscoveryRootsWatch } from '@/server/lib/omp/config/roots-watch.server';
|
|
8
8
|
import { emitRealtimeSignal } from '@kabmo-labs/kabmo-realtime-signals';
|
|
9
|
+
import { authenticatedAccount } from '@/server/lib/auth/guard';
|
|
10
|
+
import { folderAccess, ownedFolderRow } from '@/server/lib/workspace/access.server';
|
|
9
11
|
|
|
10
12
|
export async function pinFolder({ request, params }: ActionFunctionArgs) {
|
|
11
13
|
if (request.method !== 'POST') {
|
|
@@ -14,11 +16,25 @@ export async function pinFolder({ request, params }: ActionFunctionArgs) {
|
|
|
14
16
|
|
|
15
17
|
const db = await getDb();
|
|
16
18
|
const folderId = params.folderId;
|
|
19
|
+
const accountId = authenticatedAccount(request)?.id ?? 'root';
|
|
20
|
+
const access = await folderAccess(db, accountId, folderId);
|
|
21
|
+
if (!access) {
|
|
22
|
+
return json({ error: 'Workspace not found' }, { status: 404 });
|
|
23
|
+
}
|
|
17
24
|
const formData = await request.formData();
|
|
18
25
|
|
|
19
26
|
const isPinned = formData.get('isPinned') === 'true' ? 1 : 0;
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
if (access.access === 'shared') {
|
|
29
|
+
await db.run(
|
|
30
|
+
`INSERT INTO workspace_folder_user_state (folder_id, account_id, is_pinned)
|
|
31
|
+
VALUES (?, ?, ?)
|
|
32
|
+
ON CONFLICT(folder_id, account_id) DO UPDATE SET is_pinned = excluded.is_pinned`,
|
|
33
|
+
[folderId, accountId, isPinned],
|
|
34
|
+
);
|
|
35
|
+
} else {
|
|
36
|
+
await db.run('UPDATE workspace_folders SET is_pinned = ? WHERE id = ?', [isPinned, folderId]);
|
|
37
|
+
}
|
|
22
38
|
// Pinning reorders the sidebar: the list is the sidebar's own structure.
|
|
23
39
|
emitRealtimeSignal('sidebar-structure');
|
|
24
40
|
|
|
@@ -32,11 +48,25 @@ export async function toggleFolder({ request, params }: ActionFunctionArgs) {
|
|
|
32
48
|
|
|
33
49
|
const db = await getDb();
|
|
34
50
|
const folderId = params.folderId;
|
|
51
|
+
const accountId = authenticatedAccount(request)?.id ?? 'root';
|
|
52
|
+
const access = await folderAccess(db, accountId, folderId);
|
|
53
|
+
if (!access) {
|
|
54
|
+
return json({ error: 'Workspace not found' }, { status: 404 });
|
|
55
|
+
}
|
|
35
56
|
const formData = await request.formData();
|
|
36
57
|
|
|
37
58
|
const isExpanded = formData.get('isExpanded') === 'true' ? 1 : 0;
|
|
38
59
|
|
|
39
|
-
|
|
60
|
+
if (access.access === 'shared') {
|
|
61
|
+
await db.run(
|
|
62
|
+
`INSERT INTO workspace_folder_user_state (folder_id, account_id, is_expanded)
|
|
63
|
+
VALUES (?, ?, ?)
|
|
64
|
+
ON CONFLICT(folder_id, account_id) DO UPDATE SET is_expanded = excluded.is_expanded`,
|
|
65
|
+
[folderId, accountId, isExpanded],
|
|
66
|
+
);
|
|
67
|
+
} else {
|
|
68
|
+
await db.run('UPDATE workspace_folders SET is_expanded = ? WHERE id = ?', [isExpanded, folderId]);
|
|
69
|
+
}
|
|
40
70
|
// The expansion flag rides the sidebar's folder rows, so a toggle is a
|
|
41
71
|
// structure change like any other.
|
|
42
72
|
emitRealtimeSignal('sidebar-structure');
|
|
@@ -60,8 +90,10 @@ export async function openFolder({ request, params }: ActionFunctionArgs) {
|
|
|
60
90
|
if (!folderId) return json({ error: 'folderId is required' }, { status: 400 });
|
|
61
91
|
|
|
62
92
|
const db = await getDb();
|
|
63
|
-
const
|
|
64
|
-
|
|
93
|
+
const accountId = authenticatedAccount(request)?.id ?? 'root';
|
|
94
|
+
const access = await folderAccess(db, accountId, folderId);
|
|
95
|
+
if (!access) return json({ error: 'Workspace not found' }, { status: 404 });
|
|
96
|
+
const folder = access.folder;
|
|
65
97
|
if (!folder.project_path) {
|
|
66
98
|
// An unbound folder has no directory of its own — it is a grouping, not a
|
|
67
99
|
// path — so there is nothing to open and the menu must say so.
|
|
@@ -81,6 +113,10 @@ export async function deleteFolder({ request, params }: ActionFunctionArgs) {
|
|
|
81
113
|
|
|
82
114
|
const db = await getDb();
|
|
83
115
|
const folderId = params.folderId;
|
|
116
|
+
const accountId = authenticatedAccount(request)?.id ?? 'root';
|
|
117
|
+
if (!(await ownedFolderRow(db, accountId, folderId || ''))) {
|
|
118
|
+
return json({ error: 'Only the owner can delete this workspace' }, { status: 403 });
|
|
119
|
+
}
|
|
84
120
|
|
|
85
121
|
const deleted = await deleteWorkspaceFolder(db, folderId || '');
|
|
86
122
|
if (!deleted) return json({ error: 'Workspace not found' }, { status: 404 });
|
|
@@ -110,6 +146,10 @@ export async function updateFolderSettings({ request, params }: ActionFunctionAr
|
|
|
110
146
|
}
|
|
111
147
|
|
|
112
148
|
const db = await getDb();
|
|
149
|
+
const accountId = authenticatedAccount(request)?.id ?? 'root';
|
|
150
|
+
if (!(await ownedFolderRow(db, accountId, folderId))) {
|
|
151
|
+
return json({ error: 'Only the owner can change this workspace' }, { status: 403 });
|
|
152
|
+
}
|
|
113
153
|
const patch = parseFolderSettingsPatch(body);
|
|
114
154
|
const updated = await updateWorkspaceFolder(db, folderId, patch);
|
|
115
155
|
if (!updated) {
|
|
@@ -2,6 +2,7 @@ import { actionBindings, bindingsFor, type HandlerBinding } from '@/server/lib/r
|
|
|
2
2
|
import * as foldersCreate from '@/server/routes/folders/create';
|
|
3
3
|
import * as foldersClone from '@/server/routes/folders/clone';
|
|
4
4
|
import * as foldersMkdir from '@/server/routes/folders/mkdir';
|
|
5
|
+
import * as folderShares from '@/server/routes/folders/shares';
|
|
5
6
|
import {
|
|
6
7
|
deleteFolder,
|
|
7
8
|
openFolder,
|
|
@@ -18,6 +19,8 @@ export const foldersBindings: HandlerBinding[] = [
|
|
|
18
19
|
{ method: 'POST', path: '/api/folders/batch-delete', handler: batchDeleteFolders },
|
|
19
20
|
...actionBindings(foldersClone.action, '/api/folders/clone'),
|
|
20
21
|
...actionBindings(foldersMkdir.action, '/api/folders/mkdir'),
|
|
22
|
+
...bindingsFor(folderShares, '/api/folders/:folderId/shares'),
|
|
23
|
+
...actionBindings(folderShares.action, '/api/folders/:folderId/shares/:accountId', folderShares.loader),
|
|
21
24
|
...actionBindings(pinFolder, '/api/folders/:folderId/pin'),
|
|
22
25
|
...actionBindings(toggleFolder, '/api/folders/:folderId/toggle'),
|
|
23
26
|
...actionBindings(openFolder, '/api/folders/:folderId/open'),
|