@vercel/cli-support 66.6.0 → 67.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/dist/chunks/add-PULH4LLG.js +8 -0
  2. package/dist/chunks/add-SWKAAP2V.js +8 -0
  3. package/dist/chunks/add-U3ILHW5T.js +8 -0
  4. package/dist/chunks/{alerts-72Q42HNT.js → alerts-GXY7LZWX.js} +1 -1
  5. package/dist/chunks/build-UNR3B22D.js +7 -0
  6. package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
  7. package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
  8. package/dist/chunks/chunk-2BI5SSHB.js +7 -0
  9. package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
  10. package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
  11. package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
  12. package/dist/chunks/{chunk-DZ77BIEV.js → chunk-2OMMOXFL.js} +1 -1
  13. package/dist/chunks/{chunk-6PDKIOAO.js → chunk-2TJQY7PH.js} +1 -1
  14. package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
  15. package/dist/chunks/{chunk-YOAQNRBN.js → chunk-3C6BMAGB.js} +2 -2
  16. package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
  17. package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
  18. package/dist/chunks/{chunk-QZJOKECY.js → chunk-4GYDXPNC.js} +2 -2
  19. package/dist/chunks/{chunk-H2KNSYPR.js → chunk-55FPQ5MM.js} +1 -1
  20. package/dist/chunks/{chunk-RBW62SOU.js → chunk-55WV4RRW.js} +1 -1
  21. package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
  22. package/dist/chunks/{chunk-D2TVI7KK.js → chunk-5CFLIIMP.js} +4 -4
  23. package/dist/chunks/chunk-5DHOC47O.js +13 -0
  24. package/dist/chunks/{chunk-CSCUVSJM.js → chunk-5GKIRBHJ.js} +1 -1
  25. package/dist/chunks/{chunk-YLLFLPNA.js → chunk-5QMXW5KS.js} +1 -1
  26. package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
  27. package/dist/chunks/{chunk-NLK7NGVP.js → chunk-5ZL2RRO3.js} +1 -1
  28. package/dist/chunks/chunk-67GZ5REA.js +7 -0
  29. package/dist/chunks/chunk-6D44CCJA.js +23 -0
  30. package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
  31. package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
  32. package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
  33. package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-6UWBCYEW.js} +1 -1
  34. package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
  35. package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
  36. package/dist/chunks/chunk-742MHFPK.js +31 -0
  37. package/dist/chunks/chunk-7HQZRU25.js +10 -0
  38. package/dist/chunks/{chunk-QZKRVE44.js → chunk-7J7SOUFS.js} +1 -1
  39. package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
  40. package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
  41. package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
  42. package/dist/chunks/{chunk-OISNKAC6.js → chunk-7W4GWVUP.js} +2 -2
  43. package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
  44. package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
  45. package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
  46. package/dist/chunks/{chunk-6GE4V7MW.js → chunk-ANT2GN7F.js} +2 -2
  47. package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
  48. package/dist/chunks/{chunk-Y77DXGGN.js → chunk-B6YVE4WJ.js} +1 -1
  49. package/dist/chunks/chunk-B7IB5CTS.js +7 -0
  50. package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
  51. package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
  52. package/dist/chunks/chunk-BS32OUOC.js +7 -0
  53. package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
  54. package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
  55. package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
  56. package/dist/chunks/{chunk-FOFX7LHS.js → chunk-C3KNFAVK.js} +1 -1
  57. package/dist/chunks/{chunk-OE26EQSH.js → chunk-C7TNFTTK.js} +1 -1
  58. package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
  59. package/dist/chunks/chunk-CDJ25IKC.js +7 -0
  60. package/dist/chunks/chunk-CO5LKOMH.js +7 -0
  61. package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
  62. package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
  63. package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
  64. package/dist/chunks/chunk-DORCX7UB.js +7 -0
  65. package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
  66. package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
  67. package/dist/chunks/{chunk-N6JHFCWC.js → chunk-EM4OX47A.js} +1 -1
  68. package/dist/chunks/{chunk-VPSR2O55.js → chunk-EOUT7E7U.js} +3 -3
  69. package/dist/chunks/chunk-EYRBV6RM.js +25 -0
  70. package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
  71. package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
  72. package/dist/chunks/chunk-FFHV7BRT.js +7 -0
  73. package/dist/chunks/{chunk-ACN6DBTC.js → chunk-FHUDTYY7.js} +1 -1
  74. package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
  75. package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
  76. package/dist/chunks/{chunk-3A3GU62R.js → chunk-G2CDEA2E.js} +1 -1
  77. package/dist/chunks/chunk-GQXKF3PR.js +7 -0
  78. package/dist/chunks/{chunk-KSGN5OCV.js → chunk-GT3JH2FU.js} +1 -1
  79. package/dist/chunks/{chunk-FFN3EGSF.js → chunk-GWYQXFBP.js} +1 -1
  80. package/dist/chunks/{chunk-BCAI7MED.js → chunk-H75TYZ4K.js} +1 -1
  81. package/dist/chunks/{chunk-W2L24GM7.js → chunk-HT445TYO.js} +1 -1
  82. package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-HZRU7VS6.js} +1 -1
  83. package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
  84. package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-IGJBSAFY.js} +1 -1
  85. package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
  86. package/dist/chunks/chunk-IPORRCTF.js +12 -0
  87. package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
  88. package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
  89. package/dist/chunks/{chunk-R33HJGYA.js → chunk-JYGOOFIW.js} +1 -1
  90. package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
  91. package/dist/chunks/{chunk-JBYROCAC.js → chunk-KC5BRLPR.js} +1 -1
  92. package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
  93. package/dist/chunks/{chunk-QGHAD5A5.js → chunk-KHDRQS6I.js} +1 -1
  94. package/dist/chunks/{chunk-L5PIUIUM.js → chunk-KJUFWRZP.js} +1 -1
  95. package/dist/chunks/chunk-L3DJOYTO.js +11 -0
  96. package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
  97. package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
  98. package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-LIQLOS7B.js} +1 -1
  99. package/dist/chunks/chunk-LYQECLRR.js +10 -0
  100. package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
  101. package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
  102. package/dist/chunks/{chunk-GUGP6OY2.js → chunk-ME52HBX7.js} +1 -1
  103. package/dist/chunks/{chunk-XAGG5BJT.js → chunk-MFOBJA6M.js} +1 -1
  104. package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
  105. package/dist/chunks/chunk-MNDFF42B.js +30 -0
  106. package/dist/chunks/{chunk-AFHZC47H.js → chunk-MPOK5ZI5.js} +1 -1
  107. package/dist/chunks/{chunk-WAFBTC45.js → chunk-N3IQO5HN.js} +1 -1
  108. package/dist/chunks/{chunk-2G2SALNN.js → chunk-NBRW54IL.js} +1 -1
  109. package/dist/chunks/chunk-NJFXR3FN.js +77 -0
  110. package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
  111. package/dist/chunks/chunk-NTSJNYRU.js +11 -0
  112. package/dist/chunks/{chunk-EFP3LK4G.js → chunk-OBBFWQJ3.js} +1 -1
  113. package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OOAIU7WR.js} +1 -1
  114. package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
  115. package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
  116. package/dist/chunks/chunk-PHK4OYIZ.js +8 -0
  117. package/dist/chunks/{chunk-IF6GA273.js → chunk-PKCEKIQP.js} +1 -1
  118. package/dist/chunks/{chunk-33HVDSWP.js → chunk-PYHNDBNH.js} +1 -1
  119. package/dist/chunks/chunk-QFE3RPMA.js +19 -0
  120. package/dist/chunks/{chunk-S4AANAHX.js → chunk-QKK5BAZO.js} +1 -1
  121. package/dist/chunks/{chunk-RDDIWY3O.js → chunk-QPX6N5CV.js} +3 -3
  122. package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
  123. package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
  124. package/dist/chunks/chunk-RNHPL4C7.js +13 -0
  125. package/dist/chunks/chunk-RPYIWRSN.js +7 -0
  126. package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
  127. package/dist/chunks/{chunk-2OMI3IUW.js → chunk-S6QZTDZ3.js} +1 -1
  128. package/dist/chunks/{chunk-5O4AXCN7.js → chunk-SGFMVYFR.js} +1 -1
  129. package/dist/chunks/chunk-SGNDE4YS.js +7 -0
  130. package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
  131. package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
  132. package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
  133. package/dist/chunks/{chunk-TNQUCTJH.js → chunk-THMCHMVZ.js} +1 -1
  134. package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
  135. package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-TRDAU3LX.js} +1 -1
  136. package/dist/chunks/chunk-TVTGVWCV.js +8 -0
  137. package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
  138. package/dist/chunks/chunk-UEFDCTG6.js +7 -0
  139. package/dist/chunks/{chunk-OXS5VO4X.js → chunk-URJT7V4L.js} +1 -1
  140. package/dist/chunks/chunk-UT3HLSJV.js +8 -0
  141. package/dist/chunks/chunk-V5TIFXUP.js +15 -0
  142. package/dist/chunks/chunk-VGSSSQFT.js +7 -0
  143. package/dist/chunks/{chunk-OF32Z3UP.js → chunk-VT7UAUY6.js} +1 -1
  144. package/dist/chunks/{chunk-QRG24GJG.js → chunk-VWFFYVJ2.js} +1 -1
  145. package/dist/chunks/chunk-VWKA6RKB.js +7 -0
  146. package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
  147. package/dist/chunks/{chunk-2D5PTFAY.js → chunk-WOXLDQR3.js} +1 -1
  148. package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-X3LOIVIS.js} +1 -1
  149. package/dist/chunks/{chunk-MINTHN6C.js → chunk-X4ECSRFL.js} +1 -1
  150. package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
  151. package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
  152. package/dist/chunks/{chunk-C335SWOB.js → chunk-X7TIJWNO.js} +1 -1
  153. package/dist/chunks/chunk-XTCRLS6X.js +10 -0
  154. package/dist/chunks/{chunk-KLYFOXYH.js → chunk-XUMXJUE4.js} +3 -3
  155. package/dist/chunks/{chunk-XDWAUOFO.js → chunk-XXLU5IHA.js} +1 -1
  156. package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
  157. package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
  158. package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
  159. package/dist/chunks/{chunk-YEDS2UMW.js → chunk-YBKH3IDY.js} +1 -1
  160. package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
  161. package/dist/chunks/chunk-YKIKCZQ4.js +37 -0
  162. package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
  163. package/dist/chunks/chunk-YMVS467I.js +7 -0
  164. package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
  165. package/dist/chunks/chunk-YTSGFU5T.js +7 -0
  166. package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
  167. package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
  168. package/dist/chunks/{chunk-O7GNYVVM.js → chunk-Z5HRQ3IQ.js} +2 -2
  169. package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
  170. package/dist/chunks/{chunk-F37XFLFP.js → chunk-ZNEXVCPE.js} +1 -1
  171. package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
  172. package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
  173. package/dist/chunks/clear-ZYFF7TKK.js +8 -0
  174. package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
  175. package/dist/chunks/compile-vercel-config-PM32YSEA.js +7 -0
  176. package/dist/chunks/config-BOZHXFS2.js +8 -0
  177. package/dist/chunks/config-PEQFEYH3.js +7 -0
  178. package/dist/chunks/config-validator.mjs +1 -1
  179. package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
  180. package/dist/chunks/create-project-BTOHPKZB.js +7 -0
  181. package/dist/chunks/delete-5ZT5D2ZC.js +9 -0
  182. package/dist/chunks/delete-QOXGYAV7.js +10 -0
  183. package/dist/chunks/describe-PB4P77HZ.js +25 -0
  184. package/dist/chunks/detect-projects-YFNBW57H.js +7 -0
  185. package/dist/chunks/detect-services-ZN2R3RDF.js +7 -0
  186. package/dist/chunks/disable-UB445BYJ.js +7 -0
  187. package/dist/chunks/discard-EDFRCWQJ.js +14 -0
  188. package/dist/chunks/edit-RZUR2MEI.js +9 -0
  189. package/dist/chunks/edit-ZWAA6ERV.js +8 -0
  190. package/dist/chunks/enable-YTPIGKFW.js +7 -0
  191. package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
  192. package/dist/chunks/esm-5GQXHN7C.js +9 -0
  193. package/dist/chunks/esm-FJCIOBBV.js +7 -0
  194. package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
  195. package/dist/chunks/esm-LEQXRLFV.js +9 -0
  196. package/dist/chunks/esm-NHCCFW7Z.js +7 -0
  197. package/dist/chunks/esm-QQ3MUOW4.js +7 -0
  198. package/dist/chunks/esm-T655CG6O.js +7 -0
  199. package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
  200. package/dist/chunks/{export-TOSUN6JO.js → export-GAUHNKEC.js} +2 -3
  201. package/dist/chunks/future-5CMQQWD5.js +7 -0
  202. package/dist/chunks/generate-cert-for-deploy-UIPNZXKH.js +7 -0
  203. package/dist/chunks/image-6E4KXK2L.js +7 -0
  204. package/dist/chunks/import-builders-XWE653DS.js +7 -0
  205. package/dist/chunks/{inspect-GBH7FAW6.js → inspect-6R3QRA5N.js} +1 -1
  206. package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-CAFSMVCJ.js} +1 -1
  207. package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-D7ABHU5K.js} +1 -1
  208. package/dist/chunks/{inspect-DFYVVIJW.js → inspect-INPZEWQW.js} +1 -1
  209. package/dist/chunks/inspect-MTGXZZ56.js +9 -0
  210. package/dist/chunks/inspect-RAXMU5ZB.js +13 -0
  211. package/dist/chunks/{list-HD6KXAIG.js → list-FIHRZBUS.js} +1 -1
  212. package/dist/chunks/list-JBJW5CJ5.js +12 -0
  213. package/dist/chunks/{list-4RRL326Z.js → list-VMOJ7VVX.js} +1 -1
  214. package/dist/chunks/{list-MW2FV253.js → list-ZVDEIXDS.js} +1 -1
  215. package/dist/chunks/login-H2G7BS6W.js +7 -0
  216. package/dist/chunks/login-LKMOWVCB.js +9 -0
  217. package/dist/chunks/logs-VXZM4UHP.js +7 -0
  218. package/dist/chunks/{ls-RKOM46KV.js → ls-C6AD24SN.js} +1 -1
  219. package/dist/chunks/{ls-TLEAYYXQ.js → ls-F7VCPUQX.js} +1 -1
  220. package/dist/chunks/{ls-VFE7PE25.js → ls-GDKBTL2S.js} +1 -1
  221. package/dist/chunks/ls-HDEMDHPT.js +8 -0
  222. package/dist/chunks/ls-JQ27BRGL.js +11 -0
  223. package/dist/chunks/{ls-Q4WGEEBZ.js → ls-LAGLNA5S.js} +1 -1
  224. package/dist/chunks/{ls-I767MTW4.js → ls-Z6MWIX4Y.js} +1 -1
  225. package/dist/chunks/migrate-experimental-services-EDKYGFQN.js +7 -0
  226. package/dist/chunks/mutate-QQV7STKJ.js +9 -0
  227. package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
  228. package/dist/chunks/notifications-RS7NVKX3.js +7 -0
  229. package/dist/chunks/open-FJ2GR5YN.js +7 -0
  230. package/dist/chunks/{openapi-NEYEIRF2.js → openapi-TMDHCYVN.js} +1 -1
  231. package/dist/chunks/permissions-5A7V4SB3.js +7 -0
  232. package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-EVN7NAJK.js} +1 -1
  233. package/dist/chunks/prompt-missing-credentials-KI75QVSM.js +7 -0
  234. package/dist/chunks/publish-XSPN4TNJ.js +15 -0
  235. package/dist/chunks/pull-6UMQJKSF.js +7 -0
  236. package/dist/chunks/purchase-domain-if-available-CT4I2TPX.js +7 -0
  237. package/dist/chunks/push-KY26BHB6.js +7 -0
  238. package/dist/chunks/query-RISEG5SJ.js +7 -0
  239. package/dist/chunks/raw-query-VVRMDGD2.js +8 -0
  240. package/dist/chunks/reauthenticate-OSPJ3JEZ.js +7 -0
  241. package/dist/chunks/{remove-IEEZGRB2.js → remove-2IJXYNP5.js} +1 -1
  242. package/dist/chunks/reorder-V7HLFPNM.js +10 -0
  243. package/dist/chunks/reply-DBWSTVHX.js +9 -0
  244. package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
  245. package/dist/chunks/resolve-NNJNHWK7.js +12 -0
  246. package/dist/chunks/resolve-agent-team-SDRK736H.js +7 -0
  247. package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
  248. package/dist/chunks/restore-JLS3DHVR.js +16 -0
  249. package/dist/chunks/rm-44NX26ZY.js +8 -0
  250. package/dist/chunks/rm-6K2ZAQ26.js +8 -0
  251. package/dist/chunks/rm-KX2MW3CD.js +8 -0
  252. package/dist/chunks/rm-TADMPEWP.js +8 -0
  253. package/dist/chunks/rm-YCOVLR77.js +8 -0
  254. package/dist/chunks/routes-SBMN6SDF.js +7 -0
  255. package/dist/chunks/rule-inspect-4OICMTIG.js +8 -0
  256. package/dist/chunks/{schema-L5VCG6FJ.js → schema-JVSAUVFJ.js} +1 -1
  257. package/dist/chunks/schema-NPCCNUH2.js +14 -0
  258. package/dist/chunks/select-org-PQVCQGYR.js +7 -0
  259. package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
  260. package/dist/chunks/{set-6U4QIX7A.js → set-GBB3DG2V.js} +1 -1
  261. package/dist/chunks/set-XADF6YK4.js +7 -0
  262. package/dist/chunks/setup-and-link-CBVABGTY.js +7 -0
  263. package/dist/chunks/{skills-ZMFZGPQL.js → skills-VPLIJJQG.js} +4 -19
  264. package/dist/chunks/table-SCLK33K7.js +7 -0
  265. package/dist/chunks/tags-PVI45KIL.js +7 -0
  266. package/dist/chunks/{types-CVLZCTL2.js → types-MTNJRJKG.js} +1 -1
  267. package/dist/chunks/{update-A727QN7H.js → update-KIOGBNX7.js} +1 -1
  268. package/dist/chunks/usage-XTWSFFZT.js +15 -0
  269. package/dist/chunks/validate-config-IREIABSK.js +7 -0
  270. package/dist/commands/build/index.js +1 -1
  271. package/dist/commands/deploy/index.js +28 -25
  272. package/dist/commands/dev/index.js +7 -7
  273. package/dist/commands/env/index.js +11 -10
  274. package/dist/commands/link/index.js +3 -3
  275. package/dist/commands/list/index.js +1 -1
  276. package/dist/commands/project/index.js +4 -4
  277. package/dist/commands/tunnel/index.js +1 -1
  278. package/dist/commands-account.js +16 -10
  279. package/dist/commands-ai.js +17 -10
  280. package/dist/commands-blob.js +6 -6
  281. package/dist/commands-core.js +15 -16
  282. package/dist/commands-deployments.js +12 -11
  283. package/dist/commands-flags.js +25 -20
  284. package/dist/commands-integrations.js +3 -3
  285. package/dist/commands-observability.js +38 -28
  286. package/dist/commands-routing.js +4 -4
  287. package/dist/help.js +1 -1
  288. package/dist/index.js +6 -6
  289. package/dist/internal-build-worker.js +1 -1
  290. package/dist/internal-build.js +1 -1
  291. package/dist/package.json +42 -42
  292. package/dist/version.mjs +1 -1
  293. package/package.json +43 -43
  294. package/dist/chunks/add-563RV6JX.js +0 -8
  295. package/dist/chunks/add-HRB6XY33.js +0 -8
  296. package/dist/chunks/add-IUTGTBA4.js +0 -8
  297. package/dist/chunks/build-OMIYCGMR.js +0 -7
  298. package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
  299. package/dist/chunks/chunk-2RRZCRWX.js +0 -7
  300. package/dist/chunks/chunk-4SS6W6JK.js +0 -11
  301. package/dist/chunks/chunk-5J4E2W4F.js +0 -12
  302. package/dist/chunks/chunk-76DSBD4X.js +0 -7
  303. package/dist/chunks/chunk-7W565DJB.js +0 -8
  304. package/dist/chunks/chunk-AIXEVICT.js +0 -37
  305. package/dist/chunks/chunk-BULSRTQE.js +0 -7
  306. package/dist/chunks/chunk-C35SG42R.js +0 -7
  307. package/dist/chunks/chunk-CFJBDBYH.js +0 -7
  308. package/dist/chunks/chunk-DDPH26ZO.js +0 -7
  309. package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
  310. package/dist/chunks/chunk-EFFJUYYS.js +0 -31
  311. package/dist/chunks/chunk-GOI2VVI7.js +0 -19
  312. package/dist/chunks/chunk-GYUNOFDD.js +0 -10
  313. package/dist/chunks/chunk-KDCODXVL.js +0 -25
  314. package/dist/chunks/chunk-KMTHGHJV.js +0 -8
  315. package/dist/chunks/chunk-KQ6X77WP.js +0 -7
  316. package/dist/chunks/chunk-KRP4EMD2.js +0 -10
  317. package/dist/chunks/chunk-OCR5CRTH.js +0 -10
  318. package/dist/chunks/chunk-PKR32I2N.js +0 -30
  319. package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
  320. package/dist/chunks/chunk-SXW2G4WD.js +0 -10
  321. package/dist/chunks/chunk-TC4E2TFA.js +0 -8
  322. package/dist/chunks/chunk-TUB3APDV.js +0 -7
  323. package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
  324. package/dist/chunks/chunk-VF7XWPXA.js +0 -7
  325. package/dist/chunks/chunk-VKVH7LHB.js +0 -7
  326. package/dist/chunks/chunk-VUUU4KDL.js +0 -7
  327. package/dist/chunks/chunk-W3ZH27MN.js +0 -13
  328. package/dist/chunks/chunk-X47GV5HM.js +0 -15
  329. package/dist/chunks/chunk-XBHAU2M3.js +0 -9
  330. package/dist/chunks/chunk-XR2J7PQN.js +0 -12
  331. package/dist/chunks/chunk-YI7NKOCU.js +0 -23
  332. package/dist/chunks/chunk-Z2KANBOU.js +0 -69
  333. package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
  334. package/dist/chunks/clear-TH6G33QK.js +0 -8
  335. package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
  336. package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
  337. package/dist/chunks/config-2SBML7OY.js +0 -8
  338. package/dist/chunks/config-BCKJNJPS.js +0 -7
  339. package/dist/chunks/create-project-I7UXVWIR.js +0 -7
  340. package/dist/chunks/delete-RGHXL4JH.js +0 -9
  341. package/dist/chunks/delete-ZV4SHUTR.js +0 -10
  342. package/dist/chunks/describe-442UUQIF.js +0 -25
  343. package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
  344. package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
  345. package/dist/chunks/disable-MYGA6HVS.js +0 -7
  346. package/dist/chunks/discard-I5TKYCDJ.js +0 -14
  347. package/dist/chunks/edit-KGCUTTOZ.js +0 -8
  348. package/dist/chunks/edit-ZRNGGRVL.js +0 -9
  349. package/dist/chunks/enable-NODSFDKF.js +0 -7
  350. package/dist/chunks/esm-CF5UHWPM.js +0 -7
  351. package/dist/chunks/esm-EYOXGOVF.js +0 -7
  352. package/dist/chunks/esm-IUATPKKB.js +0 -9
  353. package/dist/chunks/esm-L6OKDFWP.js +0 -7
  354. package/dist/chunks/esm-ORQC2ZSA.js +0 -7
  355. package/dist/chunks/esm-PYIZNQIK.js +0 -9
  356. package/dist/chunks/future-RXI2OW2C.js +0 -7
  357. package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
  358. package/dist/chunks/image-6A2EJP4N.js +0 -7
  359. package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
  360. package/dist/chunks/inspect-STKCC3MC.js +0 -9
  361. package/dist/chunks/inspect-VFUV7BDM.js +0 -13
  362. package/dist/chunks/list-6ENV2ZGG.js +0 -12
  363. package/dist/chunks/login-O6NLJ42W.js +0 -7
  364. package/dist/chunks/login-U5VDJURN.js +0 -9
  365. package/dist/chunks/logs-X3KGHA3J.js +0 -7
  366. package/dist/chunks/ls-HRSD6VNW.js +0 -8
  367. package/dist/chunks/ls-OLJMGFTV.js +0 -11
  368. package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
  369. package/dist/chunks/mutate-BJXJON5E.js +0 -9
  370. package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
  371. package/dist/chunks/open-JK42ZTLB.js +0 -7
  372. package/dist/chunks/permissions-3AQO3DCH.js +0 -7
  373. package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
  374. package/dist/chunks/publish-7SCXBVZR.js +0 -15
  375. package/dist/chunks/pull-LAPD5XJG.js +0 -7
  376. package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
  377. package/dist/chunks/push-BCSGQBAM.js +0 -7
  378. package/dist/chunks/query-U72BDMAK.js +0 -7
  379. package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
  380. package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
  381. package/dist/chunks/reorder-YL6L6IWC.js +0 -10
  382. package/dist/chunks/reply-7Y5TN5UV.js +0 -9
  383. package/dist/chunks/resolve-C62436YM.js +0 -12
  384. package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
  385. package/dist/chunks/restore-Z63JM5CN.js +0 -16
  386. package/dist/chunks/rm-C6QSHEA2.js +0 -8
  387. package/dist/chunks/rm-DDKE62T7.js +0 -8
  388. package/dist/chunks/rm-IUB55CCM.js +0 -8
  389. package/dist/chunks/rm-NZX43GMQ.js +0 -8
  390. package/dist/chunks/rm-UBUI7JNY.js +0 -8
  391. package/dist/chunks/routes-TME3VYIF.js +0 -7
  392. package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
  393. package/dist/chunks/schema-P7DFLXCG.js +0 -14
  394. package/dist/chunks/select-org-MBBMOUK2.js +0 -7
  395. package/dist/chunks/set-SCKMJ7LZ.js +0 -7
  396. package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
  397. package/dist/chunks/tags-7M2EW6LU.js +0 -7
  398. package/dist/chunks/usage-HT5JXVAA.js +0 -13
  399. package/dist/chunks/validate-config-Q77XESW5.js +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/cli-support",
