@vercel/cli-support 68.0.0 → 68.1.0-snapshot-f8c293166d1f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-RH3RQPGP.js → add-56T4ON6W.js} +1 -1
- package/dist/chunks/{add-4ZXS4RRN.js → add-CDHMIDYR.js} +1 -1
- package/dist/chunks/{add-G2LGF4HL.js → add-JC2KSFHX.js} +1 -1
- package/dist/chunks/{alerts-3352VWDL.js → alerts-TMFON3SU.js} +1 -1
- package/dist/chunks/{api-endpoints-2IYXPLEG.js → api-endpoints-EY2DO75S.js} +1 -1
- package/dist/chunks/auth-4A5CXZOA.js +7 -0
- package/dist/chunks/auth-ZJV6OHMS.js +7 -0
- package/dist/chunks/{build-3UFKTTS5.js → build-ALEGEJFV.js} +1 -1
- package/dist/chunks/{chunk-JDDPCL3K.js → chunk-245QYIHU.js} +1 -1
- package/dist/chunks/{chunk-SGNDE4YS.js → chunk-2ACABADL.js} +1 -1
- package/dist/chunks/{chunk-D6REP5QQ.js → chunk-2GXP676X.js} +1 -1
- package/dist/chunks/{chunk-MXTC4ZAQ.js → chunk-2ILZM77F.js} +1 -1
- package/dist/chunks/{chunk-OFDTADPQ.js → chunk-2K7U64CN.js} +1 -1
- package/dist/chunks/{chunk-DTCQWGHE.js → chunk-2KJIWBJQ.js} +2 -2
- package/dist/chunks/{chunk-T4DOV5S4.js → chunk-2V5IP6A5.js} +1 -1
- package/dist/chunks/{chunk-L46V6VL3.js → chunk-37SWAKIV.js} +1 -1
- package/dist/chunks/{chunk-ZXSZH7N5.js → chunk-3GKXXGSO.js} +1 -1
- package/dist/chunks/{chunk-QSL6AG2B.js → chunk-3HP6FOOL.js} +1 -1
- package/dist/chunks/{chunk-M32HBBPK.js → chunk-3WXQHKSS.js} +1 -1
- package/dist/chunks/{chunk-JELLVPCM.js → chunk-3XMKTJ5T.js} +1 -1
- package/dist/chunks/{chunk-KLBSCTLL.js → chunk-3YD5WA5R.js} +1 -1
- package/dist/chunks/{chunk-KIDGOY4F.js → chunk-3YNMC7FF.js} +1 -1
- package/dist/chunks/{chunk-YLXXGQQQ.js → chunk-42D3CPWB.js} +1 -1
- package/dist/chunks/{chunk-HRR57QNP.js → chunk-46R47IE5.js} +1 -1
- package/dist/chunks/{chunk-ZRFDZO7Y.js → chunk-4D4IP557.js} +1 -1
- package/dist/chunks/{chunk-OOPF73RV.js → chunk-4FPYV37P.js} +1 -1
- package/dist/chunks/{chunk-HR4ID3MU.js → chunk-4HNNFJLO.js} +1 -1
- package/dist/chunks/{chunk-5WYJSLCF.js → chunk-4HYZZASG.js} +1 -1
- package/dist/chunks/{chunk-AMZ7AUYX.js → chunk-4JPDCF2O.js} +1 -1
- package/dist/chunks/{chunk-CAJ2OUSR.js → chunk-4L7AKIX7.js} +1 -1
- package/dist/chunks/chunk-4SI66IFC.js +7 -0
- package/dist/chunks/{chunk-MCYG7CCE.js → chunk-4SIQE2W4.js} +1 -1
- package/dist/chunks/chunk-4WEKKDOL.js +8 -0
- package/dist/chunks/{chunk-Q6YPC3GK.js → chunk-57H5KQGN.js} +1 -1
- package/dist/chunks/{chunk-NWGBDBZI.js → chunk-5F4RJ32E.js} +1 -1
- package/dist/chunks/{chunk-GXWBL6YV.js → chunk-5KGALAC2.js} +1 -1
- package/dist/chunks/{chunk-KRPY5FHJ.js → chunk-5QC4IKRZ.js} +1 -1
- package/dist/chunks/{chunk-VBANKZWM.js → chunk-5RRSLENO.js} +1 -1
- package/dist/chunks/{chunk-2AMO2VMV.js → chunk-64GNDWWX.js} +1 -1
- package/dist/chunks/{chunk-J24BABG4.js → chunk-6G2AZBW5.js} +1 -1
- package/dist/chunks/{chunk-DY643UZ7.js → chunk-6JBKQ5LR.js} +2 -3
- package/dist/chunks/{chunk-X755TPX6.js → chunk-6O2LDFGJ.js} +1 -1
- package/dist/chunks/chunk-6OOJFAF5.js +20 -0
- package/dist/chunks/{chunk-T44RB754.js → chunk-6SX4TE7Y.js} +1 -1
- package/dist/chunks/{chunk-AW5KOUD7.js → chunk-6SYKGWTJ.js} +1 -1
- package/dist/chunks/chunk-6ZD6IARJ.js +33 -0
- package/dist/chunks/{chunk-O3YZLVC6.js → chunk-72CSJCJX.js} +3 -3
- package/dist/chunks/chunk-75TGTOZQ.js +8 -0
- package/dist/chunks/{chunk-GRRVPFSB.js → chunk-7JQBC2HB.js} +1 -1
- package/dist/chunks/{chunk-Y3V4JYK6.js → chunk-7MBJ4YIK.js} +1 -1
- package/dist/chunks/{chunk-PSOVLGHP.js → chunk-7O3D3XED.js} +1 -1
- package/dist/chunks/{chunk-FXLZM6Q7.js → chunk-7PK2JFEH.js} +1 -1
- package/dist/chunks/chunk-7Q5I3L37.js +68 -0
- package/dist/chunks/{chunk-24SIHFEW.js → chunk-7QHUMMBA.js} +1 -1
- package/dist/chunks/{chunk-4HR3I3ML.js → chunk-7TRHPXCG.js} +1 -1
- package/dist/chunks/{chunk-BLUPZPAS.js → chunk-7Y572CPZ.js} +1 -1
- package/dist/chunks/{chunk-ATSAMHUZ.js → chunk-A3WRF4AB.js} +1 -1
- package/dist/chunks/{chunk-6DBLXAJI.js → chunk-AGFG7WHE.js} +1 -1
- package/dist/chunks/{chunk-YFOBGEOW.js → chunk-AI32LWRL.js} +1 -1
- package/dist/chunks/chunk-AJ3KPZLM.js +18 -0
- package/dist/chunks/{chunk-MYVALJ4D.js → chunk-AJJIPBAG.js} +1 -1
- package/dist/chunks/{chunk-TGIIE2L3.js → chunk-AP2JY545.js} +1 -1
- package/dist/chunks/{chunk-Z73UJVGD.js → chunk-AU54JBLF.js} +1 -1
- package/dist/chunks/{chunk-SQ62IODX.js → chunk-AUCQKYL2.js} +1 -1
- package/dist/chunks/{chunk-ZBOTJT5S.js → chunk-AULX6RDR.js} +1 -1
- package/dist/chunks/{chunk-37P7O3AQ.js → chunk-AWB4IKVC.js} +1 -1
- package/dist/chunks/{chunk-SCV7XEEO.js → chunk-AX6UCTOC.js} +1 -1
- package/dist/chunks/{chunk-MDXG7T7M.js → chunk-B4IOZL3K.js} +1 -1
- package/dist/chunks/{chunk-Y4YBQUQM.js → chunk-B6QW2OXJ.js} +1 -1
- package/dist/chunks/{chunk-YBAGKQXC.js → chunk-BCD4TRQF.js} +1 -1
- package/dist/chunks/{chunk-OQXHBPPS.js → chunk-BCRZI5IM.js} +1 -1
- package/dist/chunks/chunk-BFS4K2RF.js +7 -0
- package/dist/chunks/chunk-BKJ4H6KK.js +8 -0
- package/dist/chunks/{chunk-O3GQG2ML.js → chunk-BLA6V5UN.js} +2 -2
- package/dist/chunks/{chunk-COD3WAUI.js → chunk-BNWEJZAC.js} +1 -1
- package/dist/chunks/{chunk-5MDNVAE6.js → chunk-BVFFSUG3.js} +1 -1
- package/dist/chunks/{chunk-X6JQI64G.js → chunk-C6AOL5RF.js} +1 -1
- package/dist/chunks/{chunk-F7L5SXJM.js → chunk-CDO5IECP.js} +1 -1
- package/dist/chunks/{chunk-XOETL6DB.js → chunk-CHY2NJU4.js} +1 -1
- package/dist/chunks/{chunk-H24KFNPB.js → chunk-CKPY7TAQ.js} +1 -1
- package/dist/chunks/chunk-COOA33HY.js +7 -0
- package/dist/chunks/{chunk-PVASGBEF.js → chunk-CSU46B7Q.js} +1 -1
- package/dist/chunks/{chunk-DDZEKNQR.js → chunk-CX4WJVNY.js} +1 -1
- package/dist/chunks/{chunk-AVCLYJNC.js → chunk-CX6QYE3Y.js} +1 -1
- package/dist/chunks/{chunk-4SAVH3H7.js → chunk-DCFCPAFQ.js} +1 -1
- package/dist/chunks/{chunk-2FUGD6J7.js → chunk-DTEWQLNP.js} +1 -1
- package/dist/chunks/chunk-DXFFWNK4.js +8 -0
- package/dist/chunks/{chunk-F4KY2TOK.js → chunk-EAQLOKZX.js} +1 -1
- package/dist/chunks/{chunk-ZGM4K3B5.js → chunk-ECQW2R5M.js} +1 -1
- package/dist/chunks/{chunk-B4KA3ZH2.js → chunk-EFGZK6OY.js} +1 -1
- package/dist/chunks/{chunk-N3ZNAMGR.js → chunk-EFQCGYZF.js} +1 -1
- package/dist/chunks/{chunk-ID663OJ7.js → chunk-EL65DTVZ.js} +1 -1
- package/dist/chunks/{chunk-PAHYNO73.js → chunk-ELQO7254.js} +1 -1
- package/dist/chunks/{chunk-3G3FQYMW.js → chunk-ERMHTPO4.js} +1 -1
- package/dist/chunks/chunk-EV2VKG2V.js +8 -0
- package/dist/chunks/{chunk-LDDXXDN5.js → chunk-EYCKXHL4.js} +1 -1
- package/dist/chunks/{chunk-5727HGA6.js → chunk-F2VXECRT.js} +1 -1
- package/dist/chunks/{chunk-NMY2YZ6M.js → chunk-F5FBLRH3.js} +1 -1
- package/dist/chunks/{chunk-TU54LHNW.js → chunk-F6BUBFV2.js} +1 -1
- package/dist/chunks/{chunk-VWKA6RKB.js → chunk-FHNHVEOX.js} +1 -1
- package/dist/chunks/{chunk-D3M2JG5C.js → chunk-FIICEEXO.js} +1 -1
- package/dist/chunks/{chunk-QPNTR3PA.js → chunk-FVMRKUWL.js} +1 -1
- package/dist/chunks/{chunk-H3ZSF2P3.js → chunk-FWYKEEQK.js} +1 -1
- package/dist/chunks/{chunk-ZHGKJCQ2.js → chunk-G7RQVFID.js} +5 -5
- package/dist/chunks/chunk-GB77JTTX.js +8 -0
- package/dist/chunks/{chunk-FTNLCQC6.js → chunk-GHZ4YQCI.js} +1 -1
- package/dist/chunks/{chunk-7RABG6HV.js → chunk-GOH7QCG3.js} +1 -1
- package/dist/chunks/{chunk-4NTBYNFR.js → chunk-GOXGA37R.js} +1 -1
- package/dist/chunks/{chunk-23FY4PR3.js → chunk-GTBPHJRJ.js} +1 -1
- package/dist/chunks/{chunk-YTSGFU5T.js → chunk-GUFRGEM5.js} +1 -1
- package/dist/chunks/{chunk-U43WXZBP.js → chunk-H2O53DAZ.js} +1 -1
- package/dist/chunks/chunk-HAM7ZPEC.js +7 -0
- package/dist/chunks/{chunk-4SWS7RKX.js → chunk-HG7NRFC5.js} +1 -1
- package/dist/chunks/{chunk-BTI5TG6Q.js → chunk-HGXM4UBQ.js} +1 -1
- package/dist/chunks/{chunk-PX3V7X3Q.js → chunk-HI5PLVKM.js} +1 -1
- package/dist/chunks/chunk-HIEFNLLO.js +7 -0
- package/dist/chunks/{chunk-NMIB4JYP.js → chunk-HJCMNBDK.js} +1 -1
- package/dist/chunks/{chunk-6WBEU34Y.js → chunk-HLJ2UIG6.js} +1 -1
- package/dist/chunks/{chunk-DH4A4QMD.js → chunk-HMNIFPU2.js} +1 -1
- package/dist/chunks/{chunk-2KXLL3DX.js → chunk-HSQPQ5RV.js} +1 -1
- package/dist/chunks/{chunk-6NC2JFUQ.js → chunk-I254SHTL.js} +1 -1
- package/dist/chunks/{chunk-YN3HZJXW.js → chunk-I3NEZRVW.js} +1 -1
- package/dist/chunks/{chunk-WHEA5VLX.js → chunk-ICPRMAKB.js} +1 -1
- package/dist/chunks/{chunk-OPORM35X.js → chunk-IFMPBA4K.js} +1 -1
- package/dist/chunks/{chunk-MCRKBVZA.js → chunk-IMLHRJ4K.js} +1 -1
- package/dist/chunks/{chunk-KA2KG3SY.js → chunk-IR3E37HD.js} +1 -1
- package/dist/chunks/chunk-IVJEYHF5.js +8 -0
- package/dist/chunks/{chunk-BPUANOGW.js → chunk-IZV6K7RR.js} +1 -1
- package/dist/chunks/{chunk-OZKP3WKT.js → chunk-J4WXRM2Y.js} +1 -1
- package/dist/chunks/chunk-J5MGMWRV.js +9 -0
- package/dist/chunks/{chunk-4FBOQLPZ.js → chunk-J7DIPT7M.js} +1 -1
- package/dist/chunks/{chunk-BOJDM3O7.js → chunk-JCDPMWKO.js} +1 -1
- package/dist/chunks/{chunk-FB37TFVF.js → chunk-JEACGNHI.js} +1 -1
- package/dist/chunks/{chunk-MGKNSTU4.js → chunk-JJNTYM7J.js} +1 -1
- package/dist/chunks/{chunk-76NL3ZRJ.js → chunk-K45TGFUJ.js} +1 -1
- package/dist/chunks/{chunk-LUX4PBJL.js → chunk-K5GE24PG.js} +1 -1
- package/dist/chunks/{chunk-25565AGS.js → chunk-K7YK4PZP.js} +1 -1
- package/dist/chunks/{chunk-D6NVKMRP.js → chunk-KEFF3BL3.js} +1 -1
- package/dist/chunks/{chunk-FBYA6LLM.js → chunk-KHJWQ4WP.js} +1 -1
- package/dist/chunks/{chunk-EHAS6SQB.js → chunk-KMTQYFJF.js} +1 -1
- package/dist/chunks/{chunk-JCHZRW4N.js → chunk-KVZR24QI.js} +1 -1
- package/dist/chunks/{chunk-BRQUZ5NC.js → chunk-L4CSJDG7.js} +1 -1
- package/dist/chunks/{chunk-ISWW3DKF.js → chunk-L6MWUMWZ.js} +1 -1
- package/dist/chunks/{chunk-KKYNEEM7.js → chunk-LKXPJLOP.js} +1 -1
- package/dist/chunks/{chunk-Q7D7RGXM.js → chunk-LLHXL3SV.js} +1 -1
- package/dist/chunks/{chunk-EYRBV6RM.js → chunk-LNRKGW7S.js} +1 -1
- package/dist/chunks/{chunk-BS32OUOC.js → chunk-LPYHYTYI.js} +1 -1
- package/dist/chunks/{chunk-A2RZZQEP.js → chunk-LY3EY2VG.js} +1 -1
- package/dist/chunks/chunk-M2XLLWK7.js +7 -0
- package/dist/chunks/{chunk-7WDSOKOY.js → chunk-MAAJGMXM.js} +1 -1
- package/dist/chunks/{chunk-DWZBL4NK.js → chunk-MAIZY5BV.js} +1 -1
- package/dist/chunks/{chunk-BUBVZ6SQ.js → chunk-MDWUJ7TA.js} +1 -1
- package/dist/chunks/{chunk-YHPPP3SF.js → chunk-MF43WTDT.js} +1 -1
- package/dist/chunks/{chunk-V3YNYCRV.js → chunk-MHVM4VKT.js} +2 -2
- package/dist/chunks/chunk-MJ2HLVVL.js +13 -0
- package/dist/chunks/{chunk-6Z5REGCM.js → chunk-MMMX3KE2.js} +1 -1
- package/dist/chunks/{chunk-ISSNEDG5.js → chunk-MN2F4NPH.js} +1 -1
- package/dist/chunks/{chunk-QFE3RPMA.js → chunk-MTPHHAPR.js} +1 -1
- package/dist/chunks/{slugify-NMMUASYK.js → chunk-N3COHC7T.js} +1 -1
- package/dist/chunks/{chunk-27FVSW45.js → chunk-N7IBUNFY.js} +1 -1
- package/dist/chunks/{chunk-BZENIQ7N.js → chunk-NBPLUP7C.js} +1 -1
- package/dist/chunks/chunk-NE5RTEMC.js +7 -0
- package/dist/chunks/{chunk-CTBSRTJW.js → chunk-NFPO75IP.js} +1 -1
- package/dist/chunks/{chunk-XE4SLG5H.js → chunk-NNPXYFMY.js} +1 -1
- package/dist/chunks/{chunk-D6O5O3CW.js → chunk-NQPQRYHS.js} +1 -1
- package/dist/chunks/{chunk-3SF3ILIT.js → chunk-NUS3WWST.js} +1 -1
- package/dist/chunks/chunk-NVU7XTNI.js +11 -0
- package/dist/chunks/{chunk-ZBZQEDZY.js → chunk-NXFYKZVZ.js} +1 -1
- package/dist/chunks/chunk-NXUDP37D.js +7 -0
- package/dist/chunks/chunk-O7AF7CLE.js +8 -0
- package/dist/chunks/{chunk-MWFHS4HV.js → chunk-O7FAYZU6.js} +1 -1
- package/dist/chunks/{chunk-MDRI27KN.js → chunk-OCX4QZ3X.js} +1 -1
- package/dist/chunks/{chunk-YOKTRWQX.js → chunk-OD4RCBDD.js} +1 -1
- package/dist/chunks/{chunk-OAM5NJCU.js → chunk-OK52DDU5.js} +1 -1
- package/dist/chunks/{chunk-PFD7LETF.js → chunk-OM6NML7C.js} +1 -1
- package/dist/chunks/{chunk-HYAIA5YC.js → chunk-OVIWCH3S.js} +2 -2
- package/dist/chunks/chunk-OVVHONX7.js +8 -0
- package/dist/chunks/{chunk-J5SINMVO.js → chunk-P5IKPNRJ.js} +1 -1
- package/dist/chunks/chunk-PG3WQGEK.js +181 -0
- package/dist/chunks/{chunk-AW33SRYY.js → chunk-PH2MLBQO.js} +1 -1
- package/dist/chunks/{chunk-XHBZITV4.js → chunk-PKECY4JZ.js} +1 -1
- package/dist/chunks/{chunk-DGLE44KA.js → chunk-PKWSWWVW.js} +1 -1
- package/dist/chunks/{chunk-RHFNVIFD.js → chunk-PNN2Y2ZQ.js} +1 -1
- package/dist/chunks/{chunk-5A3DDLQR.js → chunk-PNTKMD3A.js} +1 -1
- package/dist/chunks/{chunk-XC25DYA7.js → chunk-PQQRSUUG.js} +2 -2
- package/dist/chunks/{chunk-BKFRN6C2.js → chunk-PR4NNS3O.js} +1 -1
- package/dist/chunks/{chunk-QHGPFYWQ.js → chunk-PROENC6V.js} +1 -1
- package/dist/chunks/chunk-PW67ZNDU.js +8 -0
- package/dist/chunks/{chunk-Z436ZYLV.js → chunk-Q2FGBONA.js} +1 -1
- package/dist/chunks/{chunk-U5SZQUYO.js → chunk-QCYCLWNG.js} +1 -1
- package/dist/chunks/{chunk-6TEYSBCT.js → chunk-QDSDYOMV.js} +1 -1
- package/dist/chunks/{chunk-S3L2OHPO.js → chunk-QNMWYJQW.js} +1 -1
- package/dist/chunks/{chunk-MMMJO2M3.js → chunk-QOIG2FJP.js} +1 -1
- package/dist/chunks/{chunk-MTZYPCZ7.js → chunk-QRPBDCDH.js} +1 -1
- package/dist/chunks/{chunk-INIZJZ3O.js → chunk-RDTWDVFO.js} +1 -1
- package/dist/chunks/{chunk-GD7AV7BO.js → chunk-RFD7CEL6.js} +1 -1
- package/dist/chunks/{chunk-TSIKSHYG.js → chunk-RIVRPVTH.js} +1 -1
- package/dist/chunks/{chunk-RYSO5U3E.js → chunk-RIXTYUYN.js} +1 -1
- package/dist/chunks/{chunk-7HQZRU25.js → chunk-RRX2AMWY.js} +1 -1
- package/dist/chunks/{chunk-CEA5NDJC.js → chunk-RTIVLPN7.js} +1 -1
- package/dist/chunks/chunk-RWVYBRVF.js +13 -0
- package/dist/chunks/chunk-S4ARHJGW.js +9 -0
- package/dist/chunks/chunk-S7FMMAST.js +7 -0
- package/dist/chunks/{chunk-Q4R34AVE.js → chunk-SHLKM7EZ.js} +1 -1
- package/dist/chunks/chunk-SIWT2MBT.js +8 -0
- package/dist/chunks/{chunk-7SLMNM55.js → chunk-SPPOQ54P.js} +1 -1
- package/dist/chunks/{chunk-BIABM3FB.js → chunk-SSOWIDKG.js} +1 -1
- package/dist/chunks/{chunk-AZVSMIPP.js → chunk-STDRVWDW.js} +1 -1
- package/dist/chunks/{chunk-M2Q2DUHO.js → chunk-SUD5V67L.js} +1 -1
- package/dist/chunks/{chunk-7EJQLVWX.js → chunk-SUT2PTL3.js} +1 -1
- package/dist/chunks/chunk-SWWLPWX7.js +17 -0
- package/dist/chunks/chunk-SX2JJDHM.js +17 -0
- package/dist/chunks/{chunk-3RFQ2NXZ.js → chunk-T4257EDB.js} +1 -1
- package/dist/chunks/{chunk-G24EKATW.js → chunk-T5DQCNBC.js} +1 -1
- package/dist/chunks/chunk-TASNZYJU.js +14 -0
- package/dist/chunks/{chunk-YTSUDTAK.js → chunk-TNNCGRBK.js} +1 -1
- package/dist/chunks/{chunk-D5JQZXL7.js → chunk-TR3M42DX.js} +1 -1
- package/dist/chunks/chunk-TTM4VQ4T.js +7 -0
- package/dist/chunks/{chunk-BYBELFCP.js → chunk-UAPEASRH.js} +1 -1
- package/dist/chunks/{chunk-DXFP22OK.js → chunk-UE6M2VKP.js} +1 -1
- package/dist/chunks/chunk-UGJRAFRA.js +8 -0
- package/dist/chunks/{chunk-3AFEVHHY.js → chunk-UGVOMXYR.js} +1 -1
- package/dist/chunks/{chunk-NB2WLB3J.js → chunk-UJ7YUIEJ.js} +1 -1
- package/dist/chunks/{chunk-7OZ7OKPS.js → chunk-UJINL7VK.js} +1 -1
- package/dist/chunks/{chunk-6KNWKZR4.js → chunk-UVBRWYYJ.js} +1 -1
- package/dist/chunks/{chunk-KNNIA3PS.js → chunk-UXAPG6IX.js} +1 -1
- package/dist/chunks/{chunk-6FEMU5YF.js → chunk-V45KKYNK.js} +1 -1
- package/dist/chunks/{chunk-A6CMQOL7.js → chunk-V7EJ7O6E.js} +1 -1
- package/dist/chunks/chunk-VB6SQWSB.js +9 -0
- package/dist/chunks/{chunk-E5A7E7X6.js → chunk-VBCWRNS4.js} +1 -1
- package/dist/chunks/{chunk-5U2YLD56.js → chunk-VG44VJB5.js} +1 -1
- package/dist/chunks/{chunk-DOOBZO4W.js → chunk-VJM3WCEC.js} +1 -1
- package/dist/chunks/{chunk-BYYNR34Q.js → chunk-VNS4Z72T.js} +1 -1
- package/dist/chunks/{chunk-CTMTO2W4.js → chunk-VQAIH2X5.js} +1 -1
- package/dist/chunks/{chunk-D2JNI6UB.js → chunk-VSDLCOK3.js} +1 -1
- package/dist/chunks/chunk-VUB4NBD4.js +15 -0
- package/dist/chunks/{chunk-KXMFGDO4.js → chunk-VV5TYUAT.js} +1 -1
- package/dist/chunks/chunk-W2YAOE3Z.js +7 -0
- package/dist/chunks/{chunk-JALVF3C2.js → chunk-WMIZ6Y4E.js} +1 -1
- package/dist/chunks/{chunk-R43H4T4L.js → chunk-WPWGH5CA.js} +1 -1
- package/dist/chunks/{chunk-22ZRVWYP.js → chunk-WU22X5RO.js} +2 -2
- package/dist/chunks/{chunk-TLKBGAOL.js → chunk-WWEUGL6W.js} +1 -1
- package/dist/chunks/{chunk-S6TAO4MD.js → chunk-X3A324UF.js} +1 -1
- package/dist/chunks/{chunk-JUAHDOL6.js → chunk-X5YKQ2RJ.js} +1 -1
- package/dist/chunks/{chunk-VJNTVPUV.js → chunk-X5ZBXCCY.js} +1 -1
- package/dist/chunks/{chunk-J3U2QD2L.js → chunk-X72FHJ6W.js} +1 -1
- package/dist/chunks/{chunk-E3AML3VR.js → chunk-XBT7X2Q4.js} +1 -1
- package/dist/chunks/{chunk-CDJ25IKC.js → chunk-XGCCTSBW.js} +1 -1
- package/dist/chunks/chunk-XHXWUAJE.js +32 -0
- package/dist/chunks/{chunk-U4Z2MMOF.js → chunk-XKVKG7CW.js} +1 -1
- package/dist/chunks/{chunk-4F73GVJZ.js → chunk-XO2CZXGA.js} +1 -1
- package/dist/chunks/{chunk-E3WP42P2.js → chunk-XPEWDJV6.js} +1 -1
- package/dist/chunks/{chunk-DNONVY2L.js → chunk-XXPUBGJZ.js} +2 -2
- package/dist/chunks/{chunk-UPDIZCP3.js → chunk-Y2J2ESAE.js} +1 -1
- package/dist/chunks/chunk-Y2KAVMM4.js +10 -0
- package/dist/chunks/{chunk-46ISU3XI.js → chunk-Y3ETQZSK.js} +2 -2
- package/dist/chunks/{chunk-5RMIM4S2.js → chunk-Y7SZI3JV.js} +1 -1
- package/dist/chunks/chunk-YBWLW6SW.js +7 -0
- package/dist/chunks/{chunk-B7IUFV5P.js → chunk-YDCILYRC.js} +1 -1
- package/dist/chunks/{chunk-67GZ5REA.js → chunk-YHZXIBS7.js} +1 -1
- package/dist/chunks/{chunk-5CVEW3HD.js → chunk-YLQCB6XY.js} +1 -1
- package/dist/chunks/{chunk-47E5IB3C.js → chunk-YNNU3GPR.js} +1 -1
- package/dist/chunks/{chunk-IVZNPSHU.js → chunk-YTBNOSND.js} +1 -1
- package/dist/chunks/{chunk-WAOS5OCB.js → chunk-YU33PPKX.js} +1 -1
- package/dist/chunks/{chunk-7JU5RJ3H.js → chunk-ZEBOIM34.js} +1 -1
- package/dist/chunks/{chunk-E7IN2DGU.js → chunk-ZEGUFI44.js} +1 -1
- package/dist/chunks/{chunk-NZ2TFADV.js → chunk-ZOJI7HYA.js} +1 -1
- package/dist/chunks/{clear-GL4SZ2XR.js → clear-FQ4L2ACT.js} +1 -1
- package/dist/chunks/{cli-embedded-NR5F35LW.js → cli-embedded-CZYKFQ6U.js} +2 -2
- package/dist/chunks/cli-truncate-CylqKOGj-WE5OLB6Q.js +7 -0
- package/dist/chunks/commands-Bx-lrmie-KJI5MSFW.js +10 -0
- package/dist/chunks/compile-vercel-config-GUTXMJOP.js +7 -0
- package/dist/chunks/{config-U4GLPYDY.js → config-4KECSIYK.js} +1 -1
- package/dist/chunks/{config-KSQQQMQQ.js → config-EEYAOPDR.js} +1 -1
- package/dist/chunks/config-HiWLfXRQ-G4JC3PIR.js +43 -0
- package/dist/chunks/connect-U3yG4EtI-KWEUMGCU.js +7 -0
- package/dist/chunks/connect-git-provider-MPYSAOTH.js +7 -0
- package/dist/chunks/cp-aFe-HVrK-JGQPCT5R.js +12 -0
- package/dist/chunks/create-ilHWvzSk-MPW7HE43.js +7 -0
- package/dist/chunks/create-project-FMUOSSNP.js +7 -0
- package/dist/chunks/{delete-D2WLQHVB.js → delete-JRMGVHFJ.js} +1 -1
- package/dist/chunks/{delete-O2VWRQC3.js → delete-LP4N4BXX.js} +1 -1
- package/dist/chunks/{describe-N36SISDN.js → describe-5M3XKRMV.js} +1 -1
- package/dist/chunks/detect-projects-DHS2E3N4.js +7 -0
- package/dist/chunks/detect-services-HCUFI3RJ.js +7 -0
- package/dist/chunks/{disable-EHRVY24G.js → disable-ZFDARZAF.js} +1 -1
- package/dist/chunks/{discard-QW5TMTXX.js → discard-PE5SSIDJ.js} +1 -1
- package/dist/chunks/dist-BGUQ47VG.js +7 -0
- package/dist/chunks/{dist-33WTJLVQ.js → dist-E4BMK7BO.js} +1 -1
- package/dist/chunks/{dist-RXYNZPEA.js → dist-S7GEJ656.js} +1 -1
- package/dist/chunks/domain-DGvr_U55-AZYOJW3J.js +8 -0
- package/dist/chunks/drives-Bi-Mnt2z-JAGBYE6W.js +14 -0
- package/dist/chunks/{edit-WM6KJPSI.js → edit-7S67WBSE.js} +1 -1
- package/dist/chunks/{edit-IZR537PS.js → edit-BATH6ETJ.js} +1 -1
- package/dist/chunks/{enable-5Z72O3NI.js → enable-JWLWXAZP.js} +1 -1
- package/dist/chunks/{engine-C8wCzkw--PYVABGU4.js → engine-C8wCzkw--72P7UD6T.js} +1 -1
- package/dist/chunks/{esm-IYH32MTQ.js → esm-B3P7PUFJ.js} +1 -1
- package/dist/chunks/{esm-5GQXHN7C.js → esm-CMSQLK7G.js} +1 -1
- package/dist/chunks/{esm-LEQXRLFV.js → esm-KWMRMP74.js} +1 -1
- package/dist/chunks/{esm-NHCCFW7Z.js → esm-LRBNA4QO.js} +1 -1
- package/dist/chunks/{esm-FJCIOBBV.js → esm-NVIK2MSG.js} +1 -1
- package/dist/chunks/{esm-T655CG6O.js → esm-RAS56M3I.js} +1 -1
- package/dist/chunks/{esm-QQ3MUOW4.js → esm-WU2ZS2IW.js} +1 -1
- package/dist/chunks/{exec-PCSP64LR.js → exec-6WGVP2E2.js} +1 -1
- package/dist/chunks/exec-Bwv4MDyN-SMCC4JHS.js +7 -0
- package/dist/chunks/{export-IWVMWM2H.js → export-DASZMUUD.js} +1 -1
- package/dist/chunks/extend-D9tq9Cot-Z4ORB3B2.js +8 -0
- package/dist/chunks/{fetch-proxy-MOKBS56A.js → fetch-proxy-ZIHXTNFP.js} +1 -1
- package/dist/chunks/fork-DQ6qfKqB-AJCZOGQR.js +9 -0
- package/dist/chunks/future-CNLTCF2D.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-TCH3OY6G.js +7 -0
- package/dist/chunks/groups-B8JVEeKk-J5CCQYWU.js +10 -0
- package/dist/chunks/image-CDRXKTJG.js +7 -0
- package/dist/chunks/import-builders-XI6CYID6.js +7 -0
- package/dist/chunks/{inspect-6Y672OQ3.js → inspect-DSTHAT43.js} +1 -1
- package/dist/chunks/{inspect-SW2I7D6E.js → inspect-FCJC7XCN.js} +1 -1
- package/dist/chunks/{inspect-QT3QEFBW.js → inspect-FODCPYHT.js} +1 -1
- package/dist/chunks/{inspect-6J5DGZZ4.js → inspect-I7NZH44Z.js} +1 -1
- package/dist/chunks/{inspect-ALC2J4BF.js → inspect-JFRSCAAW.js} +1 -1
- package/dist/chunks/{inspect-47FM3OWG.js → inspect-RSSQ5YKF.js} +1 -1
- package/dist/chunks/{list-CXXDI5UV.js → list-7K3LEJXV.js} +1 -1
- package/dist/chunks/{list-BIFH4KO5.js → list-HWDVPR4V.js} +1 -1
- package/dist/chunks/{list-TGDHJKDT.js → list-NT2RHNIB.js} +1 -1
- package/dist/chunks/{list-2CMCXXP4.js → list-QDBAXYKL.js} +1 -1
- package/dist/chunks/list-iqQFvOHx-EWWTMITV.js +7 -0
- package/dist/chunks/log-update-DsqoChS1-DG7F5XJ4.js +11 -0
- package/dist/chunks/login-DGxA9ez--ZRIJ24TS.js +13 -0
- package/dist/chunks/login-RWXYD2CO.js +7 -0
- package/dist/chunks/{login-IUQDG334.js → login-WHXNCPDU.js} +1 -1
- package/dist/chunks/logout-OEbPJLu2-7NPM6ALK.js +8 -0
- package/dist/chunks/logs-RDOQVAER.js +7 -0
- package/dist/chunks/{ls-YTKJRKD3.js → ls-2OYMFZIB.js} +1 -1
- package/dist/chunks/{ls-7D73WVOF.js → ls-2PCKZKR7.js} +1 -1
- package/dist/chunks/{ls-GC5MX2HZ.js → ls-7DUE3OKC.js} +1 -1
- package/dist/chunks/{ls-C75Z5FBX.js → ls-ASWAYYAI.js} +1 -1
- package/dist/chunks/{ls-ERDQLUT2.js → ls-PEFQHSG3.js} +1 -1
- package/dist/chunks/{ls-4DNFF35I.js → ls-UQZB42CA.js} +1 -1
- package/dist/chunks/{ls-IQUZ6GWG.js → ls-XJZFHHWA.js} +1 -1
- package/dist/chunks/migrate-experimental-services-2E5TRQU6.js +7 -0
- package/dist/chunks/{mutate-YJNE2733.js → mutate-QXTPOGVD.js} +1 -1
- package/dist/chunks/{native-self-update-Q3EN6NZK.js → native-self-update-T75AUBHJ.js} +1 -1
- package/dist/chunks/{notifications-2HU4L7WA.js → notifications-F2BUWHH4.js} +1 -1
- package/dist/chunks/{open-MA7QGJKO.js → open-5FUW57NF.js} +1 -1
- package/dist/chunks/{openapi-POBVCXS3.js → openapi-NZLMBOMR.js} +1 -1
- package/dist/chunks/{permissions-AU5M5A6G.js → permissions-ABXSL4I4.js} +1 -1
- package/dist/chunks/{plugin-offer-E53UQXXX.js → plugin-offer-IMTYE365.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-3MKVB7HN.js +7 -0
- package/dist/chunks/{publish-G7NQESCE.js → publish-5AE7VXIO.js} +1 -1
- package/dist/chunks/pull-MGQ2TMA3.js +7 -0
- package/dist/chunks/purchase-domain-if-available-MU5TGXLG.js +7 -0
- package/dist/chunks/{push-BG7UEIKY.js → push-SBTMPRZE.js} +1 -1
- package/dist/chunks/query-5Q6ZV2TP.js +7 -0
- package/dist/chunks/{raw-query-QHFSKN55.js → raw-query-OAYC3OTN.js} +1 -1
- package/dist/chunks/read-BTA5slYO-TGRGDUB5.js +8 -0
- package/dist/chunks/{reauthenticate-U2LOFDFP.js → reauthenticate-PXEYMV7G.js} +1 -1
- package/dist/chunks/remove-CCa99nz9-52C5X3OV.js +7 -0
- package/dist/chunks/{remove-IB7C6LII.js → remove-WSK5OYNV.js} +1 -1
- package/dist/chunks/{reorder-E5UYNMML.js → reorder-DT32UBAI.js} +1 -1
- package/dist/chunks/{reply-DSDFBUAX.js → reply-AMZ3Y3U5.js} +1 -1
- package/dist/chunks/{repo-info-to-url-XQSULSEO.js → repo-info-to-url-S2YOQIRM.js} +1 -1
- package/dist/chunks/{repo-root-DZ6WFHMP.js → repo-root-STNOAHCH.js} +1 -1
- package/dist/chunks/{resolve-VK5QTUII.js → resolve-NPE5HKCT.js} +1 -1
- package/dist/chunks/{resolve-agent-team-D7RFR6WL.js → resolve-agent-team-75WZ2VDR.js} +1 -1
- package/dist/chunks/{resolve-deployment-framework-preset-BLMQLCIN.js → resolve-deployment-framework-preset-SCQCWANF.js} +1 -1
- package/dist/chunks/{restore-IVNZOVU3.js → restore-IZHGW3NV.js} +1 -1
- package/dist/chunks/{rm-LWEITUDD.js → rm-G4U54YJT.js} +1 -1
- package/dist/chunks/{rm-GYS4DS2Z.js → rm-HVDZJXME.js} +1 -1
- package/dist/chunks/{rm-L2KCHMLS.js → rm-ILDCA66K.js} +1 -1
- package/dist/chunks/{rm-PDJE63VV.js → rm-JWMYMOKD.js} +1 -1
- package/dist/chunks/{rm-PAI3WZXJ.js → rm-MBWOLQZJ.js} +1 -1
- package/dist/chunks/routes-GTTTHCOL.js +7 -0
- package/dist/chunks/rule-inspect-KZ7FNV26.js +8 -0
- package/dist/chunks/run-D8obqfKw-VBME5UHC.js +7 -0
- package/dist/chunks/{schema-ZIK2W4AX.js → schema-5FNNQEU5.js} +1 -1
- package/dist/chunks/{schema-ZOPJJLJC.js → schema-SKHPOMD7.js} +1 -1
- package/dist/chunks/select-org-YRCPH5Z5.js +7 -0
- package/dist/chunks/{serving-C1mhZQqH-73TMEGEB.js → serving-C1mhZQqH-XEQUVQZK.js} +1 -1
- package/dist/chunks/sessions-cvWvPgzc-XIYLOGFI.js +7 -0
- package/dist/chunks/{set-MC2CLSA2.js → set-V6QX5AZQ.js} +1 -1
- package/dist/chunks/{set-B5MPNYXG.js → set-WWREM57F.js} +1 -1
- package/dist/chunks/setup-and-link-STBOP67J.js +7 -0
- package/dist/chunks/sh-7olsIyJh-PKP4FF4F.js +7 -0
- package/dist/chunks/{skills-X5MN3OH2.js → skills-5TXXGKN5.js} +1 -1
- package/dist/chunks/slugify-OEOEYGDL.js +7 -0
- package/dist/chunks/snapshot-D9MAspub-SROFKNVE.js +9 -0
- package/dist/chunks/snapshots-DQjvm6St-4DTYO2IQ.js +9 -0
- package/dist/chunks/stamp-THWCZ5IQ.js +7 -0
- package/dist/chunks/{statuspage-K5SC7KAQ.js → statuspage-NCYXH7DR.js} +1 -1
- package/dist/chunks/stop-SQX-uC-Q-MCMKSJVQ.js +10 -0
- package/dist/chunks/table-3DCL552W.js +7 -0
- package/dist/chunks/{tags-WRVKKRN7.js → tags-SVOY7QEN.js} +1 -1
- package/dist/chunks/telemetry-KLbte3YE-OAFHJTWE.js +13 -0
- package/dist/chunks/token-DGNBXqnR-37H4S563.js +7 -0
- package/dist/chunks/token-EYEJQ7AP.js +7 -0
- package/dist/chunks/token-LNLX4V5J.js +7 -0
- package/dist/chunks/token-MZBD3R2S.js +7 -0
- package/dist/chunks/token-util-4P4GUSTT.js +7 -0
- package/dist/chunks/token-util-DAhLJ1X4-NJBLJROT.js +7 -0
- package/dist/chunks/token-util-XC5K3DNT.js +7 -0
- package/dist/chunks/token-util-XO4H5VLL.js +7 -0
- package/dist/chunks/{types-PC3JIYPX.js → types-NX7G6YBW.js} +1 -1
- package/dist/chunks/{update-QDIZFM4T.js → update-AVWVPYK5.js} +1 -1
- package/dist/chunks/{update-route-version-KWK5S4UW.js → update-route-version-MKFTZPKQ.js} +1 -1
- package/dist/chunks/{usage-JUP36KHN.js → usage-RUCM3AMF.js} +1 -1
- package/dist/chunks/users-CGEsQ4G8-BEKXN56N.js +9 -0
- package/dist/chunks/{utils-IQZEE4DT.js → utils-XXR7KIRB.js} +1 -1
- package/dist/chunks/validate-config-MJQI5EMD.js +7 -0
- package/dist/chunks/{vercel-cli-3UQLDU2S.js → vercel-cli-RW4WHHOS.js} +1 -1
- package/dist/chunks/{vlt-builder-graph-XL2XRO4V.js → vlt-builder-graph-EU5EX7KY.js} +1 -1
- package/dist/chunks/{vlt-builder-importer-RBUPAB6J.js → vlt-builder-importer-2YSRGPFC.js} +1 -1
- package/dist/chunks/wrap-ansi-CaN_P_HT-MAPHF26X.js +7 -0
- package/dist/chunks/write-DixEhGqz-D34NI34B.js +10 -0
- package/dist/chunks/{zod-Y3ZBY67C.js → zod-H7KW2D5Z.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +11 -11
- package/dist/commands/dev/index.js +5 -9
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +102 -80
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +5 -5
- package/dist/commands-ai.js +6 -6
- package/dist/commands-blob.js +3 -3
- package/dist/commands-core.js +9 -9
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +1 -1
- package/dist/commands-integrations.js +11 -11
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +9 -9
- package/dist/help.js +1 -1
- package/dist/index.js +5 -5
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +2 -2
- package/dist/package.json +8 -8
- package/dist/version.mjs +1 -1
- package/package.json +16 -16
- package/dist/chunks/chunk-3ARTWVQV.js +0 -11
- package/dist/chunks/chunk-6UJIJLQC.js +0 -13
- package/dist/chunks/chunk-EMTZZXMH.js +0 -13
- package/dist/chunks/chunk-XKPB27SC.js +0 -8
- package/dist/chunks/chunk-Z3XKNZDP.js +0 -9
- package/dist/chunks/compile-vercel-config-HMKEDWC4.js +0 -7
- package/dist/chunks/connect-git-provider-WGKVFXW2.js +0 -7
- package/dist/chunks/create-project-BTOHPKZB.js +0 -7
- package/dist/chunks/detect-projects-I7NEHWSM.js +0 -7
- package/dist/chunks/detect-services-4ONC2DH3.js +0 -7
- package/dist/chunks/future-3AUPMPY7.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-OZWVIWOO.js +0 -7
- package/dist/chunks/image-EFBQXTAP.js +0 -7
- package/dist/chunks/import-builders-2G4KVI4T.js +0 -7
- package/dist/chunks/login-WYDX5KZN.js +0 -7
- package/dist/chunks/logs-E3RZLAT2.js +0 -7
- package/dist/chunks/migrate-experimental-services-GPGYPN66.js +0 -7
- package/dist/chunks/prompt-missing-credentials-7F7MUAWK.js +0 -7
- package/dist/chunks/pull-4LISUHDN.js +0 -7
- package/dist/chunks/purchase-domain-if-available-QH2OHRLZ.js +0 -7
- package/dist/chunks/query-QCIU5IB4.js +0 -7
- package/dist/chunks/routes-SBMN6SDF.js +0 -7
- package/dist/chunks/rule-inspect-LQISNCBT.js +0 -8
- package/dist/chunks/select-org-EKDOS2CQ.js +0 -7
- package/dist/chunks/setup-and-link-FHHZAU65.js +0 -7
- package/dist/chunks/stamp-TKONNIJ5.js +0 -7
- package/dist/chunks/table-SCLK33K7.js +0 -7
- package/dist/chunks/token-MYYNOUIT.js +0 -7
- package/dist/chunks/token-util-OJHS52JP.js +0 -7
- package/dist/chunks/validate-config-K42CVRCZ.js +0 -7
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{require_pluralize}from"./chunk-4HR3I3ML.js";import{getProjectByNameOrId}from"./chunk-3AFEVHHY.js";import{require_lib}from"./chunk-LUX4PBJL.js";import{ua_default}from"./chunk-MTZYPCZ7.js";import{require_chownr,require_mkdirp,require_pump,require_tar_stream}from"./chunk-D6REP5QQ.js";import{fetch as fetch2}from"./chunk-MY4MONOH.js";import{getGlobalPathConfig,getInvocationCwd}from"./chunk-ZRFDZO7Y.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{printError}from"./chunk-UPDIZCP3.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{AGENT_REASON,AGENT_STATUS,agentErrorMetadata,getExitCodeForReason,getTeamByIdOrSlug,outputAgentError,trackAgentError}from"./chunk-3ARTWVQV.js";import{require_types}from"./chunk-AW33SRYY.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{require_graceful_fs,require_load_json_file}from"./chunk-4NTBYNFR.js";import{APIError,ConflictingConfigFiles,DeprecatedNowJson,EnvFileSymlinkError,InvalidLocalConfig,InvalidToken,MissingUser,NowError,ProjectNotFound,UnsafeWritePathError,code,humanizePath,isAPIError,parseRetryAfterHeaderAsMillis}from"./chunk-QFE3RPMA.js";import{cmd,getCommandName,packageName}from"./chunk-B4KA3ZH2.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{emoji,link_default,output_manager_default,prependEmoji,recordCliError}from"./chunk-RYSO5U3E.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_minimatch}from"./chunk-7HQZRU25.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{remoteText}from"./chunk-SQ62IODX.js";import{getGlobalFlagsFromArgs,quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_universalify=__commonJS({"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports){"use strict";exports.fromCallback=function(fn){return Object.defineProperty(function(...args){if(typeof args[args.length-1]=="function")fn.apply(this,args);else return new Promise((resolve5,reject)=>{args.push((err,res)=>err!=null?reject(err):resolve5(res)),fn.apply(this,args)})},"name",{value:fn.name})};exports.fromPromise=function(fn){return Object.defineProperty(function(...args){let cb=args[args.length-1];if(typeof cb!="function")return fn.apply(this,args);args.pop(),fn.apply(this,args).then(r=>cb(null,r),cb)},"name",{value:fn.name})}}});var require_fs=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/fs/index.js"(exports){"use strict";var u=require_universalify().fromCallback,fs4=require_graceful_fs(),api=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(key=>typeof fs4[key]=="function");Object.assign(exports,fs4);api.forEach(method=>{exports[method]=u(fs4[method])});exports.realpath.native=u(fs4.realpath.native);exports.exists=function(filename,callback){return typeof callback=="function"?fs4.exists(filename,callback):new Promise(resolve5=>fs4.exists(filename,resolve5))};exports.read=function(fd,buffer,offset,length,position,callback){return typeof callback=="function"?fs4.read(fd,buffer,offset,length,position,callback):new Promise((resolve5,reject)=>{fs4.read(fd,buffer,offset,length,position,(err,bytesRead,buffer2)=>{if(err)return reject(err);resolve5({bytesRead,buffer:buffer2})})})};exports.write=function(fd,buffer,...args){return typeof args[args.length-1]=="function"?fs4.write(fd,buffer,...args):new Promise((resolve5,reject)=>{fs4.write(fd,buffer,...args,(err,bytesWritten,buffer2)=>{if(err)return reject(err);resolve5({bytesWritten,buffer:buffer2})})})};typeof fs4.writev=="function"&&(exports.writev=function(fd,buffers,...args){return typeof args[args.length-1]=="function"?fs4.writev(fd,buffers,...args):new Promise((resolve5,reject)=>{fs4.writev(fd,buffers,...args,(err,bytesWritten,buffers2)=>{if(err)return reject(err);resolve5({bytesWritten,buffers:buffers2})})})})}});var require_utils=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports,module){"use strict";var path2=__require("path");module.exports.checkPath=function(pth){if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path2.parse(pth).root,""))){let error=new Error(`Path contains invalid characters: ${pth}`);throw error.code="EINVAL",error}}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports,module){"use strict";var fs4=require_fs(),{checkPath}=require_utils(),getMode=options=>{let defaults={mode:511};return typeof options=="number"?options:{...defaults,...options}.mode};module.exports.makeDir=async(dir,options)=>(checkPath(dir),fs4.mkdir(dir,{mode:getMode(options),recursive:!0}));module.exports.makeDirSync=(dir,options)=>(checkPath(dir),fs4.mkdirSync(dir,{mode:getMode(options),recursive:!0}))}});var require_mkdirs=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,{makeDir:_makeDir,makeDirSync}=require_make_dir(),makeDir=u(_makeDir);module.exports={mkdirs:makeDir,mkdirsSync:makeDirSync,mkdirp:makeDir,mkdirpSync:makeDirSync,ensureDir:makeDir,ensureDirSync:makeDirSync}}});var require_utimes=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/utimes.js"(exports,module){"use strict";var fs4=require_graceful_fs();function utimesMillis(path2,atime,mtime,callback){fs4.open(path2,"r+",(err,fd)=>{if(err)return callback(err);fs4.futimes(fd,atime,mtime,futimesErr=>{fs4.close(fd,closeErr=>{callback&&callback(futimesErr||closeErr)})})})}function utimesMillisSync(path2,atime,mtime){let fd=fs4.openSync(path2,"r+");return fs4.futimesSync(fd,atime,mtime),fs4.closeSync(fd)}module.exports={utimesMillis,utimesMillisSync}}});var require_stat=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/stat.js"(exports,module){"use strict";var fs4=require_fs(),path2=__require("path"),util=__require("util");function getStats(src,dest,opts){let statFunc=opts.dereference?file=>fs4.stat(file,{bigint:!0}):file=>fs4.lstat(file,{bigint:!0});return Promise.all([statFunc(src),statFunc(dest).catch(err=>{if(err.code==="ENOENT")return null;throw err})]).then(([srcStat,destStat])=>({srcStat,destStat}))}function getStatsSync(src,dest,opts){let destStat,statFunc=opts.dereference?file=>fs4.statSync(file,{bigint:!0}):file=>fs4.lstatSync(file,{bigint:!0}),srcStat=statFunc(src);try{destStat=statFunc(dest)}catch(err){if(err.code==="ENOENT")return{srcStat,destStat:null};throw err}return{srcStat,destStat}}function checkPaths(src,dest,funcName,opts,cb){util.callbackify(getStats)(src,dest,opts,(err,stats)=>{if(err)return cb(err);let{srcStat,destStat}=stats;if(destStat){if(areIdentical(srcStat,destStat)){let srcBaseName=path2.basename(src),destBaseName=path2.basename(dest);return funcName==="move"&&srcBaseName!==destBaseName&&srcBaseName.toLowerCase()===destBaseName.toLowerCase()?cb(null,{srcStat,destStat,isChangingCase:!0}):cb(new Error("Source and destination must not be the same."))}if(srcStat.isDirectory()&&!destStat.isDirectory())return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));if(!srcStat.isDirectory()&&destStat.isDirectory())return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))}return srcStat.isDirectory()&&isSrcSubdir(src,dest)?cb(new Error(errMsg(src,dest,funcName))):cb(null,{srcStat,destStat})})}function checkPathsSync(src,dest,funcName,opts){let{srcStat,destStat}=getStatsSync(src,dest,opts);if(destStat){if(areIdentical(srcStat,destStat)){let srcBaseName=path2.basename(src),destBaseName=path2.basename(dest);if(funcName==="move"&&srcBaseName!==destBaseName&&srcBaseName.toLowerCase()===destBaseName.toLowerCase())return{srcStat,destStat,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(srcStat.isDirectory()&&!destStat.isDirectory())throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);if(!srcStat.isDirectory()&&destStat.isDirectory())throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)}if(srcStat.isDirectory()&&isSrcSubdir(src,dest))throw new Error(errMsg(src,dest,funcName));return{srcStat,destStat}}function checkParentPaths(src,srcStat,dest,funcName,cb){let srcParent=path2.resolve(path2.dirname(src)),destParent=path2.resolve(path2.dirname(dest));if(destParent===srcParent||destParent===path2.parse(destParent).root)return cb();fs4.stat(destParent,{bigint:!0},(err,destStat)=>err?err.code==="ENOENT"?cb():cb(err):areIdentical(srcStat,destStat)?cb(new Error(errMsg(src,dest,funcName))):checkParentPaths(src,srcStat,destParent,funcName,cb))}function checkParentPathsSync(src,srcStat,dest,funcName){let srcParent=path2.resolve(path2.dirname(src)),destParent=path2.resolve(path2.dirname(dest));if(destParent===srcParent||destParent===path2.parse(destParent).root)return;let destStat;try{destStat=fs4.statSync(destParent,{bigint:!0})}catch(err){if(err.code==="ENOENT")return;throw err}if(areIdentical(srcStat,destStat))throw new Error(errMsg(src,dest,funcName));return checkParentPathsSync(src,srcStat,destParent,funcName)}function areIdentical(srcStat,destStat){return destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev}function isSrcSubdir(src,dest){let srcArr=path2.resolve(src).split(path2.sep).filter(i=>i),destArr=path2.resolve(dest).split(path2.sep).filter(i=>i);return srcArr.reduce((acc,cur,i)=>acc&&destArr[i]===cur,!0)}function errMsg(src,dest,funcName){return`Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`}module.exports={checkPaths,checkPathsSync,checkParentPaths,checkParentPathsSync,isSrcSubdir,areIdentical}}});var require_copy_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),mkdirsSync=require_mkdirs().mkdirsSync,utimesMillisSync=require_utimes().utimesMillisSync,stat2=require_stat();function copySync(src,dest,opts){typeof opts=="function"&&(opts={filter:opts}),opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
7
|
+
import{printAlignedLabel}from"./chunk-SUD5V67L.js";import{require_pluralize}from"./chunk-7TRHPXCG.js";import{getProjectByNameOrId}from"./chunk-UGVOMXYR.js";import{require_lib}from"./chunk-K5GE24PG.js";import{ua_default}from"./chunk-QRPBDCDH.js";import{require_chownr,require_mkdirp,require_pump,require_tar_stream}from"./chunk-2GXP676X.js";import{fetch as fetch2}from"./chunk-MY4MONOH.js";import{getGlobalPathConfig,getInvocationCwd}from"./chunk-4D4IP557.js";import{require_ms}from"./chunk-2ILZM77F.js";import{printError}from"./chunk-Y2J2ESAE.js";import{parseArguments}from"./chunk-RDTWDVFO.js";import{AGENT_REASON,AGENT_STATUS,agentErrorMetadata,getExitCodeForReason,getTeamByIdOrSlug,outputAgentError,trackAgentError}from"./chunk-NVU7XTNI.js";import{require_types}from"./chunk-PH2MLBQO.js";import{require_cli_config}from"./chunk-DCFCPAFQ.js";import{require_graceful_fs,require_load_json_file}from"./chunk-GOXGA37R.js";import{APIError,ConflictingConfigFiles,DeprecatedNowJson,EnvFileSymlinkError,InvalidLocalConfig,InvalidToken,MissingUser,NowError,ProjectNotFound,UnsafeWritePathError,code,humanizePath,isAPIError,parseRetryAfterHeaderAsMillis}from"./chunk-MTPHHAPR.js";import{cmd,getCommandName,packageName}from"./chunk-EFGZK6OY.js";import{pkg_default}from"./chunk-JCDPMWKO.js";import{emoji,link_default,output_manager_default,prependEmoji,recordCliError}from"./chunk-RIXTYUYN.js";import{require_build_utils}from"./chunk-BVFFSUG3.js";import{require_minimatch}from"./chunk-RRX2AMWY.js";import{require_dist}from"./chunk-4SIQE2W4.js";import{remoteText}from"./chunk-AUCQKYL2.js";import{getGlobalFlagsFromArgs,quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{require_strip_ansi}from"./chunk-LPYHYTYI.js";import{__commonJS,__require,__toESM}from"./chunk-NBPLUP7C.js";var require_universalify=__commonJS({"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports){"use strict";exports.fromCallback=function(fn){return Object.defineProperty(function(...args){if(typeof args[args.length-1]=="function")fn.apply(this,args);else return new Promise((resolve5,reject)=>{args.push((err,res)=>err!=null?reject(err):resolve5(res)),fn.apply(this,args)})},"name",{value:fn.name})};exports.fromPromise=function(fn){return Object.defineProperty(function(...args){let cb=args[args.length-1];if(typeof cb!="function")return fn.apply(this,args);args.pop(),fn.apply(this,args).then(r=>cb(null,r),cb)},"name",{value:fn.name})}}});var require_fs=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/fs/index.js"(exports){"use strict";var u=require_universalify().fromCallback,fs4=require_graceful_fs(),api=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(key=>typeof fs4[key]=="function");Object.assign(exports,fs4);api.forEach(method=>{exports[method]=u(fs4[method])});exports.realpath.native=u(fs4.realpath.native);exports.exists=function(filename,callback){return typeof callback=="function"?fs4.exists(filename,callback):new Promise(resolve5=>fs4.exists(filename,resolve5))};exports.read=function(fd,buffer,offset,length,position,callback){return typeof callback=="function"?fs4.read(fd,buffer,offset,length,position,callback):new Promise((resolve5,reject)=>{fs4.read(fd,buffer,offset,length,position,(err,bytesRead,buffer2)=>{if(err)return reject(err);resolve5({bytesRead,buffer:buffer2})})})};exports.write=function(fd,buffer,...args){return typeof args[args.length-1]=="function"?fs4.write(fd,buffer,...args):new Promise((resolve5,reject)=>{fs4.write(fd,buffer,...args,(err,bytesWritten,buffer2)=>{if(err)return reject(err);resolve5({bytesWritten,buffer:buffer2})})})};typeof fs4.writev=="function"&&(exports.writev=function(fd,buffers,...args){return typeof args[args.length-1]=="function"?fs4.writev(fd,buffers,...args):new Promise((resolve5,reject)=>{fs4.writev(fd,buffers,...args,(err,bytesWritten,buffers2)=>{if(err)return reject(err);resolve5({bytesWritten,buffers:buffers2})})})})}});var require_utils=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports,module){"use strict";var path2=__require("path");module.exports.checkPath=function(pth){if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path2.parse(pth).root,""))){let error=new Error(`Path contains invalid characters: ${pth}`);throw error.code="EINVAL",error}}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports,module){"use strict";var fs4=require_fs(),{checkPath}=require_utils(),getMode=options=>{let defaults={mode:511};return typeof options=="number"?options:{...defaults,...options}.mode};module.exports.makeDir=async(dir,options)=>(checkPath(dir),fs4.mkdir(dir,{mode:getMode(options),recursive:!0}));module.exports.makeDirSync=(dir,options)=>(checkPath(dir),fs4.mkdirSync(dir,{mode:getMode(options),recursive:!0}))}});var require_mkdirs=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,{makeDir:_makeDir,makeDirSync}=require_make_dir(),makeDir=u(_makeDir);module.exports={mkdirs:makeDir,mkdirsSync:makeDirSync,mkdirp:makeDir,mkdirpSync:makeDirSync,ensureDir:makeDir,ensureDirSync:makeDirSync}}});var require_utimes=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/utimes.js"(exports,module){"use strict";var fs4=require_graceful_fs();function utimesMillis(path2,atime,mtime,callback){fs4.open(path2,"r+",(err,fd)=>{if(err)return callback(err);fs4.futimes(fd,atime,mtime,futimesErr=>{fs4.close(fd,closeErr=>{callback&&callback(futimesErr||closeErr)})})})}function utimesMillisSync(path2,atime,mtime){let fd=fs4.openSync(path2,"r+");return fs4.futimesSync(fd,atime,mtime),fs4.closeSync(fd)}module.exports={utimesMillis,utimesMillisSync}}});var require_stat=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/stat.js"(exports,module){"use strict";var fs4=require_fs(),path2=__require("path"),util=__require("util");function getStats(src,dest,opts){let statFunc=opts.dereference?file=>fs4.stat(file,{bigint:!0}):file=>fs4.lstat(file,{bigint:!0});return Promise.all([statFunc(src),statFunc(dest).catch(err=>{if(err.code==="ENOENT")return null;throw err})]).then(([srcStat,destStat])=>({srcStat,destStat}))}function getStatsSync(src,dest,opts){let destStat,statFunc=opts.dereference?file=>fs4.statSync(file,{bigint:!0}):file=>fs4.lstatSync(file,{bigint:!0}),srcStat=statFunc(src);try{destStat=statFunc(dest)}catch(err){if(err.code==="ENOENT")return{srcStat,destStat:null};throw err}return{srcStat,destStat}}function checkPaths(src,dest,funcName,opts,cb){util.callbackify(getStats)(src,dest,opts,(err,stats)=>{if(err)return cb(err);let{srcStat,destStat}=stats;if(destStat){if(areIdentical(srcStat,destStat)){let srcBaseName=path2.basename(src),destBaseName=path2.basename(dest);return funcName==="move"&&srcBaseName!==destBaseName&&srcBaseName.toLowerCase()===destBaseName.toLowerCase()?cb(null,{srcStat,destStat,isChangingCase:!0}):cb(new Error("Source and destination must not be the same."))}if(srcStat.isDirectory()&&!destStat.isDirectory())return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));if(!srcStat.isDirectory()&&destStat.isDirectory())return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))}return srcStat.isDirectory()&&isSrcSubdir(src,dest)?cb(new Error(errMsg(src,dest,funcName))):cb(null,{srcStat,destStat})})}function checkPathsSync(src,dest,funcName,opts){let{srcStat,destStat}=getStatsSync(src,dest,opts);if(destStat){if(areIdentical(srcStat,destStat)){let srcBaseName=path2.basename(src),destBaseName=path2.basename(dest);if(funcName==="move"&&srcBaseName!==destBaseName&&srcBaseName.toLowerCase()===destBaseName.toLowerCase())return{srcStat,destStat,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(srcStat.isDirectory()&&!destStat.isDirectory())throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);if(!srcStat.isDirectory()&&destStat.isDirectory())throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)}if(srcStat.isDirectory()&&isSrcSubdir(src,dest))throw new Error(errMsg(src,dest,funcName));return{srcStat,destStat}}function checkParentPaths(src,srcStat,dest,funcName,cb){let srcParent=path2.resolve(path2.dirname(src)),destParent=path2.resolve(path2.dirname(dest));if(destParent===srcParent||destParent===path2.parse(destParent).root)return cb();fs4.stat(destParent,{bigint:!0},(err,destStat)=>err?err.code==="ENOENT"?cb():cb(err):areIdentical(srcStat,destStat)?cb(new Error(errMsg(src,dest,funcName))):checkParentPaths(src,srcStat,destParent,funcName,cb))}function checkParentPathsSync(src,srcStat,dest,funcName){let srcParent=path2.resolve(path2.dirname(src)),destParent=path2.resolve(path2.dirname(dest));if(destParent===srcParent||destParent===path2.parse(destParent).root)return;let destStat;try{destStat=fs4.statSync(destParent,{bigint:!0})}catch(err){if(err.code==="ENOENT")return;throw err}if(areIdentical(srcStat,destStat))throw new Error(errMsg(src,dest,funcName));return checkParentPathsSync(src,srcStat,destParent,funcName)}function areIdentical(srcStat,destStat){return destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev}function isSrcSubdir(src,dest){let srcArr=path2.resolve(src).split(path2.sep).filter(i=>i),destArr=path2.resolve(dest).split(path2.sep).filter(i=>i);return srcArr.reduce((acc,cur,i)=>acc&&destArr[i]===cur,!0)}function errMsg(src,dest,funcName){return`Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`}module.exports={checkPaths,checkPathsSync,checkParentPaths,checkParentPathsSync,isSrcSubdir,areIdentical}}});var require_copy_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),mkdirsSync=require_mkdirs().mkdirsSync,utimesMillisSync=require_utimes().utimesMillisSync,stat2=require_stat();function copySync(src,dest,opts){typeof opts=="function"&&(opts={filter:opts}),opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
8
8
|
|
|
9
9
|
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat,destStat}=stat2.checkPathsSync(src,dest,"copy",opts);return stat2.checkParentPathsSync(src,srcStat,dest,"copy"),handleFilterAndCopy(destStat,src,dest,opts)}function handleFilterAndCopy(destStat,src,dest,opts){if(opts.filter&&!opts.filter(src,dest))return;let destParent=path2.dirname(dest);return fs4.existsSync(destParent)||mkdirsSync(destParent),getStats(destStat,src,dest,opts)}function startCopy(destStat,src,dest,opts){if(!(opts.filter&&!opts.filter(src,dest)))return getStats(destStat,src,dest,opts)}function getStats(destStat,src,dest,opts){let srcStat=(opts.dereference?fs4.statSync:fs4.lstatSync)(src);if(srcStat.isDirectory())return onDir(srcStat,destStat,src,dest,opts);if(srcStat.isFile()||srcStat.isCharacterDevice()||srcStat.isBlockDevice())return onFile(srcStat,destStat,src,dest,opts);if(srcStat.isSymbolicLink())return onLink(destStat,src,dest,opts);throw srcStat.isSocket()?new Error(`Cannot copy a socket file: ${src}`):srcStat.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${src}`):new Error(`Unknown file: ${src}`)}function onFile(srcStat,destStat,src,dest,opts){return destStat?mayCopyFile(srcStat,src,dest,opts):copyFile(srcStat,src,dest,opts)}function mayCopyFile(srcStat,src,dest,opts){if(opts.overwrite)return fs4.unlinkSync(dest),copyFile(srcStat,src,dest,opts);if(opts.errorOnExist)throw new Error(`'${dest}' already exists`)}function copyFile(srcStat,src,dest,opts){return fs4.copyFileSync(src,dest),opts.preserveTimestamps&&handleTimestamps(srcStat.mode,src,dest),setDestMode(dest,srcStat.mode)}function handleTimestamps(srcMode,src,dest){return fileIsNotWritable(srcMode)&&makeFileWritable(dest,srcMode),setDestTimestamps(src,dest)}function fileIsNotWritable(srcMode){return(srcMode&128)===0}function makeFileWritable(dest,srcMode){return setDestMode(dest,srcMode|128)}function setDestMode(dest,srcMode){return fs4.chmodSync(dest,srcMode)}function setDestTimestamps(src,dest){let updatedSrcStat=fs4.statSync(src);return utimesMillisSync(dest,updatedSrcStat.atime,updatedSrcStat.mtime)}function onDir(srcStat,destStat,src,dest,opts){return destStat?copyDir(src,dest,opts):mkDirAndCopy(srcStat.mode,src,dest,opts)}function mkDirAndCopy(srcMode,src,dest,opts){return fs4.mkdirSync(dest),copyDir(src,dest,opts),setDestMode(dest,srcMode)}function copyDir(src,dest,opts){fs4.readdirSync(src).forEach(item=>copyDirItem(item,src,dest,opts))}function copyDirItem(item,src,dest,opts){let srcItem=path2.join(src,item),destItem=path2.join(dest,item),{destStat}=stat2.checkPathsSync(srcItem,destItem,"copy",opts);return startCopy(destStat,srcItem,destItem,opts)}function onLink(destStat,src,dest,opts){let resolvedSrc=fs4.readlinkSync(src);if(opts.dereference&&(resolvedSrc=path2.resolve(process.cwd(),resolvedSrc)),destStat){let resolvedDest;try{resolvedDest=fs4.readlinkSync(dest)}catch(err){if(err.code==="EINVAL"||err.code==="UNKNOWN")return fs4.symlinkSync(resolvedSrc,dest);throw err}if(opts.dereference&&(resolvedDest=path2.resolve(process.cwd(),resolvedDest)),stat2.isSrcSubdir(resolvedSrc,resolvedDest))throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);if(fs4.statSync(dest).isDirectory()&&stat2.isSrcSubdir(resolvedDest,resolvedSrc))throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);return copyLink(resolvedSrc,dest)}else return fs4.symlinkSync(resolvedSrc,dest)}function copyLink(resolvedSrc,dest){return fs4.unlinkSync(dest),fs4.symlinkSync(resolvedSrc,dest)}module.exports=copySync}});var require_copy_sync2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy-sync/index.js"(exports,module){"use strict";module.exports={copySync:require_copy_sync()}}});var require_path_exists=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/path-exists/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,fs4=require_fs();function pathExists2(path2){return fs4.access(path2).then(()=>!0).catch(()=>!1)}module.exports={pathExists:u(pathExists2),pathExistsSync:fs4.existsSync}}});var require_copy=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy/copy.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),mkdirs=require_mkdirs().mkdirs,pathExists2=require_path_exists().pathExists,utimesMillis=require_utimes().utimesMillis,stat2=require_stat();function copy(src,dest,opts,cb){typeof opts=="function"&&!cb?(cb=opts,opts={}):typeof opts=="function"&&(opts={filter:opts}),cb=cb||function(){},opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{require_pluralize}from
|
|
|
17
17
|
`;typeof options=="object"&&options!==null&&(options.spaces&&(spaces=options.spaces),options.EOL&&(EOL=options.EOL));var str=JSON.stringify(obj,options?options.replacer:null,spaces);return str.replace(/\n/g,EOL)+EOL}function writeFile2(file,obj,options,callback){callback==null&&(callback=options,options={}),options=options||{};var fs4=options.fs||_fs,str="";try{str=stringify(obj,options)}catch(err){callback&&callback(err,null);return}fs4.writeFile(file,str,options,callback)}function writeFileSync(file,obj,options){options=options||{};var fs4=options.fs||_fs,str=stringify(obj,options);return fs4.writeFileSync(file,str,options)}function stripBom(content){return Buffer.isBuffer(content)&&(content=content.toString("utf8")),content=content.replace(/^\uFEFF/,""),content}var jsonfile={readFile:readFile3,readFileSync:readFileSync2,writeFile:writeFile2,writeFileSync};module.exports=jsonfile}});var require_jsonfile4=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/jsonfile.js"(exports,module){"use strict";var u=require_universalify2().fromCallback,jsonFile=require_jsonfile3();module.exports={readJson:u(jsonFile.readFile),readJsonSync:jsonFile.readFileSync,writeJson:u(jsonFile.writeFile),writeJsonSync:jsonFile.writeFileSync}}});var require_output_json2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/output-json.js"(exports,module){"use strict";var path2=__require("path"),mkdir2=require_mkdirs3(),pathExists2=require_path_exists2().pathExists,jsonFile=require_jsonfile4();function outputJson(file,data,options,callback){typeof options=="function"&&(callback=options,options={});let dir=path2.dirname(file);pathExists2(dir,(err,itDoes)=>{if(err)return callback(err);if(itDoes)return jsonFile.writeJson(file,data,options,callback);mkdir2.mkdirs(dir,err2=>{if(err2)return callback(err2);jsonFile.writeJson(file,data,options,callback)})})}module.exports=outputJson}});var require_output_json_sync2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/output-json-sync.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),mkdir2=require_mkdirs3(),jsonFile=require_jsonfile4();function outputJsonSync(file,data,options){let dir=path2.dirname(file);fs4.existsSync(dir)||mkdir2.mkdirsSync(dir),jsonFile.writeJsonSync(file,data,options)}module.exports=outputJsonSync}});var require_json2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/json/index.js"(exports,module){"use strict";var u=require_universalify2().fromCallback,jsonFile=require_jsonfile4();jsonFile.outputJson=u(require_output_json2());jsonFile.outputJsonSync=require_output_json_sync2();jsonFile.outputJSON=jsonFile.outputJson;jsonFile.outputJSONSync=jsonFile.outputJsonSync;jsonFile.writeJSON=jsonFile.writeJson;jsonFile.writeJSONSync=jsonFile.writeJsonSync;jsonFile.readJSON=jsonFile.readJson;jsonFile.readJSONSync=jsonFile.readJsonSync;module.exports=jsonFile}});var require_move_sync3=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move-sync/move-sync.js"(exports,module){"use strict";var fs4=__require("fs"),path2=__require("path"),copySync=require_copy_sync4().copySync,removeSync=require_remove2().removeSync,mkdirpSync=require_mkdirs3().mkdirpSync,stat2=require_stat2();function moveSync(src,dest,opts){opts=opts||{};let overwrite=opts.overwrite||opts.clobber||!1,{srcStat}=stat2.checkPathsSync(src,dest,"move");return stat2.checkParentPathsSync(src,srcStat,dest,"move"),mkdirpSync(path2.dirname(dest)),doRename(src,dest,overwrite)}function doRename(src,dest,overwrite){if(overwrite)return removeSync(dest),rename2(src,dest,overwrite);if(fs4.existsSync(dest))throw new Error("dest already exists.");return rename2(src,dest,overwrite)}function rename2(src,dest,overwrite){try{fs4.renameSync(src,dest)}catch(err){if(err.code!=="EXDEV")throw err;return moveAcrossDevice(src,dest,overwrite)}}function moveAcrossDevice(src,dest,overwrite){return copySync(src,dest,{overwrite,errorOnExist:!0}),removeSync(src)}module.exports=moveSync}});var require_move_sync4=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move-sync/index.js"(exports,module){"use strict";module.exports={moveSync:require_move_sync3()}}});var require_move3=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move/move.js"(exports,module){"use strict";var fs4=__require("fs"),path2=__require("path"),copy=require_copy4().copy,remove=require_remove2().remove,mkdirp=require_mkdirs3().mkdirp,pathExists2=require_path_exists2().pathExists,stat2=require_stat2();function move(src,dest,opts,cb){typeof opts=="function"&&(cb=opts,opts={});let overwrite=opts.overwrite||opts.clobber||!1;stat2.checkPaths(src,dest,"move",(err,stats)=>{if(err)return cb(err);let{srcStat}=stats;stat2.checkParentPaths(src,srcStat,dest,"move",err2=>{if(err2)return cb(err2);mkdirp(path2.dirname(dest),err3=>err3?cb(err3):doRename(src,dest,overwrite,cb))})})}function doRename(src,dest,overwrite,cb){if(overwrite)return remove(dest,err=>err?cb(err):rename2(src,dest,overwrite,cb));pathExists2(dest,(err,destExists)=>err?cb(err):destExists?cb(new Error("dest already exists.")):rename2(src,dest,overwrite,cb))}function rename2(src,dest,overwrite,cb){fs4.rename(src,dest,err=>err?err.code!=="EXDEV"?cb(err):moveAcrossDevice(src,dest,overwrite,cb):cb())}function moveAcrossDevice(src,dest,overwrite,cb){copy(src,dest,{overwrite,errorOnExist:!0},err=>err?cb(err):remove(src,cb))}module.exports=move}});var require_move4=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/move/index.js"(exports,module){"use strict";var u=require_universalify2().fromCallback;module.exports={move:u(require_move3())}}});var require_output2=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/output/index.js"(exports,module){"use strict";var u=require_universalify2().fromCallback,fs4=require_graceful_fs(),path2=__require("path"),mkdir2=require_mkdirs3(),pathExists2=require_path_exists2().pathExists;function outputFile(file,data,encoding,callback){typeof encoding=="function"&&(callback=encoding,encoding="utf8");let dir=path2.dirname(file);pathExists2(dir,(err,itDoes)=>{if(err)return callback(err);if(itDoes)return fs4.writeFile(file,data,encoding,callback);mkdir2.mkdirs(dir,err2=>{if(err2)return callback(err2);fs4.writeFile(file,data,encoding,callback)})})}function outputFileSync(file,...args){let dir=path2.dirname(file);if(fs4.existsSync(dir))return fs4.writeFileSync(file,...args);mkdir2.mkdirsSync(dir),fs4.writeFileSync(file,...args)}module.exports={outputFile:u(outputFile),outputFileSync}}});var require_lib3=__commonJS({"../../node_modules/.pnpm/fs-extra@8.0.1/node_modules/fs-extra/lib/index.js"(exports,module){"use strict";module.exports=Object.assign({},require_fs2(),require_copy_sync4(),require_copy4(),require_empty2(),require_ensure2(),require_json2(),require_mkdirs3(),require_move_sync4(),require_move4(),require_output2(),require_path_exists2(),require_remove2());var fs4=__require("fs");Object.getOwnPropertyDescriptor(fs4,"promises")&&Object.defineProperty(module.exports,"promises",{get(){return fs4.promises}})}});var require_lib4=__commonJS({"../../node_modules/.pnpm/async-sema@3.0.0/node_modules/async-sema/lib/index.js"(exports){"use strict";var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});var events_1=__importDefault(__require("events"));function arrayMove(src,srcIndex,dst,dstIndex,len){for(let j=0;j<len;++j)dst[j+dstIndex]=src[j+srcIndex],src[j+srcIndex]=void 0}function pow2AtLeast(n){return n=n>>>0,n=n-1,n=n|n>>1,n=n|n>>2,n=n|n>>4,n=n|n>>8,n=n|n>>16,n+1}function getCapacity(capacity){return pow2AtLeast(Math.min(Math.max(16,capacity),1073741824))}var Deque=class{constructor(capacity){this._capacity=getCapacity(capacity),this._length=0,this._front=0,this.arr=[]}push(item){let length=this._length;this.checkCapacity(length+1);let i=this._front+length&this._capacity-1;return this.arr[i]=item,this._length=length+1,length+1}pop(){let length=this._length;if(length===0)return;let i=this._front+length-1&this._capacity-1,ret=this.arr[i];return this.arr[i]=void 0,this._length=length-1,ret}shift(){let length=this._length;if(length===0)return;let front=this._front,ret=this.arr[front];return this.arr[front]=void 0,this._front=front+1&this._capacity-1,this._length=length-1,ret}get length(){return this._length}checkCapacity(size){this._capacity<size&&this.resizeTo(getCapacity(this._capacity*1.5+16))}resizeTo(capacity){let oldCapacity=this._capacity;this._capacity=capacity;let front=this._front,length=this._length;if(front+length>oldCapacity){let moveItemsCount=front+length&oldCapacity-1;arrayMove(this.arr,0,this.arr,oldCapacity,moveItemsCount)}}},ReleaseEmitter=class extends events_1.default{};function isFn(x){return typeof x=="function"}function defaultInit(){return"1"}var Sema=class{constructor(nr,{initFn=defaultInit,pauseFn,resumeFn,capacity=10}={}){if(isFn(pauseFn)!==isFn(resumeFn))throw new Error("pauseFn and resumeFn must be both set for pausing");this.nrTokens=nr,this.free=new Deque(nr),this.waiting=new Deque(capacity),this.releaseEmitter=new ReleaseEmitter,this.noTokens=initFn===defaultInit,this.pauseFn=pauseFn,this.resumeFn=resumeFn,this.paused=!1,this.releaseEmitter.on("release",token=>{let p=this.waiting.shift();p?p.resolve(token):(this.resumeFn&&this.paused&&(this.paused=!1,this.resumeFn()),this.free.push(token))});for(let i=0;i<nr;i++)this.free.push(initFn())}async acquire(){let token=this.free.pop();return token!==void 0?token:new Promise((resolve5,reject)=>{this.pauseFn&&!this.paused&&(this.paused=!0,this.pauseFn()),this.waiting.push({resolve:resolve5,reject})})}release(token){this.releaseEmitter.emit("release",this.noTokens?"1":token)}drain(){let a=new Array(this.nrTokens);for(let i=0;i<this.nrTokens;i++)a[i]=this.acquire();return Promise.all(a)}nrWaiting(){return this.waiting.length}};exports.Sema=Sema;function RateLimit(rps,{timeUnit=1e3,uniformDistribution=!1}={}){let sema=new Sema(uniformDistribution?1:rps),delay=uniformDistribution?timeUnit/rps:timeUnit;return async function(){await sema.acquire(),setTimeout(()=>sema.release(),delay)}}exports.RateLimit=RateLimit}});var require_hashes=__commonJS({"../../packages/client/dist/utils/hashes.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),hashes_exports={};__export(hashes_exports,{hash:()=>hash,hashes:()=>hashes,mapToObject:()=>mapToObject});module.exports=__toCommonJS(hashes_exports);var import_crypto=__require("crypto"),import_fs_extra6=__toESM2(require_lib3()),import_async_sema=require_lib4(),MAX_BUFFER_FILE_SIZE=2**31-1;function hash(buf){return(0,import_crypto.createHash)("sha1").update(Uint8Array.from(buf)).digest("hex")}async function hashFile(path2){let digest=(0,import_crypto.createHash)("sha1");for await(let chunk of import_fs_extra6.default.createReadStream(path2))digest.update(Uint8Array.from(chunk));return digest.digest("hex")}var mapToObject=map=>{let obj={};for(let[key,value]of map)typeof key>"u"||(obj[key]=value);return obj};async function hashes(files,map=new Map){let semaphore=new import_async_sema.Sema(100);return await Promise.all(files.map(async name=>{await semaphore.acquire();let stat2=await import_fs_extra6.default.lstat(name),mode=stat2.mode,data,size,isDirectory2=stat2.isDirectory(),h;if(!isDirectory2)if(stat2.isSymbolicLink()){let link=await import_fs_extra6.default.readlink(name);data=Buffer.from(link,"utf8"),size=data.length,h=hash(data)}else stat2.size>MAX_BUFFER_FILE_SIZE?(size=stat2.size,h=await hashFile(name)):(data=await import_fs_extra6.default.readFile(name),size=data.length,h=hash(data));let entry=map.get(h);if(entry){let names=new Set(entry.names);names.add(name),entry.names=[...names]}else map.set(h,{names:[name],data,mode,size});semaphore.release()})),map}}});var require_query_string=__commonJS({"../../packages/client/dist/utils/query-string.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),query_string_exports={};__export(query_string_exports,{generateQueryString:()=>generateQueryString});module.exports=__toCommonJS(query_string_exports);var import_url2=__require("url");function generateQueryString(clientOptions){let options=new import_url2.URLSearchParams;return clientOptions.teamId&&options.set("teamId",clientOptions.teamId),clientOptions.force&&options.set("forceNew","1"),clientOptions.withCache&&options.set("withCache","1"),clientOptions.skipAutoDetectionConfirmation&&options.set("skipAutoDetectionConfirmation","1"),clientOptions.prebuilt&&options.set("prebuilt","1"),Array.from(options.entries()).length?`?${options.toString()}`:""}}});var require_ready_state=__commonJS({"../../packages/client/dist/utils/ready-state.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),ready_state_exports={};__export(ready_state_exports,{isAliasAssigned:()=>isAliasAssigned,isAliasError:()=>isAliasError,isBlocked:()=>isBlocked,isDone:()=>isDone,isFailed:()=>isFailed,isReady:()=>isReady});module.exports=__toCommonJS(ready_state_exports);var isReady=({readyState,state})=>readyState==="READY"||state==="READY",isFailed=({readyState,state})=>readyState?readyState.endsWith("_ERROR")||readyState==="ERROR":state?state.endsWith("_ERROR")||state==="ERROR":!1,isBlocked=({readyState,state})=>readyState==="BLOCKED"||state==="BLOCKED",isDone=buildOrDeployment=>isReady(buildOrDeployment)||isFailed(buildOrDeployment)||isBlocked(buildOrDeployment),isAliasAssigned=deployment=>!!deployment.aliasAssigned,isAliasError=deployment=>!!deployment.aliasError}});var require_cjs=__commonJS({"../../node_modules/.pnpm/sleep-promise@8.0.1/node_modules/sleep-promise/build/cjs.js"(exports,module){"use strict";var cachedSetTimeout=setTimeout;function createSleepPromise(a,b){var c=b.useCachedSetTimeout,d=c?cachedSetTimeout:setTimeout;return new Promise(function(b2){d(b2,a)})}function sleep2(a){function b(a2){return e.then(function(){return a2})}var c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},d=c.useCachedSetTimeout,e=createSleepPromise(a,{useCachedSetTimeout:d});return b.then=function(){return e.then.apply(e,arguments)},b.catch=Promise.resolve().catch,b}module.exports=sleep2}});var require_errors=__commonJS({"../../packages/client/dist/errors.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),errors_exports={};__export(errors_exports,{DeploymentError:()=>DeploymentError});module.exports=__toCommonJS(errors_exports);var DeploymentError=class extends Error{constructor(err){super(err.message),this.code=err.code,this.errorName=err.name,this.name="DeploymentError"}}}});var require_network_error=__commonJS({"../../packages/client/dist/utils/network-error.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),network_error_exports={};__export(network_error_exports,{formatNetworkError:()=>formatNetworkError,isRetryableNetworkError:()=>isRetryableNetworkError});module.exports=__toCommonJS(network_error_exports);var retryableCodes=new Set(["ETIMEDOUT","ECONNREFUSED","ENOTFOUND","ECONNRESET","EAI_FAIL","EAI_AGAIN","EPIPE","ENETUNREACH","EHOSTUNREACH","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_SOCKET"]);function isRetryableNetworkError(error,depth=0){if(!(error instanceof Error)||depth>5||error.name==="AbortError")return!1;let err=error;return err.code?retryableCodes.has(err.code):Array.isArray(err.errors)&&err.errors.length>0?err.errors.every(child=>isRetryableNetworkError(child,depth+1)):err.cause?isRetryableNetworkError(err.cause,depth+1):/ETIMEDOUT|ECONNREFUSED|ENOTFOUND|ECONNRESET|EAI_FAIL|socket hang up|network socket disconnected/.test(err.message)}function formatNetworkError(error,depth=0){if(!(error instanceof Error))return"Unknown error";if(depth>5)return"[truncated]";let err=error,fields=[];for(let value of[err.name,err.code])typeof value=="string"&&/^[a-zA-Z_][a-zA-Z0-9_]{0,63}$/.test(value)&&fields.push(value);return Array.isArray(err.errors)&&fields.push(`[${err.errors.slice(0,5).map(child=>formatNetworkError(child,depth+1)).join(", ")}]`),err.cause&&fields.push(`cause=(${formatNetworkError(err.cause,depth+1)})`),fields.join(" ")||"Error"}}});var require_ignore=__commonJS({"../../node_modules/.pnpm/ignore@4.0.6/node_modules/ignore/index.js"(exports,module){function make_array(subject){return Array.isArray(subject)?subject:[subject]}var REGEX_BLANK_LINE=/^\s+$/,REGEX_LEADING_EXCAPED_EXCLAMATION=/^\\!/,REGEX_LEADING_EXCAPED_HASH=/^\\#/,SLASH="/",KEY_IGNORE=typeof Symbol<"u"?Symbol.for("node-ignore"):"node-ignore",define=(object,key,value)=>Object.defineProperty(object,key,{value}),REGEX_REGEXP_RANGE=/([0-z])-([0-z])/g,sanitizeRange=range=>range.replace(REGEX_REGEXP_RANGE,(match,from,to)=>from.charCodeAt(0)<=to.charCodeAt(0)?match:""),DEFAULT_REPLACER_PREFIX=[[/\\?\s+$/,match=>match.indexOf("\\")===0?" ":""],[/\\\s/g,()=>" "],[/[\\^$.|*+(){]/g,match=>`\\${match}`],[/\[([^\]/]*)($|\])/g,(match,p1,p2)=>p2==="]"?`[${sanitizeRange(p1)}]`:`\\${match}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"]],DEFAULT_REPLACER_SUFFIX=[[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(match,index,str)=>index+6<str.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(match,p1)=>`${p1}[^\\/]*`],[/(\^|\\\/)?\\\*$/,(match,p1)=>`${p1?`${p1}[^/]+`:"[^/]*"}(?=$|\\/$)`],[/\\\\\\/g,()=>"\\"]],POSITIVE_REPLACERS=[...DEFAULT_REPLACER_PREFIX,[/(?:[^*/])$/,match=>`${match}(?=$|\\/)`],...DEFAULT_REPLACER_SUFFIX],NEGATIVE_REPLACERS=[...DEFAULT_REPLACER_PREFIX,[/(?:[^*])$/,match=>`${match}(?=$|\\/$)`],...DEFAULT_REPLACER_SUFFIX],cache=Object.create(null),make_regex=(pattern,negative,ignorecase)=>{let r=cache[pattern];if(r)return r;let source=(negative?NEGATIVE_REPLACERS:POSITIVE_REPLACERS).reduce((prev,current)=>prev.replace(current[0],current[1].bind(pattern)),pattern);return cache[pattern]=ignorecase?new RegExp(source,"i"):new RegExp(source)},checkPattern=pattern=>pattern&&typeof pattern=="string"&&!REGEX_BLANK_LINE.test(pattern)&&pattern.indexOf("#")!==0,createRule=(pattern,ignorecase)=>{let origin=pattern,negative=!1;pattern.indexOf("!")===0&&(negative=!0,pattern=pattern.substr(1)),pattern=pattern.replace(REGEX_LEADING_EXCAPED_EXCLAMATION,"!").replace(REGEX_LEADING_EXCAPED_HASH,"#");let regex=make_regex(pattern,negative,ignorecase);return{origin,pattern,negative,regex}},IgnoreBase=class{constructor({ignorecase=!0}={}){this._rules=[],this._ignorecase=ignorecase,define(this,KEY_IGNORE,!0),this._initCache()}_initCache(){this._cache=Object.create(null)}add(pattern){return this._added=!1,typeof pattern=="string"&&(pattern=pattern.split(/\r?\n/g)),make_array(pattern).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(pattern){return this.add(pattern)}_addPattern(pattern){if(pattern&&pattern[KEY_IGNORE]){this._rules=this._rules.concat(pattern._rules),this._added=!0;return}if(checkPattern(pattern)){let rule=createRule(pattern,this._ignorecase);this._added=!0,this._rules.push(rule)}}filter(paths){return make_array(paths).filter(path2=>this._filter(path2))}createFilter(){return path2=>this._filter(path2)}ignores(path2){return!this._filter(path2)}_filter(path2,slices){return path2?path2 in this._cache?this._cache[path2]:(slices||(slices=path2.split(SLASH)),slices.pop(),this._cache[path2]=slices.length?this._filter(slices.join(SLASH)+SLASH,slices)&&this._test(path2):this._test(path2)):!1}_test(path2){let matched=0;return this._rules.forEach(rule=>{matched^rule.negative||(matched=rule.negative^rule.regex.test(path2))}),!matched}};if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let filter=IgnoreBase.prototype._filter,make_posix=str=>/^\\\\\?\\/.test(str)||/[^\x00-\x80]+/.test(str)?str:str.replace(/\\/g,"/");IgnoreBase.prototype._filter=function(path2,slices){return path2=make_posix(path2),filter.call(this,path2,slices)}}module.exports=options=>new IgnoreBase(options)}});var require_package=__commonJS({"../../packages/client/package.json"(exports,module){module.exports={name:"@vercel/client",version:"18.13.0",main:"dist/index.js",typings:"dist/index.d.ts",homepage:"https://vercel.com",license:"Apache-2.0",files:["dist"],repository:{type:"git",url:"https://github.com/vercel/vercel.git",directory:"packages/client"},scripts:{build:"node ../../utils/build.mjs",test:"vitest run --config ./vitest.config.mts","test-e2e":"vitest run --config ./vitest.config.mts tests/integration-","type-check":"tsc --noEmit","test-unit":"vitest run --config ./vitest.config.mts tests/unit."},engines:{node:">= 20"},devDependencies:{"@types/async-retry":"1.4.5","@types/fs-extra":"7.0.0","@types/minimatch":"3.0.5","@types/ms":"0.7.30","@types/node":"20.11.0","@types/recursive-readdir":"2.2.0","@types/tar-fs":"1.16.1",vitest:"4.1.10"},dependencies:{"@vercel/build-utils":"workspace:*","@vercel/error-utils":"workspace:*","@vercel/microfrontends":"2.4.0","@vercel/routing-utils":"workspace:*","async-retry":"1.2.3","async-sema":"3.0.0","fs-extra":"8.0.1",ignore:"4.0.6",minimatch:"5.0.1",ms:"2.1.2",querystring:"^0.2.0","sleep-promise":"8.0.1","tar-fs":"1.16.3"}}}});var require_pkg=__commonJS({"../../packages/client/dist/pkg.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),pkg_exports={};__export(pkg_exports,{pkgVersion:()=>pkgVersion});module.exports=__toCommonJS(pkg_exports);var pkg=require_package(),pkgVersion=pkg.version}});var require_readdir_recursive=__commonJS({"../../packages/client/dist/utils/readdir-recursive.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),readdir_recursive_exports={};__export(readdir_recursive_exports,{default:()=>readdir});module.exports=__toCommonJS(readdir_recursive_exports);var import_fs6=__toESM2(__require("fs")),import_path8=__toESM2(__require("path")),import_minimatch=__toESM2(require_minimatch());function patternMatcher(pattern){return function(path2,stats){let minimatcher=new import_minimatch.default.Minimatch(pattern,{matchBase:!0});return(!minimatcher.negate||stats.isFile())&&minimatcher.match(path2)}}function toMatcherFunction(ignoreEntry){return typeof ignoreEntry=="function"?ignoreEntry:patternMatcher(ignoreEntry)}function readdir(path2,ignores){ignores=ignores.map(toMatcherFunction);let list=[];return new Promise(function(resolve5,reject){import_fs6.default.readdir(path2,function(err,files){if(err)return reject(err);let pending=files.length;if(!pending)return resolve5(list);files.forEach(function(file){let filePath=import_path8.default.join(path2,file);import_fs6.default.lstat(filePath,function(_err,stats){if(_err)return reject(_err);if(ignores.some(matcher=>matcher(filePath,stats)))return pending-=1,pending?null:resolve5(list);if(stats.isDirectory())readdir(filePath,ignores).then(function(res){if(res.length===0&&list.push(filePath),list=list.concat(res),pending-=1,!pending)return resolve5(list)}).catch(reject);else if(list.push(filePath),pending-=1,!pending)return resolve5(list)})})})})}}});var require_dpop=__commonJS({"../../packages/client/dist/utils/dpop.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),dpop_exports={};__export(dpop_exports,{DPOP_CLOCK_SKEW_TOLERANCE_SECONDS:()=>DPOP_CLOCK_SKEW_TOLERANCE_SECONDS3,getDpopServerTime:()=>getDpopServerTime3,shouldResendDpopRequest:()=>shouldResendDpopRequest3});module.exports=__toCommonJS(dpop_exports);var DPOP_CLOCK_SKEW_TOLERANCE_SECONDS3=30;function getDpopServerTime3(headers){let date=headers.get("date"),serverTime=date?Date.parse(date):Number.NaN;return Number.isNaN(serverTime)?void 0:serverTime/1e3}function iatOf(proof){try{let payload=JSON.parse(Buffer.from(proof?.split(".")[1]??"","base64url").toString());return typeof payload?.iat=="number"?payload.iat:void 0}catch{return}}async function shouldResendDpopRequest3(response,proof){if(!proof)return!1;let error=await dpopErrorOf(response);if(error==="use_dpop_nonce")return!!response.headers.get("dpop-nonce");if(error==="invalid_dpop_proof"){let iat=iatOf(proof),serverTime=getDpopServerTime3(response.headers);return iat!==void 0&&serverTime!==void 0&&Math.abs(serverTime-iat)>DPOP_CLOCK_SKEW_TOLERANCE_SECONDS3}return!1}async function dpopErrorOf(response){if(response.status===401){let challenge=response.headers.get("www-authenticate")??"";return/\berror="([^"]*)"/i.exec(challenge)?.[1]}if(response.status===400)try{let json=await response.clone().json();return typeof json=="object"&&json!==null&&"error"in json&&typeof json.error=="string"?json.error:void 0}catch{return}}}});var require_utils3=__commonJS({"../../packages/client/dist/utils/index.js"(exports,module){"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toESM2=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),utils_exports={};__export(utils_exports,{API_FILES:()=>API_FILES,EVENTS:()=>EVENTS,buildFileTree:()=>buildFileTree2,createDebug:()=>createDebug,fetchApi:()=>fetchApi,getApiDeploymentsUrl:()=>getApiDeploymentsUrl,getVercelIgnore:()=>getVercelIgnore2,isVercelStateFile:()=>isVercelStateFile2,needsNewDpopProof:()=>needsNewDpopProof,parseVercelConfig:()=>parseVercelConfig,prepareFiles:()=>prepareFiles,shouldInlineSmallProject:()=>shouldInlineSmallProject,shouldInlineStaticFiles:()=>shouldInlineStaticFiles});module.exports=__toCommonJS(utils_exports);var import_network_error=require_network_error(),import_path8=__require("path"),import_fs6=__require("fs"),import_stream=__require("stream"),import_url2=__require("url"),import_ignore=__toESM2(require_ignore()),import_pkg2=require_pkg(),import_build_utils4=__require("@vercel/build-utils"),import_async_sema=require_lib4(),import_fs_extra6=require_lib3(),import_readdir_recursive=__toESM2(require_readdir_recursive()),import_dpop4=require_dpop(),semaphore=new import_async_sema.Sema(10),API_FILES="/v2/files",EVENTS_ARRAY=["hashes-calculated","file-count","file-uploaded","all-files-uploaded","created","building","ready","alias-assigned","warning","error","notice","tip","canceled","blocked","checks-registered","checks-completed","checks-running","checks-conclusion-succeeded","checks-conclusion-failed","checks-conclusion-skipped","checks-conclusion-canceled","checks-v2-failed"],EVENTS=new Set(EVENTS_ARRAY);function getApiDeploymentsUrl(){return"/v13/deployments"}async function parseVercelConfig(filePath){if(!filePath)return{};try{let jsonString=await(0,import_fs_extra6.readFile)(filePath,"utf8");return JSON.parse(jsonString)}catch(e){return console.error(e),{}}}var maybeRead=async function(path2,default_){try{return await(0,import_fs_extra6.readFile)(path2,"utf8")}catch{return default_}};async function getUserIgnore(cwd){let[vercelignore,nowignore]=await Promise.all([maybeRead((0,import_path8.join)(cwd,".vercelignore"),""),maybeRead((0,import_path8.join)(cwd,".nowignore"),"")]);if(vercelignore&&nowignore)throw new import_build_utils4.NowBuildError({code:"CONFLICTING_IGNORE_FILES",message:"Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",link:"https://vercel.link/combining-old-and-new-config"});let ignoreFile=vercelignore||nowignore;return ignoreFile?{ig:(0,import_ignore.default)().add(clearRelative(ignoreFile)),ignoreFile,ignoreFileName:vercelignore?".vercelignore":".nowignore"}:null}var VCS_DEFAULTS=[".hg",".git",".gitmodules",".svn","CVS"],filePathMapVcsDefaults=(0,import_ignore.default)().add(VCS_DEFAULTS);function isVercelStateFile2(posixRel){let parts=posixRel.split("/");return parts.length>=2&&parts[parts.length-2].toLowerCase()===".vercel"}function isInsideDir(dir,path2){if(!dir)return!1;let rel=(0,import_path8.relative)(dir,path2);return rel!==""&&!rel.startsWith("..")&&!(0,import_path8.isAbsolute)(rel)}var FILEPATHMAP_VERCELIGNORE_EXCEPTIONS=["node_modules",".next",".yarn/cache",".pnp*",".venv","venv","__pycache__","/target"],filePathMapVercelignoreExceptions=(0,import_ignore.default)().add(FILEPATHMAP_VERCELIGNORE_EXCEPTIONS.join(`
|
|
18
18
|
`));function isFilePathMapIgnoreException(posixRel){return filePathMapVercelignoreExceptions.ignores(posixRel)}var FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT=100;function findMatchingIgnoreRule(ignoreFile,posixRel){let matcher=(0,import_ignore.default)(),wasIgnored=!1,match={};for(let[index,rule]of ignoreFile.split(/\r?\n/).entries()){matcher.add(clearRelative(rule));let isIgnored=matcher.ignores(posixRel);!wasIgnored&&isIgnored?match={rule,line:index+1}:wasIgnored&&!isIgnored&&(match={}),wasIgnored=isIgnored}return match}function formatFilePathMapIgnoreWarning(entries,ignoreFileName,truncated=!1){let shown=entries.slice(0,FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT),lines=shown.map(({path:path2,rule,line})=>rule&&line?` ${path2} (matched \`${ignoreFileName}:${line}\`: \`${rule}\`)`:` ${path2}`);truncated&&lines.push(" \u2026and more");let count=truncated?`at least ${shown.length}`:String(entries.length),fileWord=!truncated&&entries.length===1?"file":"files";return[`${ignoreFileName===".nowignore"?`\`${ignoreFileName}\` (deprecated)`:`\`${ignoreFileName}\``} excludes ${count} ${fileWord} the prebuilt functions need. Uploading without them may fail with ENOENT.`,"",...lines,"",`Remove the colliding rules from \`${ignoreFileName}\`, or exclude those paths from tracing with \`outputFileTracingExcludes\`.`].join(`
|
|
19
19
|
`)}var SENSITIVE_DEFAULT_SEGMENT=/^(?:\.now|\.vercel|\.env\.local|\.env\.[^/]*\.local)$/i;function matchesSensitiveDefault(posixRel){return posixRel.split("/").some(segment=>SENSITIVE_DEFAULT_SEGMENT.test(segment))}function isInDirectory(dir,absPath){if(!dir)return!1;let rel=(0,import_path8.relative)(dir,absPath);return!rel.startsWith("..")&&!(0,import_path8.isAbsolute)(rel)}function realPathOf(absPath){try{return import_fs6.realpathSync.native(absPath)}catch{return}}function createPrebuiltReferencePolicy(root,vercelOutputDir,userIg){return(absPath,kind)=>{let rel=(0,import_path8.relative)(root,absPath);if(rel.startsWith("..")||(0,import_path8.isAbsolute)(rel))return"outside-root";let posixRel=rel.split(import_path8.sep).join("/");if(kind==="filePathMap")return filePathMapVcsDefaults.ignores(posixRel)?"vcs-default":userIg?.ig.ignores(posixRel)&&!isFilePathMapIgnoreException(posixRel)?"user-ignore":void 0;if(!(!posixRel||isInDirectory(vercelOutputDir,absPath)))return filePathMapVcsDefaults.ignores(posixRel)?"vcs-default":matchesSensitiveDefault(posixRel)?"sensitive-default":userIg?.ig.ignores(posixRel)?"user-ignore":void 0}}var EXCLUDED_REFERENCE_WARNING_LIST_LIMIT=20;function printable(text){return text.replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029\u202a-\u202e\u2066-\u2069]/g,"?")}function formatSkippedReferencesWarning(entries,total,userRuleTotal,ignoreFileName){let lines=entries.map(([path2,exclusion])=>` ${printable(path2)} (${exclusion==="user-ignore"?`\`${ignoreFileName}\` rule`:exclusion==="unresolved"?"unknown on-disk path":"default exclusion"})`);return total>entries.length&&lines.push(` \u2026and ${total-entries.length} more`),[total===1?"A source exclusion matches 1 path that this prebuilt deployment references. The CLI skipped it.":`Source exclusions match ${total} paths that this prebuilt deployment references. The CLI skipped them.`,"",...lines,"",userRuleTotal>0?`To upload a skipped path, remove its rule from \`${ignoreFileName}\`, or move or rename the file.`:"To upload a skipped path, move or rename the file."].join(`
|
|
20
|
-
`)}var EXCLUSION_ERROR_TEXT_LIMIT=200;function bulkRedirectsExcludedError(bulkRedirectsPath,exclusion,userIg,posixRels){let shown=text=>printable(text).slice(0,EXCLUSION_ERROR_TEXT_LIMIT),ignoreFileName=userIg?.ignoreFileName||".vercelignore",reason,fix;if(exclusion==="each-file")reason=`Source exclusions match each file in the bulk redirects path "${shown(bulkRedirectsPath)}".`,fix=`Remove the rules from \`${ignoreFileName}\`, or move the redirects to a different path.`;else if(exclusion==="user-ignore"&&userIg){let match=posixRels.map(posixRel=>findMatchingIgnoreRule(userIg.ignoreFile,posixRel)).find(({rule,line})=>rule&&line);reason=match?`The bulk redirects path "${shown(bulkRedirectsPath)}" matches the rule \`${shown(match.rule)}\` (\`${ignoreFileName}:${match.line}\`).`:`The bulk redirects path "${shown(bulkRedirectsPath)}" matches a rule in \`${ignoreFileName}\`.`,fix="Remove the rule, or move the redirects to a different path."}else{if(exclusion==="unresolved")return new import_build_utils4.NowBuildError({code:"PREBUILT_BULK_REDIRECTS_EXCLUDED",message:`The CLI cannot find the on-disk path of the bulk redirects path "${shown(bulkRedirectsPath)}". The CLI does not upload a path that it cannot check against the source exclusions. Move the redirects to a different path.`});reason=`The bulk redirects path "${shown(bulkRedirectsPath)}" matches a default source exclusion.`,fix="Move the redirects to a different path."}return new import_build_utils4.NowBuildError({code:"PREBUILT_BULK_REDIRECTS_EXCLUDED",message:`${reason} The CLI does not upload a path that a source exclusion matches. ${fix}`})}async function buildFileTree2(path2,{isDirectory:isDirectory2,prebuilt,vercelOutputDir,rootDirectory,projectName,bulkRedirectsPath},debug){let ignoreList=[],fileList,warning,referenceWarning,{ig,ignores}=await getVercelIgnore2(path2,prebuilt,vercelOutputDir);if(debug(`Found ${ignores.length} rules in .vercelignore`),debug("Building file tree..."),isDirectory2&&!Array.isArray(path2)){let ignores2=absPath=>{let rel=(0,import_path8.relative)(path2,absPath),ignored=ig.ignores(rel);return ignored&&ignoreList.push(rel),ignored};fileList=await(0,import_readdir_recursive.default)(path2,[ignores2]);let refs=new Set,userIg=prebuilt?await getUserIgnore(path2):null,getReferenceExclusion=createPrebuiltReferencePolicy(path2,vercelOutputDir,userIg),realRoot=null,toRootPath=realPath=>(realRoot===null&&(realRoot=realPathOf(path2)),realRoot===void 0?void 0:(0,import_path8.join)(path2,(0,import_path8.relative)(realRoot,realPath))),getOnDiskExclusion=(absPath,realPath,kind)=>{let exclusion=getReferenceExclusion(absPath,kind);if(exclusion||realPath===absPath)return exclusion;let rootPath=realPath===void 0?void 0:toRootPath(realPath);if(rootPath===void 0)return"unresolved";let onDiskExclusion=getReferenceExclusion(rootPath,kind);return onDiskExclusion==="outside-root"?void 0:onDiskExclusion},skippedReferences=new Map,skippedReferenceCount=0,skippedByUserRuleCount=0,skipReference=(absPath,exclusion)=>{let posixRel=(0,import_path8.relative)(path2,absPath).split(import_path8.sep).join("/");debug(`Skipping the reference "${printable(posixRel)}": ${exclusion}`),!(exclusion==="outside-root"||skippedReferences.has(posixRel))&&(skippedReferenceCount++,exclusion==="user-ignore"&&skippedByUserRuleCount++,skippedReferences.size<EXCLUDED_REFERENCE_WARNING_LIST_LIMIT&&skippedReferences.set(posixRel,exclusion))};if(prebuilt){let vcConfigFilePaths=fileList.filter(file=>(0,import_path8.basename)(file)===".vc-config.json"),ignoredFilePathMap=new Map,ignoredFilePathMapTruncated=!1,vcConfigs=await Promise.all(vcConfigFilePaths.map(async p=>{let configJson=await(0,import_fs_extra6.readFile)(p,"utf8");return JSON.parse(configJson)}));for(let config2 of vcConfigs)if(config2.filePathMap)for(let v of Object.values(config2.filePathMap)){let absPath=(0,import_path8.join)(path2,v),posixRel=(0,import_path8.relative)(path2,absPath).split(import_path8.sep).join("/"),exclusion=getReferenceExclusion(absPath,"filePathMap");if(exclusion==="outside-root"){debug(`Ignoring "filePathMap" entry "${v}": resolves outside the deployment root`);continue}if(exclusion==="vcs-default")throw new import_build_utils4.NowBuildError({code:"PREBUILT_FILEPATHMAP_VCS",message:"Prebuilt functions reference version-control files that cannot be uploaded. Exclude version-control files from tracing and rebuild the prebuilt output."});if(isVercelStateFile2(posixRel)&&!isInsideDir(vercelOutputDir,absPath)){debug('Excluding a "filePathMap" entry: Vercel CLI state file');continue}if(userIg&&userIg.ig.ignores(posixRel))if(exclusion!=="user-ignore")debug(`Keeping "filePathMap" entry "${v}": matches a default-ignored dependency/output path`);else{if(ignoredFilePathMap.has(posixRel))continue;if(fileList.includes(absPath)){debug(`Skipping "filePathMap" entry "${v}": already in the upload set`);continue}else if(ignoredFilePathMap.size>=FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT){ignoredFilePathMapTruncated=!0;continue}else{ignoredFilePathMap.set(posixRel,findMatchingIgnoreRule(userIg.ignoreFile,posixRel));continue}}refs.add(absPath)}if(ignoredFilePathMap.size>0){let violations=[...ignoredFilePathMap.entries()].sort(([a],[b])=>a.localeCompare(b)).map(([ignoredPath,match])=>({path:ignoredPath,...match}));warning=formatFilePathMapIgnoreWarning(violations,userIg?.ignoreFileName||".vercelignore",ignoredFilePathMapTruncated)}try{let{findConfig:findMicrofrontendsConfig,inferMicrofrontendsLocation}=await import("./utils-
|
|
20
|
+
`)}var EXCLUSION_ERROR_TEXT_LIMIT=200;function bulkRedirectsExcludedError(bulkRedirectsPath,exclusion,userIg,posixRels){let shown=text=>printable(text).slice(0,EXCLUSION_ERROR_TEXT_LIMIT),ignoreFileName=userIg?.ignoreFileName||".vercelignore",reason,fix;if(exclusion==="each-file")reason=`Source exclusions match each file in the bulk redirects path "${shown(bulkRedirectsPath)}".`,fix=`Remove the rules from \`${ignoreFileName}\`, or move the redirects to a different path.`;else if(exclusion==="user-ignore"&&userIg){let match=posixRels.map(posixRel=>findMatchingIgnoreRule(userIg.ignoreFile,posixRel)).find(({rule,line})=>rule&&line);reason=match?`The bulk redirects path "${shown(bulkRedirectsPath)}" matches the rule \`${shown(match.rule)}\` (\`${ignoreFileName}:${match.line}\`).`:`The bulk redirects path "${shown(bulkRedirectsPath)}" matches a rule in \`${ignoreFileName}\`.`,fix="Remove the rule, or move the redirects to a different path."}else{if(exclusion==="unresolved")return new import_build_utils4.NowBuildError({code:"PREBUILT_BULK_REDIRECTS_EXCLUDED",message:`The CLI cannot find the on-disk path of the bulk redirects path "${shown(bulkRedirectsPath)}". The CLI does not upload a path that it cannot check against the source exclusions. Move the redirects to a different path.`});reason=`The bulk redirects path "${shown(bulkRedirectsPath)}" matches a default source exclusion.`,fix="Move the redirects to a different path."}return new import_build_utils4.NowBuildError({code:"PREBUILT_BULK_REDIRECTS_EXCLUDED",message:`${reason} The CLI does not upload a path that a source exclusion matches. ${fix}`})}async function buildFileTree2(path2,{isDirectory:isDirectory2,prebuilt,vercelOutputDir,rootDirectory,projectName,bulkRedirectsPath},debug){let ignoreList=[],fileList,warning,referenceWarning,{ig,ignores}=await getVercelIgnore2(path2,prebuilt,vercelOutputDir);if(debug(`Found ${ignores.length} rules in .vercelignore`),debug("Building file tree..."),isDirectory2&&!Array.isArray(path2)){let ignores2=absPath=>{let rel=(0,import_path8.relative)(path2,absPath),ignored=ig.ignores(rel);return ignored&&ignoreList.push(rel),ignored};fileList=await(0,import_readdir_recursive.default)(path2,[ignores2]);let refs=new Set,userIg=prebuilt?await getUserIgnore(path2):null,getReferenceExclusion=createPrebuiltReferencePolicy(path2,vercelOutputDir,userIg),realRoot=null,toRootPath=realPath=>(realRoot===null&&(realRoot=realPathOf(path2)),realRoot===void 0?void 0:(0,import_path8.join)(path2,(0,import_path8.relative)(realRoot,realPath))),getOnDiskExclusion=(absPath,realPath,kind)=>{let exclusion=getReferenceExclusion(absPath,kind);if(exclusion||realPath===absPath)return exclusion;let rootPath=realPath===void 0?void 0:toRootPath(realPath);if(rootPath===void 0)return"unresolved";let onDiskExclusion=getReferenceExclusion(rootPath,kind);return onDiskExclusion==="outside-root"?void 0:onDiskExclusion},skippedReferences=new Map,skippedReferenceCount=0,skippedByUserRuleCount=0,skipReference=(absPath,exclusion)=>{let posixRel=(0,import_path8.relative)(path2,absPath).split(import_path8.sep).join("/");debug(`Skipping the reference "${printable(posixRel)}": ${exclusion}`),!(exclusion==="outside-root"||skippedReferences.has(posixRel))&&(skippedReferenceCount++,exclusion==="user-ignore"&&skippedByUserRuleCount++,skippedReferences.size<EXCLUDED_REFERENCE_WARNING_LIST_LIMIT&&skippedReferences.set(posixRel,exclusion))};if(prebuilt){let vcConfigFilePaths=fileList.filter(file=>(0,import_path8.basename)(file)===".vc-config.json"),ignoredFilePathMap=new Map,ignoredFilePathMapTruncated=!1,vcConfigs=await Promise.all(vcConfigFilePaths.map(async p=>{let configJson=await(0,import_fs_extra6.readFile)(p,"utf8");return JSON.parse(configJson)}));for(let config2 of vcConfigs)if(config2.filePathMap)for(let v of Object.values(config2.filePathMap)){let absPath=(0,import_path8.join)(path2,v),posixRel=(0,import_path8.relative)(path2,absPath).split(import_path8.sep).join("/"),exclusion=getReferenceExclusion(absPath,"filePathMap");if(exclusion==="outside-root"){debug(`Ignoring "filePathMap" entry "${v}": resolves outside the deployment root`);continue}if(exclusion==="vcs-default")throw new import_build_utils4.NowBuildError({code:"PREBUILT_FILEPATHMAP_VCS",message:"Prebuilt functions reference version-control files that cannot be uploaded. Exclude version-control files from tracing and rebuild the prebuilt output."});if(isVercelStateFile2(posixRel)&&!isInsideDir(vercelOutputDir,absPath)){debug('Excluding a "filePathMap" entry: Vercel CLI state file');continue}if(userIg&&userIg.ig.ignores(posixRel))if(exclusion!=="user-ignore")debug(`Keeping "filePathMap" entry "${v}": matches a default-ignored dependency/output path`);else{if(ignoredFilePathMap.has(posixRel))continue;if(fileList.includes(absPath)){debug(`Skipping "filePathMap" entry "${v}": already in the upload set`);continue}else if(ignoredFilePathMap.size>=FILEPATHMAP_IGNORE_WARNING_LIST_LIMIT){ignoredFilePathMapTruncated=!0;continue}else{ignoredFilePathMap.set(posixRel,findMatchingIgnoreRule(userIg.ignoreFile,posixRel));continue}}refs.add(absPath)}if(ignoredFilePathMap.size>0){let violations=[...ignoredFilePathMap.entries()].sort(([a],[b])=>a.localeCompare(b)).map(([ignoredPath,match])=>({path:ignoredPath,...match}));warning=formatFilePathMapIgnoreWarning(violations,userIg?.ignoreFileName||".vercelignore",ignoredFilePathMapTruncated)}try{let{findConfig:findMicrofrontendsConfig,inferMicrofrontendsLocation}=await import("./utils-XXR7KIRB.js"),customConfigFilename=void 0,microfrontendConfigPath=findMicrofrontendsConfig({dir:(0,import_path8.join)(path2,rootDirectory||""),customConfigFilename});if(!microfrontendConfigPath&&!rootDirectory&&projectName&&(microfrontendConfigPath=findMicrofrontendsConfig({dir:inferMicrofrontendsLocation({repositoryRoot:path2,applicationContext:{name:projectName},customConfigFilename}),customConfigFilename})),microfrontendConfigPath){let exclusion=getOnDiskExclusion(microfrontendConfigPath,realPathOf(microfrontendConfigPath),"microfrontends");exclusion?skipReference(microfrontendConfigPath,exclusion):refs.add(microfrontendConfigPath)}}catch(e){debug(`Error detecting microfrontend config: ${e}`)}}try{let routesJsonPath=(0,import_path8.join)(path2,".vercel","routes.json");await maybeRead(routesJsonPath,null)!==null&&(refs.add(routesJsonPath),debug("Including .vercel/routes.json in deployment"))}catch(e){debug(`Error checking for .vercel/routes.json: ${e}`)}if(prebuilt&&bulkRedirectsPath)try{let projectRoot=path2,bulkRedirectsFullPath=(0,import_path8.join)(projectRoot,rootDirectory||"",bulkRedirectsPath);if(getReferenceExclusion(bulkRedirectsFullPath,"bulkRedirects")==="outside-root")debug(`Skipping bulk redirects path "${bulkRedirectsPath}" - path traversal detected (resolves outside project root)`);else try{let stats=await(0,import_fs_extra6.stat)(bulkRedirectsFullPath),realBulkRedirectsPath=realPathOf(bulkRedirectsFullPath),exclusion=getOnDiskExclusion(bulkRedirectsFullPath,realBulkRedirectsPath,"bulkRedirects");if(exclusion||realBulkRedirectsPath===void 0){let rootPath=realBulkRedirectsPath&&toRootPath(realBulkRedirectsPath);throw bulkRedirectsExcludedError(bulkRedirectsPath,exclusion||"unresolved",userIg,[bulkRedirectsFullPath,rootPath||bulkRedirectsFullPath].map(file=>(0,import_path8.relative)(path2,file).split(import_path8.sep).join("/")))}else if(stats.isDirectory()){let skipped=0,kept=0,dirFiles=await(0,import_readdir_recursive.default)(bulkRedirectsFullPath,[(file,fileStats)=>{let fileExclusion=getOnDiskExclusion(file,(0,import_path8.join)(realBulkRedirectsPath,(0,import_path8.relative)(bulkRedirectsFullPath,file)),"bulkRedirects");return fileExclusion?(skipReference(file,fileExclusion),skipped++,!0):(fileStats.isDirectory()||kept++,!1)}]);if(kept===0&&skipped>0)throw bulkRedirectsExcludedError(bulkRedirectsPath,"each-file",userIg,[]);for(let file of dirFiles)refs.add(file);debug(`Including ${dirFiles.length} files from bulk redirects directory "${bulkRedirectsPath}" in deployment`)}else stats.isFile()&&(refs.add(bulkRedirectsFullPath),debug(`Including bulk redirects file "${bulkRedirectsPath}" in deployment`))}catch(e){if(e instanceof import_build_utils4.NowBuildError)throw e;debug(`Bulk redirects path "${bulkRedirectsPath}" not found`)}}catch(e){if(e instanceof import_build_utils4.NowBuildError)throw e;debug(`Error checking for bulk redirects path: ${e}`)}skippedReferenceCount>0&&(referenceWarning=formatSkippedReferencesWarning([...skippedReferences.entries()].sort(([a],[b])=>a.localeCompare(b)),skippedReferenceCount,skippedByUserRuleCount,userIg?.ignoreFileName||".vercelignore")),refs.size>0&&(fileList=fileList.concat(Array.from(refs))),debug(`Found ${fileList.length} files in the specified directory`)}else Array.isArray(path2)?(fileList=path2,debug(`Assigned ${fileList.length} files provided explicitly`)):(fileList=[path2],debug("Deploying the provided path as single file"));return{fileList,ignoreList,warning,referenceWarning}}async function getVercelIgnore2(cwd,prebuilt,vercelOutputDir){let ig=(0,import_ignore.default)(),ignores;if(prebuilt){if(typeof vercelOutputDir!="string")throw new Error('Missing required `vercelOutputDir` parameter when "prebuilt" is true');if(typeof cwd!="string")throw new Error('`cwd` must be a "string"');let relOutputDir=(0,import_path8.relative)(cwd,vercelOutputDir);ignores=["*"];let parts=relOutputDir.split(import_path8.sep);parts.forEach((_,i)=>{let level=parts.slice(0,i+1).join("/");ignores.push(`!/${level}`)}),ignores.push(`!/${parts.join("/")}/**`),ig.add(ignores.join(`
|
|
21
21
|
`))}else{ignores=[...VCS_DEFAULTS,".cache",".next",".now",".vercel",".npmignore",".dockerignore",".gitignore",".*.swp",".DS_Store",".wafpicke-*",".lock-wscript",".env.local",".env.*.local",".venv",".yarn/cache",".pnp*","npm-debug.log","config.gypi","node_modules","__pycache__","venv"];let cwds=Array.isArray(cwd)?cwd:[cwd],files=await Promise.all(cwds.map(async cwd2=>{let[vercelignore,nowignore]=await Promise.all([maybeRead((0,import_path8.join)(cwd2,".vercelignore"),""),maybeRead((0,import_path8.join)(cwd2,".nowignore"),"")]);if(vercelignore&&nowignore)throw new import_build_utils4.NowBuildError({code:"CONFLICTING_IGNORE_FILES",message:"Cannot use both a `.vercelignore` and `.nowignore` file. Please delete the `.nowignore` file.",link:"https://vercel.link/combining-old-and-new-config"});return vercelignore||nowignore}));(await Promise.all(cwds.map(cwd2=>(0,import_fs_extra6.pathExists)((0,import_path8.join)(cwd2,"Cargo.toml"))))).some(Boolean)&&ignores.push("/target");let ignoreFile=files.join(`
|
|
22
22
|
`);ig.add(`${ignores.join(`
|
|
23
23
|
`)}
|
|
@@ -41,14 +41,14 @@ ${dirtyResult.reason}`);return}let dirty=dirtyResult.value,commit=commitResult.v
|
|
|
41
41
|
`)?`\r
|
|
42
42
|
`:os.EOL,contentModified=!1;gitIgnore.split(EOL).includes(ignore)||(gitIgnore+=`${gitIgnore.endsWith(EOL)||gitIgnore.length===0?"":EOL}${ignore}${EOL}`,contentModified=!0),contentModified&&(await(0,import_fs_extra2.writeFile)(gitIgnorePath,gitIgnore),isGitIgnoreUpdated=!0)}catch{}return isGitIgnoreUpdated}var home=homedir();async function getRepoLink(client,cwd,{git=!client.filesystemOnlyRepoDiscovery}={}){let rootPath=await findRepoRoot(cwd,{git});if(!rootPath)return;let repoConfigPath=join7(rootPath,VERCEL_DIR,VERCEL_DIR_REPO),repoConfig=await(0,import_fs_extra3.readJSON)(repoConfigPath).catch(err=>{if(err.code!=="ENOENT")throw err});return{rootPath,repoConfig,repoConfigPath}}async function resolveGitRemote(client,rootPath,{yes,existingRemoteName}){let gitConfigPath=getGitConfigPath({cwd:rootPath})??join7(rootPath,".git/config"),remoteUrls=await getRemoteUrls(gitConfigPath);if(!remoteUrls)return;let remoteName;if(existingRemoteName){if(remoteName=existingRemoteName,!remoteUrls[remoteName])throw new Error(`Git remote "${remoteName}" from repo.json no longer exists`)}else remoteName=await selectGitRemote(client,Object.keys(remoteUrls),yes);return{rootPath,remoteName,repoUrl:remoteUrls[remoteName]}}async function selectGitRemote(client,names,yes=!1){let remoteNames=[...names].sort(),defaultRemote=remoteNames.includes("origin")?"origin":remoteNames[0];return remoteNames.length===1||yes?defaultRemote:client.input.select({message:"Which Git remote should be used?",choices:remoteNames.map(name=>({name,value:name})),default:defaultRemote})}async function writeRepoConfig(repoConfigPath,repoConfig,root){await writeFileNoFollow(repoConfigPath,`${JSON.stringify(repoConfig,null,2)}
|
|
43
43
|
`,root)}async function fetchProjectsForRepoUrl(client,repoUrl,orgId){let query=new URLSearchParams({repoUrl}),projectsIterator=client.fetchPaginated(`/v9/projects?${query}`,{accountId:orgId}),projects=[];for await(let chunk of projectsIterator)projects=projects.concat(chunk.projects);return projects}async function linkRepoProject(client,cwd,{project,orgId,orgSlug,remoteName,successEmoji="link"}){let repoLink=await getRepoLink(client,cwd);if(!repoLink)throw new Error("Could not determine Git repository root directory");let directory=(0,import_build_utils.normalizePath)(project.rootDirectory||"."),projectConfig={id:project.id,name:project.name,directory,orgId},filteredProjects=(repoLink.repoConfig?.projects??[]).filter(p=>p.id!==project.id&&(0,import_build_utils.normalizePath)(p.directory)!==directory),repoConfig={remoteName,projects:[...filteredProjects,projectConfig]},root=getWriteCheckRoot(client.cwd,repoLink.rootPath);return await assertNotSymlinkedConfigPath(join7(repoLink.rootPath,VERCEL_DIR)),await inspectLinkFiles(repoLink.rootPath,[VERCEL_DIR_REPO,VERCEL_DIR_README],root),await writeRepoConfig(repoLink.repoConfigPath,repoConfig,root),await writeReadme(repoLink.rootPath,root),await addToGitIgnore(repoLink.rootPath),output_manager_default.print(`
|
|
44
|
-
`),printAlignedLabel("Linked",`${orgSlug}/${project.name}`,{gutter:"\u2713"}),{repoConfig,repoConfigPath:repoLink.repoConfigPath,rootPath:repoLink.rootPath}}async function discoverRepoProjects(client,rootPath,{yes,existingProjectIds,existingDirectories,existingRemoteName}){let{Separator}=await import("./esm-
|
|
44
|
+
`),printAlignedLabel("Linked",`${orgSlug}/${project.name}`,{gutter:"\u2713"}),{repoConfig,repoConfigPath:repoLink.repoConfigPath,rootPath:repoLink.rootPath}}async function discoverRepoProjects(client,rootPath,{yes,existingProjectIds,existingDirectories,existingRemoteName}){let{Separator}=await import("./esm-CMSQLK7G.js"),{default:slugify}=await import("./slugify-OEOEYGDL.js"),{default:selectOrg}=await import("./select-org-YRCPH5Z5.js"),{default:createProject}=await import("./create-project-FMUOSSNP.js"),{repoInfoToUrl}=await import("./repo-info-to-url-S2YOQIRM.js"),{connectGitProvider,parseRepoUrl}=await import("./connect-git-provider-MPYSAOTH.js"),detectedProjectsPromise=import("./detect-projects-DHS2E3N4.js").then(({detectProjects})=>detectProjects(rootPath)).catch(err=>(output_manager_default.debug(`Failed to detect local projects: ${err}`),new Map)),confirmMessage=(existingRemoteName?"add":"link")==="add"?`Add Project(s) for Git repository at ${import_chalk3.default.dim(`"${humanizePath(rootPath)}"`)}?`:`Link Git repository at ${import_chalk3.default.dim(`"${humanizePath(rootPath)}"`)} to your Project(s)?`;if(!(yes||await client.input.confirm(confirmMessage,!0))){output_manager_default.print(` Canceled. Repository not linked.
|
|
45
45
|
`);return}let org=await selectOrg(client,"Which team?",yes);client.config.currentTeam=org.type==="team"?org.id:void 0;let remote=await resolveGitRemote(client,rootPath,{yes,existingRemoteName});if(!remote)throw new Error("Could not determine Git remote URLs");let{remoteName,repoUrl}=remote,parsedRepoUrl=parseRepoUrl(repoUrl);if(!parsedRepoUrl)throw new Error(`Failed to parse Git URL: ${repoUrl}`);let repoUrlLink=output_manager_default.link(repoUrl,repoInfoToUrl(parsedRepoUrl),{fallback:()=>link_default(repoUrl)});output_manager_default.spinner(`Fetching Projects for ${repoUrlLink} under ${import_chalk3.default.bold(org.slug)}\u2026`);let detectedProjects=await detectedProjectsPromise,projects=await fetchProjectsForRepoUrl(client,repoUrl,org.id);(existingProjectIds||existingDirectories)&&(projects=projects.filter(p=>!(existingProjectIds?.has(p.id)||existingDirectories?.has((0,import_build_utils.normalizePath)(p.rootDirectory||"."))))),projects.length===0?output_manager_default.print(` No Projects are linked to ${repoUrlLink} under ${import_chalk3.default.bold(org.slug)}.
|
|
46
46
|
`):output_manager_default.print(` Found ${(0,import_pluralize.default)("Project",projects.length,!0)} linked to ${repoUrlLink} under ${import_chalk3.default.bold(org.slug)}
|
|
47
47
|
`);for(let project of projects)detectedProjects.delete(project.rootDirectory??"");if(existingDirectories)for(let dir of existingDirectories)detectedProjects.delete(dir==="."?"":dir);let detectedProjectsCount=Array.from(detectedProjects.values()).reduce((o,f)=>o+f.length,0);detectedProjectsCount>0&&output_manager_default.print(` Detected ${(0,import_pluralize.default)("new Project",detectedProjectsCount,!0)} that may be created.
|
|
48
48
|
`);let selected;if(yes)selected=projects;else{let addSeparators=projects.length>0&&detectedProjectsCount>0;selected=await client.input.checkbox({message:`Which Projects should be ${projects.length?"linked to":"created"}?`,choices:[...addSeparators?[new Separator("----- Existing Projects -----")]:[],...projects.map(project=>{let dir=project.rootDirectory||".";return{name:`${org.slug}/${project.name} ${import_chalk3.default.gray(`(${dir})`)}`,value:project,checked:!0}}),...addSeparators?[new Separator("----- New Projects to be created -----")]:[],...Array.from(detectedProjects.entries()).flatMap(([rootDirectory,frameworks])=>frameworks.map((framework,i)=>{let name=slugify([basename2(rootDirectory)||basename2(rootPath),i>0?framework.slug:""].filter(Boolean).join("-"));return{name:`${org.slug}/${name} ${import_chalk3.default.gray(`(${rootDirectory||"."} \xB7 ${framework.name})`)}`,value:{newProject:!0,rootDirectory,name,framework},checked:projects.length===0}}))]})}if(selected.length===0){output_manager_default.print(` No Projects were selected. Repository not linked.
|
|
49
49
|
`);return}for(let i=0;i<selected.length;i++){let selection=selected[i];if(!("newProject"in selection&&selection.newProject))continue;let orgAndName=`${org.slug}/${selection.name}`;output_manager_default.spinner(`Creating new Project: ${orgAndName}`),delete selection.newProject,selection.rootDirectory||delete selection.rootDirectory;let project=selected[i]=await createProject(client,{...selection,framework:selection.framework.slug});await connectGitProvider(client,project.id,parsedRepoUrl.provider,`${parsedRepoUrl.org}/${parsedRepoUrl.repo}`),output_manager_default.print(` Created new Project: ${output_manager_default.link(orgAndName,`https://vercel.com/${orgAndName}`,{fallback:!1})}
|
|
50
50
|
`)}let repoProjects=selected.map(project=>{if(!("id"in project))throw new TypeError(`Not a Project: ${JSON.stringify(project)}`);return{id:project.id,name:project.name,directory:(0,import_build_utils.normalizePath)(project.rootDirectory||"."),orgId:org.id}});return{remoteName,projects:repoProjects,orgSlug:org.slug}}async function ensureRepoLink(client,cwd,{yes,overwrite}){let repoLink=await getRepoLink(client,cwd);if(repoLink)output_manager_default.debug(`Found Git repository root directory: ${repoLink.rootPath}`);else throw new Error("Could not determine Git repository root directory");let{rootPath,repoConfig,repoConfigPath}=repoLink;if(overwrite||!repoConfig){let root=getWriteCheckRoot(client.cwd,rootPath);await inspectLinkFiles(rootPath,[VERCEL_DIR_REPO,VERCEL_DIR_README],root);let result=await discoverRepoProjects(client,rootPath,{yes});if(!result)return;repoConfig={remoteName:result.remoteName,projects:result.projects},await writeRepoConfig(repoConfigPath,repoConfig,root),await writeReadme(rootPath,root),await addToGitIgnore(rootPath),printAlignedLabel("Linked",`${(0,import_pluralize.default)("Project",result.projects.length,!0)} under ${result.orgSlug}`,{gutter:"\u2713"})}return{repoConfig,repoConfigPath,rootPath}}async function addRepoLink(client,cwd,{yes}){let repoLink=await getRepoLink(client,cwd);if(!repoLink)throw new Error("Could not determine Git repository root directory");let{rootPath,repoConfig,repoConfigPath}=repoLink;if(!repoConfig)throw new Error("No existing repository link found. Run `vc link --repo` first to link the repository.");output_manager_default.debug(`Found Git repository root directory: ${rootPath}`);let root=getWriteCheckRoot(client.cwd,rootPath);await inspectLinkFiles(rootPath,[VERCEL_DIR_REPO],root);let existingProjectIds=new Set(repoConfig.projects.map(p=>p.id)),existingDirectories=new Set(repoConfig.projects.map(p=>p.directory)),result=await discoverRepoProjects(client,rootPath,{yes,existingProjectIds,existingDirectories,existingRemoteName:repoConfig.remoteName});if(!result)return;if(result.projects.length===0)return output_manager_default.print(` No new Projects were added.
|
|
51
|
-
`),{repoConfig,repoConfigPath,rootPath};let mergedProjects=[...repoConfig.projects];for(let project of result.projects)existingProjectIds.has(project.id)||mergedProjects.push(project);let updatedConfig={...repoConfig,projects:mergedProjects};return await writeRepoConfig(repoConfigPath,updatedConfig,root),printAlignedLabel("Added",`${(0,import_pluralize.default)("Project",result.projects.length,!0)} under ${result.orgSlug}`,{gutter:"\u2713"}),{repoConfig:updatedConfig,repoConfigPath,rootPath}}async function findRepoRoot(start,{git=!0}={}){let{debug}=output_manager_default,REPO_JSON_PATH=join7(VERCEL_DIR,VERCEL_DIR_REPO);for(let current of(0,import_build_utils.traverseUpDirectories)({start})){if(current===home){debug("Arrived at home directory");break}let repoConfigPath=join7(current,REPO_JSON_PATH);if(await(0,import_fs_extra3.lstat)(repoConfigPath).catch(err=>{if(err.code!=="ENOENT")throw err}))return debug(`Found "${REPO_JSON_PATH}" - detected "${current}" as repo root`),current}let gitRoot=git?getGitRootDirectory({cwd:start}):null;if(gitRoot)return debug(`Found git root via "git rev-parse --show-toplevel" - detected "${gitRoot}" as repo root`),gitRoot;for(let current of(0,import_build_utils.traverseUpDirectories)({start})){if(current===home){debug("Arrived at home directory");break}let gitPath=join7(current,".git");if(await(0,import_fs_extra3.lstat)(gitPath).catch(err=>{if(err.code!=="ENOENT")throw err}))return debug(`Found ".git" - detected "${current}" as repo root`),current}debug("Aborting search for repo root")}function sortByDirectory(a,b){let aParts=a.directory.split("/");return b.directory.split("/").length-aParts.length}function findProjectsFromPath(projects,path2){let normalizedPath=(0,import_build_utils.normalizePath)(path2),matches=projects.slice().sort(sortByDirectory).filter(project=>project.directory==="."?!0:normalizedPath===project.directory||normalizedPath.startsWith(`${project.directory}/`)),firstMatch=matches[0];return firstMatch?matches.filter(match=>match.directory===firstMatch.directory):[]}var import_chalk4=__toESM(require_source(),1),import_fs_extra4=__toESM(require_lib2(),1);import{stat}from"fs/promises";import{join as join8,dirname as dirname2}from"path";async function findProjectRoot(startDir){let cwdDev;try{cwdDev=(await stat(startDir)).dev}catch{return null}let dir=dirname2(startDir);for(;dirname2(dir)!==dir;){try{if((await stat(dir)).dev!==cwdDev)return null}catch{return null}let hasVercelDir=await(0,import_fs_extra4.pathExists)(join8(dir,".vercel")),hasVercelJson=await(0,import_fs_extra4.pathExists)(join8(dir,"vercel.json")),hasVercelToml=await(0,import_fs_extra4.pathExists)(join8(dir,"vercel.toml")),hasGit=await(0,import_fs_extra4.pathExists)(join8(dir,".git"));if(hasVercelDir||hasVercelJson||hasVercelToml||hasGit)return dir;dir=dirname2(dir)}return null}async function resolveProjectCwd(cwd,{allowConfigExecution=!0}={}){let projectRoot=await findProjectRoot(cwd);if(!projectRoot||projectRoot===cwd)return cwd;let{isExperimentalServicesEnabled,loadStaticVercelConfig,tryDetectServices}=await import("./detect-services-4ONC2DH3.js"),config2=await loadStaticVercelConfig(projectRoot);if(!await isExperimentalServicesEnabled(projectRoot,{allowConfigExecution,config:config2}))return cwd;let result=await tryDetectServices(projectRoot,config2,{allowConfigExecution});return result&&(result.services?.length??0)>0?(output_manager_default.debug(`Running from project root: ${import_chalk4.default.cyan(projectRoot)}`),projectRoot):cwd}var readFile2=promisify(fs3.readFile),lstat4=promisify(fs3.lstat),VERCEL_DIR=".vercel",VERCEL_DIR_FALLBACK=".now",VERCEL_DIR_README="README.txt",VERCEL_DIR_PROJECT="project.json",VERCEL_DIR_REPO="repo.json";function isOwnerLookupUnavailableLink(link){return"ownerLookupUnavailable"in link&&link.ownerLookupUnavailable===!0}function isRemoteLookupSkippedLink(link){return"remoteLookupSkipped"in link&&link.remoteLookupSkipped===!0}function isProjectReadLink(link){return"projectRead"in link&&link.projectRead===!0}function isOwnerLookupUnavailableError(error){return isAPIError(error)&&error.status===403&&error.code==="team_unauthorized"}function isValidProjectLink(value){if(!value||typeof value!="object"||Array.isArray(value))return!1;let link=value;return typeof link.projectId=="string"&&link.projectId.length>0&&typeof link.orgId=="string"&&link.orgId.length>0&&(link.projectName===void 0||typeof link.projectName=="string"&&link.projectName.length>0)}var PROJECT_LINK_FIELDS=["projectId","orgId","projectName","settings"];function decodeProjectLink(value){if(!value||typeof value!="object"||Array.isArray(value))return value;let link={};for(let field of PROJECT_LINK_FIELDS)Object.prototype.hasOwnProperty.call(value,field)&&(link[field]=value[field]);return link}function getVercelDirectory(cwd){let possibleDirs=[join9(cwd,VERCEL_DIR),join9(cwd,VERCEL_DIR_FALLBACK)],existingDirs=possibleDirs.filter(d=>isDirectory(d));if(existingDirs.length>1)throw new import_build_utils2.NowBuildError({code:"CONFLICTING_CONFIG_DIRECTORIES",message:"Both `.vercel` and `.now` directories exist. Please remove the `.now` directory.",link:"https://vercel.link/combining-old-and-new-config"});return existingDirs[0]||possibleDirs[0]}async function assertNotSymlinkedConfigPath(path2){if((await lstat4(path2).catch(()=>null))?.isSymbolicLink())throw new import_build_utils2.NowBuildError({code:"UNSAFE_CONFIG_DIRECTORY",message:`Refusing to modify ${path2} because it is a symbolic link.`})}async function inspectLinkFiles(directory,names,root=directory){for(let name of names)await inspectWritableFile(join9(directory,VERCEL_DIR,name),root)}async function getProjectLink(client,path2,projectName,projectNameIsExplicit){let dirLink=await getLinkFromDir(getVercelDirectory(path2));return dirLink&&(!projectNameIsExplicit||!projectName||dirLink.projectId===projectName||dirLink.projectName===projectName)?dirLink:await getProjectLinkFromRepoLink(client,path2,projectName,projectNameIsExplicit)}async function getProjectLinkFromRepoLink(client,path2,projectName,projectNameIsExplicit){let repoLink=await getRepoLink(client,path2);if(!repoLink?.repoConfig)return null;let projects=findProjectsFromPath(repoLink.repoConfig.projects,relative2(repoLink.rootPath,path2)),project;if(projectName&&projectNameIsExplicit)project=repoLink.repoConfig.projects.find(p=>p.id===projectName||p.name===projectName);else if(projects.length===1)project=projects[0];else{let selectableProjects=projects.length>0?projects:repoLink.repoConfig.projects;if(projectName&&(project=selectableProjects.find(p=>p.id===projectName||p.name===projectName)),!project)if(client.nonInteractive)if(selectableProjects.length===1)project=selectableProjects[0];else return null;else project=await client.input.select({message:"Please select a Project:",choices:selectableProjects.map(p=>({value:p,name:remoteText(String(p.name??p.id))}))})}if(project){let orgId=project.orgId??repoLink.repoConfig.orgId;if(!orgId){let projectInfo=[project.name?`name: "${remoteText(project.name)}"`:"",project.directory?`directory: "${remoteText(project.directory)}"`:""].filter(Boolean).join(", "),details=projectInfo?` Project: { ${projectInfo} }.`:"";throw new Error(`Could not determine org ID from repo.json config at "${repoLink.repoConfigPath}".${details} Please re-link the repository.`)}return{repoRoot:repoLink.rootPath,orgId,projectId:project.id,projectName:project.name,projectRootDirectory:project.directory}}return null}function getLinkedProjectIdSync(dir){try{let link=JSON.parse(fs3.readFileSync(join9(dir,VERCEL_DIR_PROJECT),"utf8"));return isValidProjectLink(link)?link.projectId:void 0}catch{return}}async function getLinkFromDir(dir){try{let json=await readFile2(join9(dir,VERCEL_DIR_PROJECT),"utf8"),link=decodeProjectLink(JSON.parse(json));if(!isValidProjectLink(link)){let raw=link,projectId=raw?.projectId,orgId=raw?.orgId;if(!(typeof projectId=="string"&&projectId.length>0&&typeof orgId=="string"&&orgId.length>0))return null;throw new Error(`Project Settings are invalid. To link your project again, remove the ${dir} directory.`)}return link}catch(err){if((0,import_error_utils5.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code))return null;throw(0,import_error_utils5.isError)(err)&&err.name==="SyntaxError"?new Error(`Project Settings could not be retrieved. To link your project again, remove the ${dir} directory.`):err}}async function hasLocalProjectLink(client,cwd){try{if(await getLinkFromDir(getVercelDirectory(cwd)))return!0}catch{}try{let repoLink=await getRepoLink(client,cwd,{git:!1});return repoLink?.repoConfig?findProjectsFromPath(repoLink.repoConfig.projects,relative2(repoLink.rootPath,cwd)).length>0:!1}catch{return!1}}async function hasProjectLink(client,projectLink,path2){let VERCEL_ORG_ID=(0,import_build_utils2.getPlatformEnv)("ORG_ID"),VERCEL_PROJECT_ID=(0,import_build_utils2.getPlatformEnv)("PROJECT_ID");if(VERCEL_ORG_ID===projectLink.orgId&&VERCEL_PROJECT_ID===projectLink.projectId)return!0;let repoLink=await getRepoLink(client,path2);if(repoLink?.repoConfig){let matchingProject=repoLink.repoConfig.projects.find(p=>p.id===projectLink.projectId);if(matchingProject){let orgId=matchingProject.orgId??repoLink.repoConfig.orgId;if(!orgId)throw new Error(`Invalid "repo.json": missing "orgId" for project "${matchingProject.id}" and no top-level "orgId" is defined.`);if(orgId===projectLink.orgId)return!0}}let link=await getLinkFromDir(getVercelDirectory(path2));return!!(link&&link.orgId===projectLink.orgId&&link.projectId===projectLink.projectId)}var SAFE_LINK_ID=/^[A-Za-z0-9_-]+$/;function getLocalProjectLink(link,{useIdAsName=!1}={}){let projectName=link.projectName||(useIdAsName?link.projectId:void 0);if(!projectName||!SAFE_LINK_ID.test(link.projectId)||!SAFE_LINK_ID.test(link.orgId))return null;let settings=link.settings,localRootDirectory=link.projectRootDirectory??settings?.rootDirectory??null,rootDirectory=localRootDirectory==="."?null:localRootDirectory,project={...settings,id:link.projectId,accountId:link.orgId,name:projectName,createdAt:settings?.createdAt??0,updatedAt:settings?.updatedAt??settings?.createdAt??0,rootDirectory};return{...{status:"linked",org:{type:link.orgId.startsWith("team_")?"team":"user",id:link.orgId,slug:""},project,repoRoot:link.repoRoot,remoteLookupSkipped:!0},projectRootDirectory:link.projectRootDirectory,orgId:link.orgId}}function throwProjectLookupError(client,err){if(isAPIError(err)&&err.status===403){if(output_manager_default.stopSpinner(),err.missingToken||err.invalidToken)throw new InvalidToken(client.authConfig.tokenSource);if(err.code==="forbidden"||err.code==="team_unauthorized")throw new import_build_utils2.NowBuildError({message:`Could not retrieve Project Settings. To link your Project, remove the ${code(VERCEL_DIR)} directory and deploy again.`,code:"PROJECT_UNAUTHORIZED",link:"https://vercel.link/cannot-load-project-settings"})}throw err}async function getLinkedProject(client,options={}){let path2=options.cwd??client.cwd,ignoreLocalLink=options.ignoreLocalLink===!0;ignoreLocalLink||(path2=await resolveProjectCwd(path2,{allowConfigExecution:options.allowConfigExecution}));let VERCEL_ORG_ID=(0,import_build_utils2.getPlatformEnv)("ORG_ID"),VERCEL_PROJECT_ID=(0,import_build_utils2.getPlatformEnv)("PROJECT_ID"),shouldUseEnv=!!(VERCEL_ORG_ID&&VERCEL_PROJECT_ID),projectName=options.projectName,projectNameIsExplicit=options.projectNameIsExplicit===!0,explicitProjectName=projectNameIsExplicit?projectName:void 0,hasExplicitProject=!!explicitProjectName,shouldUseEnvContext=shouldUseEnv&&!hasExplicitProject;if(!hasExplicitProject&&(VERCEL_ORG_ID||VERCEL_PROJECT_ID)&&!shouldUseEnv)return options.quiet||output_manager_default.error(`You specified ${VERCEL_ORG_ID?"`VERCEL_ORG_ID`":"`VERCEL_PROJECT_ID`"} but you forgot to specify ${VERCEL_ORG_ID?"`VERCEL_PROJECT_ID`":"`VERCEL_ORG_ID`"}. You need to specify both to deploy to a custom project.
|
|
51
|
+
`),{repoConfig,repoConfigPath,rootPath};let mergedProjects=[...repoConfig.projects];for(let project of result.projects)existingProjectIds.has(project.id)||mergedProjects.push(project);let updatedConfig={...repoConfig,projects:mergedProjects};return await writeRepoConfig(repoConfigPath,updatedConfig,root),printAlignedLabel("Added",`${(0,import_pluralize.default)("Project",result.projects.length,!0)} under ${result.orgSlug}`,{gutter:"\u2713"}),{repoConfig:updatedConfig,repoConfigPath,rootPath}}async function findRepoRoot(start,{git=!0}={}){let{debug}=output_manager_default,REPO_JSON_PATH=join7(VERCEL_DIR,VERCEL_DIR_REPO);for(let current of(0,import_build_utils.traverseUpDirectories)({start})){if(current===home){debug("Arrived at home directory");break}let repoConfigPath=join7(current,REPO_JSON_PATH);if(await(0,import_fs_extra3.lstat)(repoConfigPath).catch(err=>{if(err.code!=="ENOENT")throw err}))return debug(`Found "${REPO_JSON_PATH}" - detected "${current}" as repo root`),current}let gitRoot=git?getGitRootDirectory({cwd:start}):null;if(gitRoot)return debug(`Found git root via "git rev-parse --show-toplevel" - detected "${gitRoot}" as repo root`),gitRoot;for(let current of(0,import_build_utils.traverseUpDirectories)({start})){if(current===home){debug("Arrived at home directory");break}let gitPath=join7(current,".git");if(await(0,import_fs_extra3.lstat)(gitPath).catch(err=>{if(err.code!=="ENOENT")throw err}))return debug(`Found ".git" - detected "${current}" as repo root`),current}debug("Aborting search for repo root")}function sortByDirectory(a,b){let aParts=a.directory.split("/");return b.directory.split("/").length-aParts.length}function findProjectsFromPath(projects,path2){let normalizedPath=(0,import_build_utils.normalizePath)(path2),matches=projects.slice().sort(sortByDirectory).filter(project=>project.directory==="."?!0:normalizedPath===project.directory||normalizedPath.startsWith(`${project.directory}/`)),firstMatch=matches[0];return firstMatch?matches.filter(match=>match.directory===firstMatch.directory):[]}var import_chalk4=__toESM(require_source(),1),import_fs_extra4=__toESM(require_lib2(),1);import{stat}from"fs/promises";import{join as join8,dirname as dirname2}from"path";async function findProjectRoot(startDir){let cwdDev;try{cwdDev=(await stat(startDir)).dev}catch{return null}let dir=dirname2(startDir);for(;dirname2(dir)!==dir;){try{if((await stat(dir)).dev!==cwdDev)return null}catch{return null}let hasVercelDir=await(0,import_fs_extra4.pathExists)(join8(dir,".vercel")),hasVercelJson=await(0,import_fs_extra4.pathExists)(join8(dir,"vercel.json")),hasVercelToml=await(0,import_fs_extra4.pathExists)(join8(dir,"vercel.toml")),hasGit=await(0,import_fs_extra4.pathExists)(join8(dir,".git"));if(hasVercelDir||hasVercelJson||hasVercelToml||hasGit)return dir;dir=dirname2(dir)}return null}async function resolveProjectCwd(cwd,{allowConfigExecution=!0}={}){let projectRoot=await findProjectRoot(cwd);if(!projectRoot||projectRoot===cwd)return cwd;let{isExperimentalServicesEnabled,loadStaticVercelConfig,tryDetectServices}=await import("./detect-services-HCUFI3RJ.js"),config2=await loadStaticVercelConfig(projectRoot);if(!await isExperimentalServicesEnabled(projectRoot,{allowConfigExecution,config:config2}))return cwd;let result=await tryDetectServices(projectRoot,config2,{allowConfigExecution});return result&&(result.services?.length??0)>0?(output_manager_default.debug(`Running from project root: ${import_chalk4.default.cyan(projectRoot)}`),projectRoot):cwd}var readFile2=promisify(fs3.readFile),lstat4=promisify(fs3.lstat),VERCEL_DIR=".vercel",VERCEL_DIR_FALLBACK=".now",VERCEL_DIR_README="README.txt",VERCEL_DIR_PROJECT="project.json",VERCEL_DIR_REPO="repo.json";function isOwnerLookupUnavailableLink(link){return"ownerLookupUnavailable"in link&&link.ownerLookupUnavailable===!0}function isRemoteLookupSkippedLink(link){return"remoteLookupSkipped"in link&&link.remoteLookupSkipped===!0}function isProjectReadLink(link){return"projectRead"in link&&link.projectRead===!0}function isOwnerLookupUnavailableError(error){return isAPIError(error)&&error.status===403&&error.code==="team_unauthorized"}function isValidProjectLink(value){if(!value||typeof value!="object"||Array.isArray(value))return!1;let link=value;return typeof link.projectId=="string"&&link.projectId.length>0&&typeof link.orgId=="string"&&link.orgId.length>0&&(link.projectName===void 0||typeof link.projectName=="string"&&link.projectName.length>0)}var PROJECT_LINK_FIELDS=["projectId","orgId","projectName","settings"];function decodeProjectLink(value){if(!value||typeof value!="object"||Array.isArray(value))return value;let link={};for(let field of PROJECT_LINK_FIELDS)Object.prototype.hasOwnProperty.call(value,field)&&(link[field]=value[field]);return link}function getVercelDirectory(cwd){let possibleDirs=[join9(cwd,VERCEL_DIR),join9(cwd,VERCEL_DIR_FALLBACK)],existingDirs=possibleDirs.filter(d=>isDirectory(d));if(existingDirs.length>1)throw new import_build_utils2.NowBuildError({code:"CONFLICTING_CONFIG_DIRECTORIES",message:"Both `.vercel` and `.now` directories exist. Please remove the `.now` directory.",link:"https://vercel.link/combining-old-and-new-config"});return existingDirs[0]||possibleDirs[0]}async function assertNotSymlinkedConfigPath(path2){if((await lstat4(path2).catch(()=>null))?.isSymbolicLink())throw new import_build_utils2.NowBuildError({code:"UNSAFE_CONFIG_DIRECTORY",message:`Refusing to modify ${path2} because it is a symbolic link.`})}async function inspectLinkFiles(directory,names,root=directory){for(let name of names)await inspectWritableFile(join9(directory,VERCEL_DIR,name),root)}async function getProjectLink(client,path2,projectName,projectNameIsExplicit){let dirLink=await getLinkFromDir(getVercelDirectory(path2));return dirLink&&(!projectNameIsExplicit||!projectName||dirLink.projectId===projectName||dirLink.projectName===projectName)?dirLink:await getProjectLinkFromRepoLink(client,path2,projectName,projectNameIsExplicit)}async function getProjectLinkFromRepoLink(client,path2,projectName,projectNameIsExplicit){let repoLink=await getRepoLink(client,path2);if(!repoLink?.repoConfig)return null;let projects=findProjectsFromPath(repoLink.repoConfig.projects,relative2(repoLink.rootPath,path2)),project;if(projectName&&projectNameIsExplicit)project=repoLink.repoConfig.projects.find(p=>p.id===projectName||p.name===projectName);else if(projects.length===1)project=projects[0];else{let selectableProjects=projects.length>0?projects:repoLink.repoConfig.projects;if(projectName&&(project=selectableProjects.find(p=>p.id===projectName||p.name===projectName)),!project)if(client.nonInteractive)if(selectableProjects.length===1)project=selectableProjects[0];else return null;else project=await client.input.select({message:"Please select a Project:",choices:selectableProjects.map(p=>({value:p,name:remoteText(String(p.name??p.id))}))})}if(project){let orgId=project.orgId??repoLink.repoConfig.orgId;if(!orgId){let projectInfo=[project.name?`name: "${remoteText(project.name)}"`:"",project.directory?`directory: "${remoteText(project.directory)}"`:""].filter(Boolean).join(", "),details=projectInfo?` Project: { ${projectInfo} }.`:"";throw new Error(`Could not determine org ID from repo.json config at "${repoLink.repoConfigPath}".${details} Please re-link the repository.`)}return{repoRoot:repoLink.rootPath,orgId,projectId:project.id,projectName:project.name,projectRootDirectory:project.directory}}return null}function getLinkedProjectIdSync(dir){try{let link=JSON.parse(fs3.readFileSync(join9(dir,VERCEL_DIR_PROJECT),"utf8"));return isValidProjectLink(link)?link.projectId:void 0}catch{return}}async function getLinkFromDir(dir){try{let json=await readFile2(join9(dir,VERCEL_DIR_PROJECT),"utf8"),link=decodeProjectLink(JSON.parse(json));if(!isValidProjectLink(link)){let raw=link,projectId=raw?.projectId,orgId=raw?.orgId;if(!(typeof projectId=="string"&&projectId.length>0&&typeof orgId=="string"&&orgId.length>0))return null;throw new Error(`Project Settings are invalid. To link your project again, remove the ${dir} directory.`)}return link}catch(err){if((0,import_error_utils5.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code))return null;throw(0,import_error_utils5.isError)(err)&&err.name==="SyntaxError"?new Error(`Project Settings could not be retrieved. To link your project again, remove the ${dir} directory.`):err}}async function hasLocalProjectLink(client,cwd){try{if(await getLinkFromDir(getVercelDirectory(cwd)))return!0}catch{}try{let repoLink=await getRepoLink(client,cwd,{git:!1});return repoLink?.repoConfig?findProjectsFromPath(repoLink.repoConfig.projects,relative2(repoLink.rootPath,cwd)).length>0:!1}catch{return!1}}async function hasProjectLink(client,projectLink,path2){let VERCEL_ORG_ID=(0,import_build_utils2.getPlatformEnv)("ORG_ID"),VERCEL_PROJECT_ID=(0,import_build_utils2.getPlatformEnv)("PROJECT_ID");if(VERCEL_ORG_ID===projectLink.orgId&&VERCEL_PROJECT_ID===projectLink.projectId)return!0;let repoLink=await getRepoLink(client,path2);if(repoLink?.repoConfig){let matchingProject=repoLink.repoConfig.projects.find(p=>p.id===projectLink.projectId);if(matchingProject){let orgId=matchingProject.orgId??repoLink.repoConfig.orgId;if(!orgId)throw new Error(`Invalid "repo.json": missing "orgId" for project "${matchingProject.id}" and no top-level "orgId" is defined.`);if(orgId===projectLink.orgId)return!0}}let link=await getLinkFromDir(getVercelDirectory(path2));return!!(link&&link.orgId===projectLink.orgId&&link.projectId===projectLink.projectId)}var SAFE_LINK_ID=/^[A-Za-z0-9_-]+$/;function getLocalProjectLink(link,{useIdAsName=!1}={}){let projectName=link.projectName||(useIdAsName?link.projectId:void 0);if(!projectName||!SAFE_LINK_ID.test(link.projectId)||!SAFE_LINK_ID.test(link.orgId))return null;let settings=link.settings,localRootDirectory=link.projectRootDirectory??settings?.rootDirectory??null,rootDirectory=localRootDirectory==="."?null:localRootDirectory,project={...settings,id:link.projectId,accountId:link.orgId,name:projectName,createdAt:settings?.createdAt??0,updatedAt:settings?.updatedAt??settings?.createdAt??0,rootDirectory};return{...{status:"linked",org:{type:link.orgId.startsWith("team_")?"team":"user",id:link.orgId,slug:""},project,repoRoot:link.repoRoot,remoteLookupSkipped:!0},projectRootDirectory:link.projectRootDirectory,orgId:link.orgId}}function throwProjectLookupError(client,err){if(isAPIError(err)&&err.status===403){if(output_manager_default.stopSpinner(),err.missingToken||err.invalidToken)throw new InvalidToken(client.authConfig.tokenSource);if(err.code==="forbidden"||err.code==="team_unauthorized")throw new import_build_utils2.NowBuildError({message:`Could not retrieve Project Settings. To link your Project, remove the ${code(VERCEL_DIR)} directory and deploy again.`,code:"PROJECT_UNAUTHORIZED",link:"https://vercel.link/cannot-load-project-settings"})}throw err}async function getLinkedProject(client,options={}){let path2=options.cwd??client.cwd,ignoreLocalLink=options.ignoreLocalLink===!0;ignoreLocalLink||(path2=await resolveProjectCwd(path2,{allowConfigExecution:options.allowConfigExecution}));let VERCEL_ORG_ID=(0,import_build_utils2.getPlatformEnv)("ORG_ID"),VERCEL_PROJECT_ID=(0,import_build_utils2.getPlatformEnv)("PROJECT_ID"),shouldUseEnv=!!(VERCEL_ORG_ID&&VERCEL_PROJECT_ID),projectName=options.projectName,projectNameIsExplicit=options.projectNameIsExplicit===!0,explicitProjectName=projectNameIsExplicit?projectName:void 0,hasExplicitProject=!!explicitProjectName,shouldUseEnvContext=shouldUseEnv&&!hasExplicitProject;if(!hasExplicitProject&&(VERCEL_ORG_ID||VERCEL_PROJECT_ID)&&!shouldUseEnv)return options.quiet||output_manager_default.error(`You specified ${VERCEL_ORG_ID?"`VERCEL_ORG_ID`":"`VERCEL_PROJECT_ID`"} but you forgot to specify ${VERCEL_ORG_ID?"`VERCEL_PROJECT_ID`":"`VERCEL_ORG_ID`"}. You need to specify both to deploy to a custom project.
|
|
52
52
|
`),{status:"error",exitCode:1};let link,explicitlyResolvedProject=null,orgId;if(explicitProjectName){let hasExplicitScope=options.scopeIsExplicit===!0,matchingLocalLink=hasExplicitScope||shouldUseEnv||ignoreLocalLink?null:await getProjectLink(client,path2,explicitProjectName,!0),fallbackOrgId=shouldUseEnv?VERCEL_ORG_ID:matchingLocalLink?.orgId??client.config.currentTeam,lookupOrgId=hasExplicitScope?client.config.currentTeam:fallbackOrgId;orgId=lookupOrgId;let apiProject=await getProjectByNameOrId(client,explicitProjectName,lookupOrgId);if(explicitlyResolvedProject=apiProject instanceof ProjectNotFound?null:apiProject,explicitlyResolvedProject===null)link=null;else{let resolvedOrgId=explicitlyResolvedProject.accountId??lookupOrgId??matchingLocalLink?.orgId,localLink2=matchingLocalLink?.projectId===explicitlyResolvedProject.id?matchingLocalLink:null;if(!localLink2&&!ignoreLocalLink)try{localLink2=await getProjectLink(client,path2,explicitlyResolvedProject.id,!0)}catch(err){output_manager_default.debug(`Ignoring local project metadata after explicit project resolution: ${err}`)}link=resolvedOrgId?{...localLink2?.projectId===explicitlyResolvedProject.id&&localLink2.orgId===resolvedOrgId?localLink2:{},projectId:explicitlyResolvedProject.id,orgId:resolvedOrgId}:null}}else link=shouldUseEnvContext?{orgId:VERCEL_ORG_ID,projectId:VERCEL_PROJECT_ID}:ignoreLocalLink?null:await getProjectLink(client,path2,projectName,projectNameIsExplicit),link&&(orgId=link.orgId);if(!link)return{status:"not_linked",org:null,project:null,orgId};let localLink=getLocalProjectLink(link);if(options.skipRemoteLookup&&localLink)return localLink;let fallbackLink=options.allowProjectLookupFallback?getLocalProjectLink(link,{useIdAsName:!options.fallbackRequiresProjectName}):null;options.quiet||output_manager_default.spinner("Retrieving project\u2026",1e3);let org=null,project=null,ownerLookupUnavailable=!1,projectLookupForbidden;try{let[orgResult,projectResult]=await Promise.allSettled([options.skipOwnerLookup?Promise.resolve({type:link.orgId.startsWith("team_")?"team":"user",id:link.orgId,slug:""}):getOrgById(client,link.orgId),explicitlyResolvedProject?Promise.resolve(explicitlyResolvedProject):getProjectByNameOrId(client,link.projectId,link.orgId)]);if(orgResult.status==="fulfilled")org=orgResult.value;else if(isAPIError(orgResult.reason)&&(orgResult.reason.status===404||orgResult.reason.code==="not_found"||orgResult.reason.code==="mock_unimplemented"))org=null;else if(options.allowOwnerLookupFallback&&isOwnerLookupUnavailableError(orgResult.reason))ownerLookupUnavailable=!0;else throw orgResult.reason;if(projectResult.status==="fulfilled")project=projectResult.value;else if(isAPIError(projectResult.reason)&&(projectResult.reason.status===404||projectResult.reason.code==="not_found"||projectResult.reason.code==="mock_unimplemented"))project=new ProjectNotFound(link.projectId);else if(fallbackLink&&isAPIError(projectResult.reason)&&projectResult.reason.status===403&&!projectResult.reason.missingToken&&!projectResult.reason.invalidToken)projectLookupForbidden=projectResult.reason,project=new ProjectNotFound(link.projectId);else throw projectResult.reason}catch(err){throwProjectLookupError(client,err)}finally{output_manager_default.stopSpinner()}if(fallbackLink&&project instanceof ProjectNotFound){if((await getAppTokenTeam(client))?.id===link.orgId)return fallbackLink;projectLookupForbidden&&throwProjectLookupError(client,projectLookupForbidden)}if(ownerLookupUnavailable&&project&&!(project instanceof ProjectNotFound)){let ownerId=project.accountId||link.orgId;return{status:"linked",org:{type:ownerId.startsWith("team_")?"team":"user",id:ownerId,slug:ownerId},project,repoRoot:link.repoRoot,projectRootDirectory:link.projectRootDirectory,orgId:link.orgId,ownerLookupUnavailable:!0,projectRead:!0}}return!org||!project||project instanceof ProjectNotFound?shouldUseEnvContext?(options.quiet||output_manager_default.error(`Project not found (${JSON.stringify({VERCEL_PROJECT_ID,VERCEL_ORG_ID})})
|
|
53
53
|
`),{status:"error",exitCode:1,orgId}):(options.quiet||output_manager_default.print(prependEmoji(`Your Project was either deleted, transferred to a new Team, or you don\u2019t have access to it anymore.
|
|
54
54
|
`,emoji("warning"))),{status:"not_linked",org:null,project:null,orgId:link.orgId}):{...{status:"linked",org,project,repoRoot:link.repoRoot,projectRead:!0},projectRootDirectory:link.projectRootDirectory,orgId:link.orgId}}var VERCEL_DIR_README_CONTENT=`> Why do I have a folder named ".vercel" in my project?
|
|
@@ -64,7 +64,7 @@ No, you should not share the ".vercel" folder with anyone.
|
|
|
64
64
|
Upon creation, it will be automatically added to your ".gitignore" file.
|
|
65
65
|
`;async function writeReadme(path2,root=path2){await assertNotSymlinkedConfigPath(join9(path2,VERCEL_DIR)),await writeFileNoFollow(join9(path2,VERCEL_DIR,VERCEL_DIR_README),VERCEL_DIR_README_CONTENT,root)}async function linkFolderToProject(client,path2,projectLink,projectName,orgSlug,successEmoji="link",autoConfirm=!1,pullEnv=!0,resultLabel="Linked"){if(await hasProjectLink(client,projectLink,path2))return;let root=getWriteCheckRoot(client.cwd,path2);try{await assertNotSymlinkedConfigPath(join9(path2,VERCEL_DIR)),await inspectLinkFiles(path2,[VERCEL_DIR_PROJECT,VERCEL_DIR_README],root),await(0,import_fs_extra5.ensureDir)(join9(path2,VERCEL_DIR))}catch(err){if((0,import_error_utils5.isErrnoException)(err)&&err.code==="ENOTDIR")return;throw err}if(await writeFileNoFollow(join9(path2,VERCEL_DIR,VERCEL_DIR_PROJECT),JSON.stringify({...projectLink,projectName}),root),await writeReadme(path2,root),await addToGitIgnore(path2),output_manager_default.print(`
|
|
66
66
|
`),printAlignedLabel(resultLabel,`${orgSlug}/${projectName}`,{gutter:"\u2713"}),!pullEnv||!client.stdin.isTTY||client.nonInteractive)return;if(output_manager_default.print(`
|
|
67
|
-
`),autoConfirm||await client.input.confirm("Pull development environment variables into .env.local?",!0)){let originalCwd=client.cwd;try{client.cwd=path2;let args=autoConfirm?["--yes"]:[],{default:pull}=await import("./pull-4LISUHDN.js");await pull(client,args,"vercel-cli:link")!==0&&output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}catch(error){error instanceof EnvFileSymlinkError?warnEnvFileSymlink(client,error):output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}finally{client.cwd=originalCwd}}}function localConfigFlagPath(){let customPath=parseArguments(process.argv.slice(2),{},{permissive:!0}).flags["--local-config"];if(customPath){if(typeof customPath!="string")throw new InvalidLocalConfig(customPath);return path.resolve(process.cwd(),customPath)}}function getLocalPathConfig(prefix,useCompiledConfig=!0){let customPath=localConfigFlagPath();if(customPath)return customPath;let vercelConfigPath=path.join(prefix,"vercel.json"),vercelTomlPath=path.join(prefix,"vercel.toml"),nowConfigPath=path.join(prefix,"now.json"),vercelConfigExists=existsSync(vercelConfigPath),vercelTomlExists=existsSync(vercelTomlPath),nowConfigExists=existsSync(nowConfigPath),foundConfigs=[];if(vercelConfigExists&&foundConfigs.push(vercelConfigPath),vercelTomlExists&&foundConfigs.push(vercelTomlPath),nowConfigExists)throw new DeprecatedNowJson(nowConfigPath);if(foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs);let compiledConfigPath=path.join(prefix,VERCEL_DIR,"vercel.json"),compiledConfigExists=existsSync(compiledConfigPath);return useCompiledConfig&&compiledConfigExists?compiledConfigPath:vercelConfigPath}var VERCEL_CONFIG_EXTENSIONS=["ts","mts","js","mjs","cjs"],DEFAULT_VERCEL_CONFIG_FILENAME="Vercel config";var globalDir,getVercelDir=()=>globalDir??=getGlobalPathConfig(),readConfigFile=()=>config.readGlobalConfigFile(getConfigFilePath2()),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(getConfigFilePath2(),stuff)}catch(err){throw(0,import_error_utils6.isErrnoException)(err)&&((0,import_error_utils6.isErrnoException)(err)&&err.code==="EPERM"?(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>{if(isDpopLoginEnabled()){let dpopLogin=readDpopCredentials(getVercelDir());return{...config.getDefaultAuthConfig(),...dpopLogin?.dpop&&dpopLogin}}return{...config.getDefaultAuthConfig(),...readCliAuthConfig(getVercelDir())}},persistAuthConfig=(authConfig,_globalConfig)=>{let isDpopLogin=isDpopLoginEnabled()||!!authConfig.dpop;try{return isDpopLogin?persistDpopCliAuthConfig(getVercelDir(),authConfig):persistCliAuthConfig(getVercelDir(),authConfig)}catch(err){throw notAbleToCreate(isDpopLogin?getDpopAuthConfigFilePath2():getAuthConfigFilePath2(),err)}},readSavedLogin=globalConfig=>{try{let authConfig=readAuthConfigFile(globalConfig);return config.authConfigHasUsableTokenData(authConfig)?{status:"found",authConfig}:{status:"missing"}}catch(error){return(0,import_error_utils6.isErrnoException)(error)&&error.code==="ENOENT"?{status:"missing"}:{status:"unreadable"}}};function getSavedLoginFilePath(authConfig){return isDpopLoginEnabled()||!!authConfig.dpop?getDpopAuthConfigFilePath2():getAuthConfigFilePath2()}function getSavedLoginLockPath(authConfig){return`${getSavedLoginFilePath(authConfig)}.lock`}function notAbleToCreate(filePath,err){let wrappedError=new Error(`Not able to create ${humanizePath(filePath)} (${(0,import_error_utils6.errorToStringFriendly)(err)}).`);return wrappedError.cause=err,wrappedError}function getConfigFilePath2(){return config.getConfigFilePath(getVercelDir())}function getAuthConfigFilePath2(){return config.getAuthConfigFilePath(getVercelDir())}function getDpopAuthConfigFilePath2(){return config.getDpopAuthConfigFilePath(getVercelDir())}function readLocalConfig(prefix=process.cwd()){let config2,target="";try{target=getLocalPathConfig(prefix)}catch(err){if(err instanceof NowError)output_manager_default.error(err.message),process.exit(1);else throw err}if(!target)return;try{accessSync3(target,constants3.F_OK),config2=import_load_json_file.default.sync(target)}catch(err){if(!((0,import_error_utils6.isErrnoException)(err)&&err.code==="ENOENT"))if((0,import_error_utils6.isError)(err)&&err.name==="JSONError")output_manager_default.error(err.message),process.exit(1);else if((0,import_error_utils6.isErrnoException)(err)){let code2=err.code?` (${err.code})`:"";output_manager_default.error(`Failed to read config file: ${target}${code2}`),process.exit(1)}else output_manager_default.prettyError(err),process.exit(1)}if(!config2)return;if(basename3(target)==="vercel.json"&&basename3(dirname3(target))===VERCEL_DIR){let workPath=dirname3(dirname3(target)),sourceFile=null;for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join10(workPath,`vercel.${ext}`);try{accessSync3(configPath,constants3.F_OK),sourceFile=basename3(configPath);break}catch{}}if(!sourceFile){let tomlPath=join10(workPath,"vercel.toml");try{accessSync3(tomlPath,constants3.F_OK),sourceFile="vercel.toml"}catch{}}config2[import_types.fileNameSymbol]=sourceFile||DEFAULT_VERCEL_CONFIG_FILENAME}else config2[import_types.fileNameSymbol]=basename3(target);return config2}function createTraceContext(span){return{span,budget:{remaining:1e3,dropped:0}}}function startTrace(parent,name,attrs){if(parent){if(parent.budget.remaining<=0){parent.budget.dropped++;return}return parent.budget.remaining--,{span:parent.span.child(name,attrs),budget:parent.budget}}}function stopTrace(trace,droppedBefore){if(!trace)return;let dropped=trace.budget.dropped-droppedBefore;dropped&&trace.span.setAttributes({dropped_spans:String(dropped)}),trace.span.stop()}async function traceOperation(parent,name,operation,attrs){let droppedBefore=parent?.budget.dropped??0,trace=startTrace(parent,name,attrs);try{return await operation(trace)}catch(error){throw trace?.span.setAttributes({error:"true"}),error}finally{stopTrace(trace,droppedBefore)}}var ROUTES=[["files","/v*/files"],["(?:now/)?deployments/[^/]+/events","/v*/deployments/:deployment/events"],["env/pull/[^/]+","/v*/env/pull/:deployment"],["deployments/[^/]+/builds/function-descriptors","/v*/deployments/:deployment/builds/function-descriptors"],["user","/v*/user"],["teams","/v*/teams"],["teams/[^/]+","/v*/teams/:team"],["projects","/v*/projects"],["projects/[^/]+","/v*/projects/:project"],["projects/[^/]+/env","/v*/projects/:project/env"],["projects/[^/]+/logs","/v*/projects/:project/logs"],["deployments","/v*/deployments"],["deployments/[^/]+","/v*/deployments/:deployment"],["deployments/[^/]+/builds","/v*/deployments/:deployment/builds"]].map(([pattern,route])=>({pattern:new RegExp(`^/v[0-9]+/${pattern}/?$`),route}));function requestTraceAttributes(url,method="GET"){let path2=String(url).split(/[?#]/,1)[0].replace(/^https?:\/\/[^/]+/i,""),normalizedMethod=method.toUpperCase();return{http_method:["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"].includes(normalizedMethod)?normalizedMethod:"OTHER",http_route:ROUTES.find(route=>route.pattern.test(path2))?.route??"other"}}function traceResponseBody(response,request,budget={remaining:1e3,dropped:0}){if(!request)return;for(let method of["json","text","arrayBuffer","blob","formData"]){let original=response[method];if(typeof original!="function")continue;let read=original.bind(response);Object.defineProperty(response,method,{configurable:!0,writable:!0,value:async()=>{let span=startTrace({span:request,budget},"vc.cli.api.body")?.span;try{return await read()}catch(error){throw span?.setAttributes({error:"true"}),error}finally{span?.stop()}}})}let clone=response.clone.bind(response);Object.defineProperty(response,"clone",{configurable:!0,writable:!0,value:()=>{let copy=clone();return traceResponseBody(copy,request,budget),copy}})}function sharedPromise(fn){let promise=null;return function(...args){return promise||(promise=fn.apply(this,args),promise.finally(()=>{promise=null})),promise}}var import_error_utils8=__toESM(require_dist(),1);function sleep(ms2){return new Promise(resolve5=>{setTimeout(resolve5,ms2)})}var import_ms=__toESM(require_ms(),1);var LoginRefreshError=class extends Error{constructor(reason,options={}){super(loginRefreshMessage(reason,options),{cause:options.cause});this.code=reason==="rate_limited"?"RATE_LIMITED":"LOGIN_REFRESH_FAILED"}};function rateLimitRecovery(retryAfterMs){if(retryAfterMs===void 0)return"Wait a minute, then run the command again.";if(retryAfterMs<=0)return"Run the command again.";let seconds=Math.ceil(retryAfterMs/1e3);return`Try again in ${(0,import_ms.default)(seconds*1e3,{long:!0})}.`}function loginRefreshMessage(reason,options){let failed="Couldn't refresh your login.",kept="Your login was kept.",rerun="Run the command again.";switch(reason){case"rate_limited":return`${failed} Too many requests to the Vercel API. ${kept} ${rateLimitRecovery(options.retryAfterMs)}`;case"unreadable_login":{let where=options.file?` in ${humanizePath(options.file)}`:"";return`${failed} The saved login${where} can't be read. ${kept} ${rerun}`}case"login_changed":return`${failed} Another process changed the saved login. ${kept} ${rerun}`;case"another_login":return`${failed} Another login was saved while this command ran. Run the command again to use it.`;case"server_error":return`${failed} The Vercel API returned an error. ${kept} ${rerun} If it fails again, run ${getCommandName("login")}.`}}var import_error_utils7=__toESM(require_dist(),1);import{randomUUID as randomUUID2}from"node:crypto";import{closeSync,openSync,readFileSync,rmSync,statSync,writeSync}from"node:fs";var STALE_AFTER_MS=3e4,MAX_WAIT_MS=1e4,POLL_INTERVAL_MS=50;async function withLoginRefreshLock(lockPath,fn){let owner=await acquire(lockPath);try{return await fn()}finally{owner&&release(lockPath,owner)}}async function acquire(lockPath){let owner=`${process.pid} ${randomUUID2()}`,deadline=Date.now()+MAX_WAIT_MS;for(;;){try{let fd=openSync(lockPath,"wx",384);try{writeSync(fd,owner)}finally{closeSync(fd)}return owner}catch(error){if(!(0,import_error_utils7.isErrnoException)(error)||error.code!=="EEXIST"){output_manager_default.debug(`Couldn't create the login refresh lock, continuing without it: ${String(error)}`);return}}if(isAbandoned(lockPath)){try{rmSync(lockPath)}catch(error){if(!(0,import_error_utils7.isErrnoException)(error)||error.code!=="ENOENT")return}continue}if(Date.now()>=deadline){output_manager_default.debug("Another process holds the login refresh lock, continuing without it.");return}await sleep(POLL_INTERVAL_MS)}}function release(lockPath,owner){try{readFileSync(lockPath,"utf8")===owner&&rmSync(lockPath,{force:!0})}catch{}}function isAbandoned(lockPath){try{if(Date.now()-statSync(lockPath).mtimeMs>STALE_AFTER_MS)return!0;let pid=Number.parseInt(readFileSync(lockPath,"utf8"),10);return Number.isInteger(pid)&&pid>0&&!isProcessRunning(pid)}catch{return!1}}function isProcessRunning(pid){try{return process.kill(pid,0),!0}catch(error){return(0,import_error_utils7.isErrnoException)(error)&&error.code==="EPERM"}}var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let cached=client.tokenIntrospection;if(cached&&cached.token===token)return cached.promise;let promise=requestIntrospection(token),entry={token,promise};return client.tokenIntrospection=entry,promise.catch(()=>{client.tokenIntrospection===entry&&(client.tokenIntrospection=void 0)}),promise}async function introspectTokenUserId(apiUrl,token){try{if(new URL(apiUrl).origin!==VERCEL_API_ORIGIN)return;let introspection=await requestIntrospection(token);return introspection.active?introspection.sub:void 0}catch{return}}async function requestIntrospection(token){let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}var PromptCanceledError=class extends Error{constructor(){super("Prompt canceled"),this.name="PromptCanceledError"}},PromptBackError=class extends Error{constructor(){super("Prompt back"),this.name="PromptBackError"}};function isPromptBackError(error){return error instanceof PromptBackError}function isPromptCanceledError(error){return error instanceof PromptCanceledError?!0:error instanceof Error&&error.message.includes("User force closed the prompt")}var TEAM_NOT_CHOSEN="",DOMAINS_API_PATH=/^\/v\d+\/(?:domains|registrar)(?:\/|$)/,MAX_TRACED_REQUESTS=200,AUTH_HOSTS=new Set(["api.vercel.com","vercel.com","www.vercel.com","vercel-schedules.com"]),MAX_LOGIN_REFRESH_ATTEMPTS=3,SAVED_LOGIN_READ_RETRY_MS=50,MAX_REFRESH_REQUESTS=2,REFRESH_RETRY_DELAY_MS=250,MAX_SAVED_LOGIN_READS=3;function isSameLogin(a,b){return a.token===b.token&&a.refreshToken===b.refreshToken}function isNewerLogin(login,other){return isValidAccessToken(login)||(login.expiresAt??0)>(other.expiresAt??0)}var isSAMLError=v=>v&&v.saml,isJSONObject=v=>v&&typeof v=="object"&&v.constructor===Object;function isValidAccessToken(authConfig){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3);return authConfig.expiresAt>=nowInSeconds}function hasRefreshToken(authConfig){return"refreshToken"in authConfig}function canResend(body){return body==null||typeof body=="string"||body instanceof Uint8Array||body instanceof URLSearchParams}var Client=class extends EventEmitter{constructor(opts){super();this._argv=[];this.invocationCwd=process.cwd();this.retiredDpopKeys=[];this.traceStorage=new AsyncLocalStorage;this.tracedRequests=0;this._loggedTokenSource=!1;this.escapePromptCancellationDepth=0;this.promptBackNavigationDepth=0;this.getAuthHeaders=Object.assign(async(method,url)=>{let{token,dpop}=this.authConfig;return!token||!this.sendsAuthHeaders(url)?{}:dpop?{authorization:`DPoP ${token}`,dpop:createDpopProof(dpop.key,{method,url,accessToken:token})}:{authorization:`Bearer ${token}`}},{onResponse:(url,headers)=>{this.authConfig.dpop&&rememberDpopResponse(url,headers)}});this.reauthenticate=sharedPromise(async function(error){let{default:reauthenticate}=await import("./reauthenticate-U2LOFDFP.js");if(typeof await reauthenticate(this,error)=="number")throw error instanceof APIError?output_manager_default.prettyError(error):output_manager_default.error(`Failed to re-authenticate for ${(0,import_chalk5.bold)(error.scope)} scope`),error});this._onRetry=()=>{output_manager_default.debug("Retrying request\u2026")};this.setArgv(opts.argv),this.apiUrl=opts.apiUrl,this.authConfig=opts.authConfig,this.stdin=opts.stdin,this.stdout=opts.stdout,this.stderr=opts.stderr,this.config=opts.config,this.savedTeam=opts.config.currentTeam,this.localConfig=opts.localConfig,this.localConfigPath=opts.localConfigPath,this.requestIdCounter=1,this.telemetryEventStore=opts.telemetryEventStore,this.isAgent=opts.isAgent??!1,this.agentName=opts.agentName,this.nonInteractive=opts.nonInteractive??this.isAgent,this.ignoresSavedTeam=this.isAgent&&this.nonInteractive,this.dangerouslySkipPermissions=opts.dangerouslySkipPermissions??!1;let theme={prefix:(0,import_chalk5.gray)("?"),style:{answer:import_chalk5.gray}};this.input={text:async opts2=>{let{default:input}=await import("./esm-QQ3MUOW4.js");return this.runPrompt(input({theme,...opts2},{input:this.stdin,output:this.stderr}))},password:async opts2=>{let{default:password}=await import("./esm-NHCCFW7Z.js");return this.runPrompt(password({theme,...opts2},{input:this.stdin,output:this.stderr}))},checkbox:async opts2=>{let{default:checkbox}=await import("./esm-5GQXHN7C.js");return this.runPrompt(checkbox({theme,...opts2},{input:this.stdin,output:this.stderr}))},expand:async opts2=>{let{default:expand}=await import("./esm-LEQXRLFV.js");return this.runPrompt(expand({theme,...opts2},{input:this.stdin,output:this.stderr}))},confirm:async(message,default_value,opts2)=>{let{default:confirm}=await import("./esm-FJCIOBBV.js"),prompt=confirm({theme,message,default:default_value},{input:this.stdin,output:this.stderr}),signal=opts2?.signal,cancel=()=>prompt.cancel();return signal?.aborted&&cancel(),signal?.addEventListener("abort",cancel,{once:!0}),this.runPrompt(prompt).finally(()=>signal?.removeEventListener("abort",cancel))},select:async opts2=>{let{default:select}=await import("./esm-T655CG6O.js");return this.runPrompt(select({theme,...opts2},{input:this.stdin,output:this.stderr}))},search:async opts2=>{let{default:search}=await import("./esm-IYH32MTQ.js");return this.runPrompt(search({theme,...opts2},{input:this.stdin,output:this.stderr}))}}}getTraceContext(){if(!this.telemetryEventStore.enabled||!this.rootSpan)return;let active=this.traceStorage.getStore();return active||(this.invocationTrace?.span!==this.rootSpan&&(this.invocationTrace=createTraceContext(this.rootSpan)),this.invocationTrace)}withTrace(name,operation,attrs){return traceOperation(this.getTraceContext(),name,trace=>trace?this.traceStorage.run(trace,()=>operation(trace)):operation(trace),attrs)}async withEscapePromptCancellation(run){this.escapePromptCancellationDepth++;try{return await run()}finally{this.escapePromptCancellationDepth--}}async withPromptBackNavigation(run){this.promptBackNavigationDepth++;try{return await run()}finally{this.promptBackNavigationDepth--}}runPrompt(prompt){let escapeCancellationEnabled=this.escapePromptCancellationDepth>0,backNavigationEnabled=this.promptBackNavigationDepth>0;if(!escapeCancellationEnabled&&!backNavigationEnabled||!this.stdin.isTTY||!prompt.cancel)return prompt;let cancellation,onKeypress=(_input,key)=>{key?.name==="escape"&&escapeCancellationEnabled&&!cancellation?(cancellation="escape",prompt.cancel?.()):key?.name==="up"&&backNavigationEnabled&&!cancellation&&(cancellation="back",prompt.cancel?.())};return this.stdin.on("keypress",onKeypress),prompt.catch(error=>{throw cancellation==="escape"?new PromptCanceledError:cancellation==="back"?new PromptBackError:error}).finally(()=>{this.stdin.off("keypress",onKeypress)})}get argv(){return this._argv}setArgv(argvOrFirst,...rest){let argv=Array.isArray(argvOrFirst)?argvOrFirst:[argvOrFirst,...rest];this._argv=argv,this._parsedArgsCache=void 0}getParsedArgs(){return this._parsedArgsCache||(this._parsedArgsCache=parseArguments(this.argv.slice(2),{},{permissive:!0})),this._parsedArgsCache}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}async ensureAuthorized(){let{authConfig}=this;if(isValidAccessToken(authConfig)){this._loggedTokenSource||(authConfig.tokenSource==="flag"?output_manager_default.debug("Using token from the `--token` option, skipping token refresh."):authConfig.tokenSource==="env"?output_manager_default.debug("Using token from VERCEL_TOKEN environment variable, skipping token refresh."):output_manager_default.debug("Valid access token, skipping token refresh."),this._loggedTokenSource=!0);return}return this.loginRefresh??=this.refreshLogin().finally(()=>{this.loginRefresh=void 0}),this.loginRefresh}async refreshLogin(){let{token,refreshToken,skipWrite,tokenSource}=this.authConfig;if(!token&&!refreshToken){output_manager_default.debug("No login found, skipping token refresh.");return}let sharesSavedLogin=!skipWrite&&!tokenSource,refused=sharesSavedLogin?await withLoginRefreshLock(getSavedLoginLockPath(this.authConfig),()=>this.refreshExpiredLogin(!0)):await this.refreshExpiredLogin(!1);if(!refused)return;output_manager_default.debug(`Stored session refresh failed: ${refused.error.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");let{performDeviceCodeFlow}=await import("./future-3AUPMPY7.js"),recoveredTokens=await performDeviceCodeFlow(this);if(recoveredTokens){this.updateAuthConfig({token:recoveredTokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+recoveredTokens.expires_in,refreshToken:recoveredTokens.refresh_token,dpop:recoveredTokens.dpop}),this.persistAuthConfig();return}if(!this.sharesSavedLogin(sharesSavedLogin)){this.removeRefusedLogin(refused.dpopKey);return}await withLoginRefreshLock(getSavedLoginLockPath(this.authConfig),async()=>{let login=await this.useSavedLogin("refused");if(login==="unreadable")throw this.unreadableLoginError();if(login==="unidentified")throw new LoginRefreshError("another_login");if(login==="own"){this.removeRefusedLogin(refused.dpopKey);return}if(isValidAccessToken(this.authConfig))return;let refusedAgain=await this.refreshExpiredLogin(!0);refusedAgain&&this.removeRefusedLogin(refusedAgain.dpopKey)})}async refreshExpiredLogin(sharesSavedLogin){let own="expired",refused;for(let attempt=1;;attempt++){if(this.sharesSavedLogin(sharesSavedLogin)){hasRefreshToken(this.authConfig)||(own="refused");let login=await this.useSavedLogin(own);if(login==="unreadable")throw this.unreadableLoginError(refused?.error);if(login==="unidentified")throw new LoginRefreshError("another_login",{cause:refused?.error});if(login==="saved"){if(isValidAccessToken(this.authConfig)){output_manager_default.debug("Another process refreshed the saved login, skipping token refresh.");return}own="expired",refused=void 0}}let{authConfig}=this;if(refused){if(!authConfig.tokenSource&&this.stdin.isTTY&&!this.nonInteractive)return refused;this.removeRefusedLogin(refused.dpopKey);return}if(!hasRefreshToken(authConfig)){output_manager_default.debug("No refresh token found, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}if(attempt>MAX_LOGIN_REFRESH_ATTEMPTS)throw new LoginRefreshError("login_changed");let dpopKey=authConfig.dpop?.key,{response:tokenResponse,result}=await this.requestRefreshedTokens(authConfig.refreshToken,dpopKey),[tokensError,tokens]=result;if(!tokensError){this.sharesSavedLogin(sharesSavedLogin)&&!await this.canSaveRefreshedLogin(authConfig,tokens.access_token)&&this.stopSavingLogin(),this.updateAuthConfig({token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in}),tokens.refresh_token&&this.updateAuthConfig({refreshToken:tokens.refresh_token}),this.persistAuthConfig(),output_manager_default.debug("Tokens refreshed successfully.");return}let loginIsGone=isOAuthError(tokensError)&&tokensError.code==="invalid_grant";if(output_manager_default.debug(`Login refresh failed: HTTP ${tokenResponse.status}, ${isOAuthError(tokensError)?tokensError.cause.message:tokensError.message}, request ${tokenResponse.headers.get("x-vercel-id")??"unknown"}`),!loginIsGone)throw dpopKey?new DpopRefreshError(isOAuthError(tokensError)?tokensError.cause:tokensError):new LoginRefreshError(tokenResponse.status===429?"rate_limited":"server_error",{cause:tokensError,retryAfterMs:parseRetryAfterHeaderAsMillis(tokenResponse.headers.get("retry-after"))});refused={error:tokensError,dpopKey},own="refused"}}async requestRefreshedTokens(refreshToken,dpopKey){for(let request=1;;request++){let response=await refreshTokenRequest({refresh_token:refreshToken,dpopKey}),isJson=!0,result=await processTokenResponse(response,{dpop:!!dpopKey}).catch(()=>(isJson=!1,[new TypeError("Expected the token response to be JSON")]));if(!(response.status>=500||response.ok&&!isJson)||request===MAX_REFRESH_REQUESTS)return{response,result};output_manager_default.debug(`Login refresh got HTTP ${response.status}, sending the request one more time.`),await sleep(REFRESH_RETRY_DELAY_MS)}}sharesSavedLogin(sharedAtStart){return sharedAtStart&&!this.authConfig.skipWrite}stopSavingLogin(){output_manager_default.debug("The saved login is no longer the login of this run. This run keeps its login and no longer saves it."),this.authConfig={...this.authConfig,skipWrite:!0}}async useSavedLogin(own){for(let read=1;read<=MAX_SAVED_LOGIN_READS;read++){let saved=await this.readSavedLoginTwice();if(saved.status==="unreadable")return output_manager_default.debug("Couldn't read the saved login."),"unreadable";if(saved.status==="missing")return"own";let current=this.authConfig,next=saved.authConfig;if(isSameLogin(next,current))return"own";let user=await this.savedLoginUser(next);if(this.isSavedLogin(next)){if(user==="other")return this.stopSavingLogin(),"own";if(own==="expired"){if(user!=="same"||!isNewerLogin(next,current))return"own"}else if(user!=="same")return"unidentified";return next.token!==current.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),this.authConfig={...next,userId:current.userId,cachedUser:next.cachedUser??current.cachedUser},"saved"}}return own==="refused"?"unidentified":"own"}async readSavedLoginTwice(){let saved=readSavedLogin(this.config);return saved.status!=="unreadable"?saved:(await sleep(SAVED_LOGIN_READ_RETRY_MS),readSavedLogin(this.config))}isSavedLogin(login){let saved=readSavedLogin(this.config);return saved.status==="found"&&isSameLogin(saved.authConfig,login)}persistLoginDetails(){if(!this.authConfig.skipWrite&&!this.isSavedLogin(this.authConfig)){output_manager_default.debug("The saved login is not the login of this run, so its details were not saved.");return}this.persistAuthConfig()}async savedLoginUser(saved){let own=this.authConfig.userId;if(!own)return"unknown";let theirs=saved.userId;return!theirs&&saved.token&&isValidAccessToken(saved)&&(theirs=await introspectTokenUserId(this.apiUrl,saved.token)),theirs?theirs===own?"same":"other":"unknown"}async canSaveRefreshedLogin(sent,newToken){let saved=await this.readSavedLoginTwice();if(saved.status!=="found")return!1;let next=saved.authConfig;return isSameLogin(next,sent)||next.token===newToken?!0:!isNewerLogin(next,sent)&&!!sent.userId&&next.userId===sent.userId}unreadableLoginError(cause){return new LoginRefreshError("unreadable_login",{cause,file:getSavedLoginFilePath(this.authConfig)})}removeRefusedLogin(dpopKey){output_manager_default.debug("Error refreshing token, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig(),dpopKey&&output_manager_default.warning(`Couldn't refresh your DPoP login, so it was removed. To log in with DPoP again, run ${cmd(`__VERCEL_FF_DPOP=1 ${packageName} login`)}.`)}getGlobalPathConfig(){let confFlag=this.getParsedArgs().flags["--global-config"];return typeof confFlag=="string"?resolve4(getInvocationCwd(),confFlag):(0,import_cli_config.getGlobalPathConfig)()}async readConfig(fileName,schema){let filePath=join11(this.getGlobalPathConfig(),fileName);return(0,import_cli_config.readConfigFile)(filePath,schema)}async maybeReadConfig(fileName,schema){try{return await this.readConfig(fileName,schema)}catch{return null}}async writeConfig(fileName,schema,value){let filePath=join11(this.getGlobalPathConfig(),fileName);(0,import_cli_config.writeConfigFile)(filePath,schema,value)}updateConfig(config2){this.config={...this.config,...config2},"currentTeam"in config2&&(this.savedTeam=config2.currentTeam)}writeToConfigFile(config2=this.config){writeToConfigFile({...config2,currentTeam:this.savedTeam})}isTeamUnchosen(){return this.ignoresSavedTeam&&this.config.currentTeam===TEAM_NOT_CHOSEN}needsTeamChoice(url,opts){return this.isTeamUnchosen()&&!opts.teamOptional&&!opts.accountId&&opts.useCurrentTeam!==!1&&!new URL2(url,this.apiUrl).searchParams.has("teamId")}chooseTeam({ask=!0}={}){return ask?(this.teamChoice??=this.applyTeamChoice(!0).finally(()=>{this.teamChoice=void 0}),this.teamChoice):this.applyTeamChoice(!1)}async applyTeamChoice(ask){let{resolveAgentTeam}=await import("./resolve-agent-team-D7RFR6WL.js"),team=await resolveAgentTeam(this,{ask});team!==null&&this.isTeamUnchosen()&&(this.config.currentTeam=team)}async resolveCurrentTeam({ask=!0}={}){return this.isTeamUnchosen()&&await this.chooseTeam({ask}),this.isTeamUnchosen()?void 0:this.config.currentTeam}updateAuthConfig(authConfig){authConfig.token&&authConfig.token!==this.authConfig.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),"dpop"in authConfig&&this.releaseDpopKey(authConfig.dpop?.key),this.authConfig={...this.authConfig,...authConfig}}emptyAuthConfig(){this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0,this.releaseDpopKey(void 0),this.authConfig=this.authConfig.skipWrite?{skipWrite:!0}:{}}releaseDpopKey(nextKey){let key=this.authConfig.dpop?.key;key&&!isSameDpopKey(key,nextKey)&&this.retiredDpopKeys.push(key)}persistAuthConfig(){if(persistAuthConfig(this.authConfig,this.config),this.authConfig.skipWrite)return;let currentKey=this.authConfig.dpop?.key;for(let key of this.retiredDpopKeys.splice(0))isSameDpopKey(key,currentKey)||deleteDpopKey(key)}async confirmMutatingOperation(url,method){if(!((method||"GET").toUpperCase()==="DELETE"))return!0;if(this.isAgent&&this.dangerouslySkipPermissions){let agentInfo=this.agentName?` (${this.agentName})`:"";output_manager_default.print(`
|
|
67
|
+
`),autoConfirm||await client.input.confirm("Pull development environment variables into .env.local?",!0)){let originalCwd=client.cwd;try{client.cwd=path2;let args=autoConfirm?["--yes"]:[],{default:pull}=await import("./pull-MGQ2TMA3.js");await pull(client,args,"vercel-cli:link")!==0&&output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}catch(error){error instanceof EnvFileSymlinkError?warnEnvFileSymlink(client,error):output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}finally{client.cwd=originalCwd}}}function localConfigFlagPath(){let customPath=parseArguments(process.argv.slice(2),{},{permissive:!0}).flags["--local-config"];if(customPath){if(typeof customPath!="string")throw new InvalidLocalConfig(customPath);return path.resolve(process.cwd(),customPath)}}function getLocalPathConfig(prefix,useCompiledConfig=!0){let customPath=localConfigFlagPath();if(customPath)return customPath;let vercelConfigPath=path.join(prefix,"vercel.json"),vercelTomlPath=path.join(prefix,"vercel.toml"),nowConfigPath=path.join(prefix,"now.json"),vercelConfigExists=existsSync(vercelConfigPath),vercelTomlExists=existsSync(vercelTomlPath),nowConfigExists=existsSync(nowConfigPath),foundConfigs=[];if(vercelConfigExists&&foundConfigs.push(vercelConfigPath),vercelTomlExists&&foundConfigs.push(vercelTomlPath),nowConfigExists)throw new DeprecatedNowJson(nowConfigPath);if(foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs);let compiledConfigPath=path.join(prefix,VERCEL_DIR,"vercel.json"),compiledConfigExists=existsSync(compiledConfigPath);return useCompiledConfig&&compiledConfigExists?compiledConfigPath:vercelConfigPath}var VERCEL_CONFIG_EXTENSIONS=["ts","mts","js","mjs","cjs"],DEFAULT_VERCEL_CONFIG_FILENAME="Vercel config";var globalDir,getVercelDir=()=>globalDir??=getGlobalPathConfig(),readConfigFile=()=>config.readGlobalConfigFile(getConfigFilePath2()),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(getConfigFilePath2(),stuff)}catch(err){throw(0,import_error_utils6.isErrnoException)(err)&&((0,import_error_utils6.isErrnoException)(err)&&err.code==="EPERM"?(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>{if(isDpopLoginEnabled()){let dpopLogin=readDpopCredentials(getVercelDir());return{...config.getDefaultAuthConfig(),...dpopLogin?.dpop&&dpopLogin}}return{...config.getDefaultAuthConfig(),...readCliAuthConfig(getVercelDir())}},persistAuthConfig=(authConfig,_globalConfig)=>{let isDpopLogin=isDpopLoginEnabled()||!!authConfig.dpop;try{return isDpopLogin?persistDpopCliAuthConfig(getVercelDir(),authConfig):persistCliAuthConfig(getVercelDir(),authConfig)}catch(err){throw notAbleToCreate(isDpopLogin?getDpopAuthConfigFilePath2():getAuthConfigFilePath2(),err)}},readSavedLogin=globalConfig=>{try{let authConfig=readAuthConfigFile(globalConfig);return config.authConfigHasUsableTokenData(authConfig)?{status:"found",authConfig}:{status:"missing"}}catch(error){return(0,import_error_utils6.isErrnoException)(error)&&error.code==="ENOENT"?{status:"missing"}:{status:"unreadable"}}};function getSavedLoginFilePath(authConfig){return isDpopLoginEnabled()||!!authConfig.dpop?getDpopAuthConfigFilePath2():getAuthConfigFilePath2()}function getSavedLoginLockPath(authConfig){return`${getSavedLoginFilePath(authConfig)}.lock`}function notAbleToCreate(filePath,err){let wrappedError=new Error(`Not able to create ${humanizePath(filePath)} (${(0,import_error_utils6.errorToStringFriendly)(err)}).`);return wrappedError.cause=err,wrappedError}function getConfigFilePath2(){return config.getConfigFilePath(getVercelDir())}function getAuthConfigFilePath2(){return config.getAuthConfigFilePath(getVercelDir())}function getDpopAuthConfigFilePath2(){return config.getDpopAuthConfigFilePath(getVercelDir())}function readLocalConfig(prefix=process.cwd()){let config2,target="";try{target=getLocalPathConfig(prefix)}catch(err){if(err instanceof NowError)output_manager_default.error(err.message),process.exit(1);else throw err}if(!target)return;try{accessSync3(target,constants3.F_OK),config2=import_load_json_file.default.sync(target)}catch(err){if(!((0,import_error_utils6.isErrnoException)(err)&&err.code==="ENOENT"))if((0,import_error_utils6.isError)(err)&&err.name==="JSONError")output_manager_default.error(err.message),process.exit(1);else if((0,import_error_utils6.isErrnoException)(err)){let code2=err.code?` (${err.code})`:"";output_manager_default.error(`Failed to read config file: ${target}${code2}`),process.exit(1)}else output_manager_default.prettyError(err),process.exit(1)}if(!config2)return;if(basename3(target)==="vercel.json"&&basename3(dirname3(target))===VERCEL_DIR){let workPath=dirname3(dirname3(target)),sourceFile=null;for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join10(workPath,`vercel.${ext}`);try{accessSync3(configPath,constants3.F_OK),sourceFile=basename3(configPath);break}catch{}}if(!sourceFile){let tomlPath=join10(workPath,"vercel.toml");try{accessSync3(tomlPath,constants3.F_OK),sourceFile="vercel.toml"}catch{}}config2[import_types.fileNameSymbol]=sourceFile||DEFAULT_VERCEL_CONFIG_FILENAME}else config2[import_types.fileNameSymbol]=basename3(target);return config2}function createTraceContext(span){return{span,budget:{remaining:1e3,dropped:0}}}function startTrace(parent,name,attrs){if(parent){if(parent.budget.remaining<=0){parent.budget.dropped++;return}return parent.budget.remaining--,{span:parent.span.child(name,attrs),budget:parent.budget}}}function stopTrace(trace,droppedBefore){if(!trace)return;let dropped=trace.budget.dropped-droppedBefore;dropped&&trace.span.setAttributes({dropped_spans:String(dropped)}),trace.span.stop()}async function traceOperation(parent,name,operation,attrs){let droppedBefore=parent?.budget.dropped??0,trace=startTrace(parent,name,attrs);try{return await operation(trace)}catch(error){throw trace?.span.setAttributes({error:"true"}),error}finally{stopTrace(trace,droppedBefore)}}var ROUTES=[["files","/v*/files"],["(?:now/)?deployments/[^/]+/events","/v*/deployments/:deployment/events"],["env/pull/[^/]+","/v*/env/pull/:deployment"],["deployments/[^/]+/builds/function-descriptors","/v*/deployments/:deployment/builds/function-descriptors"],["user","/v*/user"],["teams","/v*/teams"],["teams/[^/]+","/v*/teams/:team"],["projects","/v*/projects"],["projects/[^/]+","/v*/projects/:project"],["projects/[^/]+/env","/v*/projects/:project/env"],["projects/[^/]+/logs","/v*/projects/:project/logs"],["deployments","/v*/deployments"],["deployments/[^/]+","/v*/deployments/:deployment"],["deployments/[^/]+/builds","/v*/deployments/:deployment/builds"]].map(([pattern,route])=>({pattern:new RegExp(`^/v[0-9]+/${pattern}/?$`),route}));function requestTraceAttributes(url,method="GET"){let path2=String(url).split(/[?#]/,1)[0].replace(/^https?:\/\/[^/]+/i,""),normalizedMethod=method.toUpperCase();return{http_method:["GET","HEAD","POST","PUT","PATCH","DELETE","OPTIONS"].includes(normalizedMethod)?normalizedMethod:"OTHER",http_route:ROUTES.find(route=>route.pattern.test(path2))?.route??"other"}}function traceResponseBody(response,request,budget={remaining:1e3,dropped:0}){if(!request)return;for(let method of["json","text","arrayBuffer","blob","formData"]){let original=response[method];if(typeof original!="function")continue;let read=original.bind(response);Object.defineProperty(response,method,{configurable:!0,writable:!0,value:async()=>{let span=startTrace({span:request,budget},"vc.cli.api.body")?.span;try{return await read()}catch(error){throw span?.setAttributes({error:"true"}),error}finally{span?.stop()}}})}let clone=response.clone.bind(response);Object.defineProperty(response,"clone",{configurable:!0,writable:!0,value:()=>{let copy=clone();return traceResponseBody(copy,request,budget),copy}})}function sharedPromise(fn){let promise=null;return function(...args){return promise||(promise=fn.apply(this,args),promise.finally(()=>{promise=null})),promise}}var import_error_utils8=__toESM(require_dist(),1);function sleep(ms2){return new Promise(resolve5=>{setTimeout(resolve5,ms2)})}var import_ms=__toESM(require_ms(),1);var LoginRefreshError=class extends Error{constructor(reason,options={}){super(loginRefreshMessage(reason,options),{cause:options.cause});this.code=reason==="rate_limited"?"RATE_LIMITED":"LOGIN_REFRESH_FAILED"}};function rateLimitRecovery(retryAfterMs){if(retryAfterMs===void 0)return"Wait a minute, then run the command again.";if(retryAfterMs<=0)return"Run the command again.";let seconds=Math.ceil(retryAfterMs/1e3);return`Try again in ${(0,import_ms.default)(seconds*1e3,{long:!0})}.`}function loginRefreshMessage(reason,options){let failed="Couldn't refresh your login.",kept="Your login was kept.",rerun="Run the command again.";switch(reason){case"rate_limited":return`${failed} Too many requests to the Vercel API. ${kept} ${rateLimitRecovery(options.retryAfterMs)}`;case"unreadable_login":{let where=options.file?` in ${humanizePath(options.file)}`:"";return`${failed} The saved login${where} can't be read. ${kept} ${rerun}`}case"login_changed":return`${failed} Another process changed the saved login. ${kept} ${rerun}`;case"another_login":return`${failed} Another login was saved while this command ran. Run the command again to use it.`;case"server_error":return`${failed} The Vercel API returned an error. ${kept} ${rerun} If it fails again, run ${getCommandName("login")}.`}}var import_error_utils7=__toESM(require_dist(),1);import{randomUUID as randomUUID2}from"node:crypto";import{closeSync,openSync,readFileSync,rmSync,statSync,writeSync}from"node:fs";var STALE_AFTER_MS=3e4,MAX_WAIT_MS=1e4,POLL_INTERVAL_MS=50;async function withLoginRefreshLock(lockPath,fn){let owner=await acquire(lockPath);try{return await fn()}finally{owner&&release(lockPath,owner)}}async function acquire(lockPath){let owner=`${process.pid} ${randomUUID2()}`,deadline=Date.now()+MAX_WAIT_MS;for(;;){try{let fd=openSync(lockPath,"wx",384);try{writeSync(fd,owner)}finally{closeSync(fd)}return owner}catch(error){if(!(0,import_error_utils7.isErrnoException)(error)||error.code!=="EEXIST"){output_manager_default.debug(`Couldn't create the login refresh lock, continuing without it: ${String(error)}`);return}}if(isAbandoned(lockPath)){try{rmSync(lockPath)}catch(error){if(!(0,import_error_utils7.isErrnoException)(error)||error.code!=="ENOENT")return}continue}if(Date.now()>=deadline){output_manager_default.debug("Another process holds the login refresh lock, continuing without it.");return}await sleep(POLL_INTERVAL_MS)}}function release(lockPath,owner){try{readFileSync(lockPath,"utf8")===owner&&rmSync(lockPath,{force:!0})}catch{}}function isAbandoned(lockPath){try{if(Date.now()-statSync(lockPath).mtimeMs>STALE_AFTER_MS)return!0;let pid=Number.parseInt(readFileSync(lockPath,"utf8"),10);return Number.isInteger(pid)&&pid>0&&!isProcessRunning(pid)}catch{return!1}}function isProcessRunning(pid){try{return process.kill(pid,0),!0}catch(error){return(0,import_error_utils7.isErrnoException)(error)&&error.code==="EPERM"}}var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let cached=client.tokenIntrospection;if(cached&&cached.token===token)return cached.promise;let promise=requestIntrospection(token),entry={token,promise};return client.tokenIntrospection=entry,promise.catch(()=>{client.tokenIntrospection===entry&&(client.tokenIntrospection=void 0)}),promise}async function introspectTokenUserId(apiUrl,token){try{if(new URL(apiUrl).origin!==VERCEL_API_ORIGIN)return;let introspection=await requestIntrospection(token);return introspection.active?introspection.sub:void 0}catch{return}}async function requestIntrospection(token){let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}var PromptCanceledError=class extends Error{constructor(){super("Prompt canceled"),this.name="PromptCanceledError"}},PromptBackError=class extends Error{constructor(){super("Prompt back"),this.name="PromptBackError"}};function isPromptBackError(error){return error instanceof PromptBackError}function isPromptCanceledError(error){return error instanceof PromptCanceledError?!0:error instanceof Error&&error.message.includes("User force closed the prompt")}var TEAM_NOT_CHOSEN="",DOMAINS_API_PATH=/^\/v\d+\/(?:domains|registrar)(?:\/|$)/,MAX_TRACED_REQUESTS=200,AUTH_HOSTS=new Set(["api.vercel.com","vercel.com","www.vercel.com","vercel-schedules.com"]),MAX_LOGIN_REFRESH_ATTEMPTS=3,SAVED_LOGIN_READ_RETRY_MS=50,MAX_REFRESH_REQUESTS=2,REFRESH_RETRY_DELAY_MS=250,MAX_SAVED_LOGIN_READS=3;function isSameLogin(a,b){return a.token===b.token&&a.refreshToken===b.refreshToken}function isNewerLogin(login,other){return isValidAccessToken(login)||(login.expiresAt??0)>(other.expiresAt??0)}var isSAMLError=v=>v&&v.saml,isJSONObject=v=>v&&typeof v=="object"&&v.constructor===Object;function isValidAccessToken(authConfig){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3);return authConfig.expiresAt>=nowInSeconds}function hasRefreshToken(authConfig){return"refreshToken"in authConfig}function canResend(body){return body==null||typeof body=="string"||body instanceof Uint8Array||body instanceof URLSearchParams}var Client=class extends EventEmitter{constructor(opts){super();this._argv=[];this.invocationCwd=process.cwd();this.retiredDpopKeys=[];this.traceStorage=new AsyncLocalStorage;this.tracedRequests=0;this._loggedTokenSource=!1;this.escapePromptCancellationDepth=0;this.promptBackNavigationDepth=0;this.getAuthHeaders=Object.assign(async(method,url)=>{let{token,dpop}=this.authConfig;return!token||!this.sendsAuthHeaders(url)?{}:dpop?{authorization:`DPoP ${token}`,dpop:createDpopProof(dpop.key,{method,url,accessToken:token})}:{authorization:`Bearer ${token}`}},{onResponse:(url,headers)=>{this.authConfig.dpop&&rememberDpopResponse(url,headers)}});this.reauthenticate=sharedPromise(async function(error){let{default:reauthenticate}=await import("./reauthenticate-PXEYMV7G.js");if(typeof await reauthenticate(this,error)=="number")throw error instanceof APIError?output_manager_default.prettyError(error):output_manager_default.error(`Failed to re-authenticate for ${(0,import_chalk5.bold)(error.scope)} scope`),error});this._onRetry=()=>{output_manager_default.debug("Retrying request\u2026")};this.setArgv(opts.argv),this.apiUrl=opts.apiUrl,this.authConfig=opts.authConfig,this.stdin=opts.stdin,this.stdout=opts.stdout,this.stderr=opts.stderr,this.config=opts.config,this.savedTeam=opts.config.currentTeam,this.localConfig=opts.localConfig,this.localConfigPath=opts.localConfigPath,this.requestIdCounter=1,this.telemetryEventStore=opts.telemetryEventStore,this.isAgent=opts.isAgent??!1,this.agentName=opts.agentName,this.nonInteractive=opts.nonInteractive??this.isAgent,this.ignoresSavedTeam=this.isAgent&&this.nonInteractive,this.dangerouslySkipPermissions=opts.dangerouslySkipPermissions??!1;let theme={prefix:(0,import_chalk5.gray)("?"),style:{answer:import_chalk5.gray}};this.input={text:async opts2=>{let{default:input}=await import("./esm-WU2ZS2IW.js");return this.runPrompt(input({theme,...opts2},{input:this.stdin,output:this.stderr}))},password:async opts2=>{let{default:password}=await import("./esm-LRBNA4QO.js");return this.runPrompt(password({theme,...opts2},{input:this.stdin,output:this.stderr}))},checkbox:async opts2=>{let{default:checkbox}=await import("./esm-CMSQLK7G.js");return this.runPrompt(checkbox({theme,...opts2},{input:this.stdin,output:this.stderr}))},expand:async opts2=>{let{default:expand}=await import("./esm-KWMRMP74.js");return this.runPrompt(expand({theme,...opts2},{input:this.stdin,output:this.stderr}))},confirm:async(message,default_value,opts2)=>{let{default:confirm}=await import("./esm-NVIK2MSG.js"),prompt=confirm({theme,message,default:default_value},{input:this.stdin,output:this.stderr}),signal=opts2?.signal,cancel=()=>prompt.cancel();return signal?.aborted&&cancel(),signal?.addEventListener("abort",cancel,{once:!0}),this.runPrompt(prompt).finally(()=>signal?.removeEventListener("abort",cancel))},select:async opts2=>{let{default:select}=await import("./esm-RAS56M3I.js");return this.runPrompt(select({theme,...opts2},{input:this.stdin,output:this.stderr}))},search:async opts2=>{let{default:search}=await import("./esm-B3P7PUFJ.js");return this.runPrompt(search({theme,...opts2},{input:this.stdin,output:this.stderr}))}}}getTraceContext(){if(!this.telemetryEventStore.enabled||!this.rootSpan)return;let active=this.traceStorage.getStore();return active||(this.invocationTrace?.span!==this.rootSpan&&(this.invocationTrace=createTraceContext(this.rootSpan)),this.invocationTrace)}withTrace(name,operation,attrs){return traceOperation(this.getTraceContext(),name,trace=>trace?this.traceStorage.run(trace,()=>operation(trace)):operation(trace),attrs)}async withEscapePromptCancellation(run){this.escapePromptCancellationDepth++;try{return await run()}finally{this.escapePromptCancellationDepth--}}async withPromptBackNavigation(run){this.promptBackNavigationDepth++;try{return await run()}finally{this.promptBackNavigationDepth--}}runPrompt(prompt){let escapeCancellationEnabled=this.escapePromptCancellationDepth>0,backNavigationEnabled=this.promptBackNavigationDepth>0;if(!escapeCancellationEnabled&&!backNavigationEnabled||!this.stdin.isTTY||!prompt.cancel)return prompt;let cancellation,onKeypress=(_input,key)=>{key?.name==="escape"&&escapeCancellationEnabled&&!cancellation?(cancellation="escape",prompt.cancel?.()):key?.name==="up"&&backNavigationEnabled&&!cancellation&&(cancellation="back",prompt.cancel?.())};return this.stdin.on("keypress",onKeypress),prompt.catch(error=>{throw cancellation==="escape"?new PromptCanceledError:cancellation==="back"?new PromptBackError:error}).finally(()=>{this.stdin.off("keypress",onKeypress)})}get argv(){return this._argv}setArgv(argvOrFirst,...rest){let argv=Array.isArray(argvOrFirst)?argvOrFirst:[argvOrFirst,...rest];this._argv=argv,this._parsedArgsCache=void 0}getParsedArgs(){return this._parsedArgsCache||(this._parsedArgsCache=parseArguments(this.argv.slice(2),{},{permissive:!0})),this._parsedArgsCache}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}async ensureAuthorized(){let{authConfig}=this;if(isValidAccessToken(authConfig)){this._loggedTokenSource||(authConfig.tokenSource==="flag"?output_manager_default.debug("Using token from the `--token` option, skipping token refresh."):authConfig.tokenSource==="env"?output_manager_default.debug("Using token from VERCEL_TOKEN environment variable, skipping token refresh."):output_manager_default.debug("Valid access token, skipping token refresh."),this._loggedTokenSource=!0);return}return this.loginRefresh??=this.refreshLogin().finally(()=>{this.loginRefresh=void 0}),this.loginRefresh}async refreshLogin(){let{token,refreshToken,skipWrite,tokenSource}=this.authConfig;if(!token&&!refreshToken){output_manager_default.debug("No login found, skipping token refresh.");return}let sharesSavedLogin=!skipWrite&&!tokenSource,refused=sharesSavedLogin?await withLoginRefreshLock(getSavedLoginLockPath(this.authConfig),()=>this.refreshExpiredLogin(!0)):await this.refreshExpiredLogin(!1);if(!refused)return;output_manager_default.debug(`Stored session refresh failed: ${refused.error.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");let{performDeviceCodeFlow}=await import("./future-CNLTCF2D.js"),recoveredTokens=await performDeviceCodeFlow(this);if(recoveredTokens){this.updateAuthConfig({token:recoveredTokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+recoveredTokens.expires_in,refreshToken:recoveredTokens.refresh_token,dpop:recoveredTokens.dpop}),this.persistAuthConfig();return}if(!this.sharesSavedLogin(sharesSavedLogin)){this.removeRefusedLogin(refused.dpopKey);return}await withLoginRefreshLock(getSavedLoginLockPath(this.authConfig),async()=>{let login=await this.useSavedLogin("refused");if(login==="unreadable")throw this.unreadableLoginError();if(login==="unidentified")throw new LoginRefreshError("another_login");if(login==="own"){this.removeRefusedLogin(refused.dpopKey);return}if(isValidAccessToken(this.authConfig))return;let refusedAgain=await this.refreshExpiredLogin(!0);refusedAgain&&this.removeRefusedLogin(refusedAgain.dpopKey)})}async refreshExpiredLogin(sharesSavedLogin){let own="expired",refused;for(let attempt=1;;attempt++){if(this.sharesSavedLogin(sharesSavedLogin)){hasRefreshToken(this.authConfig)||(own="refused");let login=await this.useSavedLogin(own);if(login==="unreadable")throw this.unreadableLoginError(refused?.error);if(login==="unidentified")throw new LoginRefreshError("another_login",{cause:refused?.error});if(login==="saved"){if(isValidAccessToken(this.authConfig)){output_manager_default.debug("Another process refreshed the saved login, skipping token refresh.");return}own="expired",refused=void 0}}let{authConfig}=this;if(refused){if(!authConfig.tokenSource&&this.stdin.isTTY&&!this.nonInteractive)return refused;this.removeRefusedLogin(refused.dpopKey);return}if(!hasRefreshToken(authConfig)){output_manager_default.debug("No refresh token found, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}if(attempt>MAX_LOGIN_REFRESH_ATTEMPTS)throw new LoginRefreshError("login_changed");let dpopKey=authConfig.dpop?.key,{response:tokenResponse,result}=await this.requestRefreshedTokens(authConfig.refreshToken,dpopKey),[tokensError,tokens]=result;if(!tokensError){this.sharesSavedLogin(sharesSavedLogin)&&!await this.canSaveRefreshedLogin(authConfig,tokens.access_token)&&this.stopSavingLogin(),this.updateAuthConfig({token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in}),tokens.refresh_token&&this.updateAuthConfig({refreshToken:tokens.refresh_token}),this.persistAuthConfig(),output_manager_default.debug("Tokens refreshed successfully.");return}let loginIsGone=isOAuthError(tokensError)&&tokensError.code==="invalid_grant";if(output_manager_default.debug(`Login refresh failed: HTTP ${tokenResponse.status}, ${isOAuthError(tokensError)?tokensError.cause.message:tokensError.message}, request ${tokenResponse.headers.get("x-vercel-id")??"unknown"}`),!loginIsGone)throw dpopKey?new DpopRefreshError(isOAuthError(tokensError)?tokensError.cause:tokensError):new LoginRefreshError(tokenResponse.status===429?"rate_limited":"server_error",{cause:tokensError,retryAfterMs:parseRetryAfterHeaderAsMillis(tokenResponse.headers.get("retry-after"))});refused={error:tokensError,dpopKey},own="refused"}}async requestRefreshedTokens(refreshToken,dpopKey){for(let request=1;;request++){let response=await refreshTokenRequest({refresh_token:refreshToken,dpopKey}),isJson=!0,result=await processTokenResponse(response,{dpop:!!dpopKey}).catch(()=>(isJson=!1,[new TypeError("Expected the token response to be JSON")]));if(!(response.status>=500||response.ok&&!isJson)||request===MAX_REFRESH_REQUESTS)return{response,result};output_manager_default.debug(`Login refresh got HTTP ${response.status}, sending the request one more time.`),await sleep(REFRESH_RETRY_DELAY_MS)}}sharesSavedLogin(sharedAtStart){return sharedAtStart&&!this.authConfig.skipWrite}stopSavingLogin(){output_manager_default.debug("The saved login is no longer the login of this run. This run keeps its login and no longer saves it."),this.authConfig={...this.authConfig,skipWrite:!0}}async useSavedLogin(own){for(let read=1;read<=MAX_SAVED_LOGIN_READS;read++){let saved=await this.readSavedLoginTwice();if(saved.status==="unreadable")return output_manager_default.debug("Couldn't read the saved login."),"unreadable";if(saved.status==="missing")return"own";let current=this.authConfig,next=saved.authConfig;if(isSameLogin(next,current))return"own";let user=await this.savedLoginUser(next);if(this.isSavedLogin(next)){if(user==="other")return this.stopSavingLogin(),"own";if(own==="expired"){if(user!=="same"||!isNewerLogin(next,current))return"own"}else if(user!=="same")return"unidentified";return next.token!==current.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),this.authConfig={...next,userId:current.userId,cachedUser:next.cachedUser??current.cachedUser},"saved"}}return own==="refused"?"unidentified":"own"}async readSavedLoginTwice(){let saved=readSavedLogin(this.config);return saved.status!=="unreadable"?saved:(await sleep(SAVED_LOGIN_READ_RETRY_MS),readSavedLogin(this.config))}isSavedLogin(login){let saved=readSavedLogin(this.config);return saved.status==="found"&&isSameLogin(saved.authConfig,login)}persistLoginDetails(){if(!this.authConfig.skipWrite&&!this.isSavedLogin(this.authConfig)){output_manager_default.debug("The saved login is not the login of this run, so its details were not saved.");return}this.persistAuthConfig()}async savedLoginUser(saved){let own=this.authConfig.userId;if(!own)return"unknown";let theirs=saved.userId;return!theirs&&saved.token&&isValidAccessToken(saved)&&(theirs=await introspectTokenUserId(this.apiUrl,saved.token)),theirs?theirs===own?"same":"other":"unknown"}async canSaveRefreshedLogin(sent,newToken){let saved=await this.readSavedLoginTwice();if(saved.status!=="found")return!1;let next=saved.authConfig;return isSameLogin(next,sent)||next.token===newToken?!0:!isNewerLogin(next,sent)&&!!sent.userId&&next.userId===sent.userId}unreadableLoginError(cause){return new LoginRefreshError("unreadable_login",{cause,file:getSavedLoginFilePath(this.authConfig)})}removeRefusedLogin(dpopKey){output_manager_default.debug("Error refreshing token, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig(),dpopKey&&output_manager_default.warning(`Couldn't refresh your DPoP login, so it was removed. To log in with DPoP again, run ${cmd(`__VERCEL_FF_DPOP=1 ${packageName} login`)}.`)}getGlobalPathConfig(){let confFlag=this.getParsedArgs().flags["--global-config"];return typeof confFlag=="string"?resolve4(getInvocationCwd(),confFlag):(0,import_cli_config.getGlobalPathConfig)()}async readConfig(fileName,schema){let filePath=join11(this.getGlobalPathConfig(),fileName);return(0,import_cli_config.readConfigFile)(filePath,schema)}async maybeReadConfig(fileName,schema){try{return await this.readConfig(fileName,schema)}catch{return null}}async writeConfig(fileName,schema,value){let filePath=join11(this.getGlobalPathConfig(),fileName);(0,import_cli_config.writeConfigFile)(filePath,schema,value)}updateConfig(config2){this.config={...this.config,...config2},"currentTeam"in config2&&(this.savedTeam=config2.currentTeam)}writeToConfigFile(config2=this.config){writeToConfigFile({...config2,currentTeam:this.savedTeam})}isTeamUnchosen(){return this.ignoresSavedTeam&&this.config.currentTeam===TEAM_NOT_CHOSEN}needsTeamChoice(url,opts){return this.isTeamUnchosen()&&!opts.teamOptional&&!opts.accountId&&opts.useCurrentTeam!==!1&&!new URL2(url,this.apiUrl).searchParams.has("teamId")}chooseTeam({ask=!0}={}){return ask?(this.teamChoice??=this.applyTeamChoice(!0).finally(()=>{this.teamChoice=void 0}),this.teamChoice):this.applyTeamChoice(!1)}async applyTeamChoice(ask){let{resolveAgentTeam}=await import("./resolve-agent-team-75WZ2VDR.js"),team=await resolveAgentTeam(this,{ask});team!==null&&this.isTeamUnchosen()&&(this.config.currentTeam=team)}async resolveCurrentTeam({ask=!0}={}){return this.isTeamUnchosen()&&await this.chooseTeam({ask}),this.isTeamUnchosen()?void 0:this.config.currentTeam}updateAuthConfig(authConfig){authConfig.token&&authConfig.token!==this.authConfig.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),"dpop"in authConfig&&this.releaseDpopKey(authConfig.dpop?.key),this.authConfig={...this.authConfig,...authConfig}}emptyAuthConfig(){this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0,this.releaseDpopKey(void 0),this.authConfig=this.authConfig.skipWrite?{skipWrite:!0}:{}}releaseDpopKey(nextKey){let key=this.authConfig.dpop?.key;key&&!isSameDpopKey(key,nextKey)&&this.retiredDpopKeys.push(key)}persistAuthConfig(){if(persistAuthConfig(this.authConfig,this.config),this.authConfig.skipWrite)return;let currentKey=this.authConfig.dpop?.key;for(let key of this.retiredDpopKeys.splice(0))isSameDpopKey(key,currentKey)||deleteDpopKey(key)}async confirmMutatingOperation(url,method){if(!((method||"GET").toUpperCase()==="DELETE"))return!0;if(this.isAgent&&this.dangerouslySkipPermissions){let agentInfo=this.agentName?` (${this.agentName})`:"";output_manager_default.print(`
|
|
68
68
|
`),output_manager_default.print((0,import_chalk5.bgRed)((0,import_chalk5.white)((0,import_chalk5.bold)(" \u26A0 WARNING ")))+(0,import_chalk5.red)((0,import_chalk5.bold)(` AGENT MODE - DELETE CONFIRMATION BYPASSED
|
|
69
69
|
`))),output_manager_default.print((0,import_chalk5.yellow)(` An AI agent${agentInfo} is executing a ${(0,import_chalk5.bold)("DELETE")} request with --dangerously-skip-permissions option.
|
|
70
70
|
`)),output_manager_default.print((0,import_chalk5.yellow)(` This operation will delete data: ${(0,import_chalk5.bold)(url)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{N,X,Z}from"./chunk-6OOJFAF5.js";import{d}from"./chunk-YBWLW6SW.js";var i=d(N());Z();var a=i.extendType(i.string,{displayName:"name",description:"The name of the sandbox",async from(e){if(!e||e.trim().length===0)throw Error(["Sandbox name cannot be empty.",`${X.bold("hint:")} Provide a sandbox name.`,"\u2570\u25B6 run `sandbox list` to see available sandboxes."].join(`
|
|
8
|
+
`));return e}});export{a};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{outputError}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-4FPYV37P.js";import{getScope}from"./chunk-HG7NRFC5.js";import{getLinkedProject}from"./chunk-G7RQVFID.js";import{getProjectByNameOrId}from"./chunk-UGVOMXYR.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-NVU7XTNI.js";import{ProjectNotFound,isAPIError}from"./chunk-MTPHHAPR.js";function emitAlertsScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveAlertsScope(client,opts){let command=opts.command??"alerts",projectCommand=`${command} --project <name_or_id>`,allCommand=`${command} --all`;if(opts.all||opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitAlertsScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project or --all with alerts.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}if(opts.all)return{teamId:team.id};let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitAlertsScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitAlertsScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a valid project (replace <name_or_id>)"}]})}return{teamId:team.id,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or use --project <name> or --all.";return emitAlertsScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project or --all when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with an explicit project (replace <name_or_id>)"},{command:buildCommandWithGlobalFlags(client.argv,allCommand),when:"Use team-wide scope without a linked project"}]})}return scopeFromLinkedProject(linkedProject)}function scopeFromLinkedProject(linkedProject){return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope,scopeFromLinkedProject};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-EFGZK6OY.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import{normalizeFlagName,stripSensitiveAuthArgs}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);var DEFAULT_LIST_LIMIT=20,MAX_LIST_LIMIT=100;function parseListLimit(value,{defaultLimit=DEFAULT_LIST_LIMIT,maxLimit=MAX_LIST_LIMIT}={}){if(value===void 0)return defaultLimit;if(!Number.isInteger(value)||value<1||value>maxLimit)throw new Error(`The --limit option must be an integer from 1 to ${maxLimit}.`);return value}var PaginationError=class extends Error{constructor(message){super(message),this.name="PaginationError"}};async function fetchAllPages(fetchPage,{maxPages=1e3}={}){let items=[],seen=new Set,next;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(next);if(items.push(...page.items),!page.next)return items;if(seen.has(page.next))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");seen.add(page.next),next=page.next}throw new PaginationError(`Stopped after ${maxPages} pages. The list is incomplete. Use --limit and --next to page through it manually.`)}var CURSOR_FLAGS=["--next","-N"];function quoteShellArg(value){return/^[A-Za-z0-9_./@:,=+-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}function splitInvocation(argv,dropFlags,clusterLetters){let args=stripSensitiveAuthArgs(argv.slice(2)),delimiter=args.indexOf("--"),own=delimiter===-1?args:args.slice(0,delimiter),passthrough=delimiter===-1?[]:args.slice(delimiter),letters=new RegExp(`[${clusterLetters}]`,"g"),kept=[];for(let i=0;i<own.length;i++){let arg=own[i];if(dropFlags.includes(normalizeFlagName(arg))){!arg.includes("=")&&i+1<own.length&&i++;continue}if(/^-[A-Za-z]{2,}$/.test(arg)&&arg.search(letters)!==-1){kept.push(arg.replace(letters,"")),i+1<own.length&&i++;continue}kept.push(arg)}return{kept,passthrough}}function getNextPageCommand(argv,next,dropFlags=[]){let{kept,passthrough}=splitInvocation(argv,[...CURSOR_FLAGS,...dropFlags],"N");return kept.push(`--next=${next}`,...passthrough),`${packageName} ${kept.map(quoteShellArg).join(" ")}`}function getCommandFromArgv(argv,added=[],dropFlags=[]){let drop=[...CURSOR_FLAGS,...dropFlags],{kept,passthrough}=splitInvocation(argv,drop,drop.filter(flag=>/^-[A-Za-z]$/.test(flag)).map(flag=>flag[1]).join("")),args=[...kept,...added,...passthrough],shown=args.map(arg=>added.includes(arg)&&/^<[A-Z_]+>$/.test(arg)?arg:quoteShellArg(arg));return{command:[packageName,...shown].join(" "),argv:[packageName,...args]}}function printNextPageCommand(command,label="Next page",options){let rendered=options?.template?command:import_chalk.default.cyan(command);output_manager_default.print(` ${label}:
|
|
8
8
|
${rendered}
|
|
9
9
|
`)}function printNextPageHint(client,next,dropFlags=[]){next&&(output_manager_default.print(`
|
|
10
10
|
`),printNextPageCommand(getNextPageCommand(client.argv,next,dropFlags)))}export{DEFAULT_LIST_LIMIT,MAX_LIST_LIMIT,parseListLimit,PaginationError,fetchAllPages,quoteShellArg,getNextPageCommand,getCommandFromArgv,printNextPageCommand,printNextPageHint};
|