0sec-cli 0.24.1 → 0.26.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/0.js +67 -62
- package/README.md +121 -82
- package/chunks/{adapt-loop-L77BWMNE.js → adapt-loop-P4HKONB5.js} +6 -5
- package/chunks/{artifact-scraper-BV67RAP5.js → artifact-scraper-IIRJNYKT.js} +4 -3
- package/chunks/{assumption-mining-RPVR77A3.js → assumption-mining-YA6VJ2V6.js} +22 -20
- package/chunks/{backend-connections-ACIXNYZN.js → backend-connections-64PKYKL7.js} +5 -4
- package/chunks/chunk-36J5ZLFE.js +18729 -0
- package/chunks/{chunk-ZM6ANQZJ.js → chunk-3MWQNNJU.js} +16180 -34467
- package/chunks/{chunk-GV5WXDHY.js → chunk-3VQ5EZKG.js} +11 -9
- package/chunks/chunk-5XOYTAOK.js +1546 -0
- package/chunks/{chunk-UJE4WOQS.js → chunk-6GV5G6U3.js} +1 -1
- package/chunks/{chunk-X2ZMSRTP.js → chunk-6SNOKNCS.js} +333 -3
- package/chunks/{chunk-BMDG6T7D.js → chunk-72PU46MS.js} +178 -133
- package/chunks/{chunk-KCA35IL3.js → chunk-7PUJI64A.js} +11 -9
- package/chunks/chunk-A7G6S5RA.js +90 -0
- package/chunks/chunk-ABKUI3QB.js +196 -0
- package/chunks/{chunk-5ETI27Q3.js → chunk-AFJ2UMPR.js} +3 -3
- package/chunks/{chunk-XA2IBHPB.js → chunk-B7XL6RON.js} +1 -1
- package/chunks/{chunk-TVS6WVSK.js → chunk-BM6EYP2D.js} +3 -3
- package/chunks/{chunk-7UHAXEOV.js → chunk-D4M5WURF.js} +226 -4
- package/chunks/{chunk-K74DRDC5.js → chunk-EHNVP6QB.js} +1 -1
- package/chunks/{chunk-I43YYHDU.js → chunk-FBZBJYZS.js} +5 -50
- package/chunks/{chunk-GXXX7AGH.js → chunk-GYEYTNHK.js} +144 -14
- package/chunks/{chunk-IJ6UPW3H.js → chunk-HS2NQ7K6.js} +393 -58
- package/chunks/chunk-HUZ2EC2R.js +196 -0
- package/chunks/{chunk-SU4IHQQI.js → chunk-IUUNIJPM.js} +1 -1
- package/chunks/chunk-JGDA6EIJ.js +49 -0
- package/chunks/{chunk-CJRZSWII.js → chunk-K3PTYN43.js} +3 -3
- package/chunks/{chunk-2NBZZFRG.js → chunk-KCABBZHN.js} +8 -10
- package/chunks/{chunk-3LPBJMHB.js → chunk-LRD5N2TQ.js} +1 -1
- package/chunks/{chunk-SQCBHFWN.js → chunk-LWMEJYCP.js} +2 -2
- package/chunks/chunk-MNK373HF.js +57 -0
- package/chunks/{chunk-R2XBH476.js → chunk-MOEVVXML.js} +2 -2
- package/chunks/{chunk-F2P25DJY.js → chunk-MOGWEHSC.js} +1448 -1050
- package/chunks/{chunk-6XMFCVJS.js → chunk-N7YCONYR.js} +1 -1
- package/chunks/{chunk-3WUPCZGF.js → chunk-NA3FKCI2.js} +1 -1
- package/chunks/{chunk-S2GITRD5.js → chunk-NABVDAAO.js} +2 -2
- package/chunks/{chunk-SZDD77KX.js → chunk-NNMOTHKC.js} +6 -10
- package/chunks/{chunk-LMP2T4G2.js → chunk-OILVEROI.js} +22 -172
- package/chunks/{chunk-YERUDEXT.js → chunk-PAE7ZAV6.js} +2780 -1255
- package/chunks/{chunk-NBV4I237.js → chunk-PAMJEXE2.js} +1 -1
- package/chunks/{chunk-PJU24AKR.js → chunk-R7VWEY45.js} +337 -257
- package/chunks/{chunk-QNRYOJEB.js → chunk-RZZ6VPRY.js} +1 -1
- package/chunks/{chunk-WUPN3D37.js → chunk-S4DFH2FJ.js} +26 -1
- package/chunks/{chunk-5WAHHZBF.js → chunk-SIR7XW2S.js} +61910 -30777
- package/chunks/{chunk-BD7WULFS.js → chunk-SSPP64FF.js} +3 -2
- package/chunks/{chunk-BOBIAHKA.js → chunk-STPHTPSD.js} +3 -333
- package/chunks/{chunk-Q7JKIKKF.js → chunk-UGCTPKJG.js} +89 -17
- package/chunks/{chunk-5PFRE522.js → chunk-ULRLUXSS.js} +1 -1
- package/chunks/{chunk-GZA7RGK7.js → chunk-UQS7XCBV.js} +2085 -1093
- package/chunks/{chunk-X2IPO5JO.js → chunk-V2KJQVYE.js} +2676 -2959
- package/chunks/{chunk-CGBDEST2.js → chunk-VJBEB2K6.js} +1 -1
- package/chunks/{chunk-ILRMLA6J.js → chunk-VWE36MUN.js} +1 -1
- package/chunks/{chunk-RURJYCWY.js → chunk-WNWDQ2TO.js} +1 -1
- package/chunks/{chunk-GTED3FSZ.js → chunk-WPJMA5AK.js} +4 -99
- package/chunks/{chunk-5NFIY2SJ.js → chunk-XJ2TBEV7.js} +3 -3
- package/chunks/{chunk-PVJUPIQG.js → chunk-XOVYV7TT.js} +6 -6
- package/chunks/{chunk-IXT64DV5.js → chunk-XPDJE537.js} +97 -1
- package/chunks/{chunk-YKWARO3T.js → chunk-YGYJ2FTH.js} +95 -21
- package/chunks/{chunk-JWSOUKFF.js → chunk-YJGPPPUB.js} +66 -21
- package/chunks/chunk-YP2DHYNI.js +650 -0
- package/chunks/{chunk-RVJVM5L4.js → chunk-Z2VLJEQJ.js} +5 -5
- package/chunks/chunk-ZPVSDB63.js +3839 -0
- package/chunks/{codex-models-6XVNFRXZ.js → codex-models-CI22KIHY.js} +9 -8
- package/chunks/{commands-FRPOFIO4.js → commands-C2WRSCNB.js} +909 -610
- package/chunks/dashboard-XO2X2SPD.js +75 -0
- package/chunks/{db-BXJNWUYJ.js → db-FU3OIGQK.js} +5 -4
- package/chunks/{deep-review-GSJEBLCG.js → deep-review-5AL6QYTK.js} +37 -38
- package/chunks/{disclose-OU6Z6GVT.js → disclose-YPV5KIUU.js} +6 -5
- package/chunks/{dist-M2X367VW.js → dist-JAZWL3SC.js} +3 -2
- package/chunks/{dist-TQMHMSBZ.js → dist-ONIRKDH6.js} +376 -333
- package/chunks/{dist-RKLQIXDT.js → dist-QLMPTFT7.js} +4 -3
- package/chunks/{dist-7KSYDDSG.js → dist-QXJKD743.js} +5 -2
- package/chunks/{dist-LNXGATR2.js → dist-WNAOCQGA.js} +5 -4
- package/chunks/eval-runner-D3RUCU3R.js +38 -0
- package/chunks/{exploit-agent-Y2P4GFIY.js → exploit-agent-4E4HXKUA.js} +1 -1
- package/chunks/{exploit-autoclimb-YRZ3TMS2.js → exploit-autoclimb-5GRXI6VQ.js} +1 -1
- package/chunks/{exploit-climb-4LEY4SDW.js → exploit-climb-AHQEJ2I2.js} +4 -3
- package/chunks/{fix-RQSIG75B.js → fix-CHD7LXDS.js} +9 -8
- package/chunks/{harness-3NVC3DDY.js → harness-E63KDHPG.js} +5 -4
- package/chunks/{http-conformance-U5F6GKYG.js → http-conformance-AXMUOE6C.js} +3 -2
- package/chunks/hunt-scan-ME2Z4CTC.js +43 -0
- package/chunks/{kernel-primitive-T47V3RD3.js → kernel-primitive-S566GXWP.js} +4 -3
- package/chunks/{kernel-vm-runner-AEL5E3SV.js → kernel-vm-runner-KREBY4DC.js} +4 -3
- package/chunks/{local-engine-ZCW4YC6E.js → local-engine-ZRTZVSSX.js} +7 -6
- package/chunks/managed-operation-ZMLLRCCQ.js +59 -0
- package/chunks/{memsafety-scan-L2Z7E7TE.js → memsafety-scan-Q2MBZEGJ.js} +1 -2
- package/chunks/{native-loop-26X2CHBV.js → native-loop-UV3Z4Z2F.js} +31 -16
- package/chunks/operator-services-JOCREEBA.js +79 -0
- package/chunks/orchestrate-ZF6ZTSIQ.js +62 -0
- package/chunks/{prepare-C3KGMBXT.js → prepare-PLDVGLDX.js} +7 -6
- package/chunks/{provider-model-discovery-QGUGL3XW.js → provider-model-discovery-3X6DON3Y.js} +7 -2
- package/chunks/{remote-workflow-runtime-DB52SINR.js → remote-workflow-runtime-GOI4TYP5.js} +4 -3
- package/chunks/routing-WCQLO5SP.js +61 -0
- package/chunks/{runtime-AUBLQUOH.js → runtime-6ZIXFTW5.js} +4 -3
- package/chunks/{runtime-U66JNSAY.js → runtime-TVH5ORUK.js} +13 -8
- package/chunks/{scan-stream-34F3LTPV.js → scan-stream-HJVTWZ44.js} +6 -4
- package/chunks/{scope-HSTG63TQ.js → scope-RCYXVGJR.js} +4 -3
- package/chunks/service-plugins-TN6KDX4L.js +63 -0
- package/chunks/{session-store-MKAAP3WL.js → session-store-6QR3CVUA.js} +8 -5
- package/chunks/{variant-candidates-LG767HWH.js → variant-candidates-SGLKPPHI.js} +9 -8
- package/chunks/{web-recon-prepass-NJP6J3E4.js → web-recon-prepass-GO7CTMVQ.js} +7 -6
- package/chunks/{workflow-runtime-AR627I26.js → workflow-runtime-CQTDASFA.js} +50 -49
- package/dashboard/assets/{abnfDiagram-VCTEODGH-Cq149Jpk.js → abnfDiagram-VCTEODGH-DDZsU70-.js} +1 -1
- package/dashboard/assets/{arc-CpP-3TRW.js → arc-iDXNTSL6.js} +1 -1
- package/dashboard/assets/architecture-7GRP2DOG-DJcY9RFg.js +1 -0
- package/dashboard/assets/architectureDiagram-5GKGNRK7-d0ZuOniQ.js +36 -0
- package/dashboard/assets/{blockDiagram-I7D4REHJ-CZYkRRDi.js → blockDiagram-I7D4REHJ-B-EWfMy1.js} +2 -2
- package/dashboard/assets/{c4Diagram-7LVT6UL2-CV7Iu3_Z.js → c4Diagram-7LVT6UL2-KcZRuXZC.js} +1 -1
- package/dashboard/assets/channel-CeWMIm0w.js +1 -0
- package/dashboard/assets/{chunk-4HAMMTFA-PKCyW4m-.js → chunk-4HAMMTFA-DXWulBlo.js} +1 -1
- package/dashboard/assets/{chunk-75Z2AOVW-C5MlFTc_.js → chunk-75Z2AOVW-RiLZItrz.js} +1 -1
- package/dashboard/assets/chunk-DU6HZSFF-MBcaIyTX.js +127 -0
- package/dashboard/assets/{chunk-F27PBJKO-DTAok0qM.js → chunk-F27PBJKO-kLWCBX_W.js} +1 -1
- package/dashboard/assets/{chunk-FOHPRMQF-DHwB1DNv.js → chunk-FOHPRMQF-COOliuUh.js} +14 -14
- package/dashboard/assets/{chunk-GMAD6QVW-CPsr2F33.js → chunk-GMAD6QVW-BeQeSjpW.js} +7 -7
- package/dashboard/assets/{chunk-GVQU2GXP-C2AXGf9A.js → chunk-GVQU2GXP-CjCMlOIB.js} +1 -1
- package/dashboard/assets/{chunk-IMKFNOWR-DMG6yD_O.js → chunk-IMKFNOWR-BwNst53D.js} +1 -1
- package/dashboard/assets/{chunk-L3NEJ4N5-BSvwdbXx.js → chunk-L3NEJ4N5-CHXWQrkL.js} +1 -1
- package/dashboard/assets/{chunk-OSK3NFVY-CfB8V7FU.js → chunk-OSK3NFVY-B2vd19Ed.js} +1 -1
- package/dashboard/assets/{chunk-P2QGCYS3-CvmZvq6n.js → chunk-P2QGCYS3-Dk7Fyh6n.js} +1 -1
- package/dashboard/assets/{chunk-POPQ4Y6H-D_TvwDxL.js → chunk-POPQ4Y6H-CPAgOvYe.js} +1 -1
- package/dashboard/assets/{chunk-PWAF6VOD-Da5GnuOY.js → chunk-PWAF6VOD-BotyfMha.js} +1 -1
- package/dashboard/assets/{chunk-SHT3W25Y-CcsMJpR-.js → chunk-SHT3W25Y-Buz5gLRP.js} +1 -1
- package/dashboard/assets/{chunk-SVP7TREG-COojjieJ.js → chunk-SVP7TREG-_rpYEZcs.js} +1 -1
- package/dashboard/assets/{chunk-TICWLB2K-nBAmJwx6.js → chunk-TICWLB2K-DOJxPoec.js} +2 -2
- package/dashboard/assets/{chunk-XXDRQBXY-r5HyhWDv.js → chunk-XXDRQBXY-EXxKJbAs.js} +1 -1
- package/dashboard/assets/classDiagram-ZZMXUADV-DV_h1NoS.js +1 -0
- package/dashboard/assets/classDiagram-v2-VYDZK3BY-DV_h1NoS.js +1 -0
- package/dashboard/assets/common-VLJRx-Jq.js +5 -0
- package/dashboard/assets/cose-bilkent-JH36ORCC-B1SVC57o.js +1 -0
- package/dashboard/assets/cynefin-OW5HDTMX-BzhRorj4.js +1 -0
- package/dashboard/assets/{cynefinDiagram-5FMLGOSQ-xodkuQtW.js → cynefinDiagram-5FMLGOSQ-JXzRmldX.js} +1 -1
- package/dashboard/assets/cytoscape.esm-BbBREfsg.js +321 -0
- package/dashboard/assets/dagre-D7JM2Yhv.js +1 -0
- package/dashboard/assets/dagre-GXQ25YYZ-1LZ-X0-Z.js +4 -0
- package/dashboard/assets/{diagram-S7CK7UJ4-DNoTMlCO.js → diagram-S7CK7UJ4-C_-J_LQ4.js} +2 -2
- package/dashboard/assets/{diagram-UQ7AKVKN-COccuyew.js → diagram-UQ7AKVKN-CnxL1k8g.js} +1 -1
- package/dashboard/assets/{diagram-VSXAHHWV-g6D1tWRb.js → diagram-VSXAHHWV-WzSb3aby.js} +1 -1
- package/dashboard/assets/{diagram-VX7I27RA-DhO4eVIC.js → diagram-VX7I27RA-DKhrMInE.js} +1 -1
- package/dashboard/assets/{diagram-Z3DM3KII-DeOQFexd.js → diagram-Z3DM3KII-CDhI2WGP.js} +1 -1
- package/dashboard/assets/{dist-BQYeOQg3.js → dist-B0bfBMeP.js} +1 -1
- package/dashboard/assets/{ebnfDiagram-PWID7BFC-MtkX2feM.js → ebnfDiagram-PWID7BFC-iL5NQ1PE.js} +1 -1
- package/dashboard/assets/{erDiagram-RLTQ6QDP-DIWSsoYZ.js → erDiagram-RLTQ6QDP-RK2Voa5O.js} +1 -1
- package/dashboard/assets/eventmodeling-NTZA5JFV-WgE7OJBb.js +1 -0
- package/dashboard/assets/flowDiagram-HODETNUW-B9YcQ0Aq.js +1 -0
- package/dashboard/assets/{ganttDiagram-EL5Y4UJY-DKggkJe0.js → ganttDiagram-EL5Y4UJY-D8CJXHRF.js} +1 -1
- package/dashboard/assets/gitGraph-4MIJSDKK-BuZ9Lg04.js +1 -0
- package/dashboard/assets/{gitGraphDiagram-WWUBYQGX-r_iR8Qzo.js → gitGraphDiagram-WWUBYQGX-LEJMh54j.js} +1 -1
- package/dashboard/assets/info-A6RAGUB7-BL5k3pev.js +1 -0
- package/dashboard/assets/{infoDiagram-27XIBGKW-ClQk7UyQ.js → infoDiagram-27XIBGKW-LJvntUnZ.js} +1 -1
- package/dashboard/assets/{ishikawaDiagram-5VMMS53U-tR7Vziog.js → ishikawaDiagram-5VMMS53U-BYTYgKCG.js} +2 -2
- package/dashboard/assets/{journeyDiagram-3NMN7TZE-Cpb9IqKL.js → journeyDiagram-3NMN7TZE-G25qgQgO.js} +1 -1
- package/dashboard/assets/{kanban-definition-UXKFOSKX-BzUuKbA9.js → kanban-definition-UXKFOSKX-Bk3uLl1i.js} +1 -1
- package/dashboard/assets/{katex-BdBmVSus.js → katex-nLxf_RlZ.js} +2 -2
- package/dashboard/assets/{line-BHY_tSHu.js → line-i4qHBaWO.js} +1 -1
- package/dashboard/assets/linear-DmrqRsKG.js +1 -0
- package/dashboard/assets/mermaid-parser.core-BxbKr4QF.js +7 -0
- package/dashboard/assets/{mermaid.core-D_QsUPU8.js → mermaid.core-Cltee6FS.js} +9 -9
- package/dashboard/assets/{mindmap-definition-YA3MSWOX-CtfLTPPJ.js → mindmap-definition-YA3MSWOX-DkzO2JgS.js} +1 -1
- package/dashboard/assets/operations-B4_timQX.css +1 -0
- package/dashboard/assets/operations-DwppJviL.js +199 -0
- package/dashboard/assets/packet-AYTQ26CC-uZQUKnrE.js +1 -0
- package/dashboard/assets/{pegDiagram-XKGWAZYB-C1Dclbzj.js → pegDiagram-XKGWAZYB-CrOEi00T.js} +1 -1
- package/dashboard/assets/pie-WAS4IAKB-Dn9_tpQT.js +1 -0
- package/dashboard/assets/{pieDiagram-E7YTZNPT-Cd7XwYo5.js → pieDiagram-E7YTZNPT-D-niUkzc.js} +1 -1
- package/dashboard/assets/{quadrantDiagram-AXDQQJYC-CaS-GQ4X.js → quadrantDiagram-AXDQQJYC-CJOTiG5V.js} +1 -1
- package/dashboard/assets/radar-RG4KPBEZ-DIIVz4e8.js +1 -0
- package/dashboard/assets/railroad-74A4TZTK-1kiqDEID.js +1 -0
- package/dashboard/assets/railroad-abnf-HS5TGJTU-DK6rQPZR.js +1 -0
- package/dashboard/assets/railroad-ebnf-LZEXJU2U-C6cOgYW4.js +1 -0
- package/dashboard/assets/railroad-peg-WCYAUIDC-CQ3ptKef.js +1 -0
- package/dashboard/assets/{railroadDiagram-O6MQD6OU-BeesTrqn.js → railroadDiagram-O6MQD6OU-nEfkpa-m.js} +1 -1
- package/dashboard/assets/{requirementDiagram-BXWQKSXE-IjyK0DhW.js → requirementDiagram-BXWQKSXE-CdFMY8tG.js} +1 -1
- package/dashboard/assets/{sankeyDiagram-P5KCCOFB-DmIluQqo.js → sankeyDiagram-P5KCCOFB-C0KxrFYv.js} +1 -1
- package/dashboard/assets/{sequenceDiagram-WJ2MYXX4-CUp8ZjTc.js → sequenceDiagram-WJ2MYXX4-DeZ5ATiu.js} +2 -2
- package/dashboard/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dashboard/assets/src-Cg-chcoE.js +1 -0
- package/dashboard/assets/{stateDiagram-D77RDMKH-Dy9TQb8P.js → stateDiagram-D77RDMKH-B9MwWL5B.js} +1 -1
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-SucFndhx.js +1 -0
- package/dashboard/assets/swimlanes-42K2YHIH-DB--fwQE.js +1 -0
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-BzH-rIaK.js +8 -0
- package/dashboard/assets/{timeline-definition-24CTP7MA-BGdXW-iY.js → timeline-definition-24CTP7MA-DLkkTbWb.js} +1 -1
- package/dashboard/assets/treeView-Q6P3EWNA-XkZ9rl9H.js +1 -0
- package/dashboard/assets/treemap-WGGIJYW6-JCtVKxCE.js +1 -0
- package/dashboard/assets/{vennDiagram-4TSXK5OY-DzKWHJsl.js → vennDiagram-4TSXK5OY-DEb-x29Z.js} +1 -1
- package/dashboard/assets/wardley-WFR3VGLG-DhI7ROY3.js +1 -0
- package/dashboard/assets/{wardleyDiagram-VM6X3IG4-DGsjYmNJ.js → wardleyDiagram-VM6X3IG4-KNckudc5.js} +1 -1
- package/dashboard/assets/{xychartDiagram-S5SC5T6Z-C7_T_tWt.js → xychartDiagram-S5SC5T6Z-D4c0ynCk.js} +1 -1
- package/dashboard/index.html +13 -2
- package/package.json +2 -5
- package/worker-assets/demo-target/README.md +7 -3
- package/chunks/chunk-2XGBEH53.js +0 -4304
- package/chunks/chunk-4ROZFLSR.js +0 -279
- package/chunks/chunk-56UTQKXO.js +0 -56
- package/chunks/chunk-BPU6M42R.js +0 -77
- package/chunks/chunk-H5QURBBK.js +0 -1123
- package/chunks/chunk-IIBNQTOK.js +0 -1532
- package/chunks/chunk-NJLKFC66.js +0 -4790
- package/chunks/chunk-OOMBOLAF.js +0 -295
- package/chunks/chunk-VIT5ALXF.js +0 -4054
- package/chunks/chunk-VU7V2SDW.js +0 -284
- package/chunks/chunk-W624J7NF.js +0 -117
- package/chunks/chunk-YSQWZ67M.js +0 -6027
- package/chunks/dashboard-5HDSNBAU.js +0 -76
- package/chunks/eval-runner-A2DIGVP7.js +0 -31
- package/chunks/hunt-scan-W246VWJC.js +0 -40
- package/chunks/managed-operation-6R2QPPW5.js +0 -60
- package/chunks/orchestrate-OBS37FWQ.js +0 -63
- package/chunks/run-MU3MFL2Z.js +0 -28242
- package/chunks/service-plugins-5B23PWXC.js +0 -64
- package/dashboard/assets/architecture-7GRP2DOG-z5EHYkyH.js +0 -1
- package/dashboard/assets/architectureDiagram-5GKGNRK7-ewtXpjR_.js +0 -36
- package/dashboard/assets/channel-CuYjfiC5.js +0 -1
- package/dashboard/assets/chunk-DU6HZSFF-3M37ulcO.js +0 -127
- package/dashboard/assets/classDiagram-ZZMXUADV-DCuOrWUV.js +0 -1
- package/dashboard/assets/classDiagram-v2-VYDZK3BY-DCuOrWUV.js +0 -1
- package/dashboard/assets/common-C6snVPsk.js +0 -5
- package/dashboard/assets/cose-bilkent-JH36ORCC-BLGcaZHk.js +0 -1
- package/dashboard/assets/cynefin-OW5HDTMX-DbZMK00I.js +0 -1
- package/dashboard/assets/cytoscape.esm-CGd-uY3x.js +0 -321
- package/dashboard/assets/dagre-GXQ25YYZ-CRk9qfSG.js +0 -4
- package/dashboard/assets/dagre-PrKaheQc.js +0 -1
- package/dashboard/assets/eventmodeling-NTZA5JFV-D_3ez4Gv.js +0 -1
- package/dashboard/assets/flowDiagram-HODETNUW-D2boyYEd.js +0 -1
- package/dashboard/assets/gitGraph-4MIJSDKK-DFOQYwXc.js +0 -1
- package/dashboard/assets/info-A6RAGUB7-DeednLoB.js +0 -1
- package/dashboard/assets/linear-naZZ1pHk.js +0 -1
- package/dashboard/assets/mermaid-parser.core-CPvd4cEx.js +0 -7
- package/dashboard/assets/operations-BwCzhVnT.js +0 -130
- package/dashboard/assets/operations-QjKT0Hwi.css +0 -1
- package/dashboard/assets/packet-AYTQ26CC-DDQbkT9I.js +0 -1
- package/dashboard/assets/pie-WAS4IAKB-LpU4ULAs.js +0 -1
- package/dashboard/assets/radar-RG4KPBEZ-CcxW3NJm.js +0 -1
- package/dashboard/assets/railroad-74A4TZTK-9P5Rl8fP.js +0 -1
- package/dashboard/assets/railroad-abnf-HS5TGJTU-CSfpwjna.js +0 -1
- package/dashboard/assets/railroad-ebnf-LZEXJU2U-D6R5qzr-.js +0 -1
- package/dashboard/assets/railroad-peg-WCYAUIDC-DKEX7ITG.js +0 -1
- package/dashboard/assets/sizeCapture-INFHLROL-B0uUizjq.js +0 -1
- package/dashboard/assets/src-r61wDjcA.js +0 -1
- package/dashboard/assets/stateDiagram-v2-MP3YSRHH-CQb0ZtPr.js +0 -1
- package/dashboard/assets/swimlanes-42K2YHIH-CZuDV7V5.js +0 -1
- package/dashboard/assets/swimlanesDiagram-VR7AAH4N-BxgWMq8X.js +0 -8
- package/dashboard/assets/treeView-Q6P3EWNA-DlRrayjM.js +0 -1
- package/dashboard/assets/treemap-WGGIJYW6-C6UqLKfI.js +0 -1
- package/dashboard/assets/wardley-WFR3VGLG-thmyHKb0.js +0 -1
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __0CreateRequire } from "node:module";
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
bufferToString
|
|
6
|
-
} from "./chunk-4ROZFLSR.js";
|
|
7
4
|
import {
|
|
8
5
|
scanExecutionTimeout
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
|
|
11
|
-
// packages/core/dist/prepare.js
|
|
12
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
13
|
-
import { existsSync as existsSync2, mkdirSync as mkdirSync3, rmSync as rmSync2 } from "node:fs";
|
|
14
|
-
import { join as join3, basename } from "node:path";
|
|
15
|
-
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
16
|
-
import { tmpdir as tmpdir2 } from "node:os";
|
|
6
|
+
} from "./chunk-SSPP64FF.js";
|
|
17
7
|
|
|
18
8
|
// packages/core/dist/package-ecosystems.js
|
|
19
|
-
import { execFileSync, execSync } from "node:child_process";
|
|
20
|
-
import { existsSync, mkdirSync as mkdirSync2, readFileSync, readdirSync, rmSync, statSync, writeFileSync as
|
|
21
|
-
import { join as
|
|
9
|
+
import { execFileSync as execFileSync2, execSync } from "node:child_process";
|
|
10
|
+
import { existsSync, mkdirSync as mkdirSync2, readFileSync, readdirSync, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync3 } from "node:fs";
|
|
11
|
+
import { join as join3 } from "node:path";
|
|
22
12
|
import { randomUUID } from "node:crypto";
|
|
23
|
-
import { tmpdir } from "node:os";
|
|
13
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
24
14
|
|
|
25
15
|
// packages/core/dist/historical-package-fallback.js
|
|
26
16
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
@@ -93,6 +83,271 @@ function restoreHistoricalPackageFixture(packageName, tempDir, emit) {
|
|
|
93
83
|
};
|
|
94
84
|
}
|
|
95
85
|
|
|
86
|
+
// packages/core/dist/shared-analysis.js
|
|
87
|
+
import { execFileSync } from "node:child_process";
|
|
88
|
+
import { mkdtempSync, rmSync, statSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
89
|
+
import { tmpdir } from "node:os";
|
|
90
|
+
import { dirname as dirname2, isAbsolute, join as join2, relative, resolve, sep } from "node:path";
|
|
91
|
+
var FOXGUARD_PINNED_TAG = "v0.14.0";
|
|
92
|
+
var CLI_RUNTIME_TYPES = /* @__PURE__ */ new Set(["claude", "codex", "gemini"]);
|
|
93
|
+
function bufferToString(value) {
|
|
94
|
+
if (!value) {
|
|
95
|
+
return "";
|
|
96
|
+
}
|
|
97
|
+
return Buffer.isBuffer(value) ? value.toString("utf-8") : value;
|
|
98
|
+
}
|
|
99
|
+
function mapSemgrepSeverity(level) {
|
|
100
|
+
switch (level.toUpperCase()) {
|
|
101
|
+
case "ERROR":
|
|
102
|
+
return "high";
|
|
103
|
+
case "WARNING":
|
|
104
|
+
return "medium";
|
|
105
|
+
case "INFO":
|
|
106
|
+
return "low";
|
|
107
|
+
default:
|
|
108
|
+
return "info";
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function mapFoxguardSeverity(level) {
|
|
112
|
+
switch ((level ?? "").toLowerCase()) {
|
|
113
|
+
case "error":
|
|
114
|
+
case "critical":
|
|
115
|
+
return "critical";
|
|
116
|
+
case "warning":
|
|
117
|
+
case "high":
|
|
118
|
+
return "high";
|
|
119
|
+
case "note":
|
|
120
|
+
case "medium":
|
|
121
|
+
return "medium";
|
|
122
|
+
case "low":
|
|
123
|
+
return "low";
|
|
124
|
+
default:
|
|
125
|
+
return "info";
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function runSemgrepScan(targetPath, emit, opts) {
|
|
129
|
+
emit({
|
|
130
|
+
type: "stage:start",
|
|
131
|
+
stage: "source-analysis",
|
|
132
|
+
message: "Running semgrep security scan..."
|
|
133
|
+
});
|
|
134
|
+
if (opts?.paths?.length === 0) {
|
|
135
|
+
emit({ type: "stage:end", stage: "source-analysis", message: "Semgrep: no files selected" });
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
const args = [
|
|
139
|
+
"scan",
|
|
140
|
+
"--config",
|
|
141
|
+
"auto",
|
|
142
|
+
"--json",
|
|
143
|
+
...opts?.noGitIgnore ? ["--no-git-ignore"] : [],
|
|
144
|
+
"--timeout",
|
|
145
|
+
"60",
|
|
146
|
+
"--max-target-bytes",
|
|
147
|
+
"1000000",
|
|
148
|
+
...opts?.paths ?? [targetPath]
|
|
149
|
+
];
|
|
150
|
+
let rawOutput;
|
|
151
|
+
try {
|
|
152
|
+
rawOutput = execFileSync("semgrep", args, {
|
|
153
|
+
timeout: scanExecutionTimeout(3e5),
|
|
154
|
+
stdio: "pipe",
|
|
155
|
+
encoding: "utf-8",
|
|
156
|
+
env: { ...process.env, SEMGREP_SEND_METRICS: "off" }
|
|
157
|
+
});
|
|
158
|
+
} catch (err) {
|
|
159
|
+
if (!err || typeof err !== "object" || !("status" in err) || err.status !== 1)
|
|
160
|
+
throw err;
|
|
161
|
+
rawOutput = bufferToString("stdout" in err ? err.stdout : void 0);
|
|
162
|
+
}
|
|
163
|
+
const raw = JSON.parse(rawOutput);
|
|
164
|
+
if (!raw || !Array.isArray(raw.results))
|
|
165
|
+
throw new Error("invalid Semgrep JSON report");
|
|
166
|
+
const results = raw.results;
|
|
167
|
+
const findings = results.map((r) => ({
|
|
168
|
+
ruleId: r.check_id,
|
|
169
|
+
message: r.extra?.message ?? "",
|
|
170
|
+
severity: mapSemgrepSeverity(r.extra?.severity ?? "WARNING"),
|
|
171
|
+
path: r.path,
|
|
172
|
+
startLine: r.start?.line ?? 0,
|
|
173
|
+
endLine: r.end?.line ?? 0,
|
|
174
|
+
snippet: r.extra?.lines ?? "",
|
|
175
|
+
metadata: r.extra?.metadata
|
|
176
|
+
}));
|
|
177
|
+
emit({
|
|
178
|
+
type: "stage:end",
|
|
179
|
+
stage: "source-analysis",
|
|
180
|
+
message: `Semgrep: ${findings.length} findings`
|
|
181
|
+
});
|
|
182
|
+
return findings;
|
|
183
|
+
}
|
|
184
|
+
function selectedStaticScanner() {
|
|
185
|
+
return process.env["ZERO_STATIC"] === "semgrep" ? "semgrep" : "foxguard";
|
|
186
|
+
}
|
|
187
|
+
function runFoxguardScan(targetPath, emit, opts) {
|
|
188
|
+
emit({
|
|
189
|
+
type: "stage:start",
|
|
190
|
+
stage: "source-analysis",
|
|
191
|
+
message: "Running foxguard security scan..."
|
|
192
|
+
});
|
|
193
|
+
if (opts?.paths?.length === 0) {
|
|
194
|
+
emit({ type: "stage:end", stage: "source-analysis", message: "Foxguard: no files selected" });
|
|
195
|
+
return [];
|
|
196
|
+
}
|
|
197
|
+
const foxguardTag = opts?.foxguardTag ?? FOXGUARD_PINNED_TAG;
|
|
198
|
+
const runner = opts?.runner ?? execFileSync;
|
|
199
|
+
const logger = opts?.logger ?? ((m) => console.warn(m));
|
|
200
|
+
const cwd = statSync(targetPath, { throwIfNoEntry: false })?.isFile() ? dirname2(resolve(targetPath)) : resolve(targetPath);
|
|
201
|
+
let useNpm = opts?.foxguardCommand !== void 0 || opts?.foxguardTag !== void 0;
|
|
202
|
+
const findings = [];
|
|
203
|
+
let selectionDir;
|
|
204
|
+
try {
|
|
205
|
+
let selectionFile;
|
|
206
|
+
if (opts?.paths && !opts.diffBase) {
|
|
207
|
+
const paths = opts.paths.map((path) => {
|
|
208
|
+
const selected = relative(cwd, resolve(cwd, path));
|
|
209
|
+
if (isAbsolute(selected) || selected === ".." || selected.startsWith(`..${sep}`) || /[\r\n\0]/.test(selected)) {
|
|
210
|
+
throw new Error(`selected Foxguard path is outside the scan root or cannot be represented: ${path}`);
|
|
211
|
+
}
|
|
212
|
+
return selected.split(sep).join("/");
|
|
213
|
+
});
|
|
214
|
+
selectionDir = mkdtempSync(join2(tmpdir(), "0-foxguard-"));
|
|
215
|
+
selectionFile = join2(selectionDir, "changed-files.txt");
|
|
216
|
+
writeFileSync2(selectionFile, `${paths.join("\n")}
|
|
217
|
+
`, { mode: 384 });
|
|
218
|
+
}
|
|
219
|
+
const scanRoot = relative(cwd, resolve(targetPath)) || ".";
|
|
220
|
+
const invocations = [opts?.diffBase ? ["diff", opts.diffBase, scanRoot, "--format", "json"] : ["--format", "json", ...selectionFile ? ["--changed-files-from", selectionFile] : [], scanRoot]];
|
|
221
|
+
for (const args of invocations) {
|
|
222
|
+
let rawOutput;
|
|
223
|
+
const invoke = () => {
|
|
224
|
+
try {
|
|
225
|
+
return bufferToString(runner(useNpm ? opts?.foxguardCommand ?? "npx" : "foxguard", useNpm ? ["--yes", `foxguard@${foxguardTag}`, ...args] : args, {
|
|
226
|
+
cwd,
|
|
227
|
+
timeout: scanExecutionTimeout(3e5),
|
|
228
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
229
|
+
stdio: "pipe",
|
|
230
|
+
encoding: "utf-8"
|
|
231
|
+
}));
|
|
232
|
+
} catch (err) {
|
|
233
|
+
if (err && typeof err === "object" && "status" in err && err.status === 1) {
|
|
234
|
+
return bufferToString("stdout" in err ? err.stdout : void 0);
|
|
235
|
+
}
|
|
236
|
+
throw err;
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
try {
|
|
240
|
+
rawOutput = invoke();
|
|
241
|
+
} catch (err) {
|
|
242
|
+
if (!useNpm && err && typeof err === "object" && "code" in err && err.code === "ENOENT") {
|
|
243
|
+
useNpm = true;
|
|
244
|
+
rawOutput = invoke();
|
|
245
|
+
} else {
|
|
246
|
+
throw err;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const report = parseFoxguardJson(rawOutput);
|
|
250
|
+
if (report === null)
|
|
251
|
+
throw new Error("invalid Foxguard JSON report");
|
|
252
|
+
if (report.filesScanned === 0) {
|
|
253
|
+
throw new Error("Foxguard scanned 0 files; static coverage is unavailable (files may be excluded or unsupported)");
|
|
254
|
+
}
|
|
255
|
+
for (const finding of translateFoxguardFindings(report.findings)) {
|
|
256
|
+
finding.path = resolve(cwd, finding.path);
|
|
257
|
+
findings.push(finding);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
} catch (err) {
|
|
261
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
262
|
+
logger(`[0] foxguard scan failed (${message}). Npm pin: foxguard@${foxguardTag}. Set ZERO_STATIC=semgrep to use semgrep.`);
|
|
263
|
+
emit({ type: "error", stage: "source-analysis", message: `Foxguard scan failed: ${message}` });
|
|
264
|
+
throw err;
|
|
265
|
+
} finally {
|
|
266
|
+
if (selectionDir)
|
|
267
|
+
rmSync(selectionDir, { recursive: true, force: true });
|
|
268
|
+
}
|
|
269
|
+
emit({
|
|
270
|
+
type: "stage:end",
|
|
271
|
+
stage: "source-analysis",
|
|
272
|
+
message: `Foxguard: ${findings.length} findings`
|
|
273
|
+
});
|
|
274
|
+
return findings;
|
|
275
|
+
}
|
|
276
|
+
function runSelectedStaticScan(targetPath, emit, opts) {
|
|
277
|
+
return selectedStaticScanner() === "foxguard" ? runFoxguardScan(targetPath, emit, opts) : runSemgrepScan(targetPath, emit, opts);
|
|
278
|
+
}
|
|
279
|
+
function parseFoxguardJson(rawJson) {
|
|
280
|
+
let parsed;
|
|
281
|
+
try {
|
|
282
|
+
parsed = JSON.parse(rawJson);
|
|
283
|
+
} catch {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
if (Array.isArray(parsed))
|
|
287
|
+
return { findings: parsed };
|
|
288
|
+
if (!parsed || typeof parsed !== "object" || !("findings" in parsed))
|
|
289
|
+
return null;
|
|
290
|
+
for (const field of ["schema_version", "finding_schema_version"]) {
|
|
291
|
+
if (field in parsed && !/^1\.\d+\.\d+$/.test(String(parsed[field]))) {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
if (!Array.isArray(parsed.findings))
|
|
296
|
+
return null;
|
|
297
|
+
const target = "target" in parsed ? parsed.target : void 0;
|
|
298
|
+
const filesScanned = target && typeof target === "object" && "files_scanned" in target ? target.files_scanned : void 0;
|
|
299
|
+
if (filesScanned !== void 0 && (typeof filesScanned !== "number" || !Number.isSafeInteger(filesScanned) || filesScanned < 0))
|
|
300
|
+
return null;
|
|
301
|
+
return { findings: parsed.findings, ...typeof filesScanned === "number" ? { filesScanned } : {} };
|
|
302
|
+
}
|
|
303
|
+
function translateFoxguardFindings(rawFindings) {
|
|
304
|
+
const out = [];
|
|
305
|
+
for (const raw of rawFindings) {
|
|
306
|
+
if (!raw || typeof raw !== "object")
|
|
307
|
+
continue;
|
|
308
|
+
if (!raw.rule_id || !raw.file || typeof raw.line !== "number")
|
|
309
|
+
continue;
|
|
310
|
+
const startLine = raw.line;
|
|
311
|
+
const endLine = typeof raw.end_line === "number" ? raw.end_line : startLine;
|
|
312
|
+
const metadata = { scanner: "foxguard" };
|
|
313
|
+
if (raw.cwe)
|
|
314
|
+
metadata.cwe = raw.cwe;
|
|
315
|
+
if (typeof raw.confidence === "number")
|
|
316
|
+
metadata.confidence = raw.confidence;
|
|
317
|
+
if (typeof raw.taint_hops === "number")
|
|
318
|
+
metadata.taintHops = raw.taint_hops;
|
|
319
|
+
if (raw.source_line || raw.sink_line) {
|
|
320
|
+
metadata.dataflow = {
|
|
321
|
+
sourceLine: raw.source_line,
|
|
322
|
+
sourceDescription: raw.source_description,
|
|
323
|
+
sinkLine: raw.sink_line,
|
|
324
|
+
sinkDescription: raw.sink_description
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
if (raw.fix_suggestion)
|
|
328
|
+
metadata.fixSuggestion = raw.fix_suggestion;
|
|
329
|
+
if (raw.tags && raw.tags.length > 0)
|
|
330
|
+
metadata.tags = raw.tags;
|
|
331
|
+
if (raw.crypto_algorithm)
|
|
332
|
+
metadata.cryptoAlgorithm = raw.crypto_algorithm;
|
|
333
|
+
if (raw.cnsa2_deadline)
|
|
334
|
+
metadata.cnsa2Deadline = raw.cnsa2_deadline;
|
|
335
|
+
if (raw.dep_name)
|
|
336
|
+
metadata.depName = raw.dep_name;
|
|
337
|
+
out.push({
|
|
338
|
+
ruleId: raw.rule_id,
|
|
339
|
+
message: raw.description ?? "",
|
|
340
|
+
severity: mapFoxguardSeverity(raw.severity),
|
|
341
|
+
path: raw.file,
|
|
342
|
+
startLine,
|
|
343
|
+
endLine,
|
|
344
|
+
snippet: raw.snippet ?? "",
|
|
345
|
+
metadata
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
return out;
|
|
349
|
+
}
|
|
350
|
+
|
|
96
351
|
// packages/core/dist/package-ecosystems.js
|
|
97
352
|
function stderrLooksLikeEresolve(stderr) {
|
|
98
353
|
return /ERESOLVE/i.test(stderr);
|
|
@@ -270,7 +525,7 @@ function queryOsvAdvisoriesSync(ecosystem, packageName, version) {
|
|
|
270
525
|
version
|
|
271
526
|
});
|
|
272
527
|
try {
|
|
273
|
-
const rawOutput =
|
|
528
|
+
const rawOutput = execFileSync2("curl", [
|
|
274
529
|
"-fsSL",
|
|
275
530
|
"--retry",
|
|
276
531
|
"3",
|
|
@@ -308,7 +563,7 @@ function splitPackageSpec(rawPackageName, requestedVersion) {
|
|
|
308
563
|
return { packageName, version };
|
|
309
564
|
}
|
|
310
565
|
function writeMinimalPackageJson(tempDir) {
|
|
311
|
-
|
|
566
|
+
execFileSync2("npm", ["init", "-y", "--silent"], {
|
|
312
567
|
cwd: tempDir,
|
|
313
568
|
timeout: scanExecutionTimeout(15e3),
|
|
314
569
|
stdio: "pipe"
|
|
@@ -325,18 +580,18 @@ function restoreNpmFixtureOrThrow(packageName, tempDir, msg, emit) {
|
|
|
325
580
|
};
|
|
326
581
|
}
|
|
327
582
|
}
|
|
328
|
-
|
|
583
|
+
rmSync2(tempDir, { recursive: true, force: true });
|
|
329
584
|
throw new Error(msg);
|
|
330
585
|
}
|
|
331
586
|
function installNpmPackage(packageName, requestedVersion, emit) {
|
|
332
|
-
const tempDir =
|
|
587
|
+
const tempDir = join3(tmpdir2(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
333
588
|
mkdirSync2(tempDir, { recursive: true });
|
|
334
589
|
const spec = requestedVersion ? `${packageName}@${requestedVersion}` : `${packageName}@latest`;
|
|
335
590
|
emit({ type: "stage:start", stage: "discovery", message: `Installing ${spec}...` });
|
|
336
591
|
try {
|
|
337
592
|
writeMinimalPackageJson(tempDir);
|
|
338
593
|
try {
|
|
339
|
-
|
|
594
|
+
execFileSync2("npm", ["install", spec, "--ignore-scripts", "--no-audit", "--no-fund"], {
|
|
340
595
|
cwd: tempDir,
|
|
341
596
|
timeout: scanExecutionTimeout(12e4),
|
|
342
597
|
stdio: "pipe"
|
|
@@ -351,7 +606,7 @@ function installNpmPackage(packageName, requestedVersion, emit) {
|
|
|
351
606
|
stage: "discovery",
|
|
352
607
|
message: `npm install ${spec} hit ERESOLVE peer conflict \u2014 retrying with --legacy-peer-deps`
|
|
353
608
|
});
|
|
354
|
-
|
|
609
|
+
execFileSync2("npm", ["install", "--legacy-peer-deps", spec, "--ignore-scripts", "--no-audit", "--no-fund"], {
|
|
355
610
|
cwd: tempDir,
|
|
356
611
|
timeout: scanExecutionTimeout(12e4),
|
|
357
612
|
stdio: "pipe"
|
|
@@ -366,14 +621,14 @@ function installNpmPackage(packageName, requestedVersion, emit) {
|
|
|
366
621
|
const msg = err instanceof Error ? err.message : String(err);
|
|
367
622
|
return restoreNpmFixtureOrThrow(packageName, tempDir, `Failed to install ${spec}: ${msg}`, emit);
|
|
368
623
|
}
|
|
369
|
-
const pkgJsonPath =
|
|
624
|
+
const pkgJsonPath = join3(tempDir, "node_modules", packageName, "package.json");
|
|
370
625
|
if (!existsSync(pkgJsonPath)) {
|
|
371
|
-
|
|
626
|
+
rmSync2(tempDir, { recursive: true, force: true });
|
|
372
627
|
throw new Error(`Package ${packageName} not found after install. Check the package name.`);
|
|
373
628
|
}
|
|
374
629
|
const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf8"));
|
|
375
630
|
const installedVersion = pkgJson.version;
|
|
376
|
-
const packagePath =
|
|
631
|
+
const packagePath = join3(tempDir, "node_modules", packageName);
|
|
377
632
|
emit({ type: "stage:end", stage: "discovery", message: `Installed ${packageName}@${installedVersion}` });
|
|
378
633
|
return {
|
|
379
634
|
ecosystem: "npm",
|
|
@@ -384,7 +639,7 @@ function installNpmPackage(packageName, requestedVersion, emit) {
|
|
|
384
639
|
};
|
|
385
640
|
}
|
|
386
641
|
function extractSingleArchive(archivePath, outputDir) {
|
|
387
|
-
|
|
642
|
+
execFileSync2("python3", ["-c", `
|
|
388
643
|
import pathlib, tarfile, zipfile, sys
|
|
389
644
|
archive = pathlib.Path(sys.argv[1])
|
|
390
645
|
out = pathlib.Path(sys.argv[2]).resolve()
|
|
@@ -411,7 +666,7 @@ else:
|
|
|
411
666
|
`, archivePath, outputDir], { stdio: "pipe", timeout: scanExecutionTimeout(6e4) });
|
|
412
667
|
}
|
|
413
668
|
function pickPythonScopePath(extractRoot) {
|
|
414
|
-
const entries = readdirSync(extractRoot).map((name) =>
|
|
669
|
+
const entries = readdirSync(extractRoot).map((name) => join3(extractRoot, name)).filter((abs) => existsSync(abs) && statSync2(abs).isDirectory());
|
|
415
670
|
return entries.length === 1 ? entries[0] : extractRoot;
|
|
416
671
|
}
|
|
417
672
|
function readPythonVersionFromMetadata(scopePath) {
|
|
@@ -426,16 +681,16 @@ function readPythonVersionFromMetadata(scopePath) {
|
|
|
426
681
|
continue;
|
|
427
682
|
}
|
|
428
683
|
for (const entry of entries) {
|
|
429
|
-
const abs =
|
|
684
|
+
const abs = join3(current, entry);
|
|
430
685
|
let st;
|
|
431
686
|
try {
|
|
432
|
-
st =
|
|
687
|
+
st = statSync2(abs);
|
|
433
688
|
} catch {
|
|
434
689
|
continue;
|
|
435
690
|
}
|
|
436
691
|
if (st.isDirectory()) {
|
|
437
692
|
if (entry.endsWith(".dist-info")) {
|
|
438
|
-
candidates.push(
|
|
693
|
+
candidates.push(join3(abs, "METADATA"));
|
|
439
694
|
} else {
|
|
440
695
|
stack.push(abs);
|
|
441
696
|
}
|
|
@@ -502,7 +757,7 @@ with urllib.request.urlopen(request, timeout=120) as response, archive_path.open
|
|
|
502
757
|
|
|
503
758
|
print(json.dumps({"archivePath": str(archive_path), "resolvedVersion": metadata.get("info", {}).get("version") or requested_version or "unknown"}))
|
|
504
759
|
`;
|
|
505
|
-
const rawOutput =
|
|
760
|
+
const rawOutput = execFileSync2("python3", ["-c", script, packageName, requestedVersion ?? "", downloadDir], {
|
|
506
761
|
encoding: "utf8",
|
|
507
762
|
timeout: scanExecutionTimeout(18e4),
|
|
508
763
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -510,9 +765,9 @@ print(json.dumps({"archivePath": str(archive_path), "resolvedVersion": metadata.
|
|
|
510
765
|
return JSON.parse(rawOutput);
|
|
511
766
|
}
|
|
512
767
|
function installPypiPackage(packageName, requestedVersion, emit) {
|
|
513
|
-
const tempDir =
|
|
514
|
-
const downloadDir =
|
|
515
|
-
const extractDir =
|
|
768
|
+
const tempDir = join3(tmpdir2(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
769
|
+
const downloadDir = join3(tempDir, "downloads");
|
|
770
|
+
const extractDir = join3(tempDir, "src");
|
|
516
771
|
mkdirSync2(downloadDir, { recursive: true });
|
|
517
772
|
mkdirSync2(extractDir, { recursive: true });
|
|
518
773
|
const spec = requestedVersion ? `${packageName}==${requestedVersion}` : packageName;
|
|
@@ -524,14 +779,14 @@ function installPypiPackage(packageName, requestedVersion, emit) {
|
|
|
524
779
|
archivePath = downloaded.archivePath;
|
|
525
780
|
installedVersion = downloaded.resolvedVersion;
|
|
526
781
|
} catch (err) {
|
|
527
|
-
|
|
782
|
+
rmSync2(tempDir, { recursive: true, force: true });
|
|
528
783
|
const msg = err instanceof Error ? err.message : String(err);
|
|
529
784
|
throw new Error(`Failed to download ${spec} from PyPI: ${msg}`);
|
|
530
785
|
}
|
|
531
786
|
extractSingleArchive(archivePath, extractDir);
|
|
532
787
|
const scopePath = pickPythonScopePath(extractDir);
|
|
533
|
-
const pyprojectPath =
|
|
534
|
-
const setupPyPath =
|
|
788
|
+
const pyprojectPath = join3(scopePath, "pyproject.toml");
|
|
789
|
+
const setupPyPath = join3(scopePath, "setup.py");
|
|
535
790
|
if (!installedVersion && existsSync(pyprojectPath)) {
|
|
536
791
|
const content = readFileSync(pyprojectPath, "utf8");
|
|
537
792
|
const match = content.match(/^\s*version\s*=\s*["']([^"']+)["']/m);
|
|
@@ -549,7 +804,7 @@ function installPypiPackage(packageName, requestedVersion, emit) {
|
|
|
549
804
|
installedVersion = readPythonVersionFromArchiveName(packageName, archivePath);
|
|
550
805
|
}
|
|
551
806
|
installedVersion = installedVersion ?? "unknown";
|
|
552
|
-
|
|
807
|
+
writeFileSync3(join3(tempDir, "requirements.txt"), `${packageName}==${installedVersion}
|
|
553
808
|
`, "utf8");
|
|
554
809
|
emit({ type: "stage:end", stage: "discovery", message: `Prepared ${packageName}==${installedVersion} from PyPI` });
|
|
555
810
|
return {
|
|
@@ -563,7 +818,7 @@ function installPypiPackage(packageName, requestedVersion, emit) {
|
|
|
563
818
|
function resolveCargoVersion(packageName, requestedVersion) {
|
|
564
819
|
if (requestedVersion)
|
|
565
820
|
return requestedVersion;
|
|
566
|
-
const raw =
|
|
821
|
+
const raw = execFileSync2("curl", buildCratesIoCurlArgs(`https://crates.io/api/v1/crates/${packageName}`), {
|
|
567
822
|
encoding: "utf8",
|
|
568
823
|
stdio: ["ignore", "pipe", "pipe"],
|
|
569
824
|
timeout: scanExecutionTimeout(6e4)
|
|
@@ -572,39 +827,39 @@ function resolveCargoVersion(packageName, requestedVersion) {
|
|
|
572
827
|
return parsed.crate?.max_stable_version ?? parsed.crate?.max_version ?? parsed.crate?.newest_version ?? "latest";
|
|
573
828
|
}
|
|
574
829
|
function installCargoPackage(packageName, requestedVersion, emit) {
|
|
575
|
-
const tempDir =
|
|
576
|
-
const downloadDir =
|
|
577
|
-
const extractDir =
|
|
830
|
+
const tempDir = join3(tmpdir2(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
831
|
+
const downloadDir = join3(tempDir, "downloads");
|
|
832
|
+
const extractDir = join3(tempDir, "src");
|
|
578
833
|
mkdirSync2(downloadDir, { recursive: true });
|
|
579
834
|
mkdirSync2(extractDir, { recursive: true });
|
|
580
835
|
const version = resolveCargoVersion(packageName, requestedVersion);
|
|
581
836
|
emit({ type: "stage:start", stage: "discovery", message: `Downloading crates.io crate ${packageName}@${version}...` });
|
|
582
837
|
try {
|
|
583
|
-
|
|
838
|
+
execFileSync2("curl", [
|
|
584
839
|
...buildCratesIoCurlArgs(`https://crates.io/api/v1/crates/${packageName}/${version}/download`),
|
|
585
840
|
"-o",
|
|
586
|
-
|
|
841
|
+
join3(downloadDir, `${packageName}-${version}.crate`)
|
|
587
842
|
], {
|
|
588
843
|
cwd: tempDir,
|
|
589
844
|
timeout: scanExecutionTimeout(12e4),
|
|
590
845
|
stdio: "pipe"
|
|
591
846
|
});
|
|
592
847
|
} catch (err) {
|
|
593
|
-
|
|
848
|
+
rmSync2(tempDir, { recursive: true, force: true });
|
|
594
849
|
const msg = err instanceof Error ? err.message : String(err);
|
|
595
850
|
throw new Error(`Failed to download ${packageName}@${version} from crates.io: ${msg}`);
|
|
596
851
|
}
|
|
597
|
-
const archivePath =
|
|
852
|
+
const archivePath = join3(downloadDir, `${packageName}-${version}.crate`);
|
|
598
853
|
extractSingleArchive(archivePath, extractDir);
|
|
599
854
|
const scopePath = pickPythonScopePath(extractDir);
|
|
600
|
-
const cargoTomlPath =
|
|
855
|
+
const cargoTomlPath = join3(scopePath, "Cargo.toml");
|
|
601
856
|
let resolvedVersion = version;
|
|
602
857
|
if (existsSync(cargoTomlPath)) {
|
|
603
858
|
const content = readFileSync(cargoTomlPath, "utf8");
|
|
604
859
|
const match = content.match(/^\s*version\s*=\s*["']([^"']+)["']/m);
|
|
605
860
|
resolvedVersion = match?.[1] ?? version;
|
|
606
861
|
}
|
|
607
|
-
|
|
862
|
+
writeFileSync3(join3(tempDir, "Cargo.toml"), `[package]
|
|
608
863
|
name = "0-cargo-audit"
|
|
609
864
|
version = "0.1.0"
|
|
610
865
|
edition = "2021"
|
|
@@ -612,10 +867,10 @@ edition = "2021"
|
|
|
612
867
|
[dependencies]
|
|
613
868
|
${packageName} = "${resolvedVersion}"
|
|
614
869
|
`, "utf8");
|
|
615
|
-
mkdirSync2(
|
|
616
|
-
|
|
870
|
+
mkdirSync2(join3(tempDir, "src"), { recursive: true });
|
|
871
|
+
writeFileSync3(join3(tempDir, "src", "main.rs"), "fn main() {}\n", "utf8");
|
|
617
872
|
try {
|
|
618
|
-
|
|
873
|
+
execFileSync2("cargo", ["generate-lockfile"], {
|
|
619
874
|
cwd: tempDir,
|
|
620
875
|
timeout: scanExecutionTimeout(18e4),
|
|
621
876
|
stdio: "pipe"
|
|
@@ -681,7 +936,7 @@ function resolveOciImageRef(rawImageRef, requestedVersion) {
|
|
|
681
936
|
}
|
|
682
937
|
function hasExecutable(command, args = ["--version"]) {
|
|
683
938
|
try {
|
|
684
|
-
|
|
939
|
+
execFileSync2(command, args, {
|
|
685
940
|
timeout: scanExecutionTimeout(1e4),
|
|
686
941
|
stdio: "ignore"
|
|
687
942
|
});
|
|
@@ -733,22 +988,22 @@ for layer in layers:
|
|
|
733
988
|
continue
|
|
734
989
|
layer_tar.extract(member, rootfs)
|
|
735
990
|
`;
|
|
736
|
-
|
|
991
|
+
execFileSync2("python3", ["-c", script, archivePath, rootfsDir], {
|
|
737
992
|
timeout: scanExecutionTimeout(3e5),
|
|
738
993
|
stdio: "pipe"
|
|
739
994
|
});
|
|
740
995
|
}
|
|
741
996
|
function installOciImage(rawImageRef, requestedVersion, emit) {
|
|
742
|
-
const tempDir =
|
|
743
|
-
const rootfsDir =
|
|
744
|
-
const exportTar =
|
|
997
|
+
const tempDir = join3(tmpdir2(), `0-audit-${randomUUID().slice(0, 8)}`);
|
|
998
|
+
const rootfsDir = join3(tempDir, "rootfs");
|
|
999
|
+
const exportTar = join3(tempDir, "image.tar");
|
|
745
1000
|
mkdirSync2(rootfsDir, { recursive: true });
|
|
746
1001
|
const { imageRef, name, version } = resolveOciImageRef(rawImageRef, requestedVersion);
|
|
747
1002
|
emit({ type: "stage:start", stage: "discovery", message: `Pulling OCI image ${imageRef}...` });
|
|
748
1003
|
let containerId = "";
|
|
749
1004
|
try {
|
|
750
1005
|
if (hasExecutable("skopeo")) {
|
|
751
|
-
|
|
1006
|
+
execFileSync2("skopeo", [
|
|
752
1007
|
"copy",
|
|
753
1008
|
"--insecure-policy",
|
|
754
1009
|
`docker://${imageRef}`,
|
|
@@ -759,32 +1014,32 @@ function installOciImage(rawImageRef, requestedVersion, emit) {
|
|
|
759
1014
|
});
|
|
760
1015
|
extractDockerArchiveLayers(exportTar, rootfsDir);
|
|
761
1016
|
} else {
|
|
762
|
-
|
|
1017
|
+
execFileSync2("docker", ["pull", imageRef], {
|
|
763
1018
|
timeout: scanExecutionTimeout(3e5),
|
|
764
1019
|
stdio: "pipe"
|
|
765
1020
|
});
|
|
766
|
-
containerId =
|
|
1021
|
+
containerId = execFileSync2("docker", ["create", imageRef], {
|
|
767
1022
|
encoding: "utf8",
|
|
768
1023
|
timeout: scanExecutionTimeout(6e4),
|
|
769
1024
|
stdio: ["pipe", "pipe", "pipe"]
|
|
770
1025
|
}).trim();
|
|
771
|
-
|
|
1026
|
+
execFileSync2("docker", ["export", containerId, "-o", exportTar], {
|
|
772
1027
|
timeout: scanExecutionTimeout(3e5),
|
|
773
1028
|
stdio: "pipe"
|
|
774
1029
|
});
|
|
775
|
-
|
|
1030
|
+
execFileSync2("tar", ["-xf", exportTar, "-C", rootfsDir], {
|
|
776
1031
|
timeout: scanExecutionTimeout(3e5),
|
|
777
1032
|
stdio: "pipe"
|
|
778
1033
|
});
|
|
779
1034
|
}
|
|
780
1035
|
} catch (err) {
|
|
781
|
-
|
|
1036
|
+
rmSync2(tempDir, { recursive: true, force: true });
|
|
782
1037
|
const msg = err instanceof Error ? err.message : String(err);
|
|
783
1038
|
throw new Error(`Failed to prepare OCI image ${imageRef}: ${msg}`);
|
|
784
1039
|
} finally {
|
|
785
1040
|
if (containerId) {
|
|
786
1041
|
try {
|
|
787
|
-
|
|
1042
|
+
execFileSync2("docker", ["rm", "-f", containerId], {
|
|
788
1043
|
timeout: 3e4,
|
|
789
1044
|
stdio: "pipe"
|
|
790
1045
|
});
|
|
@@ -850,7 +1105,7 @@ function walkInstalledNpmTree(projectDir, rootName, maxPackages = 5e3) {
|
|
|
850
1105
|
const out = [];
|
|
851
1106
|
const rootLower = rootName.toLowerCase();
|
|
852
1107
|
function readPackage(pkgDir) {
|
|
853
|
-
const pkgJsonPath =
|
|
1108
|
+
const pkgJsonPath = join3(pkgDir, "package.json");
|
|
854
1109
|
if (!existsSync(pkgJsonPath))
|
|
855
1110
|
return null;
|
|
856
1111
|
try {
|
|
@@ -873,9 +1128,9 @@ function walkInstalledNpmTree(projectDir, rootName, maxPackages = 5e3) {
|
|
|
873
1128
|
for (const entry of entries) {
|
|
874
1129
|
if (entry === ".bin" || entry === ".cache" || entry === ".package-lock.json")
|
|
875
1130
|
continue;
|
|
876
|
-
const abs =
|
|
1131
|
+
const abs = join3(nodeModulesDir, entry);
|
|
877
1132
|
try {
|
|
878
|
-
if (!
|
|
1133
|
+
if (!statSync2(abs).isDirectory())
|
|
879
1134
|
continue;
|
|
880
1135
|
} catch {
|
|
881
1136
|
continue;
|
|
@@ -888,9 +1143,9 @@ function walkInstalledNpmTree(projectDir, rootName, maxPackages = 5e3) {
|
|
|
888
1143
|
continue;
|
|
889
1144
|
}
|
|
890
1145
|
for (const inner of scoped) {
|
|
891
|
-
const innerAbs =
|
|
1146
|
+
const innerAbs = join3(abs, inner);
|
|
892
1147
|
try {
|
|
893
|
-
if (
|
|
1148
|
+
if (statSync2(innerAbs).isDirectory())
|
|
894
1149
|
dirs.push(innerAbs);
|
|
895
1150
|
} catch {
|
|
896
1151
|
}
|
|
@@ -914,12 +1169,12 @@ function walkInstalledNpmTree(projectDir, rootName, maxPackages = 5e3) {
|
|
|
914
1169
|
if (!(depth === 1 && meta.name.toLowerCase() === rootLower)) {
|
|
915
1170
|
out.push({ name: meta.name, version: meta.version, path: pkgDir, depth, dependencyPath });
|
|
916
1171
|
}
|
|
917
|
-
const nested =
|
|
1172
|
+
const nested = join3(pkgDir, "node_modules");
|
|
918
1173
|
if (existsSync(nested))
|
|
919
1174
|
walk(nested, depth + 1, dependencyPath);
|
|
920
1175
|
}
|
|
921
1176
|
}
|
|
922
|
-
walk(
|
|
1177
|
+
walk(join3(projectDir, "node_modules"), 1, [rootName]);
|
|
923
1178
|
return out;
|
|
924
1179
|
}
|
|
925
1180
|
async function probePublicNpmRegistry(packageName, opts = {}) {
|
|
@@ -951,211 +1206,38 @@ async function probePublicNpmRegistry(packageName, opts = {}) {
|
|
|
951
1206
|
}
|
|
952
1207
|
|
|
953
1208
|
// packages/core/dist/path-resolution.js
|
|
954
|
-
import { statSync as
|
|
1209
|
+
import { statSync as statSync3 } from "node:fs";
|
|
955
1210
|
import { homedir } from "node:os";
|
|
956
|
-
import { isAbsolute, resolve } from "node:path";
|
|
1211
|
+
import { isAbsolute as isAbsolute2, resolve as resolve2 } from "node:path";
|
|
957
1212
|
function expandHomePath(input, homeDir = homedir()) {
|
|
958
1213
|
if (input === "~")
|
|
959
1214
|
return homeDir;
|
|
960
1215
|
if (input.startsWith("~/"))
|
|
961
|
-
return
|
|
1216
|
+
return resolve2(homeDir, input.slice(2));
|
|
962
1217
|
return input;
|
|
963
1218
|
}
|
|
964
1219
|
function resolveLocalTargetPath(input, opts = {}) {
|
|
965
1220
|
const expanded = expandHomePath(input, opts.homeDir);
|
|
966
|
-
if (
|
|
967
|
-
return
|
|
968
|
-
return
|
|
1221
|
+
if (isAbsolute2(expanded))
|
|
1222
|
+
return resolve2(expanded);
|
|
1223
|
+
return resolve2(opts.cwd ?? process.cwd(), expanded);
|
|
969
1224
|
}
|
|
970
1225
|
function isExplicitLocalTargetPath(input) {
|
|
971
|
-
return input === "." || input === ".." || input === "~" || input.startsWith("./") || input.startsWith("../") || input.startsWith("~/") ||
|
|
1226
|
+
return input === "." || input === ".." || input === "~" || input.startsWith("./") || input.startsWith("../") || input.startsWith("~/") || isAbsolute2(input);
|
|
972
1227
|
}
|
|
973
1228
|
function isExistingLocalTargetPath(input, opts = {}) {
|
|
974
1229
|
try {
|
|
975
|
-
return
|
|
1230
|
+
return statSync3(resolveLocalTargetPath(input, opts)).isDirectory();
|
|
976
1231
|
} catch {
|
|
977
1232
|
return false;
|
|
978
1233
|
}
|
|
979
1234
|
}
|
|
980
1235
|
|
|
981
|
-
// packages/core/dist/prepare.js
|
|
982
|
-
function detectTargetType(target) {
|
|
983
|
-
if (target.startsWith("git@") || target.startsWith("git://") || target.endsWith(".git") || target.startsWith("https://github.com/")) {
|
|
984
|
-
return "source-code";
|
|
985
|
-
}
|
|
986
|
-
if (target.startsWith("http://") || target.startsWith("https://")) {
|
|
987
|
-
return "url";
|
|
988
|
-
}
|
|
989
|
-
if (isExplicitLocalTargetPath(target) || isExistingLocalTargetPath(target)) {
|
|
990
|
-
return "source-code";
|
|
991
|
-
}
|
|
992
|
-
if (/^(@[a-z0-9-]+\/)?[a-z0-9][a-z0-9._-]*(@.*)?$/.test(target)) {
|
|
993
|
-
return "npm-package";
|
|
994
|
-
}
|
|
995
|
-
return "source-code";
|
|
996
|
-
}
|
|
997
|
-
function installPackage(ecosystem, packageName, requestedVersion, emit) {
|
|
998
|
-
return installPackageForEcosystem(ecosystem, packageName, requestedVersion, emit);
|
|
999
|
-
}
|
|
1000
|
-
function resolveRepo(repo, emit) {
|
|
1001
|
-
const isUrl = repo.startsWith("https://") || repo.startsWith("http://") || repo.startsWith("git@") || repo.startsWith("git://");
|
|
1002
|
-
if (!isUrl) {
|
|
1003
|
-
const absPath = resolveLocalTargetPath(repo);
|
|
1004
|
-
if (!existsSync2(absPath)) {
|
|
1005
|
-
throw new Error(`Repository path not found: ${absPath}`);
|
|
1006
|
-
}
|
|
1007
|
-
return { repoPath: absPath, cloned: false };
|
|
1008
|
-
}
|
|
1009
|
-
const tempDir = join3(tmpdir2(), `0-review-${randomUUID2().slice(0, 8)}`);
|
|
1010
|
-
mkdirSync3(tempDir, { recursive: true });
|
|
1011
|
-
emit({
|
|
1012
|
-
type: "stage:start",
|
|
1013
|
-
stage: "discovery",
|
|
1014
|
-
message: `Cloning ${repo}...`
|
|
1015
|
-
});
|
|
1016
|
-
try {
|
|
1017
|
-
execFileSync2("git", ["clone", "--depth", "1", repo, `${tempDir}/repo`], {
|
|
1018
|
-
timeout: 12e4,
|
|
1019
|
-
stdio: "pipe"
|
|
1020
|
-
});
|
|
1021
|
-
} catch (err) {
|
|
1022
|
-
rmSync2(tempDir, { recursive: true, force: true });
|
|
1023
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
1024
|
-
throw new Error(`Failed to clone ${repo}: ${msg}`);
|
|
1025
|
-
}
|
|
1026
|
-
const repoPath = join3(tempDir, "repo");
|
|
1027
|
-
emit({
|
|
1028
|
-
type: "stage:end",
|
|
1029
|
-
stage: "discovery",
|
|
1030
|
-
message: `Cloned ${basename(repo.replace(/\.git$/, ""))}`
|
|
1031
|
-
});
|
|
1032
|
-
return { repoPath, cloned: true, tempDir };
|
|
1033
|
-
}
|
|
1034
|
-
async function validateUrl(url) {
|
|
1035
|
-
const controller = new AbortController();
|
|
1036
|
-
const timer = setTimeout(() => controller.abort(), 1e4);
|
|
1037
|
-
try {
|
|
1038
|
-
const res = await fetch(url, {
|
|
1039
|
-
method: "HEAD",
|
|
1040
|
-
signal: controller.signal,
|
|
1041
|
-
redirect: "follow"
|
|
1042
|
-
});
|
|
1043
|
-
if (!res.ok) {
|
|
1044
|
-
throw new Error(`URL returned HTTP ${res.status}: ${url}`);
|
|
1045
|
-
}
|
|
1046
|
-
} catch (err) {
|
|
1047
|
-
if (err instanceof Error && err.name === "AbortError") {
|
|
1048
|
-
throw new Error(`URL unreachable (timeout): ${url}`);
|
|
1049
|
-
}
|
|
1050
|
-
throw err;
|
|
1051
|
-
} finally {
|
|
1052
|
-
clearTimeout(timer);
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
async function prepare(target, type, opts, emit) {
|
|
1056
|
-
switch (type) {
|
|
1057
|
-
case "npm-package": {
|
|
1058
|
-
let packageName = target;
|
|
1059
|
-
let version = opts.packageVersion;
|
|
1060
|
-
const atIdx = target.startsWith("@") ? target.indexOf("@", 1) : target.indexOf("@");
|
|
1061
|
-
if (atIdx > 0) {
|
|
1062
|
-
packageName = target.slice(0, atIdx);
|
|
1063
|
-
version = version ?? target.slice(atIdx + 1);
|
|
1064
|
-
}
|
|
1065
|
-
const pkg = installPackage("npm", packageName, version, emit);
|
|
1066
|
-
return {
|
|
1067
|
-
targetType: type,
|
|
1068
|
-
resolvedTarget: pkg.path,
|
|
1069
|
-
packageInfo: pkg,
|
|
1070
|
-
cleanup: () => {
|
|
1071
|
-
try {
|
|
1072
|
-
rmSync2(pkg.tempDir, { recursive: true, force: true });
|
|
1073
|
-
} catch {
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
case "pypi-package": {
|
|
1079
|
-
const pkg = installPackage("pypi", target, opts.packageVersion, emit);
|
|
1080
|
-
return {
|
|
1081
|
-
targetType: type,
|
|
1082
|
-
resolvedTarget: pkg.path,
|
|
1083
|
-
packageInfo: pkg,
|
|
1084
|
-
cleanup: () => {
|
|
1085
|
-
try {
|
|
1086
|
-
rmSync2(pkg.tempDir, { recursive: true, force: true });
|
|
1087
|
-
} catch {
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
};
|
|
1091
|
-
}
|
|
1092
|
-
case "cargo-package": {
|
|
1093
|
-
const pkg = installPackage("cargo", target, opts.packageVersion, emit);
|
|
1094
|
-
return {
|
|
1095
|
-
targetType: type,
|
|
1096
|
-
resolvedTarget: pkg.path,
|
|
1097
|
-
packageInfo: pkg,
|
|
1098
|
-
cleanup: () => {
|
|
1099
|
-
try {
|
|
1100
|
-
rmSync2(pkg.tempDir, { recursive: true, force: true });
|
|
1101
|
-
} catch {
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
};
|
|
1105
|
-
}
|
|
1106
|
-
case "oci-image": {
|
|
1107
|
-
const pkg = installPackage("oci", target, opts.packageVersion, emit);
|
|
1108
|
-
return {
|
|
1109
|
-
targetType: type,
|
|
1110
|
-
resolvedTarget: pkg.path,
|
|
1111
|
-
packageInfo: pkg,
|
|
1112
|
-
cleanup: () => {
|
|
1113
|
-
try {
|
|
1114
|
-
rmSync2(pkg.tempDir, { recursive: true, force: true });
|
|
1115
|
-
} catch {
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
case "source-code": {
|
|
1121
|
-
const { repoPath, cloned, tempDir } = resolveRepo(target, emit);
|
|
1122
|
-
return {
|
|
1123
|
-
targetType: type,
|
|
1124
|
-
resolvedTarget: repoPath,
|
|
1125
|
-
repoPath,
|
|
1126
|
-
cleanup: () => {
|
|
1127
|
-
if (cloned && tempDir) {
|
|
1128
|
-
try {
|
|
1129
|
-
rmSync2(tempDir, { recursive: true, force: true });
|
|
1130
|
-
} catch {
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
};
|
|
1135
|
-
}
|
|
1136
|
-
case "url":
|
|
1137
|
-
case "web-app": {
|
|
1138
|
-
await validateUrl(target);
|
|
1139
|
-
emit({
|
|
1140
|
-
type: "stage:end",
|
|
1141
|
-
stage: "discovery",
|
|
1142
|
-
message: `URL reachable: ${target}`
|
|
1143
|
-
});
|
|
1144
|
-
return {
|
|
1145
|
-
targetType: type,
|
|
1146
|
-
resolvedTarget: target,
|
|
1147
|
-
cleanup: () => {
|
|
1148
|
-
}
|
|
1149
|
-
};
|
|
1150
|
-
}
|
|
1151
|
-
default: {
|
|
1152
|
-
const _exhaustive = type;
|
|
1153
|
-
throw new Error(`Unknown target type: ${_exhaustive}`);
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
1236
|
export {
|
|
1237
|
+
CLI_RUNTIME_TYPES,
|
|
1238
|
+
selectedStaticScanner,
|
|
1239
|
+
runFoxguardScan,
|
|
1240
|
+
runSelectedStaticScan,
|
|
1159
1241
|
normalizeSeverity,
|
|
1160
1242
|
installPackageForEcosystem,
|
|
1161
1243
|
runDependencyAuditForEcosystem,
|
|
@@ -1164,7 +1246,5 @@ export {
|
|
|
1164
1246
|
expandHomePath,
|
|
1165
1247
|
resolveLocalTargetPath,
|
|
1166
1248
|
isExplicitLocalTargetPath,
|
|
1167
|
-
isExistingLocalTargetPath
|
|
1168
|
-
detectTargetType,
|
|
1169
|
-
prepare
|
|
1249
|
+
isExistingLocalTargetPath
|
|
1170
1250
|
};
|