3
- "version": "66.6.0",
3
+ "version": "67.0.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "The JavaScript Vercel CLI, installed by vercel to run where its native binary can't",
@@ -33,54 +33,54 @@
33
33
  "undici": "5.29.0",
34
34
  "uuid": "14.0.1",
35
35
  "zod": "4.6.7",
36
- "@vercel/backends": "27.0.0",
37
- "@vercel/build-utils": "15.5.0",
38
- "@vercel/cli-auth": "0.4.2",
39
- "@vercel/container": "27.0.0",
36
+ "@vercel/backends": "28.0.0",
37
+ "@vercel/cli-auth": "0.4.3",
38
+ "@vercel/build-utils": "15.6.0",
39
+ "@vercel/container": "28.0.0",
40
40
  "@vercel/cli-config": "0.4.0",
41
41
  "@vercel/detect-agent": "1.2.7",
42
- "@vercel/elysia": "27.0.0",
43
- "@vercel/express": "27.0.0",
44
- "@vercel/fastify": "27.0.0",
45
- "@vercel/go": "30.0.0",
46
- "@vercel/h3": "27.0.0",
47
- "@vercel/koa": "27.0.0",
48
- "@vercel/hono": "27.0.0",
49
- "@vercel/nestjs": "27.0.0",
50
- "@vercel/node": "32.0.0",
51
- "@vercel/next": "31.0.2",
52
- "@vercel/hydrogen": "28.0.0",
53
- "@vercel/python": "33.0.0",
54
- "@vercel/python-analysis": "0.15.3",
55
- "@vercel/redwood": "29.0.0",
56
- "@vercel/remix-builder": "32.0.0",
57
- "@vercel/ruby": "29.0.0",
58
- "@vercel/rust": "28.0.0",
59
- "@vercel/static-build": "29.0.0"
42
+ "@vercel/elysia": "28.0.0",
43
+ "@vercel/express": "28.0.0",
44
+ "@vercel/go": "31.0.0",
45
+ "@vercel/fastify": "28.0.0",
46
+ "@vercel/h3": "28.0.0",
47
+ "@vercel/hono": "28.0.0",
48
+ "@vercel/hydrogen": "29.0.0",
49
+ "@vercel/koa": "28.0.0",
50
+ "@vercel/next": "32.0.0",
51
+ "@vercel/nestjs": "28.0.0",
52
+ "@vercel/node": "33.0.0",
53
+ "@vercel/python-analysis": "0.15.4",
54
+ "@vercel/python": "34.0.0",
55
+ "@vercel/redwood": "30.0.0",
56
+ "@vercel/remix-builder": "33.0.0",
57
+ "@vercel/ruby": "30.0.0",
58
+ "@vercel/rust": "29.0.0",
59
+ "@vercel/static-build": "30.0.0"
60
60
  },
