@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
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* UI-auth state for ONE run of the server.
|
|
8
|
-
*
|
|
9
|
-
* There is no stored password. A password is supplied per invocation — through
|
|
10
|
-
* `--ui-password` or `KABMO_UI_PASSWORD` — hashed in memory at boot, and
|
|
11
|
-
* forgotten when the process exits. A plain `bun run dev` therefore runs with no
|
|
12
|
-
* authentication, which is the default: a file on disk must not be able to
|
|
13
|
-
* decide that a server the user started needs a credential they never set.
|
|
14
|
-
*
|
|
15
|
-
* The only thing persisted is the SESSION SIGNING SECRET, and it holds no
|
|
16
|
-
* password. It is persisted for one reason: `bun run --hot` re-evaluates the
|
|
17
|
-
* server entry on every save, so an in-memory secret would log the user out on
|
|
18
|
-
* each edit — a dev loop that punishes the person using it. A file that only
|
|
19
|
-
* signs cookies can be shared across restarts without ever being able to enable
|
|
20
|
-
* authentication on its own.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import fs from 'fs';
|
|
24
|
-
import { scryptSync } from 'node:crypto';
|
|
25
|
-
|
|
26
|
-
import { getAuthPath, getDataDir } from '@kabmo-labs/kabmo-paths/paths';
|
|
27
|
-
|
|
28
|
-
/** Shape of the persisted secret file. `version` guards a future change. */
|
|
29
|
-
export interface AuthSecretFile {
|
|
30
|
-
version: 2;
|
|
31
|
-
/** HMAC key for session tokens. Never a password, and never sufficient to log in. */
|
|
32
|
-
sessionSecret: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** The auth state of the running process. Null means authentication is off. */
|
|
37
|
-
export interface ActiveAuthConfig {
|
|
38
|
-
/** argon2id hash of the password supplied for this run. */
|
|
39
|
-
passwordHash: string;
|
|
40
|
-
/**
|
|
41
|
-
* Deterministic scrypt-derived key for THIS password and THIS secret. It is
|
|
42
|
-
* what a session's fingerprint binds to; unlike {@link passwordHash} it is
|
|
43
|
-
* stable across restarts, which is what keeps a session alive through one.
|
|
44
|
-
*/
|
|
45
|
-
credentialKey: string;
|
|
46
|
-
/** Signs session cookies; survives restarts so sessions do too. */
|
|
47
|
-
sessionSecret: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* The stored session secret, or null when there is none.
|
|
52
|
-
*
|
|
53
|
-
* Any object carrying a non-empty `sessionSecret` is accepted, including the
|
|
54
|
-
* retired v1 shape — reusing it means upgrading does not sign every logged-in
|
|
55
|
-
* user out. The `passwordHash` that file may also carry is deliberately NOT
|
|
56
|
-
* read: under this design a stored hash can never enable authentication.
|
|
57
|
-
*/
|
|
58
|
-
export async function readSessionSecret(): Promise<string | null> {
|
|
59
|
-
try {
|
|
60
|
-
const parsed: unknown = JSON.parse(await Bun.file(getAuthPath()).text());
|
|
61
|
-
if (!parsed || typeof parsed !== 'object') return null;
|
|
62
|
-
const secret = (parsed as Record<string, unknown>).sessionSecret;
|
|
63
|
-
return typeof secret === 'string' && secret.length > 0 ? secret : null;
|
|
64
|
-
} catch {
|
|
65
|
-
// Absent, unreadable or malformed all mean "no secret to reuse": a fresh one
|
|
66
|
-
// is generated, which is a logout rather than an error.
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Persist the session secret (temp file + rename, mode 0600). Returns false
|
|
73
|
-
* instead of throwing when the data directory is not writable — the run
|
|
74
|
-
* continues with the secret it generated, it just will not survive a restart.
|
|
75
|
-
*/
|
|
76
|
-
export async function writeSessionSecret(sessionSecret: string): Promise<boolean> {
|
|
77
|
-
const target = getAuthPath();
|
|
78
|
-
const temp = `${target}.${process.pid}.tmp`;
|
|
79
|
-
const contents: AuthSecretFile = { version: 2, sessionSecret, updatedAt: new Date().toISOString() };
|
|
80
|
-
try {
|
|
81
|
-
fs.mkdirSync(getDataDir(), { recursive: true, mode: 0o700 });
|
|
82
|
-
fs.writeFileSync(temp, `${JSON.stringify(contents, null, 2)}\n`, { mode: 0o600 });
|
|
83
|
-
fs.renameSync(temp, target);
|
|
84
|
-
return true;
|
|
85
|
-
} catch {
|
|
86
|
-
try {
|
|
87
|
-
fs.rmSync(temp, { force: true });
|
|
88
|
-
} catch {
|
|
89
|
-
// Best-effort cleanup only.
|
|
90
|
-
}
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** Hash a password for this run. argon2id, ~70 ms — the brute-force floor. */
|
|
96
|
-
export function hashPassword(password: string): Promise<string> {
|
|
97
|
-
return Bun.password.hash(password, { algorithm: 'argon2id' });
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Verify a candidate against the run's hash.
|
|
102
|
-
*
|
|
103
|
-
* `Bun.password.verify` compares in constant time and answers false for a
|
|
104
|
-
* malformed hash rather than throwing, so a corrupted value reads as "wrong
|
|
105
|
-
* password" — the outcome the user can act on.
|
|
106
|
-
*/
|
|
107
|
-
export function verifyPassword(candidate: string, passwordHash: string): Promise<boolean> {
|
|
108
|
-
return Bun.password.verify(candidate, passwordHash);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* The value a session's fingerprint binds to, for a password and a secret.
|
|
113
|
-
*
|
|
114
|
-
* DETERMINISTIC on purpose: the same password with the same session secret must
|
|
115
|
-
* produce the same key on every boot, because the fingerprint is what makes a
|
|
116
|
-
* token fail after a password change and the token must otherwise survive a
|
|
117
|
-
* restart. `passwordHash` cannot serve as that value — its argon2 salt is
|
|
118
|
-
* random per boot, so a restart with the SAME password minted a new hash and
|
|
119
|
-
* invalidated every session (measured: a token valid before a second `initAuth`
|
|
120
|
-
* call was rejected after it, with the persisted secret correctly reused). The
|
|
121
|
-
* stated point of persisting the secret — "a restart keeps its sessions" — was
|
|
122
|
-
* therefore not delivered at all.
|
|
123
|
-
*
|
|
124
|
-
* argon2's own `salt` option is not an alternative (verified on Bun 1.4.2: two
|
|
125
|
-
* hashes with the same salt still differ), so the derivation is scrypt, salted
|
|
126
|
-
* with the SECRET and memory-hard for the same reason the verifier is. Nothing
|
|
127
|
-
* is persisted: the secret comes from `auth.json` and the password from the
|
|
128
|
-
* command line, so a leaked cookie plus that file is what an attacker would
|
|
129
|
-
* need to brute-force against, exactly as before.
|
|
130
|
-
*/
|
|
131
|
-
export function deriveCredentialKey(password: string, sessionSecret: string): string {
|
|
132
|
-
return scryptSync(password, sessionSecret, 32, { N: 1 << 14, r: 8, p: 1 }).toString('base64url');
|
|
133
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Login throttling: a per-IP attempt budget in front of the password check.
|
|
8
|
-
*
|
|
9
|
-
* argon2id already makes one guess cost ~70 ms, but that only bounds the RATE of
|
|
10
|
-
* guesses — it does not stop a script from running them for a week. This bounds
|
|
11
|
-
* the NUMBER of failures instead: past the budget the address is locked out
|
|
12
|
-
* outright, and no verification runs at all.
|
|
13
|
-
*
|
|
14
|
-
* State is in-memory and therefore resets when the process restarts. That is the
|
|
15
|
-
* right trade for a single-user console: a persisted lockout would have to be
|
|
16
|
-
* cleared by hand after a restart, and the process is only reachable at all
|
|
17
|
-
* because someone chose to expose it.
|
|
18
|
-
*
|
|
19
|
-
* The key is the SOCKET address (`requestIP`), except when the socket is
|
|
20
|
-
* loopback — the case a tunnel creates. `cloudflared` and `tailscale serve`
|
|
21
|
-
* connect from `127.0.0.1`, so every client behind one shares a single address
|
|
22
|
-
* and ten failures from an attacker anywhere would lock the owner out. In that
|
|
23
|
-
* one case the forwarded address is used instead; see
|
|
24
|
-
* `effectiveClientAddress` in `client-address.ts` for why the socket, not the
|
|
25
|
-
* header, is the condition. A direct remote connection still keys on its own
|
|
26
|
-
* socket address, which a caller cannot forge.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/** Sliding window an attempt count is measured over. */
|
|
30
|
-
export const RATE_LIMIT_WINDOW_MS = 5 * 60 * 1000;
|
|
31
|
-
|
|
32
|
-
/** Failures allowed within the window before the lockout. */
|
|
33
|
-
export const RATE_LIMIT_MAX_ATTEMPTS = 10;
|
|
34
|
-
|
|
35
|
-
/** How long a tripped lockout lasts. */
|
|
36
|
-
export const RATE_LIMIT_LOCKOUT_MS = 15 * 60 * 1000;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Budget for a request whose address could not be determined. Lower than the
|
|
40
|
-
* per-IP budget on purpose: an unidentifiable caller cannot be distinguished
|
|
41
|
-
* from any other, so the budget they share must be small.
|
|
42
|
-
*/
|
|
43
|
-
export const RATE_LIMIT_UNKNOWN_MAX_ATTEMPTS = 3;
|
|
44
|
-
|
|
45
|
-
/** Key used when the socket address is unavailable. */
|
|
46
|
-
export const UNKNOWN_CLIENT_KEY = 'unknown-client';
|
|
47
|
-
|
|
48
|
-
interface AttemptRecord {
|
|
49
|
-
count: number;
|
|
50
|
-
lastAttempt: number;
|
|
51
|
-
lockedUntil: number;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const attempts = new Map<string, AttemptRecord>();
|
|
55
|
-
|
|
56
|
-
/** Entries older than this are dropped opportunistically; see `prune`. */
|
|
57
|
-
const STALE_AFTER_MS = 60 * 60 * 1000;
|
|
58
|
-
|
|
59
|
-
const MAX_TRACKED_CLIENTS = 4096;
|
|
60
|
-
|
|
61
|
-
function maxAttemptsFor(key: string): number {
|
|
62
|
-
return key === UNKNOWN_CLIENT_KEY ? RATE_LIMIT_UNKNOWN_MAX_ATTEMPTS : RATE_LIMIT_MAX_ATTEMPTS;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Drop records that are neither locked nor recently touched.
|
|
67
|
-
*
|
|
68
|
-
* Runs on write rather than on a timer: a module-level interval would have to be
|
|
69
|
-
* unref'd and torn down, and this map is written exactly when a login fails —
|
|
70
|
-
* which is also the only moment it can grow.
|
|
71
|
-
*/
|
|
72
|
-
function prune(now: number): void {
|
|
73
|
-
if (attempts.size < MAX_TRACKED_CLIENTS) return;
|
|
74
|
-
for (const [key, record] of attempts) {
|
|
75
|
-
const locked = record.lockedUntil > now;
|
|
76
|
-
if (!locked && now - record.lastAttempt > STALE_AFTER_MS) attempts.delete(key);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface RateLimitStatus {
|
|
81
|
-
allowed: boolean;
|
|
82
|
-
/** Seconds until the lockout lifts; only present when `allowed` is false. */
|
|
83
|
-
retryAfterSec?: number;
|
|
84
|
-
limit: number;
|
|
85
|
-
remaining: number;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** Whether this key may attempt a login right now. Does not consume the budget. */
|
|
89
|
-
export function checkLoginRateLimit(key: string, now = Date.now()): RateLimitStatus {
|
|
90
|
-
const limit = maxAttemptsFor(key);
|
|
91
|
-
const record = attempts.get(key);
|
|
92
|
-
|
|
93
|
-
if (!record) return { allowed: true, limit, remaining: limit };
|
|
94
|
-
|
|
95
|
-
if (record.lockedUntil > now) {
|
|
96
|
-
return {
|
|
97
|
-
allowed: false,
|
|
98
|
-
retryAfterSec: Math.ceil((record.lockedUntil - now) / 1000),
|
|
99
|
-
limit,
|
|
100
|
-
remaining: 0,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// A lockout that has run out, or a window that has gone quiet, both start over.
|
|
105
|
-
if (record.lockedUntil > 0 || now - record.lastAttempt > RATE_LIMIT_WINDOW_MS) {
|
|
106
|
-
attempts.delete(key);
|
|
107
|
-
return { allowed: true, limit, remaining: limit };
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return { allowed: true, limit, remaining: Math.max(0, limit - record.count) };
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Record a failed attempt, tripping the lockout once the budget is spent.
|
|
115
|
-
* Returns the status AFTER the failure, so the caller can answer 429 immediately.
|
|
116
|
-
*/
|
|
117
|
-
export function recordLoginFailure(key: string, now = Date.now()): RateLimitStatus {
|
|
118
|
-
const limit = maxAttemptsFor(key);
|
|
119
|
-
const record = attempts.get(key);
|
|
120
|
-
|
|
121
|
-
if (!record || now - record.lastAttempt > RATE_LIMIT_WINDOW_MS) {
|
|
122
|
-
attempts.set(key, { count: 1, lastAttempt: now, lockedUntil: 0 });
|
|
123
|
-
prune(now);
|
|
124
|
-
return { allowed: true, limit, remaining: limit - 1 };
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const count = record.count + 1;
|
|
128
|
-
const lockedUntil = count >= limit ? now + RATE_LIMIT_LOCKOUT_MS : 0;
|
|
129
|
-
attempts.set(key, { count, lastAttempt: now, lockedUntil });
|
|
130
|
-
prune(now);
|
|
131
|
-
|
|
132
|
-
if (lockedUntil > 0) {
|
|
133
|
-
return { allowed: false, retryAfterSec: Math.ceil(RATE_LIMIT_LOCKOUT_MS / 1000), limit, remaining: 0 };
|
|
134
|
-
}
|
|
135
|
-
return { allowed: true, limit, remaining: Math.max(0, limit - count) };
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/** Forget a key's failures — called after a successful login. */
|
|
139
|
-
export function clearLoginRateLimit(key: string): void {
|
|
140
|
-
attempts.delete(key);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/** Drop every record. Test seam; the process otherwise keeps them for its life. */
|
|
144
|
-
export function resetLoginRateLimits(): void {
|
|
145
|
-
attempts.clear();
|
|
146
|
-
}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* SPDX-License-Identifier: MIT
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Session tokens and the cookie that carries them.
|
|
8
|
-
*
|
|
9
|
-
* A session is a stateless signed value — `v1.<expiresAt>.<fingerprint>.<mac>` —
|
|
10
|
-
* so validating one costs an HMAC and no storage. The middle segment is
|
|
11
|
-
* `HMAC(secret, passwordHash)`: because it is part of the signed payload, every
|
|
12
|
-
* token minted before a password change fails verification afterwards. Changing
|
|
13
|
-
* the password therefore revokes every session, with no session table to sweep.
|
|
14
|
-
*
|
|
15
|
-
* The cookie NAME carries the request port. Browsers key cookies by host and
|
|
16
|
-
* ignore the port (RFC 6265), so two Kabmo instances on one machine share a
|
|
17
|
-
* jar: without the port in the name, logging into the second silently overwrote
|
|
18
|
-
* the first instance's cookie. This install routinely has several ports live at
|
|
19
|
-
* once, so the collision is the normal case rather than an edge one.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
23
|
-
|
|
24
|
-
/** Cookie base name; the resolved name appends `_<port>` when the host has one. */
|
|
25
|
-
export const SESSION_COOKIE_BASE = 'omp_session';
|
|
26
|
-
|
|
27
|
-
/** Default session lifetime: 12 hours. */
|
|
28
|
-
export const SESSION_TTL_MS = 12 * 60 * 60 * 1000;
|
|
29
|
-
|
|
30
|
-
/** Lifetime when the user asks to be remembered on this device: 7 days. */
|
|
31
|
-
export const TRUSTED_DEVICE_TTL_MS = 7 * 24 * 60 * 60 * 1000;
|
|
32
|
-
|
|
33
|
-
const TOKEN_VERSION = 'v1';
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The trailing port of a `Host` authority, or null when there is none.
|
|
37
|
-
* Handles bracketed IPv6 (`[::1]:3000`) and plain host names.
|
|
38
|
-
*/
|
|
39
|
-
function hostPort(host: string): string | null {
|
|
40
|
-
if (host.startsWith('[')) {
|
|
41
|
-
const end = host.indexOf(']');
|
|
42
|
-
if (end === -1) return null;
|
|
43
|
-
const rest = host.slice(end + 1);
|
|
44
|
-
return rest.startsWith(':') && /^\d+$/.test(rest.slice(1)) ? rest.slice(1) : null;
|
|
45
|
-
}
|
|
46
|
-
const match = host.match(/:(\d+)$/);
|
|
47
|
-
return match ? match[1] : null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Cookie name for a request. `x-forwarded-host` wins when present, so an
|
|
52
|
-
* instance behind a reverse proxy is keyed by the port the browser used rather
|
|
53
|
-
* than the upstream one.
|
|
54
|
-
*/
|
|
55
|
-
export function sessionCookieName(headers: Headers): string {
|
|
56
|
-
const forwarded = headers.get('x-forwarded-host');
|
|
57
|
-
const host = (forwarded ? forwarded.split(',')[0] : headers.get('host') ?? '').trim();
|
|
58
|
-
if (!host) return SESSION_COOKIE_BASE;
|
|
59
|
-
const port = hostPort(host);
|
|
60
|
-
if (!port) return SESSION_COOKIE_BASE;
|
|
61
|
-
const portNumber = Number.parseInt(port, 10);
|
|
62
|
-
return Number.isFinite(portNumber) && portNumber > 0 ? `${SESSION_COOKIE_BASE}_${port}` : SESSION_COOKIE_BASE;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Read the session token from a request's cookies, or null when absent. */
|
|
66
|
-
export function readSessionCookie(request: Request): string | null {
|
|
67
|
-
const header = request.headers.get('cookie');
|
|
68
|
-
if (!header) return null;
|
|
69
|
-
const name = sessionCookieName(request.headers);
|
|
70
|
-
for (const segment of header.split(';')) {
|
|
71
|
-
const index = segment.indexOf('=');
|
|
72
|
-
if (index === -1) continue;
|
|
73
|
-
if (segment.slice(0, index).trim() !== name) continue;
|
|
74
|
-
const value = segment.slice(index + 1).trim();
|
|
75
|
-
if (!value) return null;
|
|
76
|
-
try {
|
|
77
|
-
return decodeURIComponent(value);
|
|
78
|
-
} catch {
|
|
79
|
-
return value;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* `HMAC(secret, credentialKey)` — the value that binds a session to one password.
|
|
87
|
-
*
|
|
88
|
-
* The key is what `deriveCredentialKey` produces, NOT the argon2 hash: it has to
|
|
89
|
-
* be reproducible from the secret and the password alone, or a session would die
|
|
90
|
-
* with the process that minted it.
|
|
91
|
-
*/
|
|
92
|
-
export function credentialFingerprint(sessionSecret: string, credentialKey: string): string {
|
|
93
|
-
return createHmac('sha256', sessionSecret).update(credentialKey).digest('base64url');
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function sign(sessionSecret: string, payload: string): string {
|
|
97
|
-
return createHmac('sha256', sessionSecret).update(payload).digest('base64url');
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** Constant-time string comparison that tolerates unequal lengths. */
|
|
101
|
-
function safeEqual(left: string, right: string): boolean {
|
|
102
|
-
const a = Buffer.from(left);
|
|
103
|
-
const b = Buffer.from(right);
|
|
104
|
-
if (a.length !== b.length) return false;
|
|
105
|
-
return timingSafeEqual(a, b);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface SessionIssueOptions {
|
|
109
|
-
sessionSecret: string;
|
|
110
|
-
/** A `deriveCredentialKey` result — never the argon2 hash (see the field). */
|
|
111
|
-
credentialKey: string;
|
|
112
|
-
ttlMs?: number;
|
|
113
|
-
/** Injected for tests; defaults to now. */
|
|
114
|
-
now?: number;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** Mint a session token valid for `ttlMs`. */
|
|
118
|
-
export function issueSessionToken({
|
|
119
|
-
sessionSecret,
|
|
120
|
-
credentialKey,
|
|
121
|
-
ttlMs = SESSION_TTL_MS,
|
|
122
|
-
now = Date.now(),
|
|
123
|
-
}: SessionIssueOptions): string {
|
|
124
|
-
const expiresAt = now + ttlMs;
|
|
125
|
-
const payload = [
|
|
126
|
-
TOKEN_VERSION,
|
|
127
|
-
String(expiresAt),
|
|
128
|
-
credentialFingerprint(sessionSecret, credentialKey),
|
|
129
|
-
].join('.');
|
|
130
|
-
return `${payload}.${sign(sessionSecret, payload)}`;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* True when `token` was minted by this secret for the CURRENT password and has
|
|
135
|
-
* not expired. Every failure mode — malformed, wrong version, bad signature,
|
|
136
|
-
* stale fingerprint, past expiry — is a plain false.
|
|
137
|
-
*/
|
|
138
|
-
export function verifySessionToken(
|
|
139
|
-
token: string | null | undefined,
|
|
140
|
-
{ sessionSecret, credentialKey, now = Date.now() }: Omit<SessionIssueOptions, 'ttlMs'>,
|
|
141
|
-
): boolean {
|
|
142
|
-
if (!token) return false;
|
|
143
|
-
const parts = token.split('.');
|
|
144
|
-
if (parts.length !== 4) return false;
|
|
145
|
-
const [version, expiresAt, fingerprint, mac] = parts;
|
|
146
|
-
if (version !== TOKEN_VERSION) return false;
|
|
147
|
-
if (!safeEqual(mac, sign(sessionSecret, `${version}.${expiresAt}.${fingerprint}`))) return false;
|
|
148
|
-
if (!safeEqual(fingerprint, credentialFingerprint(sessionSecret, credentialKey))) return false;
|
|
149
|
-
const expiry = Number(expiresAt);
|
|
150
|
-
return Number.isFinite(expiry) && expiry > now;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Remaining lifetime of a VALID token, in ms, or null when it is unusable.
|
|
155
|
-
*
|
|
156
|
-
* Reissuing a session (after a password change, after a revocation) has to
|
|
157
|
-
* preserve what the user chose at the login screen. Measured: a 7-day session
|
|
158
|
-
* came back as `Max-Age=43200` after a revoke, because those routes minted a
|
|
159
|
-
* fresh token with the DEFAULT ttl — a silent downgrade from a week to 12 hours
|
|
160
|
-
* that the user could only discover by being signed out early.
|
|
161
|
-
*
|
|
162
|
-
* The deadline is the token's own signed `expiresAt`, so this cannot be talked
|
|
163
|
-
* into extending a session beyond what was issued.
|
|
164
|
-
*/
|
|
165
|
-
export function sessionRemainingMs(
|
|
166
|
-
token: string | null | undefined,
|
|
167
|
-
{ sessionSecret, credentialKey, now = Date.now() }: Omit<SessionIssueOptions, 'ttlMs'>,
|
|
168
|
-
): number | null {
|
|
169
|
-
if (!verifySessionToken(token, { sessionSecret, credentialKey, now })) return null;
|
|
170
|
-
// `verifySessionToken` proves the token is a string with a numeric expiry.
|
|
171
|
-
const expiry = Number((token as string).split('.')[1]);
|
|
172
|
-
if (!Number.isFinite(expiry) || expiry <= now) return null;
|
|
173
|
-
return expiry - now;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* `Set-Cookie` value for a session.
|
|
178
|
-
*
|
|
179
|
-
* `SameSite=Lax` rather than `Strict`: this app's own document navigations must
|
|
180
|
-
* keep the cookie (a Strict cookie is withheld on a top-level navigation from
|
|
181
|
-
* another site, which would bounce a returning user through the login screen),
|
|
182
|
-
* while cross-site POSTs still cannot carry it — which is the CSRF exposure that
|
|
183
|
-
* matters here.
|
|
184
|
-
*
|
|
185
|
-
* `Secure` is added only when the request arrived over https. Hardcoding it
|
|
186
|
-
* would make the cookie unsettable on the plain-http localhost this server
|
|
187
|
-
* normally runs on, i.e. login would appear to succeed and never stick.
|
|
188
|
-
*/
|
|
189
|
-
export function sessionCookieHeader(name: string, token: string, ttlMs: number, secure: boolean): string {
|
|
190
|
-
const maxAge = Math.max(0, Math.floor(ttlMs / 1000));
|
|
191
|
-
const expires = maxAge === 0
|
|
192
|
-
? 'Thu, 01 Jan 1970 00:00:00 GMT'
|
|
193
|
-
: new Date(Date.now() + maxAge * 1000).toUTCString();
|
|
194
|
-
const attributes = [
|
|
195
|
-
`${name}=${encodeURIComponent(token)}`,
|
|
196
|
-
'Path=/',
|
|
197
|
-
'HttpOnly',
|
|
198
|
-
'SameSite=Lax',
|
|
199
|
-
`Max-Age=${maxAge}`,
|
|
200
|
-
`Expires=${expires}`,
|
|
201
|
-
];
|
|
202
|
-
if (secure) attributes.push('Secure');
|
|
203
|
-
return attributes.join('; ');
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/** `Set-Cookie` value that clears the session cookie. */
|
|
207
|
-
export function clearSessionCookieHeader(name: string, secure: boolean): string {
|
|
208
|
-
return sessionCookieHeader(name, '', 0, secure);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/** True when the request reached the server over https, directly or via a proxy. */
|
|
212
|
-
export function isSecureRequest(request: Request): boolean {
|
|
213
|
-
const forwarded = request.headers.get('x-forwarded-proto');
|
|
214
|
-
if (forwarded) return forwarded.split(',')[0].trim().toLowerCase() === 'https';
|
|
215
|
-
try {
|
|
216
|
-
return new URL(request.url).protocol === 'https:';
|
|
217
|
-
} catch {
|
|
218
|
-
return false;
|
|
219
|
-
}
|
|
220
|
-
}
|