61
61
  "builders": {
62
- "@vercel/backends": "27.0.0",
63
- "@vercel/container": "27.0.0",
64
- "@vercel/elysia": "27.0.0",
65
- "@vercel/express": "27.0.0",
66
- "@vercel/fastify": "27.0.0",
67
- "@vercel/go": "30.0.0",
68
- "@vercel/h3": "27.0.0",
69
- "@vercel/hono": "27.0.0",
70
- "@vercel/hydrogen": "28.0.0",
71
- "@vercel/koa": "27.0.0",
72
- "@vercel/nestjs": "27.0.0",
73
- "@vercel/next": "31.0.2",
74
- "@vercel/node": "32.0.0",
75
- "@vercel/python": "33.0.0",
76
- "@vercel/redwood": "29.0.0",
77
- "@vercel/remix-builder": "32.0.0",
78
- "@vercel/ruby": "29.0.0",
79
- "@vercel/rust": "28.0.0",
80
- "@vercel/static-build": "29.0.0"
62
+ "@vercel/backends": "28.0.0",
63
+ "@vercel/container": "28.0.0",
64
+ "@vercel/elysia": "28.0.0",
65
+ "@vercel/express": "28.0.0",
66
+ "@vercel/fastify": "28.0.0",
67
+ "@vercel/go": "31.0.0",
68
+ "@vercel/h3": "28.0.0",
69
+ "@vercel/hono": "28.0.0",
70
+ "@vercel/hydrogen": "29.0.0",
71
+ "@vercel/koa": "28.0.0",
72
+ "@vercel/nestjs": "28.0.0",
73
+ "@vercel/next": "32.0.0",
74
+ "@vercel/node": "33.0.0",
75
+ "@vercel/python": "34.0.0",
76
+ "@vercel/redwood": "30.0.0",
77
+ "@vercel/remix-builder": "33.0.0",
78
+ "@vercel/ruby": "30.0.0",
79
+ "@vercel/rust": "29.0.0",
80
+ "@vercel/static-build": "30.0.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@vercel-internals/cli-core": "66.6.0"
83
+ "@vercel-internals/cli-core": "67.0.0"
84
84
  },
85
85
  "os": [
86
86
  "aix",
@@ -1,8 +0,0 @@
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{printRuleMutationReceipt}from"./chunk-QZJOKECY.js";import"./chunk-GHNHUSVK.js";import{resolveRulesProject,resolveRulesTeam}from"./chunk-AFHZC47H.js";import"./chunk-CSCUVSJM.js";import{emitRulesArgParseError,getBodyType,handleRulesApiError,outputRulesError,readRuleBody,rulesCollectionPath}from"./chunk-XAGG5BJT.js";import"./chunk-GHAY4PSD.js";import"./chunk-TOTTVS5P.js";import"./chunk-ZJNDLFZ7.js";import"./chunk-D3M2JG5C.js";import"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import{trackCreatedId}from"./chunk-YJNMDXEG.js";import"./chunk-CJZE7647.js";import{monitorsAddSubcommand}from"./chunk-5ZCSFPWG.js";import{printError}from"./chunk-33HVDSWP.js";import"./chunk-NLK7NGVP.js";import"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-Z2KANBOU.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-DJZBJC2A.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-UG3FZ5Q7.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import"./chunk-4SS6W6JK.js";import{validateJsonOutput}from"./chunk-FEJD7MRH.js";import"./chunk-AW33SRYY.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import"./chunk-GLIQ4KNY.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";function applyScopeFlag(client,body,type,scope,flags,jsonOutput){if(Object.hasOwn(body,"ruleScope"))return flags["--project"]||flags["--all"]?outputRulesError(client,jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both."):void 0;if(flags["--project"]){body.ruleScope=type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]};return}if(flags["--all"]){if(type==="custom")return outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>.");body.ruleScope={type:"all"};return}return outputRulesError(client,jsonOutput,"MISSING_SCOPE","Missing monitor scope. Add ruleScope to the body, or pass --project or --all.")}async function resolveCreateScope(client,flags,jsonOutput){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,"monitors add"):resolveRulesTeam(client,jsonOutput)}async function add(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsAddSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors add --project <name-or-id> --body <path>"),printError(error),2}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);if(!flags["--body"])return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS","Missing required option: --body <PATH>.");let body=readRuleBody(client,flags["--body"],format.jsonOutput);if(typeof body=="number")return body;let type=getBodyType(body);if(!type)return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE","Create body must set a supported monitor type.");if(Object.hasOwn(body,"ruleScope")&&(flags["--project"]||flags["--all"]))return outputRulesError(client,format.jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both.");if(type==="custom"&&flags["--all"])return outputRulesError(client,format.jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>.");let scope=await resolveCreateScope(client,flags,format.jsonOutput);if(typeof scope=="number")return scope;let scopeError=applyScopeFlag(client,body,type,scope,flags,format.jsonOutput);if(scopeError!==void 0)return scopeError;output_manager_default.spinner("Creating monitor\u2026");try{let response=await client.fetch(rulesCollectionPath(api,scope.teamId),{method:"POST",body});return trackCreatedId(client,"monitor",response[api.itemKey]?.id),format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
8
- `):printRuleMutationReceipt("Created",response[api.itemKey],client.argv),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{add as default};
@@ -1,8 +0,0 @@
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{emitVcrArgParseError,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-RDDIWY3O.js";import{outputError}from"./chunk-ZJNDLFZ7.js";import"./chunk-M32HBBPK.js";import"./chunk-D3M2JG5C.js";import"./chunk-GD7AV7BO.js";import{trackCreatedId}from"./chunk-YJNMDXEG.js";import{addSubcommand}from"./chunk-BMIYC2MH.js";import"./chunk-6CJFPT4F.js";import"./chunk-ZZD5W5KT.js";import"./chunk-VHSAI6FS.js";import{printError}from"./chunk-33HVDSWP.js";import"./chunk-NLK7NGVP.js";import"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-Z2KANBOU.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-DJZBJC2A.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-UG3FZ5Q7.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-4SS6W6JK.js";import"./chunk-FEJD7MRH.js";import"./chunk-AW33SRYY.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import"./chunk-GLIQ4KNY.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(addSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr create <name> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let name=parsedArgs.args[0],project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),!name)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository name. Example: ${packageName} vcr create <name>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr create <name>"),when:"Replace <name> with the repository name to create"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel vcr create <name>`");let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=`/v1/vcr/repository?teamId=${encodeURIComponent(scope.teamId)}`;output_manager_default.spinner("Creating repository...");try{let created=await client.fetch(path,{method:"POST",body:{projectId:scope.projectId,name}});return trackCreatedId(client,"vcr-repository",created.repository?.id),fr.jsonOutput?client.stdout.write(`${JSON.stringify(created,null,2)}
8
- `):output_manager_default.success(`Created repository ${created.repository?.name??name}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List existing repositories (a name conflict means it already exists)"}});throw err}finally{output_manager_default.stopSpinner()}}export{add as default};
@@ -1,8 +0,0 @@
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{parseTeamRefs,teamRefBody}from"./chunk-LSF7FY6X.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-RDDIWY3O.js";import{require_async_sema}from"./chunk-NZ2TFADV.js";import{outputError}from"./chunk-ZJNDLFZ7.js";import"./chunk-M32HBBPK.js";import"./chunk-D3M2JG5C.js";import"./chunk-GD7AV7BO.js";import{permissionsAddSubcommand}from"./chunk-6CJFPT4F.js";import{printError}from"./chunk-33HVDSWP.js";import"./chunk-NLK7NGVP.js";import"./chunk-Z2KANBOU.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-DJZBJC2A.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-UG3FZ5Q7.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-4SS6W6JK.js";import"./chunk-FEJD7MRH.js";import"./chunk-AW33SRYY.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-GLIQ4KNY.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_sema=__toESM(require_async_sema(),1);var USAGE="vcr permissions <repository> add <team>[,<team>...]";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsAddSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],teamRefs=parseTeamRefs(parsedArgs.args.slice(2)),project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),teamRefs.length===0)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing team. Example: ${packageName} vcr permissions ${repository} add team_1a2b3c4d`,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Replace <team> with a team id or slug (comma-separate multiple teams)"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${USAGE}\``);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPermissionsPath(scope,repository),added=[],failed=[];output_manager_default.spinner(`Sharing ${repository} with ${teamRefs.length===1?teamRefs[0]:`${teamRefs.length} teams`}...`);let sema=new import_async_sema.default(10),results;try{results=await Promise.all(teamRefs.map(async team=>{await sema.acquire();try{let result=await client.fetch(path,{method:"POST",body:teamRefBody(team)});return{ok:!0,team,permission:result.permission}}catch(err){if(!isAPIError(err))throw err;let message=err.serverMessage||`API error (${err.status}).`;return{ok:!1,team,failure:{team,code:err.code||"API_ERROR",message}}}finally{sema.release()}}))}finally{output_manager_default.stopSpinner()}for(let result of results)result.ok?(added.push(result.permission),fr.jsonOutput||output_manager_default.success(`Shared ${repository} with ${result.permission?.teamSlug??result.team}`)):(failed.push(result.failure),fr.jsonOutput||output_manager_default.error(`Failed to share ${repository} with ${result.team}: ${result.failure.message}`));return failed.length>0&&outputAgentError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:`Failed to share ${repository} with ${failed.map(f=>`${f.team} (${f.message})`).join(", ")}`},1),fr.jsonOutput&&client.stdout.write(`${JSON.stringify({permissions:added,failed},null,2)}
8
- `),failed.length>0?1:0}export{add as default};
@@ -1,7 +0,0 @@
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{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isBuildxAvailable,isEngineInstalled,pushCompressionArgs,reportEngineCommandFailure,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-RDDIWY3O.js";import{outputError}from"./chunk-ZJNDLFZ7.js";import"./chunk-M32HBBPK.js";import"./chunk-D3M2JG5C.js";import"./chunk-GD7AV7BO.js";import{buildSubcommand}from"./chunk-BMIYC2MH.js";import"./chunk-6CJFPT4F.js";import"./chunk-ZZD5W5KT.js";import"./chunk-VHSAI6FS.js";import{printError}from"./chunk-33HVDSWP.js";import"./chunk-NLK7NGVP.js";import"./chunk-Z2KANBOU.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-DJZBJC2A.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-UG3FZ5Q7.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-4SS6W6JK.js";import"./chunk-FEJD7MRH.js";import"./chunk-AW33SRYY.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-GLIQ4KNY.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";var DEFAULT_PLATFORM="linux/amd64";async function build(client,telemetry){let{own,passthrough}=splitPassthrough(client.argv),parsedArgs;try{parsedArgs=parseArguments(own,getFlagsSpecification(buildSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr build <engine> [path] [name[:tag]]"),printError(err),2}let[engineArg,pathArg,nameArg]=parsedArgs.args.slice(2),project=parsedArgs.flags["--project"],platform=parsedArgs.flags["--platform"],push=!!parsedArgs.flags["--push"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliArgumentPath(pathArg),telemetry.trackCliArgumentName(nameArg),telemetry.trackCliOptionProject(project),telemetry.trackCliOptionPlatform(platform),telemetry.trackCliFlagPush(push),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr build docker"),when:"Replace docker with the container tool you use"}]},2),outputError(client,!1,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,!1);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,!1,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:!1});if(typeof scope=="number")return scope;let parsed=parseNameArg(nameArg,scope.projectName);if("error"in parsed)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:parsed.error},2),outputError(client,!1,"INVALID_ARGUMENTS",parsed.error);let validationError=validateImageParts(parsed);if(validationError)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:validationError},2),outputError(client,!1,"INVALID_ARGUMENTS",validationError);let ref=`${buildRepositoryReference({registry:resolveRegistry(),teamSlug:scope.teamSlug,projectName:scope.projectName,repository:parsed.repository})}:${parsed.tag??DEFAULT_TAG}`,contextPath=pathArg??".",buildPlatform=platform??DEFAULT_PLATFORM;if(push&&engine==="docker"&&await isBuildxAvailable()){let outputSpec=`type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`,engineArgs2=["buildx","build","--platform",buildPlatform,"--output",outputSpec,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);let result2=await runEngine(engine,engineArgs2,{cwd:client.cwd,captureStderr:!0});return result2.exitCode!==0?reportEnginePushFailure(client,engine,"buildx build",result2):(output_manager_default.success(`Built and pushed ${ref} (zstd compression)`),0)}push&&engine==="docker"&&output_manager_default.warn("Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes.");let engineArgs=["build","--platform",buildPlatform,"--tag",ref,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);let result=await runEngine(engine,engineArgs,{cwd:client.cwd});if(result.exitCode!==0)return reportEngineCommandFailure(client,engine,"build",result);if(!push)return output_manager_default.success(`Built ${ref}`),output_manager_default.log(`Push it with \`${buildCommandWithGlobalFlags(client.argv,`vcr push ${engine}${nameArg?` ${nameArg}`:""}`)}\`.`),0;let pushArgs=["push",...pushCompressionArgs(engine),ref];output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);let pushResult=await runEngine(engine,pushArgs,{cwd:client.cwd,captureStderr:!0});if(pushResult.exitCode!==0)return reportEnginePushFailure(client,engine,"push",pushResult);let compressed=engine!=="docker";return output_manager_default.success(`Built and pushed ${ref}${compressed?" (zstd compression)":""}`),0}export{build as default};
@@ -1,7 +0,0 @@
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{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,sinceOption,untilOption}from"./chunk-CFJBDBYH.js";var usageCommand={name:"usage",aliases:[],summary:"Show billing usage and costs",description:"Show billing usage and costs for the current billing cycle or a custom date range",arguments:[],options:[{...sinceOption,description:"Start time: YYYY-MM-DD (midnight LA time), ISO 8601, or relative, like 7d (default: start of the current billing cycle)"},{...untilOption,description:"End time: YYYY-MM-DD (end of day LA time), ISO 8601, or relative; requires --since (default: now)"},{name:"from",shorthand:null,type:String,deprecated:!0},{name:"to",shorthand:null,type:String,deprecated:!0},{name:"breakdown",shorthand:null,type:String,argument:"PERIOD",description:"Show usage breakdown by time period instead of aggregated totals (daily, weekly, monthly)",deprecated:!1},{name:"group-by",shorthand:null,type:String,argument:"DIMENSION",description:"Group usage by a dimension instead of aggregated totals (project, region)",deprecated:!1},formatOption,jsonOption],examples:[{name:"Show usage for the current billing period",value:`${packageName} billing usage`},{name:"Show usage for a custom date range",value:`${packageName} billing usage --since 2025-01-01 --until 2025-01-31`},{name:"Show usage for the last 7 days",value:`${packageName} billing usage --since 7d`},{name:"Show daily usage breakdown",value:`${packageName} billing usage --breakdown daily`},{name:"Show weekly usage breakdown",value:`${packageName} billing usage --breakdown weekly`},{name:"Show usage grouped by project",value:`${packageName} billing usage --group-by project`},{name:"Show usage grouped by region",value:`${packageName} billing usage --group-by region`},{name:"Output usage data as JSON",value:`${packageName} billing usage --json`}]};export{usageCommand};
@@ -1,7 +0,0 @@
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{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-REJLEESP.js";import{pullEnvRecords}from"./chunk-2AU6O6Z5.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{remoteText}from"./chunk-GLIQ4KNY.js";import{__toESM}from"./chunk-BZENIQ7N.js";import{existsSync,readFileSync}from"node:fs";import{homedir}from"node:os";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir)),setting=typeof rootDirectorySetting=="string"?normalizeRelative(rootDirectorySetting):"";if(linkLocation===""){let gitRoot=setting!==""&&!existsSync(join(anchorDir,setting))?findEnclosingGitRoot(anchorDir):null;return gitRoot&&normalizeRelative(relative(gitRoot,anchorDir))===setting?{repoRoot,resolvedRootDirectory:"",ignoreRootDirectory:!0,advisory:`Ignoring the Root Directory ${quote(setting,setting)} of the project linked in "${anchorDir}": it is the path of this directory in its Git repository, and ${quote(join(anchorDir,setting),setting)} does not exist. The build uses the linked directory. To correct this, link the project from "${gitRoot}", or clear the Root Directory in the Project Settings and pull them again.`}:{repoRoot,resolvedRootDirectory:""}}return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting ${quote(setting,setting)} for the project linked in "${anchorDir}": ${quote(join(anchorDir,setting),setting)} does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function findEnclosingGitRoot(dir){if(existsSync(join(dir,".git")))return null;let home=homedir(),current=dir;for(let i=0;i<64;i++){let parent=dirname(current);if(parent===current||parent===home)return null;if(existsSync(join(parent,".git")))return parent;current=parent}return null}var PLAIN_PATH=/^[\p{L}\p{N}_.@-]+(?:\/[\p{L}\p{N}_.@-]+)*\/?$/u;function isPlainPath(value){return typeof value=="string"&&value.length<=256&&PLAIN_PATH.test(value)}function quote(text,setting){return isPlainPath(setting)?`"${text}"`:remoteText(JSON.stringify(text))}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}export{resolvePerDirectoryLinkRoot,isPlainPath,fetchDeploymentBuildEnv};
@@ -1,11 +0,0 @@
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{linkCommand}from"./chunk-FEJD7MRH.js";import{InvalidToken,LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-GOI2VVI7.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-B4KA3ZH2.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{recordCliError}from"./chunk-AP6DZGTK.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{arg_common_default,getFlagsSpecification,getGlobalFlagsFromArgs,normalizeFlagName,quoteArg,quoteEnvPlaceholder,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-CFJBDBYH.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",ROOT_DIRECTORY_NOT_FOUND:"root_directory_not_found",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",AGENT_CANNOT_SWITCH:"agent_cannot_switch",API_ERROR:"api_error",INVALID_REQUEST:"invalid_request",PAYMENT_REQUIRED:"payment_required",DRIVE_NOT_INITIALIZED:"drive_not_initialized",STDIN_ERROR:"stdin_error",RATE_LIMITED:"rate_limited",NETWORK_ERROR:"network_error",PARTIAL_FAILURE:"partial_failure",GIT_NOT_CONNECTED:"git_not_connected",NATIVE_BINARY_UNAVAILABLE:"native_binary_unavailable",PLATFORM_UNSUPPORTED:"platform_unsupported",SPAWN_FAILED:"spawn_failed",UNKNOWN_COMMAND:"unknown_command",MISSING_COMMAND:"missing_command",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",BRANCH_NOT_FOUND:"branch_not_found",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",PRICE_CHANGED:"price_changed",EFFECTS_CHANGED:"effects_changed",CONFLICT:"conflict",DOMAIN_NOT_AVAILABLE:"domain_not_available",TLD_NOT_SUPPORTED:"tld_not_supported",PAYMENT_FAILED:"payment_failed",PAYMENT_AUTHENTICATION_REQUIRED:"payment_authentication_required",UNKNOWN_OUTCOME:"unknown_outcome",PURCHASE_IN_PROGRESS:"purchase_in_progress",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",PAGE_INTEGRITY_NOT_AVAILABLE:"page_integrity_not_available",PATHS_NOT_APPLIED:"paths_not_applied",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_SINGLE_AT_PASSED:"schedule_single_at_passed",SCHEDULE_ALREADY_ACTIVE:"schedule_already_active",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",REDIRECT_FAILED:"redirect_failed",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",PLAN_LIMIT:"plan_limit",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination",BRANCH_USED_FOR_ENV_VARIABLE:"branch_used_for_env_variable",BRANCH_USED_FOR_DOMAIN:"branch_used_for_domain",TARGET_CONFLICT:"target_conflict",BOARD_NOT_FOUND:"board_not_found",CHANNEL_NOT_FOUND:"channel_not_found",MESSAGE_NOT_FOUND:"message_not_found",DEPLOYMENT_PROTECTED:"deployment_protected",WRONG_PROJECT:"wrong_project",WRONG_URL:"wrong_url",AMBIGUOUS_AGENT:"ambiguous_agent",UNKNOWN_OPTION:"unknown_option",FILE_NOT_FOUND:"file_not_found",WRITE_FAILED:"write_failed",BOARD_OUTDATED:"board_outdated",TIMEOUT:"timeout",FIRST_DEPLOYMENT_PRODUCTION:"first_deployment_production",BLOB_PREFLIGHT_FAILED:"blob_preflight_failed",BLOB_SETUP_REQUIRED:"blob_setup_required",CONNECT_METHOD_UNAVAILABLE:"connect_method_unavailable",CONNECT_PREFLIGHT_FAILED:"connect_preflight_failed",CONNECT_PRODUCTION_REQUIRED:"connect_production_required",CONNECT_SETUP_FAILED:"connect_setup_failed",CONNECT_SETUP_INCOMPLETE:"connect_setup_incomplete",CONNECT_SETUP_REQUIRED:"connect_setup_required",CONNECT_TRIGGER_LIMIT:"connect_trigger_limit",CONNECT_TRIGGERS_UNSUPPORTED:"connect_triggers_unsupported",CONNECTION_CHANGED:"connection_changed",CONNECTOR_CHANGED:"connector_changed",CONNECTOR_MISMATCH:"connector_mismatch",COPY_UNVERIFIED:"copy_unverified",DEPLOYMENT_CHANGED:"deployment_changed",DEPLOYMENT_ENVIRONMENT_MISMATCH:"deployment_environment_mismatch",DEPLOYMENT_FAILED:"deployment_failed",ENVIRONMENT_INCOMPLETE:"environment_incomplete",GITHUB_SETUP_REQUIRED:"github_setup_required",GROUP_CHANGED:"group_changed",INVALID_CONFIG:"invalid_config",INVALID_GROUP_NAME:"invalid_group_name",INVALID_MICROFRONTENDS:"invalid_microfrontends",INVALID_RESOURCE:"invalid_resource",INVALID_RESOURCE_METADATA:"invalid_resource_metadata",INVALID_RUN:"invalid_run",INVALID_SOURCE:"invalid_source",MISSING_RESOURCE_INPUT:"missing_resource_input",MISSING_RESOURCE_METADATA:"missing_resource_metadata",PROJECT_CHANGED:"project_changed",REPOSITORY_MISMATCH:"repository_mismatch",REPOSITORY_REQUIRED:"repository_required",REQUIRED_RESOURCE:"required_resource",RESOURCE_CHANGED:"resource_changed",RESOURCE_UNVERIFIED:"resource_unverified",RUN_LOCKED:"run_locked",RUN_MISMATCH:"run_mismatch",SOURCE_CHANGED:"source_changed",SOURCE_UNAVAILABLE:"source_unavailable",TEMPLATE_NOT_DEPLOYABLE:"template_not_deployable",UNSUPPORTED_PROTOCOL_SETTINGS:"unsupported_protocol_settings",DEPRECATED:"deprecated",GIT_REPOSITORY_MISMATCH:"git_repository_mismatch",ROOT_DIRECTORY_IGNORED:"root_directory_ignored",LIMIT_CLAMPED:"limit_clamped",STRICT_DYNAMIC:"strict_dynamic",METRICS_UNAVAILABLE:"metrics_unavailable",STREAM_GAP:"stream_gap",INCOMPLETE_RESULTS:"incomplete_results",PRODUCTION_DEPLOYMENT_AFFECTED:"production_deployment_affected",COMMAND_FAILED:"command_failed",INTERNAL_ERROR:"internal_error"},USAGE_ERROR_REASONS=new Set(["invalid_arguments","missing_arguments","unknown_command","missing_command","invalid_environment","invalid_type","missing_id","missing_value","missing_name","missing_flags","missing_clients","invalid_clients","conflicting_type_flags","missing_environment","invalid_slug","invalid_name","invalid_alert_thresholds","invalid_budget","invalid_dns_type","invalid_event","invalid_expiration","invalid_port","invalid_refresh_period","invalid_role_combination","invalid_url","missing_events","missing_issuer_id","missing_key_id","missing_key","missing_url","unknown_option","wrong_url","ambiguous_agent","file_not_found","repository_required"]);function getExitCodeForReason(reason){return reason!==void 0&&USAGE_ERROR_REASONS.has(reason)?2:1}var AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};var teamCache=new Map;async function getTeamByIdOrSlug(client,teamIdOrSlug,{useCurrentTeam=!0}={}){let team=teamCache.get(teamIdOrSlug);return team||(team=await client.fetch(`/teams/${encodeURIComponent(teamIdOrSlug)}`,{useCurrentTeam,teamOptional:!0}),teamCache.set(team.id,team),teamCache.set(team.slug,team)),team}var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus",PRIORITY_PROJECT_ENABLE_COMMAND="project priority enable",BUY_PRO_COMMAND="buy pro",PROJECT_ENABLE_COMMAND="project observability enable";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function mentionsPriorityProject(message){return/priority\s+project/i.test(message)||/priority\s+tier/i.test(message)}function observabilityPlusDenialReason(error){if(!error||typeof error!="object"||!("meta"in error))return;let meta=error.meta;if(meta&&typeof meta=="object"&&"reason"in meta&&typeof meta.reason=="string")return meta.reason}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function isHobbyLikePlan(plan){return plan==="hobby"||plan==="oss"}function isProOrEnterprisePlan(plan){return plan==="pro"||plan==="enterprise"}function currentTeamPlan(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.billing?.plan}function planForTeam(idOrSlug){return teamCache.get(idOrSlug)?.billing?.plan}function buyProFix(hint){return{command:BUY_PRO_COMMAND,hint:hint??`Upgrade with ${getCommandName(BUY_PRO_COMMAND)}.`,when:"a person has approved upgrading the plan"}}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function inferDenialReason(message){if(/(?:disabled|switched off|re-enable)/i.test(message))return"subscription_disabled";if(/excluded from it|include the project/i.test(message))return"project_excluded";if(/upgrade your plan/i.test(message)&&/pro and enterprise/i.test(message))return"plan_upgrade_required";if(/(?:quota|usage limit|query limit)/i.test(message))return"quota"}function plusNeedsPlanUpgradeHint(){return`Observability Plus is available on Pro and Enterprise. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}. The add-on cannot be purchased on Hobby.`}function observabilityPlusRecovery(message,denialReason,plan){if(mentionsObservabilityPlus(message))switch(denialReason??inferDenialReason(message)){case"subscription_disabled":return{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."};case"project_excluded":return{command:PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:`Observability Plus is on for the team, but this project is excluded. Enable it with ${getCommandName(PROJECT_ENABLE_COMMAND)}. A new subscription is not needed.`,preserveProject:!1,when:"a person has approved enabling Observability Plus for this project"};case"plan_upgrade_required":return buyProFix(plusNeedsPlanUpgradeHint());case"quota":return{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."};default:return isHobbyLikePlan(plan)?buyProFix(plusNeedsPlanUpgradeHint()):{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}}function priorityProjectRecovery(message,plan){if(mentionsPriorityProject(message))return isHobbyLikePlan(plan)?buyProFix(`Priority Projects are only available on Pro or Enterprise team plans. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}, then run ${getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND)}.`):{command:PRIORITY_PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND),preserveProject:!1,when:"user runs this command in an interactive terminal"}}function observabilityPlanRecovery(message,denialReason,plan){return priorityProjectRecovery(message,plan)??observabilityPlusRecovery(message,denialReason,plan)}var PROJECT_POSITIONAL_COMMANDS=new Set([PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND]);function currentTeamScope(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.slug??id}function targetRecovery(fix,target){if(!fix)return;let targeted=command=>{let out=command;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(command)&&(out+=` ${quoteArg(target.projectName)}`),target.scope&&(out+=` --scope ${quoteArg(target.scope)}`),out},hint=fix.hint;for(let command of[BUY_PRO_COMMAND,OBSERVABILITY_PLUS_PURCHASE_COMMAND,PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND])hint=hint.split(getCommandName(command)).join(getCommandName(targeted(command)));if(!fix.command)return{...fix,hint};let excludeFlags=new Set(fix.excludeFlags??[]),preserveProject=fix.preserveProject;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(fix.command)&&(excludeFlags.add("--project"),preserveProject=!1),fix.command===BUY_PRO_COMMAND&&excludeFlags.add("--project"),target.scope&&(excludeFlags.add("--scope"),excludeFlags.add("--team")),{...fix,command:targeted(fix.command),hint,...excludeFlags.size?{excludeFlags:Array.from(excludeFlags)}:{},...preserveProject!==void 0?{preserveProject}:{}}}function clientObservabilityPlanRecovery(client,error,message,projectName,scope){return targetRecovery(observabilityPlanRecovery(message,observabilityPlusDenialReason(error),scope?planForTeam(scope):currentTeamPlan(client)),{projectName,scope:scope??currentTeamScope(client)})}function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}var TOKENS_URL="https://vercel.com/account/tokens";function isInvalidTokenApiError(error){if(typeof error!="object"||error===null)return!1;let{status,invalidToken,missingToken}=error;return(status===401||status===403)&&(invalidToken===!0||missingToken===!0)}function isInvalidTokenError(error){return error instanceof InvalidToken||isInvalidTokenApiError(error)}function getInvalidTokenRecovery(client){let source=client?.authConfig?.tokenSource,create=`Create a token at ${TOKENS_URL}.`;return{hint:source==="env"?`Replace the token in VERCEL_TOKEN with a valid one, or unset it to use the saved login, then retry. ${create}`:source==="flag"?`Pass a valid token with --token, or set VERCEL_TOKEN, then retry. ${create}`:`Run \`${getCommandNamePlain("login")}\`. It prints a URL and a code. A person opens the URL to approve the login. Or set VERCEL_TOKEN or pass --token with a valid token, then retry. ${create}`,retryable:!1,userActionRequired:!0}}function getFlagExperimentConflict(error){if(error.code!=="experiment_owned_flag"||!error.failedAction)return;let experiment=error.experimentId?`Experiment ${error.experimentId}`:"An experiment";return{message:`Can't ${error.failedAction}. ${experiment} uses it.`,remoteMessage:(error.serverMessage??"").replace(/[\u0000-\u001f\u007f-\u009f]/g," ").trim(),commandTemplate:`experiments inspect ${error.experimentId??"<experiment>"}`}}function experimentInspectCommand(experimentId){return getCommandNamePlain(`experiments inspect ${experimentId??"<experiment>"}`)}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(isInvalidTokenApiError(error))return getInvalidTokenRecovery(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||reason==="not_authorized")return{hint:"Provide valid credentials for the intended account and team, then retry.",retryable:!1,userActionRequired:!0};if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlanRecovery(message,observabilityPlusDenialReason(error),currentTeamPlan(client))?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.code==="experiment_owned_flag")return{hint:`An experiment uses this flag. To see the experiment, run \`${experimentInspectCommand(error.experimentId)}\`.`,retryable:!1,userActionRequired:!0};if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}var import_error_utils=__toESM(require_dist(),1),import_strip_ansi=__toESM(require_strip_ansi(),1);import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function isHelpInvocation(argv){let args=argv.slice(2),separator=args.indexOf("--");return args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h")}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let help=isHelpInvocation(client.argv);client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.map(quoteEnvPlaceholder).join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){let flag=arg==="-e"?"--environment":arg;preserved.push(flag),!flag.includes("=")&&suggestionFlagTakesSeparateValue(flag)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}var LINK_FLAGS={...arg_common_default(),...getFlagsSpecification(linkCommand.options)};function getLinkSuggestionArgs(args){let out=[];for(let i=0;i<args.length;i++){let arg=args[i];if(!arg.startsWith("-"))continue;let spec=LINK_FLAGS[normalizeFlagName(arg)],handler=typeof spec=="string"?LINK_FLAGS[spec]:spec,hasSeparateValue=!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-");if(handler===void 0){hasSeparateValue&&suggestionFlagTakesSeparateValue(arg)&&i++;continue}out.push(arg),hasSeparateValue&&handler!==Boolean&&out.push(args[++i])}return out}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.map(quoteEnvPlaceholder).join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkCommand2=buildCommandWithGlobalFlags(argv,"link",packageName,{preserveProject:!0,excludeFlags:["--scope","--team"]});for(let choice of payload.choices){let slug=choice.name;next.push({command:`${linkCommand2} --scope ${slug}`,when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeActionRequired(client,payload),process.exit(exitCode))}function writeActionRequired(client,payload){let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),recordCliError({code:payload.reason}),writeErrorDocument(client,enriched)}function writeErrorDocument(client,document){if(!client.jsonMode){client.stdout.write(`${JSON.stringify(document,null,2)}
8
- `);return}client.jsonMode.errorWritten=!0;let plain={...document,message:(0,import_strip_ansi.default)(document.message),...document.hint?{hint:(0,import_strip_ansi.default)(document.hint)}:{}};client.stderr.write(`${JSON.stringify(plain)}
9
- `)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function buildInvalidTokenAgentError(client){let source=client.authConfig?.tokenSource;return{status:"error",reason:AGENT_REASON.LOGIN_REQUIRED,message:source==="flag"?"The token passed with --token is not valid.":source==="env"?"The token in VERCEL_TOKEN is not valid.":"The saved login is not valid or has expired.",...getInvalidTokenRecovery(client),...source!=="flag"&&source!=="env"&&{next:[{command:withGlobalFlags(client,"login"),when:"To sign in again; a person approves it in a browser"}]}}}function outputAgentError(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client),...client.isAgent&&payload.reason!==AGENT_REASON.LOGIN_REQUIRED&&{feedback:{message:"Please send one brief feedback report about this error while helping the user resolve it. Don't delay the user's request for feedback.",command:"Run the 'vercel feedback --help' command to see how to report feedback. Make sure all feedback, including text copied from errors or logs, excludes personal data, account identifiers (e.g., usernames, team IDs, project names), and secrets (e.g., API keys, tokens, env values, credentials)."}}};recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,enriched),writeErrorDocument(client,enriched)}function writeTrackedActionRequired(client,payload){let enriched={...payload,...agentErrorMetadata(client)};recordCliError({code:payload.reason,reportOnSuccess:!0}),payload.reason&&trackAgentError(client,{reason:payload.reason,userActionRequired:payload.userActionRequired}),client.stdout.write(`${JSON.stringify(enriched,null,2)}
10
- `)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
11
- `),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --query ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --query <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isInvalidTokenError(err)){writeAgentErrorPayloadAndExit(client,buildInvalidTokenAgentError(client),exitCode,variant);return}if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{AGENT_STATUS,AGENT_REASON,getExitCodeForReason,AGENT_ACTION,teamCache,getTeamByIdOrSlug,PRIORITY_PROJECT_ENABLE_COMMAND,BUY_PRO_COMMAND,isProOrEnterprisePlan,buyProFix,targetRecovery,clientObservabilityPlanRecovery,TOKENS_URL,isInvalidTokenApiError,isInvalidTokenError,getFlagExperimentConflict,getErrorRecovery,agentErrorMetadata,trackAgentError,isHelpInvocation,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getLinkSuggestionArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,writeActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,buildInvalidTokenAgentError,outputAgentError,writeAgentError,writeTrackedActionRequired,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
@@ -1,12 +0,0 @@
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{require_dist as require_dist2}from"./chunk-KSGN5OCV.js";import{validateConfig}from"./chunk-76DSBD4X.js";import{compileVercelConfig}from"./chunk-O7GNYVVM.js";import{readJSONFile}from"./chunk-FFN3EGSF.js";import{init_dist,parse,stringify}from"./chunk-U4Z2MMOF.js";import{require_dist}from"./chunk-VPSR2O55.js";import{CantParseJSONFile}from"./chunk-GOI2VVI7.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__toESM}from"./chunk-BZENIQ7N.js";init_dist();var import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename,join as join2}from"path";var import_build_utils=__toESM(require_build_utils(),1);import{join}from"path";function createDetectEntrypoint(projectRoot){return async({workPath,framework})=>{let absWorkPath=(0,import_build_utils.normalizePath)(join(projectRoot,workPath)),builderName;if((0,import_build_utils.isPythonFramework)(framework))builderName="@vercel/python";else if((0,import_build_utils.isNodeBackendFramework)(framework))builderName="@vercel/backends";else if(framework==="go")builderName="@vercel/go";else if(framework==="rust")builderName="@vercel/rust";else return null;let detectEntrypoint=await loadBuilderDetectEntrypoint(builderName,projectRoot);return detectEntrypoint?detectEntrypoint(builderName==="@vercel/python"?{workPath:absWorkPath,framework}:{workPath:absWorkPath}):null}}async function loadBuilderDetectEntrypoint(name,projectRoot){let{importBuilders}=await import("./import-builders-I4JB6BA6.js"),loaded=(await importBuilders(new Set([name]),projectRoot)).get(name);if(!loaded)return;let detect=loaded.builder.detectEntrypoint;return typeof detect=="function"?detect:void 0}function getServicesConfiguration(config){let configuredServices=config?.services??config?.experimentalServicesV2??config?.experimentalServices,configuredServicesType=config?.services?"services":config?.experimentalServicesV2?"experimentalServicesV2":config?.experimentalServices?"experimentalServices":void 0;return{configuredServices,configuredServicesType}}async function loadVercelConfig(cwd){try{let{configPath}=await compileVercelConfig(cwd);if(!configPath)return null;let config=await readJSONFile(configPath);return config instanceof Error?null:config}catch{return null}}function isServicesEnvEnabled(){let value=process.env.VERCEL_USE_EXPERIMENTAL_SERVICES;return value==="1"||value?.toLowerCase()==="true"}async function isExperimentalServicesEnabled(cwd){let{configuredServices}=getServicesConfiguration(await loadVercelConfig(cwd));return isServicesEnvEnabled()||configuredServices!==void 0}async function tryDetectServices(cwd,config){config===void 0&&(config=await loadVercelConfig(cwd));let configuration=getServicesConfiguration(config);if(!isServicesEnvEnabled()&&!configuration.configuredServices)return null;let fs=new import_fs_detectors.LocalFileSystemDetector(cwd),result=await(0,import_service_topology.detectServices)({fs,configuredServices:configuration.configuredServices,configuredServicesType:configuration.configuredServicesType,detectEntrypoint:createDetectEntrypoint(cwd)});return result.errors.some(e=>e.code==="NO_SERVICES_CONFIGURED")?null:result}async function writeServicesConfig(cwd,config){let prepared=await prepareServicesConfigWrite(cwd,config);return await writeFile(prepared.configPath,prepared.content,"utf8"),{configFileName:basename(prepared.configPath)}}async function getServicesConfigWriteBlocker(cwd,config){try{return await prepareServicesConfigWrite(cwd,config),null}catch(error){return getServicesConfigWriteBlockerFromError(error)}}function toProjectServicesConfigPatch(config){let services={};for(let[name,svc]of Object.entries(config)){let buildCommand=svc.preDeployCommand&&svc.buildCommand?`${svc.buildCommand} && ${svc.preDeployCommand}`:svc.preDeployCommand||svc.buildCommand;services[name]={root:svc.root,...svc.framework?{framework:svc.framework}:{},...svc.entrypoint?{entrypoint:svc.entrypoint}:{},...buildCommand?{buildCommand}:{}}}let rewrites=(0,import_service_topology.generateServiceRewrites)(config);return{services,...rewrites.length>0?{rewrites}:{}}}async function prepareServicesConfigWrite(cwd,config){let compileResult=await compileVercelConfig(cwd),configPath=join2(cwd,"vercel.json");if(compileResult.sourceFile==="vercel.toml")return prepareTomlServicesConfigWrite(join2(cwd,"vercel.toml"),config);if(compileResult.wasCompiled)throw new Error(`Cannot automatically update ${compileResult.sourceFile??"the current Vercel config"}.`);let existingConfig={};if(compileResult.configPath&&basename(compileResult.configPath)==="vercel.json"){let result=await readJSONFile(configPath);if(result instanceof CantParseJSONFile)throw result;existingConfig=result??{}}let patch=toProjectServicesConfigPatch(config),nextConfig={...existingConfig,...patch,...patch.rewrites?{rewrites:[...existingConfig.rewrites??[],...patch.rewrites]}:{}},validationError=validateConfig(nextConfig);if(validationError)throw validationError;return{configPath,content:JSON.stringify(nextConfig,null,2)+`
8
- `}}async function prepareTomlServicesConfigWrite(configPath,config){let patch=toProjectServicesConfigPatch(config),patchKeys=Object.keys(patch),existingContent;try{existingContent=await readFile(configPath,"utf8")}catch{existingContent=""}if(existingContent.trim()){let existingParsed=parse(existingContent),overlapping=patchKeys.filter(key=>key in existingParsed);if(overlapping.length>0){let plural=overlapping.length>1,keyList=overlapping.map(k=>`"${k}"`).join(", ");throw new Error(`Cannot automatically update vercel.toml: key${plural?"s":""} ${keyList} already exist${plural?"":"s"}.`)}}let patchToml=stringify(patch),content=existingContent.trim()?existingContent.trimEnd()+`
9
-
10
- `+patchToml+`
11
- `:patchToml+`
12
- `;return{configPath,content}}function getServicesConfigWriteBlockerFromError(error){switch(error?.code){case"EXPERIMENTAL_SERVICES_AND_BUILDS":case"SERVICES_AND_BUILDS":return"builds";case"EXPERIMENTAL_SERVICES_AND_FUNCTIONS":case"SERVICES_AND_FUNCTIONS":return"functions";default:return null}}export{createDetectEntrypoint,loadVercelConfig,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig,getServicesConfigWriteBlocker};
@@ -1,7 +0,0 @@
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{require_dist as require_dist2}from"./chunk-VPSR2O55.js";import{require_dist}from"./chunk-ISSNEDG5.js";import{require_types}from"./chunk-AW33SRYY.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_constants=__commonJS({"../runtimes/dist/constants.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),constants_exports={};__export(constants_exports,{BUILDER_RUNTIMES:()=>BUILDER_RUNTIMES,CONTAINER_ENTRYPOINT_CANDIDATES:()=>CONTAINER_ENTRYPOINT_CANDIDATES,ENTRYPOINT_EXTENSIONS:()=>ENTRYPOINT_EXTENSIONS,ROUTE_OWNING_BUILDERS:()=>ROUTE_OWNING_BUILDERS,RUNTIME_BUILDERS:()=>RUNTIME_BUILDERS,RUNTIME_MANIFESTS:()=>RUNTIME_MANIFESTS,STATIC_BUILDERS:()=>STATIC_BUILDERS});module.exports=__toCommonJS(constants_exports);var RUNTIME_BUILDERS={node:"@vercel/backends",python:"@vercel/python",go:"@vercel/go",rust:"@vercel/rust",ruby:"@vercel/ruby",container:"@vercel/container"},RUNTIME_MANIFESTS={node:["package.json"],python:["pyproject.toml","requirements.txt","Pipfile","pylock.yml","uv.lock","setup.py"],go:["go.mod"],ruby:["Gemfile"],rust:["Cargo.toml"]},ENTRYPOINT_EXTENSIONS={".ts":"node",".mts":"node",".js":"node",".mjs":"node",".cjs":"node",".py":"python",".go":"go",".rs":"rust",".rb":"ruby",".ru":"ruby"},BUILDER_RUNTIMES={...Object.fromEntries(Object.entries(RUNTIME_BUILDERS).map(([runtime,builder])=>[builder,runtime])),"@vercel/node":"node","@vercel/next":"node","@vercel/remix-builder":"node","@vercel/redwood":"node","@vercel/hydrogen":"node","@vercel/express":"node","@vercel/hono":"node","@vercel/h3":"node","@vercel/koa":"node","@vercel/nestjs":"node","@vercel/fastify":"node","@vercel/elysia":"node"},STATIC_BUILDERS=new Set(["@vercel/static-build","@vercel/static"]),ROUTE_OWNING_BUILDERS=new Set(["@vercel/next","@vercel/backends"]),CONTAINER_ENTRYPOINT_CANDIDATES=["Dockerfile.vercel","Containerfile.vercel","Dockerfile","Containerfile"]}});var require_entrypoint=__commonJS({"../runtimes/dist/entrypoint.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),entrypoint_exports={};__export(entrypoint_exports,{isDockerfileEntrypoint:()=>isDockerfileEntrypoint,isNodeScheduleEntrypoint:()=>isNodeScheduleEntrypoint2,parsePyModuleAttrEntrypoint:()=>parsePyModuleAttrEntrypoint,parsePythonScheduleModule:()=>parsePythonScheduleModule2,stripTrailingSlash:()=>stripTrailingSlash});module.exports=__toCommonJS(entrypoint_exports);var import_path=__require("path"),import_constants=require_constants(),PYTHON_MODULE_ATTR_RE=/^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/,PYTHON_MODULE_RE=/^[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*$/,SOURCE_FILE_RE=/\.(?:py|[cm]?[jt]s)$/,NODE_SOURCE_FILE_RE=/\.(?:m?js|[cm]?ts)$/;function parsePyModuleAttrEntrypoint(entrypoint){let match=PYTHON_MODULE_ATTR_RE.exec(entrypoint);if(!match)return null;let[,modulePart,attrName]=match;return!modulePart||!attrName?null:{attrName,filePath:modulePart.replace(/\./g,"/")+".py",moduleName:modulePart}}function parsePythonScheduleModule2(entrypoint){if(!PYTHON_MODULE_RE.test(entrypoint)||SOURCE_FILE_RE.test(entrypoint))return null;let path=entrypoint.replace(/\./g,"/");return{moduleName:entrypoint,sourceFiles:[`${path}/__init__.py`,`${path}.py`]}}function isNodeScheduleEntrypoint2(entrypoint){return NODE_SOURCE_FILE_RE.test(entrypoint)}var CONTAINER_ENTRYPOINT_BASENAMES=new Set(import_constants.CONTAINER_ENTRYPOINT_CANDIDATES.map(name=>name.toLowerCase()));function isDockerfileEntrypoint(entrypoint){return CONTAINER_ENTRYPOINT_BASENAMES.has(import_path.posix.basename(entrypoint).toLowerCase())}function stripTrailingSlash(p){let stripped=p.replace(/\/+$/,"");return stripped===""?".":stripped}}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1),import_entrypoint=__toESM(require_entrypoint(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},run:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs the schedule's `entrypoint`, which is relative to it. Required with `entrypoint`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512},runtime:{description:"Runtime of an `entrypoint` without `run`: `python` for a module path like `jobs.tasks`, or `node` for a JavaScript or TypeScript file.",enum:["python","node"]}},dependencies:{requestMethod:["path"],service:["function"],run:["entrypoint"],entrypoint:["root"],root:["entrypoint"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=500,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string",minLength:1,maxLength:4096},{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=entrypoint=>/(docker|container)file/i.test((0,import_build_utils.splitDockerfileEntrypoint)(entrypoint).path.split(/[\\/]/).pop()??""),toPythonModulePath=entrypoint=>entrypoint.replace(/\.py$/,"").replace(/[\\/]+/g,".").replace(/(^|\.)__init__$/,""),hasInvalidDockerfileStage=entrypoint=>{let{buildTarget}=(0,import_build_utils.splitDockerfileEntrypoint)(entrypoint);return buildTarget!==void 0&&!(0,import_build_utils.isValidDockerfileStage)(buildTarget)};function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),scheduleServices=getScheduleServiceNames(config),destinationServices=new Set(getDestinationServices(config)),invalidSchedule=(code,message)=>new import_build_utils.NowBuildError({code,message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`}),invalidCommand=message=>invalidSchedule("INVALID_SCHEDULE_COMMAND",message),invalidEntrypoint=message=>invalidSchedule("INVALID_SCHEDULE_ENTRYPOINT",message);for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("runtime"in schedule&&("run"in schedule||!("entrypoint"in schedule)))return invalidEntrypoint(`\`${path}.runtime\` is only valid with an \`entrypoint\` and without \`run\`.`);if("entrypoint"in schedule&&!("run"in schedule)){let{entrypoint,runtime}=schedule;if(!runtime)return isDockerfilePath(entrypoint)?invalidEntrypoint(`\`${path}.entrypoint\` names a Dockerfile, so \`${path}\` must set \`run\`.`):invalidEntrypoint(`\`${path}\` must set \`runtime\` to run its \`entrypoint\`: "python" for a module path like "jobs.tasks", or "node" for a .js, .mjs, .ts, .mts or .cts file.`);if(runtime==="python"&&!(0,import_entrypoint.parsePythonScheduleModule)(entrypoint)){let suggestion=entrypoint.endsWith(".py")?toPythonModulePath(entrypoint):"";return invalidEntrypoint(`\`${path}.entrypoint\` "${entrypoint}" must be a Python module path like "${(0,import_entrypoint.parsePythonScheduleModule)(suggestion)?suggestion:"jobs.tasks"}", since \`${path}.runtime\` is "python".`)}if(runtime==="node"&&!(0,import_entrypoint.isNodeScheduleEntrypoint)(entrypoint))return invalidEntrypoint(`\`${path}.entrypoint\` "${entrypoint}" must be a .js, .mjs, .ts, .mts or .cts file, since \`${path}.runtime\` is "node".`);let configured=["schedule","timezone","jitter"].find(key=>key in schedule);if(configured)return invalidEntrypoint(runtime==="node"?`\`${path}\` runs "${entrypoint}", whose \`export const config\` sets its cron, timezone and jitter. Remove \`${path}.${configured}\`.`:`\`${path}\` runs the Python module "${entrypoint}", whose \`@schedule\` handlers set their own cron, timezone and jitter. Remove \`${path}.${configured}\`.`)}else if(!("schedule"in schedule))return invalidSchedule("INVALID_SCHEDULE_EXPRESSION",`\`${path}\` is missing required property \`schedule\`.`);if("run"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.run\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(hasInvalidDockerfileStage(schedule.entrypoint))return invalidCommand(`\`${path}.entrypoint\` "${schedule.entrypoint}" is invalid. ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}if(scheduleServices.has(name)){if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidScheduleService(config,`\`${path}\` runs as a service, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidScheduleService(config,`\`${path}\` runs as service "${name}", which is already the name of a service or daemon.`);if(destinationServices.has(name))return invalidScheduleService(config,`Rewrites and routes cannot target schedule "${name}" because schedules do not receive traffic.`)}if(!(!("timezone"in schedule)||schedule.timezone===void 0))try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Service "${serviceName}"`,binding.service):new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons)),scheduleServices=getScheduleServiceNames(config);for(let[name,daemon]of Object.entries(daemons)){if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);if(hasInvalidDockerfileStage(daemon.entrypoint))return invalid(`Daemon "${name}" has invalid \`entrypoint\` "${daemon.entrypoint}". ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Daemon "${name}"`,binding.service):invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let daemonTarget=getDestinationServices(config).find(isDaemonTarget);return daemonTarget?invalid(`Rewrites and routes cannot target daemon "${daemonTarget}" because daemons do not receive traffic.`):null}function getScheduleServiceNames(config){return new Set(Object.entries(config.schedules??{}).filter(([,schedule])=>"entrypoint"in schedule||"run"in schedule).map(([name])=>name))}function invalidScheduleService(config,message){return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_SERVICE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`})}function scheduleBindingError(config,binder,schedule){return invalidScheduleService(config,`${binder} cannot bind to schedule "${schedule}" because schedules do not receive traffic.`)}function getDestinationServices(config){let services={...config.experimentalServicesV2,...config.services};return[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].flatMap(entry=>{let destination="destination"in entry?entry.destination:void 0;return typeof destination=="object"&&destination!==null?[destination.service]:[]})}export{require_constants,require_entrypoint,buildVercelConfigSchema,validateConfig};
@@ -1,8 +0,0 @@
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{canPrompt}from"./chunk-IQ7FPAI4.js";import{humanizePath,require_lib}from"./chunk-Z2KANBOU.js";import{AGENT_REASON,AGENT_STATUS,outputActionRequired}from"./chunk-4SS6W6JK.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths,{allowFiles=!1}={}){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);if(!pathStat)return output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1};let isFile=pathStat.isFile();if(!pathStat.isDirectory()&&!(allowFiles&&isFile))return output_manager_default.fatal(allowFiles?"Deploy a regular file or directory. Symbolic links and special files are not supported as deployment paths.":"This command requires a directory. Use `vercel <file>` to deploy a single file."),{valid:!1,exitCode:1};if(path===homedir()){if(!canPrompt(client)){let message="Can't deploy your home directory without interactive confirmation. Run from your project directory, or run in a terminal to confirm deploying your home directory.";return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.INTERACTIVE_CONFIRMATION_REQUIRED,message,userActionRequired:!0},2),output_manager_default.error(message),{valid:!1,exitCode:2}}if(!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1))return output_manager_default.print(`Canceled
8
- `),{valid:!1,exitCode:0}}return{valid:!0,path,isFile}}export{validateRootDirectory,validatePaths};
@@ -1,37 +0,0 @@
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{markOnboardingSeen}from"./chunk-S4AANAHX.js";import{isInteractiveHumanRun}from"./chunk-TSNRTRIM.js";import{isGuidanceEnabled}from"./chunk-TAAWMNNL.js";import{require_open}from"./chunk-PVASGBEF.js";import{getTeams}from"./chunk-DOMBKOLJ.js";import{printError}from"./chunk-33HVDSWP.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import{createDpopKey,deleteDpopKey,deviceAccessTokenRequest,deviceAuthorizationRequest,getCachedUsername,getUser,humanizePath,isDpopLoginEnabled,isOAuthError,processDeviceAuthorizationResponse,processTokenResponse}from"./chunk-Z2KANBOU.js";import{parseArguments}from"./chunk-CINNNQDJ.js";import{getTeamByIdOrSlug}from"./chunk-4SS6W6JK.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";import{SPINNER,countRows,output_manager_default}from"./chunk-AP6DZGTK.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk3=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1),open=__toESM(require_open(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import readline from"node:readline";import{KNOWN_AGENTS}from"@vercel/detect-agent";async function updateCurrentTeamAfterLogin(client,ssoTeamId){if(ssoTeamId)client.updateConfig({currentTeam:ssoTeamId});else{let user=null;try{user=await getUser(client)}catch{return output_manager_default.error("Failed to fetch the logged in user. Please try again."),1}client.updateConfig({currentTeam:user.version==="northstar"&&user.defaultTeamId?user.defaultTeamId:void 0})}}var LoginTelemetryClient=class extends TelemetryClient{trackState(...args){this.trackLoginState(...args)}trackDpopKey(storage){this.trackDpopKeyStorage(storage)}};import{performance}from"node:perf_hooks";var{waitingFrame,settledFrame,entrance,period,finishFrame,finishDuration}=(()=>{let TURN=Math.PI*2.5,SPIN2=2,BIRTH=.02,LAG=.045,GROW=.34,PEAK=TURN*2.4/SPIN2,SETTLE=.5,DRAG=3,REACH=24,LABEL_AT=1.95,TYPE=.045,FADE=.1,T0=1.56,DWELL=.8,CLIMB=.12,PUSH=.7,LATE=.5,GLOW=.3,SHEEN=.85,LEN=Math.hypot(.507,.862),LX=-.507/LEN,LZ=-.862/LEN,LIT=-LZ,S=Math.SQRT1_2,NORMALS=[[0,-1],[S,-S],[1,0],[S,S],[0,1],[-S,S],[-1,0],[-S,-S]],entrance2=2.4,period2=7,clamp2=(n,lo=0,hi=1)=>Math.min(hi,Math.max(lo,n)),smooth=n=>n*n*(3-2*n),easeOut=n=>1-(1-n)**3,lerp=(a,b,s)=>a*(1-s)+b*s,toneOf=n=>Math.max(0,Math.min(255,Math.round(n))),bit=(u,r)=>{let h=Math.imul(u,374761393)^Math.imul(r+11,668265263);return h=Math.imul(h^h>>>13,1274126177),h>>>15&1?"1":"0"},checkTime=time=>{if(typeof time!="number"||!Number.isFinite(time)||time<0)throw new RangeError("time must be a finite number of seconds >= 0")},checkLayout=(width,alignment)=>{if(width!==30&&width!==60)throw new RangeError("width must be 30 or 60");if(alignment!=="left"&&alignment!=="center")throw new RangeError("alignment must be left or center")};function rowAt(t,r){let tau=t-BIRTH-(7-r)*LAG,q=1-clamp2(tau/SPIN2),E=TURN*(8*q**3-3*q**4)/5,vE=tau>0&&tau<SPIN2?-TURN*(24*q*q-12*q**3)/(5*SPIN2):0,phi=(t-T0-(8-1-r)*CLIMB)/period2,f=phi-Math.floor(phi),w=2*Math.PI*f,turn=(1-Math.cos(w))/2,g=easeOut(clamp2(tau/GROW)),settle=1-smooth(clamp2((tau-SPIN2+SETTLE)/SETTLE));return{th:E-Math.PI*f+DWELL/2*Math.sin(w),v:vE-Math.PI/period2*(1-DWELL*Math.cos(w)),g,e:g*Math.min(1,Math.abs(vE)/PEAK+GLOW*turn),live:settle+(1-settle)*SHEEN*turn,drag:E-PUSH*(1-Math.cos(w-LATE))/2,reach:tau/.45}}let restRow=()=>({th:0,v:0,g:1,e:0,live:0,drag:0,reach:9});function labelAt(t){let mix=[];for(let i=0;i<6;i++){let start=LABEL_AT+i*TYPE;mix.push(t<start?0:smooth(clamp2((t-start)/FADE)))}return{mix,keep:t<LABEL_AT?1:1-smooth(clamp2((t-LABEL_AT)/FADE))}}function render(rows,mix,keep,width,alignment){let c=alignment==="left"?12:width/2-4,span=Math.max(c,width-c),grid=[];for(let r=0;r<8;r++){let{th,g,e,live,drag,reach}=rows[r],row=[];for(let x=0;x<width;x++){let dx=x+.5-c,nx=dx/span,k=.35+.65/(1+(dx/REACH)**2),vis=smooth(clamp2((reach-Math.abs(nx))/.3)),tone=toneOf((20+30*e*k)*(1-.72*nx*nx)*vis);row.push(tone>=3?[bit(x-Math.round(drag*DRAG*k),r),tone]:[" ",0])}if(g>0){let hw=10.5*(r+.5)/8*g,hd=8/2*g,ch=Math.min(.5*g,hw/2,hd/2),cs=Math.cos(th),sn=Math.sin(th),at=(px,pz)=>c+px*cs+pz*sn,front=244-2.6*r,fade=.5+.5*g,loop=[[-hw+ch,-hd],[hw-ch,-hd],[hw,-hd+ch],[hw,hd-ch],[hw-ch,hd],[-hw+ch,hd],[-hw,hd-ch],[-hw,-hd+ch]],faces=[];for(let i=0;i<8;i++){let[n0,n1]=NORMALS[i],nx=n0*cs+n1*sn,nz=-n0*sn+n1*cs;if(nz>=-1e-9)continue;let lit=Math.max(0,nx*LX+nz*LZ),tone;i%4===0?tone=56+(front-56)*Math.min(1,lit/LIT)+12*smooth(clamp2((lit-LIT)/(1-LIT))):i%4===2?tone=40+104*lit:tone=front+(48+207*lit**6-front)*live;let p=at(...loop[i]),q=at(...loop[(i+1)%8]);faces.push([Math.min(p,q),Math.max(p,q),tone*fade])}let lo=1/0,hi=-1/0;for(let f of faces)lo=Math.min(lo,f[0]),hi=Math.max(hi,f[1]);let first=-1,last=-1;for(let x=Math.max(0,Math.floor(lo));x<Math.min(width,Math.ceil(hi));x++){let cover=0,ink=0;for(let[l,h,tone2]of faces){let k=Math.max(0,Math.min(x+1,h)-Math.max(x,l));cover+=k,ink+=k*tone2}if(cover<.34)continue;let tone=ink/cover,cell;cover>=.72?cell=["\u2588",tone]:lo>x&&hi>=x+1?cell=["\u2590",tone]:hi<x+1&&lo<=x?cell=["\u258C",tone]:cell=["\u2588",tone*cover];let v=toneOf(cell[1]);v<=0||(row[x]=[cell[0],v],first<0&&(first=x),last=x)}first>0&&(row[first-1]=[" ",0]),last>=0&&last<width-1&&(row[last+1]=[" ",0])}grid.push(row)}let ly=7,lx=c+12;for(let x of[lx-1,lx+6,lx+7]){if(x<0||x>=width)continue;let tone=toneOf(grid[ly][x][1]*keep);grid[ly][x]=tone>=3?[grid[ly][x][0],tone]:[" ",0]}for(let i=0;i<6;i++){let m=mix[i];if(m<=0)continue;let tone=toneOf(grid[ly][lx+i][1]*(1-m)+176*m);grid[ly][lx+i]=tone>0?["Vercel"[i],tone]:[" ",0]}return grid}function waitingFrame2(time,width=60,alignment="left"){checkTime(time),checkLayout(width,alignment);let rows=[];for(let r=0;r<8;r++)rows.push(rowAt(time,r));let{mix,keep}=labelAt(time);return render(rows,mix,keep,width,alignment)}function settledFrame2(width=60,alignment="left"){return checkLayout(width,alignment),render(Array.from({length:8},restRow),[1,1,1,1,1,1],0,width,alignment)}let finishDuration2=3,STEP=1/30,COMMIT=.25,DRIVE=.4,DRIVE_PER=.6,CATCH=2.1,SEAT=.4,LET_GO=.35,RISE=.5,SPEC=1,WARM=.5,WAKE=.9,INK_AT=.3,INK_LEN=.4,PEAK_N=60*.4**2*.6**3,A=s=>1-6*s*s+8*s**3-3*s**4,B=s=>4*s**3-3*s**4,N=s=>60*s*s*(1-s)**3,IA=s=>s-2*s**3+2*s**4-.6*s**5,IB=s=>s**4-.6*s**5,IN=s=>20*s**3-45*s**4+36*s**5-10*s**6,checkProgress=progress=>{if(typeof progress!="number"||!Number.isFinite(progress)||progress<0||progress>1)throw new RangeError("progress must be a number from 0 to 1")};function plan(time){let rows=[],sx=0,sy=0;for(let r=0;r<8;r++){let a=rowAt(time,r),lead=(8-1-r)*STEP,th=a.th+a.v*lead;rows.push({a,lead,th}),sx+=Math.cos(2*th),sy+=Math.sin(2*th)}let mean=Math.atan2(sy,sx)/2,travel=mean-Math.PI*Math.floor(mean/Math.PI);for(travel<COMMIT*Math.PI&&(travel+=Math.PI);;){let drive=DRIVE+DRIVE_PER*travel/Math.PI,forward=!0;for(let row of rows){row.target=Math.PI*Math.round((row.th-travel)/Math.PI),row.from=row.th-row.target,row.k=-row.from/drive-.4*(row.a.v-CATCH);for(let i=0;i<=64&&forward;i++){let s=i/64;row.a.v*A(s)-CATCH*B(s)+row.k*N(s)>0&&(forward=!1)}}if(forward)return{rows,travel,drive,rest:7*STEP+drive+SEAT};travel+=Math.PI}}function poseAt(p,t){let handover=smooth(clamp2(t/LET_GO)),rise=smooth(clamp2(t/RISE)),drive=p.drive;return p.rows.map(({a,lead,target,from,k})=>{let tau=t-lead;if(tau>=drive+SEAT)return{...restRow(),angle:target};let u,v,env=0,wake=0;if(tau<0)u=a.th+a.v*t-target,v=a.v;else if(tau<drive){let s=tau/drive;u=from+drive*(a.v*IA(s)-CATCH*IB(s)+k*IN(s)),v=a.v*A(s)-CATCH*B(s)+k*N(s),env=N(s)/PEAK_N,wake=16*s*s*(1-s)**2}else{let x=(tau-drive)/SEAT;u=-CATCH*SEAT*x*(1-x)**3,v=-CATCH*(1-x)**2*(1-4*x)}return{th:u,v,angle:target+u,g:lerp(a.g,1,rise),e:lerp(a.e,WARM*env,handover),live:lerp(a.live,SPEC*env,handover),drag:a.drag*(1-handover)-WAKE*p.travel/Math.PI*wake,reach:lerp(Math.min(a.reach,9),9,rise)}})}function finishFrame2(time,progress,width=60,alignment="left"){if(checkTime(time),checkLayout(width,alignment),checkProgress(progress),progress===0)return waitingFrame2(time,width,alignment);let p=plan(time),t=progress*finishDuration2;if(progress===1||t>=p.rest)return settledFrame2(width,alignment);let label=labelAt(time),mix=label.mix.map((m0,i)=>lerp(m0,1,smooth(clamp2((t-INK_AT-i*TYPE)/INK_LEN))));return render(poseAt(p,t),mix,lerp(label.keep,0,smooth(clamp2(t/(INK_AT+INK_LEN)))),width,alignment)}return{waitingFrame:waitingFrame2,settledFrame:settledFrame2,entrance:entrance2,period:period2,finishFrame:finishFrame2,finishDuration:finishDuration2}})(),BREATH=.3,VISIT=.5,LEAD=.2,STATUS=.6,SPIN=BREATH+LEAD+STATUS/2,revealDuration=BREATH+LEAD+STATUS,clamp=n=>Math.min(1,Math.max(0,n)),ramp=(time,start,length)=>{let s=clamp((time-start)/length);return s*s*(3-2*s)};function revealFrame(time,reduced=!1){if(typeof time!="number"||!Number.isFinite(time))throw new TypeError("time must be a finite number of seconds");if(typeof reduced!="boolean")throw new TypeError("reduced must be a boolean");return reduced?{visit:1,status:1,spinner:!1,ready:!0}:time>=revealDuration?{visit:1,status:1,spinner:!0,ready:!0}:{visit:ramp(time,BREATH,VISIT),status:ramp(time,BREATH+LEAD,STATUS),spinner:time>=SPIN,ready:!1}}var import_chalk=__toESM(require_source(),1);function encodeGrid(grid,width,colors){return grid.map((row,y)=>{let result="",previous="";for(let x=0;x<width;x++){let[ch,n]=row[x];if(ch===" "||n===0){result+=" ";continue}if(!colors&&(ch==="0"||ch==="1")){let h=Math.imul(x+1,73244475)^Math.imul(y+1,668265261);if(h=Math.imul(h^h>>>16,73244475),((h^h>>>16)>>>0)/4294967296>=n/96){result+=" ";continue}}let style=colors?`\x1B[22;38;2;${colors.background.map((bg,i)=>Math.round(bg+(colors.foreground[i]-bg)*n/255)).join(";")}m`:n<96?"\x1B[2;39m":"\x1B[22;39m";style!==previous&&(result+=style,previous=style),result+=ch}return"\r\x1B[2K"+result.trimEnd()+`\x1B[0m
8
- `}).join("")}function createSignInWelcome(stream,closeInputOnSignal,colors=()=>{},onShown,layout){let columns=stream.columns,rows=stream.rows,width=columns>=61?60:30,footerRows=layout?.footerRows??0,ownedRows=9+footerRows,skipFooter=footerRows?`\x1B[${footerRows}B\r`:"",spinnerIndex=0,formatSpinnerFrame=()=>`${import_chalk.default.gray(SPINNER.frames[spinnerIndex])} ${import_chalk.default.gray("Waiting for authentication...")}`,spinnerFrame=formatSpinnerFrame(),spinnerUpdated=0,shown=!1,stopped=!1,failed=!1,timer,start=0,finishStart,finishFrom=0,keepFinal=!1,finishPromise,resolveFinish,receipt,receiptRows=0,receiptPrinted=!1,receiptQueued=!1,onReceiptShown,authComplete=!1,instructionsReady=!1,instructionsVisible=!1,skipCompletion=!1,finishDeadline,pendingWrites=0,release;function releaseErrorsWhenIdle(){!stopped||pendingWrites||release||(release=setImmediate(()=>{release=void 0,stopped&&!pendingWrites&&stream.removeListener("error",errored)}))}function writePacket(packet,next){pendingWrites++;try{stream.write(packet,error=>{pendingWrites--,error?errored():next?.(),releaseErrorsWhenIdle()})}catch{pendingWrites--,errored(),releaseErrorsWhenIdle()}}let stop=()=>{if(stopped)return;stopped=!0,clearTimeout(timer),clearTimeout(finishDeadline),stream.removeListener("resize",resized),process.removeListener("exit",exiting),process.removeListener("SIGINT",finishInterrupted);for(let[signal,handler]of signals)process.removeListener(signal,handler);let showInstructions=!authComplete&&layout?.instructions&&!instructionsVisible;shown&&!keepFinal&&!receiptQueued&&!failed&&stream.columns===columns&&stream.rows===rows&&writePacket(layout?`\x1B[${ownedRows}A`+`\r\x1B[2K
9
- `.repeat(8)+(showInstructions?layout.instructions:authComplete?`\r\x1B[2K
10
- `.repeat(footerRows):skipFooter)+"\r\x1B[2K\x1B[0m":"\x1B[9A"+`\r\x1B[2K
11
- `.repeat(9)+"\x1B[9A\r\x1B[0m"),showInstructions&&!failed&&(!shown||stream.columns!==columns||stream.rows!==rows)&&writePacket(`
12
- `+layout.instructions),releaseErrorsWhenIdle(),resolveFinish?.(receiptQueued)};stop.text="Waiting for authentication...";let resized=()=>{stopped||(stop(),!authComplete&&!failed&&writePacket(`
13
- Waiting for authentication...
14
- `))},errored=()=>{failed=!0,stop()},exiting=()=>stop(),signals=["SIGTERM","SIGHUP"].map(signal=>[signal,async()=>{stop();try{await closeInputOnSignal?.()}catch{}process.kill(process.pid,signal)}]),finishInterrupted=async()=>{stop();try{await closeInputOnSignal?.()}catch{}process.kill(process.pid,"SIGINT")},finish=(text,onShown2)=>(authComplete=!0,finishPromise||(stopped||!shown?(stop(),Promise.resolve(!1)):(onReceiptShown=onShown2,receipt=text===void 0?void 0:text.endsWith(`
15
- `)?text:text+`
16
- `,receiptRows=receipt===void 0?0:countRows(receipt.slice(0,-1),columns),skipCompletion=receipt!==void 0&&9+receiptRows>=rows,finishPromise=new Promise(resolve=>{resolveFinish=resolve}),finishStart=performance.now(),finishFrom=(finishStart-start)/1e3,clearTimeout(timer),process.once("SIGINT",finishInterrupted),finishDeadline=setTimeout(stop,finishDuration*1e3+250),pendingWrites||tick(),finishPromise)));function ink(text,opacity,quiet=!1){if(opacity<=0)return"";if(opacity>=1&&!quiet)return text;let theme=colors();if(theme){let amount=opacity*(quiet?.53:1);return`\x1B[22;38;2;${theme.background.map((bg,i)=>Math.round(bg+(theme.foreground[i]-bg)*amount)).join(";")}m${text.replace(/\x1b\[[0-9;]*m/g,"")}\x1B[0m`}return opacity<.5?"":`${opacity<1||quiet?"\x1B[2m":""}${text}\x1B[0m`}let tick=()=>{if(stopped)return;if(stream.columns!==columns||stream.rows!==rows){resized();return}let first=!shown;first&&(start=performance.now(),shown=!0);let time=(performance.now()-start)/1e3,progress=finishStart===void 0?0:Math.min(1,(performance.now()-finishStart)/(finishDuration*1e3)),complete=finishStart!==void 0&&(progress>=1||skipCompletion);try{first&&onShown?.();let grid=finishStart===void 0?waitingFrame(time,width):complete?settledFrame(width):finishFrame(finishFrom,progress,width);time-spinnerUpdated>=SPINNER.interval/1e3&&(spinnerIndex=(spinnerIndex+1)%SPINNER.frames.length,spinnerFrame=formatSpinnerFrame(),spinnerUpdated=time);let reveal=layout?.instructions?revealFrame(time-entrance):{visit:1,status:1,spinner:!0,ready:!0},packet=(first?`
17
- `.repeat(layout?.instructions?ownedRows+1:layout?1:9):"")+`\x1B[${ownedRows}A`+encodeGrid(grid,width,colors()),printingReceipt=receipt!==void 0&&!receiptPrinted,showingInstructions=!1;if(receipt!==void 0)printingReceipt?(packet+=`\r\x1B[2K
18
- `.repeat(footerRows+1)+`\x1B[${footerRows+1}A\r`+receipt,ownedRows=8+receiptRows):packet+=`\x1B[${receiptRows}B\r`;else{if(layout?.instructions&&!instructionsReady){let auth=ink(layout.instructions.replace(/\n$/,""),reveal.visit);packet+=auth?auth+`
19
- `:`
20
- `.repeat(footerRows),showingInstructions=reveal.visit===1,instructionsReady=reveal.ready}else packet+=skipFooter;let status=finishStart!==void 0?"Signed in.":reveal.spinner?spinnerFrame:" Waiting for authentication...";packet+=`\r\x1B[2K${ink(status,reveal.status,finishStart===void 0)}
21
- `}printingReceipt&&(receiptQueued=!0),writePacket(packet,()=>{if(showingInstructions&&(instructionsVisible=!0),printingReceipt){receiptPrinted=!0;try{onReceiptShown?.()}catch{}}if(!stopped){if(complete){keepFinal=!0,stop();return}timer=setTimeout(tick,1e3/30)}})}catch{errored()}};stream.on("resize",resized),stream.on("error",errored),process.on("exit",exiting);for(let[signal,handler]of signals)process.on(signal,handler);return timer=setTimeout(tick,300),{stop,wasShown:()=>shown,finish}}var import_strip_ansi=__toESM(require_strip_ansi(),1);function isInteractiveHumanSignIn(client){let command;try{command=parseArguments(client.argv.slice(2),{},{permissive:!0}).args[0]}catch{return!1}return isInteractiveHumanRun(client,command,{allowAgentOverride:!0})&&output_manager_default.stream===client.stderr&&(!output_manager_default.spinnersHidden||client.isAgent||usePlainSignInWait())&&!output_manager_default.debugEnabled}function isUnseen(client,key){return client.config[key]===!1||client.config[key]===void 0&&client.config.usedBefore===!1}function canShowSignInIntroduction(client){return!client.isAgent&&isInteractiveHumanSignIn(client)&&isUnseen(client,"loginIntroductionSeen")&&isGuidanceEnabled(client,void 0,!0)}function canShowSignInWelcome(client){return isInteractiveHumanSignIn(client)&&isUnseen(client,"loginWelcomeSeen")&&!output_manager_default.colorDisabled&&!process.env.NO_COLOR&&process.env.FORCE_COLOR!=="0"&&process.env.TERM!=="dumb"&&!usePlainSignInWait()&&client.stderr.columns>=31&&client.stderr.rows>=16}function reserveSignInWelcome(client,instructions){if(!canShowSignInWelcome(client))return;let text=`
22
- `+instructions.trim()+`
23
-
24
- `,visible=(0,import_strip_ansi.default)(text);if(/[^\x20-\x7e\n]/.test(visible))return;let{columns,rows}=client.stderr,footerRows=countRows(visible.slice(0,-1),columns);if(!(9+footerRows>=rows))return{footerRows,columns,rows,instructions:text}}function startSignInWelcome(client,closeInputOnSignal,colors,onShown,layout){if(!canShowSignInWelcome(client)||layout&&(layout.columns!==client.stderr.columns||layout.rows!==client.stderr.rows))return null;try{let welcome=createSignInWelcome(output_manager_default.stream,closeInputOnSignal,colors,onShown,layout);return output_manager_default.registerSpinner(welcome.stop),welcome}catch{return null}}function usePlainSignInWait(){return process.env.NO_MOTION==="1"||process.env.REDUCE_MOTION==="1"||process.env.VERCEL_ACCESSIBLE==="1"}function markSignInWelcomeSeen(client){markOnboardingSeen(client,"loginWelcomeSeen")}function markSignInIntroductionSeen(client){markOnboardingSeen(client,"loginIntroductionSeen")}import{Transform}from"node:stream";var prefixes=["\x1B]10;","\x1B]11;"];function createWelcomeThemeInput(input,output){let env=process.env,directGhostty=env.TERM_PROGRAM==="ghostty"&&!env.FORCE_COLOR,colorEnv={...env};colorEnv.NO_COLOR===""&&delete colorEnv.NO_COLOR;let depth=directGhostty?24:output.getColorDepth?.(colorEnv)??1;if(!(["ghostty","iTerm.app","Apple_Terminal","WezTerm","vscode"].includes(env.TERM_PROGRAM??"")||env.TERM==="xterm-kitty")||depth<24||env.TMUX||env.STY||!input.isTTY||input.isRaw||input.listenerCount("data")||input.listenerCount("readable")||typeof input.setRawMode!="function")return null;let pending="",colors,foreground,background,requested=!1,accepting=!1,disposed=!1,timer,drainTimer,releaseDrain=()=>{},drained=new Promise(resolve=>{releaseDrain=resolve}),received=new Set,wasFlowing=input.readableFlowing;function reply(value){let channel=/^\x1b\](10|11);/.exec(value)?.[1];if(channel&&received.add(channel),received.size===2&&(clearTimeout(drainTimer),releaseDrain()),!accepting)return;let match=/^\x1b\](10|11);rgb:([\da-f]{1,4})\/([\da-f]{1,4})\/([\da-f]{1,4})$/i.exec(value);if(!match)return;let rgb=match.slice(2).map(hex=>Math.round(parseInt(hex,16)/(16**hex.length-1)*255));match[1]==="10"?foreground=rgb:background=rgb,foreground&&background&&(colors={foreground,background},accepting=!1,clearTimeout(timer))}let filtered=new Transform({transform(chunk,_encoding,callback){pending+=chunk.toString("latin1");let ordinary="";for(;pending;)if(requested&&prefixes.some(prefix=>pending.startsWith(prefix))){let end=/\x07|\x1b\\/.exec(pending),interrupt=pending.indexOf("");if(interrupt>=0&&(!end||interrupt<end.index))ordinary+="",pending=pending.slice(interrupt+1);else if(end)reply(pending.slice(0,end.index)),pending=pending.slice(end.index+end[0].length);else if(pending.length>256)pending="";else break}else{if(requested&&prefixes.some(prefix=>prefix.startsWith(pending)))break;ordinary+=pending[0],pending=pending.slice(1)}callback(null,Buffer.from(ordinary,"latin1"))}}),terminalInput=Object.assign(filtered,{isTTY:!0,setRawMode:mode=>input.setRawMode?.(mode)});return Object.defineProperty(terminalInput,"isRaw",{get:()=>input.isRaw}),input.pipe(terminalInput),{input:terminalInput,colors:()=>colors,drain:()=>requested?drained:Promise.resolve(),query:()=>{if(!(requested||disposed||!input.isRaw)){requested=accepting=!0,timer=setTimeout(()=>{accepting=!1},250),drainTimer=setTimeout(releaseDrain,500);try{output.write("\x1B]10;?\x1B\\\x1B]11;?\x1B\\",()=>{})}catch{accepting=!1,clearTimeout(timer)}}},dispose:()=>{disposed||(disposed=!0,accepting=!1,clearTimeout(timer),clearTimeout(drainTimer),releaseDrain(),input.unpipe(terminalInput),input.isRaw&&input.setRawMode?.(!1),wasFlowing===!0?input.resume():input.pause(),terminalInput.destroy())}}}var import_chalk2=__toESM(require_source(),1);function formatSignInReceipt({username,introduction=!1,columns=80,color=!0}={}){let bold=text=>color?import_chalk2.default.bold(text):text,command=text=>color?import_chalk2.default.cyan(text):text,marker=color?import_chalk2.default.green("\u2713"):"\u2713",identity=username&&/^[a-zA-Z0-9_-]+$/.test(username)?`Logged in as ${username}`:"Logged in",lines=["",`${marker} ${bold(identity)}`];if(!introduction)return lines.join(`
25
- `)+`
26
- `;function prose(text){let width=Math.max(20,Math.min(60,columns)-4),line="";for(let word of text.split(" "))line&&line.length+word.length+1>width&&(lines.push(" "+line),line=""),line+=(line?" ":"")+word;lines.push(" "+line)}return lines.push(""," "+bold("Next steps:")),prose("Deploy your app or backend:"),lines.push(" "+command("vercel deploy"),""),prose("Use AI Gateway models in your coding agent:"),prose("No token markup. One bill across providers."),lines.push(" "+command("vercel ai-gateway setup"),""),prose("Add AI models to your app with one API Key:"),prose("Track costs, set budgets, and use provider fallbacks."),lines.push(" "+command("vercel ai-gateway api-keys create"),""),prose("Find a domain for your project:"),lines.push(" vercel domains search <QUERY>",""),lines.push(" Browse all commands:"," "+command("vercel help")),lines.join(`
27
- `)+`
28
- `}function getSignupVerificationUrl(verificationUriComplete,email){let deviceUrl=new URL(verificationUriComplete),signupUrl=new URL("/signup",deviceUrl.origin);return signupUrl.searchParams.set("email",email),signupUrl.searchParams.set("autoSubmit","1"),signupUrl.searchParams.set("next",`${deviceUrl.pathname}${deviceUrl.search}`),signupUrl.toString()}async function performDeviceCodeFlow(client,options){let dpopKey=getDpopKeyForLogin(client,options),isNewKey=dpopKey!==client.authConfig.dpop?.key,tokens=null;try{return tokens=await runDeviceCodeFlow(client,options,dpopKey),tokens}finally{dpopKey&&isNewKey&&!tokens&&deleteDpopKey(dpopKey)}}async function runDeviceCodeFlow(client,options,dpopKey){let deviceAuthorizationResponse=await deviceAuthorizationRequest({refresh_token:options?.refreshToken,acr_values:options?.acrValues});output_manager_default.debug(`'Device Authorization response:', ${await deviceAuthorizationResponse.clone().text()}`);let[deviceAuthorizationError,deviceAuthorization]=await processDeviceAuthorizationResponse(deviceAuthorizationResponse);if(deviceAuthorizationError)return options?.fallbackToLoginOnStepUpFailure&&options.refreshToken&&isOAuthError(deviceAuthorizationError)&&(deviceAuthorizationError.code==="invalid_grant"||deviceAuthorizationError.code==="invalid_scope")?(output_manager_default.debug(`Step-up device authorization failed: ${deviceAuthorizationError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login."),performDeviceCodeFlow(client,options.teamId?{teamId:options.teamId}:void 0)):(printError(isOAuthError(deviceAuthorizationError)?deviceAuthorizationError.cause:deviceAuthorizationError),null);let{device_code,user_code,verification_uri,expiresAt,interval}=deviceAuthorization,{verification_uri_complete}=deviceAuthorization;if(options?.teamId){let url=new URL(verification_uri_complete);url.searchParams.set("team_id",options.teamId),verification_uri_complete=url.toString()}let isCursorAgent=client.agentName===KNOWN_AGENTS.CURSOR||client.agentName===KNOWN_AGENTS.CURSOR_CLI,shouldSkipBrowser=process.env.CI&&!isCursorAgent,browserUrl=verification_uri_complete,authInstructions;options?.signupEmail?(browserUrl=getSignupVerificationUrl(verification_uri_complete,options.signupEmail),authInstructions=`
29
- Visit ${import_chalk3.default.bold(output_manager_default.link(new URL(browserUrl).host+"/signup",browserUrl,{color:!1,fallback:()=>browserUrl}))} to create your account with ${import_chalk3.default.bold(options.signupEmail)} (device code ${import_chalk3.default.bold(user_code)}).
30
- `):authInstructions=`
31
- Visit ${import_chalk3.default.bold(output_manager_default.link(verification_uri.replace("https://",""),verification_uri_complete,{color:!1,fallback:()=>verification_uri_complete}))}${output_manager_default.supportsHyperlink?` and enter ${import_chalk3.default.bold(user_code)}`:""}
32
- `;let welcomeLayout=options?.welcomeShown?reserveSignInWelcome(client,options.signupEmail?authInstructions:`
33
- Visit ${import_chalk3.default.bold(verification_uri_complete)}
34
- `):void 0;if(welcomeLayout||output_manager_default.log(authInstructions),!shouldSkipBrowser)try{(await open.default(browserUrl)).on("error",error=>{output_manager_default.debug(`Failed to open browser: ${error}`)})}catch(error){output_manager_default.debug(`Failed to open browser: ${error}`),client.isAgent&&client.nonInteractive&&(output_manager_default.log(`
35
- ${import_chalk3.default.yellow("\u26A0")} ${import_chalk3.default.bold("Browser could not be opened automatically.")}
36
- `),output_manager_default.log(`Please ask the user to manually visit the URL above and complete the authentication process.
37
- `))}let themeInput=welcomeLayout&&canShowSignInWelcome(client)?createWelcomeThemeInput(client.stdin,output_manager_default.stream):null,rl=readline.createInterface({input:themeInput?.input??process.stdin,output:welcomeLayout?void 0:process.stdout,terminal:welcomeLayout?!0:void 0}).on("SIGINT",async()=>{welcome?.stop();try{await closeInput()}finally{process.exit(welcome?130:0)}});rl.once("close",()=>themeInput?.dispose());let closing,closeInput=()=>closing??=(async()=>{try{await themeInput?.drain()}catch{output_manager_default.debug("Could not drain terminal color replies.")}finally{rl.close()}})(),welcome=welcomeLayout?startSignInWelcome(client,closeInput,themeInput?.colors,themeInput?.query,welcomeLayout):null;welcome||(welcomeLayout&&output_manager_default.log(authInstructions),usePlainSignInWait()&&!output_manager_default.spinnersHidden?output_manager_default.log("Waiting for authentication..."):output_manager_default.spinner("Waiting for authentication..."));let intervalMs=interval*1e3,result=null,flowError=new Error("Timed out waiting for authentication. Please try again.");async function pollForToken(){for(;Date.now()<expiresAt;){let[tokenResponseError,tokenResponse]=await deviceAccessTokenRequest({device_code,dpopKey});if(tokenResponseError){if(tokenResponseError.message.includes("timeout")){intervalMs*=2,output_manager_default.debug(`Connection timeout. Slowing down, polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue}return tokenResponseError}output_manager_default.debug(`'Device Access Token response:', ${await tokenResponse.clone().text()}`);let[tokensError,tokens]=await processTokenResponse(tokenResponse,{dpop:!!dpopKey});if(isOAuthError(tokensError)){let{code}=tokensError;switch(code){case"authorization_pending":await wait(intervalMs);continue;case"slow_down":intervalMs+=5*1e3,output_manager_default.debug(`Authorization server requests to slow down. Polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue;default:return tokensError.cause}}if(tokensError)return tokensError;welcome||output_manager_default.print((0,import_ansi_escapes.eraseLines)(2)),result={access_token:tokens.access_token,expires_in:tokens.expires_in,refresh_token:tokens.refresh_token,dpop:dpopKey&&{key:dpopKey}};return}}try{flowError=await pollForToken()}finally{result&&!flowError&&welcome?.wasShown()&&options?.welcomeReady&&welcome?options?.welcomeReady?.(welcome,closeInput):(result&&!flowError&&welcome&&!welcome.wasShown()&&await welcome.finish(),output_manager_default.stopSpinner(),await closeInput()),welcome?.wasShown()&&options?.welcomeShown?.()}return flowError?(printError(flowError),null):result}function getDpopKeyForLogin(client,options){if(options?.refreshToken)return client.authConfig.dpop?.key;if(!isDpopLoginEnabled())return;let telemetry=new LoginTelemetryClient({opts:{store:client.telemetryEventStore}});return createDpopKey(storage=>telemetry.trackDpopKey(storage))}async function login(client,telemetry,standalone=!0,scope){let introduction=standalone&&canShowSignInIntroduction(client),receiptHandled=!1,welcomeShown=!1,presentation={welcome:null},tokens=await performDeviceCodeFlow(client,standalone?{welcomeReady:(welcome,closeInput)=>{presentation.welcome=welcome,presentation.closeInput=closeInput},welcomeShown:()=>{welcomeShown=!0}}:void 0);if(!tokens)return telemetry.trackState("error"),1;try{await saveDeviceCodeTokens(client,tokens,scope),welcomeShown&&markSignInWelcomeSeen(client);let inputClosed=presentation.closeInput?.(),receipt=standalone?formatSignInReceipt({username:getCachedUsername(client.authConfig),introduction,columns:client.stderr.columns,color:!output_manager_default.colorDisabled&&client.stderr.isTTY===!0}):void 0;try{presentation.welcome&&(receiptHandled=await presentation.welcome.finish(receipt,introduction?()=>markSignInIntroductionSeen(client):void 0))}catch{output_manager_default.debug("Could not finish the sign-in animation.")}receipt!==void 0&&!receiptHandled&&(output_manager_default.print(receipt),introduction&&markSignInIntroductionSeen(client)),await inputClosed}finally{output_manager_default.stopSpinner(),await presentation.closeInput?.()}return standalone||output_manager_default.success("Logged in."),telemetry.trackState("success"),0}async function saveDeviceCodeTokens(client,tokens,scope){let runTeam=client.config.currentTeam,previousTeamId=client.ignoresSavedTeam?client.savedTeam:runTeam;client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token,dpop:tokens.dpop});let scopeTeamId=scope?await findScopeTeamId(client,scope):void 0;if(scopeTeamId)client.updateConfig({currentTeam:scopeTeamId});else if(previousTeamId){let isMember=!0;try{isMember=(await getTeams(client)).some(team=>team.id===previousTeamId)}catch{}isMember||(output_manager_default.warn("Your previously selected team is no longer accessible; switching to your default scope."),client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client))}else client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client);client.persistAuthConfig(),client.writeToConfigFile(),client.ignoresSavedTeam&&(client.config.currentTeam=runTeam),output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`)}async function findScopeTeamId(client,scope){try{return(await getTeamByIdOrSlug(client,scope,{useCurrentTeam:!1})).id}catch(err){output_manager_default.debug(`Could not resolve --scope "${scope}": ${(0,import_error_utils.errorToString)(err)}`),output_manager_default.warn(`Couldn't find the team "${scope}", so it wasn't saved. Run ${getCommandName("switch")} to choose a team.`);return}}async function wait(intervalMs){await new Promise(resolve=>setTimeout(resolve,intervalMs))}export{LoginTelemetryClient,getSignupVerificationUrl,performDeviceCodeFlow,login,saveDeviceCodeTokens};