vercel 59.14.0 → 59.15.1

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 (459) hide show
  1. package/dist/chunks/add-7XFD2OHW.js +8 -0
  2. package/dist/chunks/add-HZC7AUBY.js +8 -0
  3. package/dist/chunks/add-PYUNJZ6K.js +8 -0
  4. package/dist/chunks/build-EFKQ6BND.js +7 -0
  5. package/dist/chunks/chunk-2B2MN3U5.js +8 -0
  6. package/dist/chunks/chunk-2H77IRPI.js +9 -0
  7. package/dist/chunks/chunk-2I64AYHG.js +7 -0
  8. package/dist/chunks/chunk-2PPXY24N.js +20 -0
  9. package/dist/chunks/chunk-2S6PE6GB.js +7 -0
  10. package/dist/chunks/{chunk-PIMIVJYK.js → chunk-3FMJYJUR.js} +7 -32
  11. package/dist/chunks/chunk-3IAQUNQH.js +7 -0
  12. package/dist/chunks/chunk-3QHJYVCY.js +7 -0
  13. package/dist/chunks/chunk-3QT7VOE3.js +7 -0
  14. package/dist/chunks/chunk-3TXEXPUW.js +7 -0
  15. package/dist/chunks/chunk-4MZK6JT6.js +7 -0
  16. package/dist/chunks/chunk-4NE5IQ25.js +7 -0
  17. package/dist/chunks/chunk-4PNSSS3L.js +7 -0
  18. package/dist/chunks/chunk-4QX77CP7.js +7 -0
  19. package/dist/chunks/chunk-562OXD3F.js +21 -0
  20. package/dist/chunks/chunk-57GHYR4Y.js +25 -0
  21. package/dist/chunks/chunk-5QQNYN4N.js +7 -0
  22. package/dist/chunks/chunk-5XJNPXQK.js +7 -0
  23. package/dist/chunks/chunk-6L236MNA.js +7 -0
  24. package/dist/chunks/chunk-6PFC3KWQ.js +7 -0
  25. package/dist/chunks/chunk-6QKS6QK7.js +7 -0
  26. package/dist/chunks/chunk-6RIQPTJA.js +8 -0
  27. package/dist/chunks/chunk-6TAQ6OWD.js +13 -0
  28. package/dist/chunks/chunk-6YAADRQB.js +9 -0
  29. package/dist/chunks/chunk-75CPY75D.js +15 -0
  30. package/dist/chunks/chunk-7HL2RPUO.js +7 -0
  31. package/dist/chunks/chunk-7PNYOSDU.js +9 -0
  32. package/dist/chunks/chunk-7R5FEXZ5.js +7 -0
  33. package/dist/chunks/chunk-7RMCBXBB.js +62 -0
  34. package/dist/chunks/chunk-7RR7MIMT.js +7 -0
  35. package/dist/chunks/chunk-7T6TL3GQ.js +7 -0
  36. package/dist/chunks/chunk-ADUYPK2G.js +13 -0
  37. package/dist/chunks/chunk-AFPOIDM5.js +7 -0
  38. package/dist/chunks/chunk-AM46JVVN.js +7 -0
  39. package/dist/chunks/chunk-AUGK2HIT.js +18 -0
  40. package/dist/chunks/chunk-AVSPFBLM.js +7 -0
  41. package/dist/chunks/chunk-B4ATVYZW.js +7 -0
  42. package/dist/chunks/chunk-BATE73HA.js +9 -0
  43. package/dist/chunks/{chunk-64IF634X.js → chunk-BRK4OB4B.js} +1 -12
  44. package/dist/chunks/chunk-BVH2AEFE.js +7 -0
  45. package/dist/chunks/chunk-CGOVWHI3.js +45 -0
  46. package/dist/chunks/chunk-CN2QZO4U.js +7 -0
  47. package/dist/chunks/chunk-COQGD2EI.js +8 -0
  48. package/dist/chunks/chunk-CUAIEGNE.js +7 -0
  49. package/dist/chunks/chunk-CVKB54WW.js +7 -0
  50. package/dist/chunks/{chunk-A3NYPUKZ.js → chunk-CZSOZKHX.js} +1 -11
  51. package/dist/chunks/chunk-D3EHMP4U.js +24 -0
  52. package/dist/chunks/chunk-D4MW3RDW.js +7 -0
  53. package/dist/chunks/chunk-DFVNL5ML.js +7 -0
  54. package/dist/chunks/chunk-EE3FVJLV.js +16 -0
  55. package/dist/chunks/chunk-EGMJRU5P.js +28 -0
  56. package/dist/chunks/chunk-ENBTTYJR.js +7 -0
  57. package/dist/chunks/chunk-ENS6KX2F.js +7 -0
  58. package/dist/chunks/chunk-EOBD4ZEG.js +8 -0
  59. package/dist/chunks/chunk-EOCTK4EA.js +7 -0
  60. package/dist/chunks/chunk-EQ52F4LH.js +7 -0
  61. package/dist/chunks/chunk-ETV3C2CV.js +7 -0
  62. package/dist/chunks/chunk-EVZRQGNK.js +7 -0
  63. package/dist/chunks/chunk-F2ZWW2IO.js +8 -0
  64. package/dist/chunks/chunk-FAW6NBLQ.js +7 -0
  65. package/dist/chunks/chunk-FI772UVH.js +7 -0
  66. package/dist/chunks/chunk-FKCOBJFH.js +7 -0
  67. package/dist/chunks/chunk-G5FC5ZCO.js +9 -0
  68. package/dist/chunks/chunk-G6CTAHKY.js +39 -0
  69. package/dist/chunks/chunk-G7Y77DFH.js +7 -0
  70. package/dist/chunks/chunk-GHAY4PSD.js +7 -0
  71. package/dist/chunks/chunk-GHM7V3GG.js +7 -0
  72. package/dist/chunks/chunk-GRNTLNC7.js +7 -0
  73. package/dist/chunks/chunk-GTRGQIY2.js +10 -0
  74. package/dist/chunks/chunk-GU6VIFR5.js +7 -0
  75. package/dist/chunks/{constants-YMCRE6IG.js → chunk-GZNDA6SV.js} +2 -9
  76. package/dist/chunks/chunk-HBFPLBTX.js +10 -0
  77. package/dist/chunks/chunk-HEGJZJO7.js +7 -0
  78. package/dist/chunks/chunk-HSJ6AHWG.js +12 -0
  79. package/dist/chunks/chunk-HTC6KO2B.js +7 -0
  80. package/dist/chunks/chunk-HVUHCRZB.js +18 -0
  81. package/dist/chunks/chunk-HZZ5L472.js +7 -0
  82. package/dist/chunks/chunk-IVSSTHB6.js +7 -0
  83. package/dist/chunks/chunk-IVWPQYIH.js +7 -0
  84. package/dist/chunks/chunk-J3U3L45Y.js +7 -0
  85. package/dist/chunks/chunk-JAJW3P42.js +7 -0
  86. package/dist/chunks/chunk-JEIMW3CO.js +7 -0
  87. package/dist/chunks/chunk-JIYY3B4C.js +7 -0
  88. package/dist/chunks/chunk-JKTQV2QJ.js +7 -0
  89. package/dist/chunks/chunk-JTVVBRW7.js +7 -0
  90. package/dist/chunks/chunk-JYAUUIR4.js +7 -0
  91. package/dist/chunks/chunk-JZRMH5UA.js +7 -0
  92. package/dist/chunks/chunk-K2RAW5DI.js +10 -0
  93. package/dist/chunks/chunk-K3KJZLBD.js +7 -0
  94. package/dist/chunks/chunk-KK4AJES5.js +36 -0
  95. package/dist/chunks/chunk-KKS7XWEX.js +7 -0
  96. package/dist/chunks/chunk-KNEWCUWF.js +14 -0
  97. package/dist/chunks/chunk-KO733OJG.js +9 -0
  98. package/dist/chunks/chunk-L243RUIR.js +19 -0
  99. package/dist/chunks/chunk-L3JDEHCQ.js +7 -0
  100. package/dist/chunks/chunk-LDM3SQAU.js +13 -0
  101. package/dist/chunks/chunk-LNPMDXBJ.js +7 -0
  102. package/dist/chunks/chunk-M2W3HKV3.js +23 -0
  103. package/dist/chunks/chunk-M2XARQBF.js +9 -0
  104. package/dist/chunks/chunk-M5AV545M.js +7 -0
  105. package/dist/chunks/chunk-MAVRGZQP.js +7 -0
  106. package/dist/chunks/chunk-MBL6TXEJ.js +7 -0
  107. package/dist/chunks/chunk-MEAY2K5Z.js +11 -0
  108. package/dist/chunks/chunk-MY4MONOH.js +7 -0
  109. package/dist/chunks/chunk-N3N5UHIL.js +7 -0
  110. package/dist/chunks/chunk-N3ZZ7FHQ.js +7 -0
  111. package/dist/chunks/chunk-N6CNMMSZ.js +7 -0
  112. package/dist/chunks/chunk-NBVY237X.js +7 -0
  113. package/dist/chunks/chunk-NGNOUPWS.js +25 -0
  114. package/dist/chunks/chunk-NHTF332K.js +7 -0
  115. package/dist/chunks/chunk-NNP5NITU.js +15 -0
  116. package/dist/chunks/chunk-NS4FH2TY.js +11 -0
  117. package/dist/chunks/chunk-NUGLE4QY.js +11 -0
  118. package/dist/chunks/chunk-NWFHHUKZ.js +7 -0
  119. package/dist/chunks/chunk-O7G3CZ42.js +7 -0
  120. package/dist/chunks/chunk-OD6RZ3XZ.js +8 -0
  121. package/dist/chunks/chunk-OHDEHZLX.js +7 -0
  122. package/dist/chunks/chunk-OK3S6KFX.js +16 -0
  123. package/dist/chunks/chunk-OKZDOANA.js +23 -0
  124. package/dist/chunks/chunk-OSCCYU74.js +7 -0
  125. package/dist/chunks/chunk-OUHPDA7Q.js +7 -0
  126. package/dist/chunks/chunk-P2O5DOYE.js +7 -0
  127. package/dist/chunks/chunk-PHW54NU5.js +13 -0
  128. package/dist/chunks/chunk-PPCFQQSU.js +7 -0
  129. package/dist/chunks/chunk-QGIGNMII.js +8 -0
  130. package/dist/chunks/chunk-QGIQK47P.js +7 -0
  131. package/dist/chunks/chunk-QHJLRTVY.js +7 -0
  132. package/dist/chunks/{chunk-2473DUBR.js → chunk-QR7QPUFN.js} +1 -9
  133. package/dist/chunks/chunk-QTKJC2O5.js +7 -0
  134. package/dist/chunks/chunk-R2TGGVCT.js +19 -0
  135. package/dist/chunks/chunk-RAIBQIKB.js +7 -0
  136. package/dist/chunks/chunk-RCTYVKM5.js +16 -0
  137. package/dist/chunks/chunk-RKAUVPOQ.js +86 -0
  138. package/dist/chunks/chunk-S5CEIACD.js +7 -0
  139. package/dist/chunks/chunk-SGWVKRSR.js +8 -0
  140. package/dist/chunks/chunk-SOJCELXH.js +7 -0
  141. package/dist/chunks/chunk-SXUEGVWB.js +7 -0
  142. package/dist/chunks/{chunk-GGPE5377.js → chunk-T3GQAMBJ.js} +1 -9
  143. package/dist/chunks/chunk-T52FMXWC.js +7 -0
  144. package/dist/chunks/chunk-TG2RCYTH.js +7 -0
  145. package/dist/chunks/chunk-TJCIHDPZ.js +9 -0
  146. package/dist/chunks/chunk-TKBXN4H3.js +9 -0
  147. package/dist/chunks/chunk-TRTEXGVN.js +7 -0
  148. package/dist/chunks/chunk-U56NHYAH.js +7 -0
  149. package/dist/chunks/chunk-U7KCDTCH.js +12 -0
  150. package/dist/chunks/chunk-UETTIYUQ.js +8 -0
  151. package/dist/chunks/chunk-ULLWCOYC.js +7 -0
  152. package/dist/chunks/chunk-UXTHEQVJ.js +21 -0
  153. package/dist/chunks/chunk-VLZ47RWM.js +44 -0
  154. package/dist/chunks/chunk-WKZ6JSGZ.js +7 -0
  155. package/dist/chunks/chunk-WPS6JZF6.js +7 -0
  156. package/dist/chunks/chunk-WRILLB46.js +7 -0
  157. package/dist/chunks/chunk-WUZD4KBL.js +7 -0
  158. package/dist/chunks/chunk-XCJDGQO7.js +7 -0
  159. package/dist/chunks/{pkg-56KRLZ5K.js → chunk-XD2LZRBS.js} +1 -7
  160. package/dist/chunks/chunk-XFVGX5HG.js +7 -0
  161. package/dist/chunks/chunk-XHOGOH6N.js +7 -0
  162. package/dist/chunks/{update-route-version-E3V47KNI.js → chunk-XPXOV5UO.js} +1 -7
  163. package/dist/chunks/chunk-XQ73QIQ3.js +7 -0
  164. package/dist/chunks/chunk-XSVBYDYI.js +8 -0
  165. package/dist/chunks/chunk-YKZLKOOD.js +12 -0
  166. package/dist/chunks/chunk-YMVDWVMO.js +7 -0
  167. package/dist/chunks/chunk-YPTLSODC.js +7 -0
  168. package/dist/chunks/chunk-YV6CTDHR.js +7 -0
  169. package/dist/chunks/chunk-Z6Y55QJW.js +23 -0
  170. package/dist/chunks/chunk-ZDX75YNZ.js +7 -0
  171. package/dist/chunks/chunk-ZIPVX7LD.js +7 -0
  172. package/dist/chunks/chunk-ZKYS7EAB.js +7 -0
  173. package/dist/chunks/chunk-ZXE4XYIV.js +7 -0
  174. package/dist/chunks/chunk-ZZQRMRWD.js +20 -0
  175. package/dist/chunks/cjs-GOQHXIHX.js +54 -0
  176. package/dist/chunks/clear-5NQAVWIF.js +8 -0
  177. package/dist/chunks/compile-vercel-config-6J2XUFRK.js +7 -0
  178. package/dist/chunks/config-CKYRXZXL.js +7 -0
  179. package/dist/chunks/config-VNUY4RJ4.js +8 -0
  180. package/dist/chunks/connect-git-provider-GIU5WZ52.js +7 -0
  181. package/dist/chunks/constants-G4UYVLOF.js +7 -0
  182. package/dist/chunks/create-project-SRQGD4JY.js +7 -0
  183. package/dist/chunks/delete-GTXXCSKQ.js +10 -0
  184. package/dist/chunks/delete-HRJEO4MI.js +9 -0
  185. package/dist/chunks/detect-projects-2GNCZ4CS.js +7 -0
  186. package/dist/chunks/detect-services-GHILEGNU.js +7 -0
  187. package/dist/chunks/disable-RWCRVG5O.js +7 -0
  188. package/dist/chunks/discard-SHFIYCJU.js +14 -0
  189. package/dist/chunks/edit-DMO3NSO2.js +9 -0
  190. package/dist/chunks/edit-EVQI2RSS.js +8 -0
  191. package/dist/chunks/enable-AWDU6STD.js +7 -0
  192. package/dist/chunks/esm-7HVUFWMN.js +7 -0
  193. package/dist/chunks/esm-BZBEM7YA.js +7 -0
  194. package/dist/chunks/esm-CXICLFA3.js +9 -0
  195. package/dist/chunks/esm-HDEHVK7I.js +9 -0
  196. package/dist/chunks/esm-NQRLKALI.js +20 -0
  197. package/dist/chunks/esm-SZZI53W7.js +7 -0
  198. package/dist/chunks/esm-WGJFGCLK.js +7 -0
  199. package/dist/chunks/exec-4AISDHUV.js +16372 -0
  200. package/dist/chunks/export-IQKTA4RS.js +19 -0
  201. package/dist/chunks/fetch-proxy-AEAWC6MD.js +7 -0
  202. package/dist/chunks/future-E2FHKPJN.js +7 -0
  203. package/dist/chunks/generate-cert-for-deploy-VKOWC4PZ.js +7 -0
  204. package/dist/chunks/image-LDFYNOCA.js +7 -0
  205. package/dist/chunks/import-builders-P7CXSX2D.js +7 -0
  206. package/dist/chunks/inspect-3N47ODIH.js +15 -0
  207. package/dist/chunks/inspect-53SGDDAH.js +20 -0
  208. package/dist/chunks/inspect-5INZDUQS.js +19 -0
  209. package/dist/chunks/inspect-WMT2M335.js +9 -0
  210. package/dist/chunks/inspect-Y6BUCOUV.js +13 -0
  211. package/dist/chunks/list-BIAPHKFM.js +11 -0
  212. package/dist/chunks/list-DMOCRRSE.js +16 -0
  213. package/dist/chunks/list-K5J7OULR.js +10 -0
  214. package/dist/chunks/login-DEAEVUHM.js +7 -0
  215. package/dist/chunks/login-SRVNHI4Y.js +9 -0
  216. package/dist/chunks/logs-GK7CJBYY.js +7 -0
  217. package/dist/chunks/ls-7ZX6DCJW.js +12 -0
  218. package/dist/chunks/ls-AJWN5ZR4.js +12 -0
  219. package/dist/chunks/ls-BFJWCRLZ.js +12 -0
  220. package/dist/chunks/ls-KGIE6HCO.js +12 -0
  221. package/dist/chunks/ls-UVKTHBTE.js +8 -0
  222. package/dist/chunks/ls-WEG45IOC.js +8 -0
  223. package/dist/chunks/native-self-update-KOJVRMHR.js +7 -0
  224. package/dist/chunks/open-OEWPI5G6.js +7 -0
  225. package/dist/chunks/openapi-MO5HYMHR.js +7 -0
  226. package/dist/chunks/permissions-EPQBQFE3.js +7 -0
  227. package/dist/chunks/pkg-YFU67U7I.js +7 -0
  228. package/dist/chunks/prompt-missing-credentials-IUHLYSQU.js +7 -0
  229. package/dist/chunks/publish-JG7MEPWT.js +15 -0
  230. package/dist/chunks/pull-MRKXG6TO.js +7 -0
  231. package/dist/chunks/purchase-domain-if-available-O5ARXEZ5.js +7 -0
  232. package/dist/chunks/push-XOXJDFYO.js +7 -0
  233. package/dist/chunks/query-AL7C6WV2.js +12 -0
  234. package/dist/chunks/reauthenticate-SH4XR7NH.js +7 -0
  235. package/dist/chunks/reorder-5DMRFDBY.js +10 -0
  236. package/dist/chunks/reply-WSRNZWFD.js +9 -0
  237. package/dist/chunks/repo-info-to-url-SK3VX6UL.js +7 -0
  238. package/dist/chunks/resolve-YJUXQVOZ.js +12 -0
  239. package/dist/chunks/resolve-deployment-framework-preset-XF3NJIDS.js +7 -0
  240. package/dist/chunks/restore-QT3DBGKU.js +16 -0
  241. package/dist/chunks/rm-MHPIUEZ5.js +8 -0
  242. package/dist/chunks/rm-MVZFU6RG.js +8 -0
  243. package/dist/chunks/rm-PXR4J2US.js +8 -0
  244. package/dist/chunks/rm-WB2AIP3N.js +8 -0
  245. package/dist/chunks/rm-XRP6MRUT.js +8 -0
  246. package/dist/chunks/routes-5DERZV5M.js +7 -0
  247. package/dist/chunks/rule-inspect-TT3DRGCS.js +8 -0
  248. package/dist/chunks/rules-B5GW4KJH.js +7 -0
  249. package/dist/chunks/schema-JY5QTZOG.js +14 -0
  250. package/dist/chunks/schema-KCNKVFT3.js +44 -0
  251. package/dist/chunks/select-org-KSCYSESV.js +7 -0
  252. package/dist/chunks/set-7BANEWEL.js +7 -0
  253. package/dist/chunks/setup-and-link-ZAV3EFGC.js +7 -0
  254. package/dist/chunks/slugify-O5DBATYT.js +7 -0
  255. package/dist/chunks/stamp-OX4YO3KY.js +7 -0
  256. package/dist/chunks/tags-VZR66NUC.js +7 -0
  257. package/dist/chunks/types-LRXQEDYI.js +14 -0
  258. package/dist/chunks/update-RBFNNSWE.js +8 -0
  259. package/dist/chunks/update-route-version-XZAFPQJC.js +7 -0
  260. package/dist/chunks/utils-B5ZTMQKY.js +58 -0
  261. package/dist/chunks/vlt-builder-importer-YVCYYRVV.js +11 -0
  262. package/dist/commands/build/index.js +24 -4925
  263. package/dist/commands/deploy/index.js +43 -2875
  264. package/dist/commands/dev/index.js +56 -23857
  265. package/dist/commands/env/index.js +26 -3411
  266. package/dist/commands/link/index.js +4 -284
  267. package/dist/commands/list/index.js +6 -566
  268. package/dist/commands-bulk.js +1187 -87691
  269. package/dist/help.js +1 -8
  270. package/dist/index.js +19 -2591
  271. package/dist/version.mjs +1 -1
  272. package/package.json +50 -51
  273. package/dist/chunks/add-EQZRT4XL.js +0 -221
  274. package/dist/chunks/add-KMDROZC3.js +0 -196
  275. package/dist/chunks/add-QPJ3XMBV.js +0 -145
  276. package/dist/chunks/build-W4HPTAOB.js +0 -251
  277. package/dist/chunks/chunk-26CU4Q3C.js +0 -598
  278. package/dist/chunks/chunk-2HSQ7YUK.js +0 -93
  279. package/dist/chunks/chunk-2JIX6UMI.js +0 -4626
  280. package/dist/chunks/chunk-2LCFOK66.js +0 -1536
  281. package/dist/chunks/chunk-332LMJLZ.js +0 -16014
  282. package/dist/chunks/chunk-3HZLXCVL.js +0 -137
  283. package/dist/chunks/chunk-3VM7HWF6.js +0 -104
  284. package/dist/chunks/chunk-3ZE5CFVM.js +0 -346
  285. package/dist/chunks/chunk-4IALDGB7.js +0 -22
  286. package/dist/chunks/chunk-4KD5BYHB.js +0 -127
  287. package/dist/chunks/chunk-4TUMNBEE.js +0 -231
  288. package/dist/chunks/chunk-4WG2MYCI.js +0 -163
  289. package/dist/chunks/chunk-57RHXXXG.js +0 -150
  290. package/dist/chunks/chunk-5AJPMLDV.js +0 -28
  291. package/dist/chunks/chunk-5EIV6LPQ.js +0 -305
  292. package/dist/chunks/chunk-5NF5HOBJ.js +0 -1854
  293. package/dist/chunks/chunk-653QRQAD.js +0 -417
  294. package/dist/chunks/chunk-67CRVWDF.js +0 -81
  295. package/dist/chunks/chunk-6E6KPBXY.js +0 -43
  296. package/dist/chunks/chunk-75VENWDN.js +0 -1892
  297. package/dist/chunks/chunk-7MRDIPJY.js +0 -107
  298. package/dist/chunks/chunk-7NRNFV77.js +0 -875
  299. package/dist/chunks/chunk-7Q45OKWR.js +0 -149
  300. package/dist/chunks/chunk-AHU7WNL2.js +0 -24
  301. package/dist/chunks/chunk-AINIBIP4.js +0 -39
  302. package/dist/chunks/chunk-AJ5HUOWB.js +0 -14059
  303. package/dist/chunks/chunk-AKLTIZCU.js +0 -46
  304. package/dist/chunks/chunk-AQ6P3IGG.js +0 -49
  305. package/dist/chunks/chunk-B5NH7SLK.js +0 -324
  306. package/dist/chunks/chunk-B5XLQKHI.js +0 -849
  307. package/dist/chunks/chunk-BEQV3X2L.js +0 -86
  308. package/dist/chunks/chunk-CAHP7UGE.js +0 -79
  309. package/dist/chunks/chunk-CFDDM4TX.js +0 -13618
  310. package/dist/chunks/chunk-CJV7J7B5.js +0 -314
  311. package/dist/chunks/chunk-CV5YC2EN.js +0 -867
  312. package/dist/chunks/chunk-CXFY6A6W.js +0 -255
  313. package/dist/chunks/chunk-D5SMZXVO.js +0 -233
  314. package/dist/chunks/chunk-E336ZXPP.js +0 -43
  315. package/dist/chunks/chunk-EDMW7SBH.js +0 -246
  316. package/dist/chunks/chunk-EFYMIIER.js +0 -40
  317. package/dist/chunks/chunk-EKPSCRJZ.js +0 -26
  318. package/dist/chunks/chunk-EOZFDJSY.js +0 -18
  319. package/dist/chunks/chunk-EWBCSDTM.js +0 -1708
  320. package/dist/chunks/chunk-EZKW5YJ2.js +0 -177
  321. package/dist/chunks/chunk-F2QLCXCF.js +0 -2399
  322. package/dist/chunks/chunk-FGDKMNEN.js +0 -21
  323. package/dist/chunks/chunk-FRVG4OW3.js +0 -7438
  324. package/dist/chunks/chunk-FVF4UHDM.js +0 -1288
  325. package/dist/chunks/chunk-G5FBSUL4.js +0 -822
  326. package/dist/chunks/chunk-GDOUDU6O.js +0 -74
  327. package/dist/chunks/chunk-GGP5R3FU.js +0 -129
  328. package/dist/chunks/chunk-GVNCVKCI.js +0 -68
  329. package/dist/chunks/chunk-GY5I4AYD.js +0 -122
  330. package/dist/chunks/chunk-GZLPFESR.js +0 -48
  331. package/dist/chunks/chunk-HB4UKFDO.js +0 -1295
  332. package/dist/chunks/chunk-HD4DR3DA.js +0 -818
  333. package/dist/chunks/chunk-HKHXKSXQ.js +0 -152
  334. package/dist/chunks/chunk-HM24ZWQL.js +0 -174
  335. package/dist/chunks/chunk-HRXRELD3.js +0 -338
  336. package/dist/chunks/chunk-IB5L4LKZ.js +0 -1082
  337. package/dist/chunks/chunk-IIMSID24.js +0 -104
  338. package/dist/chunks/chunk-J7JKZM4T.js +0 -58
  339. package/dist/chunks/chunk-JC2O346E.js +0 -137
  340. package/dist/chunks/chunk-JSD4EZL3.js +0 -34
  341. package/dist/chunks/chunk-JZXJZX7O.js +0 -257
  342. package/dist/chunks/chunk-K3RED3VO.js +0 -566
  343. package/dist/chunks/chunk-KFWQ3EFH.js +0 -151
  344. package/dist/chunks/chunk-KW7BS25T.js +0 -466
  345. package/dist/chunks/chunk-KXDWXXJH.js +0 -70
  346. package/dist/chunks/chunk-LERVNZTD.js +0 -90
  347. package/dist/chunks/chunk-LYAAQDNS.js +0 -242
  348. package/dist/chunks/chunk-M5I6INNF.js +0 -61
  349. package/dist/chunks/chunk-N6HP5BLI.js +0 -18190
  350. package/dist/chunks/chunk-ND5CF2H3.js +0 -53
  351. package/dist/chunks/chunk-NFU4XJIR.js +0 -120
  352. package/dist/chunks/chunk-NW34PW6V.js +0 -1772
  353. package/dist/chunks/chunk-OAMU5QO6.js +0 -18
  354. package/dist/chunks/chunk-OCIZ6ZYA.js +0 -253
  355. package/dist/chunks/chunk-ORQZKIIB.js +0 -2914
  356. package/dist/chunks/chunk-P3SKP5WM.js +0 -27
  357. package/dist/chunks/chunk-P4QNYOFB.js +0 -96
  358. package/dist/chunks/chunk-P7VSBDR4.js +0 -827
  359. package/dist/chunks/chunk-PEC3CQSK.js +0 -90
  360. package/dist/chunks/chunk-PMSMUMUO.js +0 -30
  361. package/dist/chunks/chunk-PNGVSHR3.js +0 -40
  362. package/dist/chunks/chunk-POOO7W47.js +0 -916
  363. package/dist/chunks/chunk-PRWJUY5U.js +0 -848
  364. package/dist/chunks/chunk-Q2DGFCO7.js +0 -579
  365. package/dist/chunks/chunk-RBF2NPUP.js +0 -577
  366. package/dist/chunks/chunk-RBIFXFZX.js +0 -52
  367. package/dist/chunks/chunk-RDTRWLWB.js +0 -11441
  368. package/dist/chunks/chunk-RN6V5ODW.js +0 -114
  369. package/dist/chunks/chunk-RNSMTWA6.js +0 -122
  370. package/dist/chunks/chunk-RTJASENB.js +0 -59
  371. package/dist/chunks/chunk-RVBZ64EQ.js +0 -52
  372. package/dist/chunks/chunk-S7KYDPEM.js +0 -1564
  373. package/dist/chunks/chunk-SLPSPYVR.js +0 -334
  374. package/dist/chunks/chunk-SM3F3PYJ.js +0 -522
  375. package/dist/chunks/chunk-TO7QZGYK.js +0 -105
  376. package/dist/chunks/chunk-TSBUHSN7.js +0 -3495
  377. package/dist/chunks/chunk-TSFWMUCY.js +0 -506
  378. package/dist/chunks/chunk-TZ2YI2VH.js +0 -87
  379. package/dist/chunks/chunk-UG2WOB5L.js +0 -150
  380. package/dist/chunks/chunk-UNKHOYMF.js +0 -559
  381. package/dist/chunks/chunk-UOVWUSLG.js +0 -2099
  382. package/dist/chunks/chunk-V4RMJKQP.js +0 -36
  383. package/dist/chunks/chunk-VGIMO3ZK.js +0 -17
  384. package/dist/chunks/chunk-VGKSIKCC.js +0 -92
  385. package/dist/chunks/chunk-VP5Y3SZG.js +0 -106
  386. package/dist/chunks/chunk-VXYGCOKL.js +0 -28
  387. package/dist/chunks/chunk-W7FGI2GZ.js +0 -233
  388. package/dist/chunks/chunk-WGGABYO5.js +0 -31
  389. package/dist/chunks/chunk-XDGOOW3K.js +0 -60
  390. package/dist/chunks/chunk-XFF5TGRA.js +0 -303
  391. package/dist/chunks/chunk-XNIZGCN5.js +0 -58
  392. package/dist/chunks/chunk-XPJLPUKO.js +0 -117
  393. package/dist/chunks/chunk-XUAWTW4W.js +0 -467
  394. package/dist/chunks/chunk-YPQSDAEW.js +0 -29
  395. package/dist/chunks/chunk-YS76T533.js +0 -270
  396. package/dist/chunks/chunk-ZDU2NODC.js +0 -104
  397. package/dist/chunks/chunk-ZW6HETRE.js +0 -97
  398. package/dist/chunks/cjs-DV4RM7XU.js +0 -20743
  399. package/dist/chunks/clear-4IACMLFU.js +0 -141
  400. package/dist/chunks/compile-vercel-config-PQQ3OCLV.js +0 -33
  401. package/dist/chunks/config-BQQKMQBP.js +0 -168
  402. package/dist/chunks/config-OCPNHXQL.js +0 -127
  403. package/dist/chunks/delete-HRKIYPCO.js +0 -159
  404. package/dist/chunks/delete-P2UL3KTU.js +0 -226
  405. package/dist/chunks/detect-projects-ODNU4PK2.js +0 -18
  406. package/dist/chunks/detect-services-U7QGT7VO.js +0 -40
  407. package/dist/chunks/disable-3NYMICQ3.js +0 -198
  408. package/dist/chunks/discard-RNVEJUK3.js +0 -145
  409. package/dist/chunks/edit-63S2RQHR.js +0 -162
  410. package/dist/chunks/edit-CTENFZ7H.js +0 -647
  411. package/dist/chunks/enable-WILWXAHV.js +0 -204
  412. package/dist/chunks/exec-4IPHZ55G.js +0 -1291
  413. package/dist/chunks/export-YHGV3EPK.js +0 -177
  414. package/dist/chunks/fetch-proxy-R3JZNXBZ.js +0 -99
  415. package/dist/chunks/image-MWKS2YMB.js +0 -75
  416. package/dist/chunks/import-builders-H55X5VYD.js +0 -39
  417. package/dist/chunks/inspect-JTJMK6TO.js +0 -596
  418. package/dist/chunks/inspect-KBIPLMGR.js +0 -216
  419. package/dist/chunks/inspect-OP26FDBY.js +0 -171
  420. package/dist/chunks/inspect-SW4UMWTB.js +0 -175
  421. package/dist/chunks/inspect-WPLZPVBO.js +0 -145
  422. package/dist/chunks/list-HE7DWAWH.js +0 -387
  423. package/dist/chunks/list-OUG7WCT7.js +0 -404
  424. package/dist/chunks/list-QUSEURJZ.js +0 -426
  425. package/dist/chunks/login-MIIQJVF3.js +0 -233
  426. package/dist/chunks/ls-24N3DUK4.js +0 -183
  427. package/dist/chunks/ls-3Y7KEFKT.js +0 -175
  428. package/dist/chunks/ls-75F5HIJ5.js +0 -188
  429. package/dist/chunks/ls-REN6X2X5.js +0 -204
  430. package/dist/chunks/ls-W4STUDXK.js +0 -223
  431. package/dist/chunks/ls-Z4CTSD6C.js +0 -210
  432. package/dist/chunks/open-ARMCLPBK.js +0 -116
  433. package/dist/chunks/permissions-JKI67F62.js +0 -99
  434. package/dist/chunks/publish-SMSQ7OX2.js +0 -155
  435. package/dist/chunks/pull-4QZJZELD.js +0 -45
  436. package/dist/chunks/push-T6IYQY2J.js +0 -191
  437. package/dist/chunks/query-CP3JK5LW.js +0 -725
  438. package/dist/chunks/reorder-RAWKFGLV.js +0 -412
  439. package/dist/chunks/reply-235UHUD4.js +0 -176
  440. package/dist/chunks/resolve-5KCLN7QV.js +0 -237
  441. package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +0 -36
  442. package/dist/chunks/restore-D24WAUAN.js +0 -252
  443. package/dist/chunks/rm-DBQDXSOC.js +0 -162
  444. package/dist/chunks/rm-G5INO77R.js +0 -148
  445. package/dist/chunks/rm-NLKSEKZ5.js +0 -195
  446. package/dist/chunks/rm-QV76CJA4.js +0 -322
  447. package/dist/chunks/rm-TZ4PDDUK.js +0 -147
  448. package/dist/chunks/routes-QVMBXOSX.js +0 -24
  449. package/dist/chunks/rule-inspect-76MC7I2D.js +0 -123
  450. package/dist/chunks/rules-IDUXVTPG.js +0 -89
  451. package/dist/chunks/schema-AV6BHGKY.js +0 -237
  452. package/dist/chunks/schema-QJVQTNB4.js +0 -381
  453. package/dist/chunks/set-L5NFQSCF.js +0 -250
  454. package/dist/chunks/setup-and-link-USSVDKCM.js +0 -65
  455. package/dist/chunks/stamp-AA7R3MZS.js +0 -16
  456. package/dist/chunks/tags-2NLUU4EC.js +0 -69
  457. package/dist/chunks/types-4GAJ7XQQ.js +0 -116
  458. package/dist/chunks/update-WGLBB65M.js +0 -224
  459. package/dist/chunks/vlt-builder-importer-USCFHWPL.js +0 -322
package/dist/index.js CHANGED
@@ -4,2594 +4,22 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import {
8
- BUILD_LABEL
9
- } from "./chunks/chunk-GGPE5377.js";
10
- import {
11
- help
12
- } from "./chunks/chunk-PIMIVJYK.js";
13
- import {
14
- box,
15
- canAutoUpdate,
16
- did_you_mean_default,
17
- executeUpgrade,
18
- hasAutoUpdatePreference,
19
- isVersionPinned,
20
- matchesCliApiTag,
21
- setAutoUpdate,
22
- tryOpenApiFallback
23
- } from "./chunks/chunk-TSBUHSN7.js";
24
- import "./chunks/chunk-FGDKMNEN.js";
25
- import {
26
- getUpdateCommand
27
- } from "./chunks/chunk-D5SMZXVO.js";
28
- import {
29
- promptMissingCredentials
30
- } from "./chunks/chunk-M5I6INNF.js";
31
- import {
32
- require_ci_info
33
- } from "./chunks/chunk-UNKHOYMF.js";
34
- import {
35
- Client,
36
- getAuthConfigFilePath,
37
- getConfigFilePath,
38
- readAuthConfigFile,
39
- readConfigFile,
40
- writeToConfigFile
41
- } from "./chunks/chunk-UOVWUSLG.js";
42
- import {
43
- getGlobalPathConfig,
44
- highlight
45
- } from "./chunks/chunk-AINIBIP4.js";
46
- import "./chunks/chunk-J7JKZM4T.js";
47
- import {
48
- shouldPrintVersionBanner,
49
- wantsMachineReadableOutput
50
- } from "./chunks/chunk-KXDWXXJH.js";
51
- import "./chunks/chunk-V4RMJKQP.js";
52
- import {
53
- commandNames,
54
- commands
55
- } from "./chunks/chunk-CFDDM4TX.js";
56
- import "./chunks/chunk-CJV7J7B5.js";
57
- import "./chunks/chunk-EZKW5YJ2.js";
58
- import "./chunks/chunk-NFU4XJIR.js";
59
- import "./chunks/chunk-3HZLXCVL.js";
60
- import "./chunks/chunk-7Q45OKWR.js";
61
- import "./chunks/chunk-GY5I4AYD.js";
62
- import "./chunks/chunk-4TUMNBEE.js";
63
- import "./chunks/chunk-POOO7W47.js";
64
- import "./chunks/chunk-SLPSPYVR.js";
65
- import "./chunks/chunk-HKHXKSXQ.js";
66
- import "./chunks/chunk-EDMW7SBH.js";
67
- import "./chunks/chunk-4KD5BYHB.js";
68
- import "./chunks/chunk-XDGOOW3K.js";
69
- import "./chunks/chunk-VP5Y3SZG.js";
70
- import {
71
- require_semver
72
- } from "./chunks/chunk-IB5L4LKZ.js";
73
- import {
74
- readJSONFile
75
- } from "./chunks/chunk-AQ6P3IGG.js";
76
- import {
77
- require_dist as require_dist2
78
- } from "./chunks/chunk-N6HP5BLI.js";
79
- import "./chunks/chunk-P7VSBDR4.js";
80
- import "./chunks/chunk-653QRQAD.js";
81
- import "./chunks/chunk-ZDU2NODC.js";
82
- import "./chunks/chunk-PEC3CQSK.js";
83
- import "./chunks/chunk-GGP5R3FU.js";
84
- import "./chunks/chunk-6E6KPBXY.js";
85
- import "./chunks/chunk-UG2WOB5L.js";
86
- import "./chunks/chunk-XUAWTW4W.js";
87
- import "./chunks/chunk-JZXJZX7O.js";
88
- import "./chunks/chunk-HRXRELD3.js";
89
- import "./chunks/chunk-YS76T533.js";
90
- import {
91
- TelemetryClient,
92
- TelemetryEventStore
93
- } from "./chunks/chunk-HB4UKFDO.js";
94
- import "./chunks/chunk-B5XLQKHI.js";
95
- import {
96
- getScope,
97
- isAppPrincipalEnabled,
98
- resolveAppTokenScope
99
- } from "./chunks/chunk-SM3F3PYJ.js";
100
- import {
101
- setFetchDispatcher
102
- } from "./chunks/chunk-XNIZGCN5.js";
103
- import "./chunks/chunk-NW34PW6V.js";
104
- import {
105
- printError
106
- } from "./chunks/chunk-3VM7HWF6.js";
107
- import {
108
- getArgs,
109
- parseArguments
110
- } from "./chunks/chunk-57RHXXXG.js";
111
- import {
112
- isNativeBinaryInstall
113
- } from "./chunks/chunk-4IALDGB7.js";
114
- import {
115
- getLinkFromDir,
116
- getTeamByIdOrSlug,
117
- getTeams,
118
- getUser,
119
- getVercelDirectory,
120
- hasLocalProjectLink,
121
- humanizePath,
122
- param,
123
- require_lib
124
- } from "./chunks/chunk-AJ5HUOWB.js";
125
- import "./chunks/chunk-G5FBSUL4.js";
126
- import "./chunks/chunk-26CU4Q3C.js";
127
- import "./chunks/chunk-XPJLPUKO.js";
128
- import {
129
- APIError,
130
- CantFindConfig,
131
- CantParseJSONFile,
132
- DeprecatedNowJson,
133
- WorkingDirectoryDoesNotExist
134
- } from "./chunks/chunk-CV5YC2EN.js";
135
- import {
136
- cmd,
137
- getTitleName
138
- } from "./chunks/chunk-Q2DGFCO7.js";
139
- import {
140
- output_manager_default
141
- } from "./chunks/chunk-2JIX6UMI.js";
142
- import {
143
- pkg_default
144
- } from "./chunks/chunk-P4QNYOFB.js";
145
- import {
146
- require_dist
147
- } from "./chunks/chunk-ZW6HETRE.js";
148
- import {
149
- require_source
150
- } from "./chunks/chunk-S7KYDPEM.js";
151
- import {
152
- __commonJS,
153
- __require,
154
- __toESM
155
- } from "./chunks/chunk-TZ2YI2VH.js";
156
-
157
- // ../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js
158
- var require_epipebomb = __commonJS({
159
- "../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports, module) {
160
- module.exports = epipeBomb;
161
- function epipeBomb(stream, callback) {
162
- if (stream == null)
163
- stream = process.stdout;
164
- if (callback == null)
165
- callback = process.exit;
166
- function epipeFilter(err) {
167
- if (err.code === "EPIPE")
168
- return callback();
169
- if (stream.listeners("error").length <= 1) {
170
- stream.removeAllListeners();
171
- stream.emit("error", err);
172
- stream.on("error", epipeFilter);
173
- }
174
- }
175
- stream.on("error", epipeFilter);
176
- }
177
- }
178
- });
179
-
180
- // ../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js
181
- var require_lib2 = __commonJS({
182
- "../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports, module) {
183
- "use strict";
184
- var os = __require("os");
185
- var paths = __require("path");
186
- var isWinOS = /^win/i.test(process.platform);
187
- function normalize_path(path2) {
188
- return paths.normalize(paths.join(path2, "."));
189
- }
190
- var base = () => {
191
- const { env } = process;
192
- const object = {};
193
- object.home = () => normalize_path(os.homedir ? os.homedir() : env.HOME);
194
- object.temp = () => normalize_path(os.tmpdir ? os.tmpdir() : env.TMPDIR || env.TEMP || env.TMP);
195
- return object;
196
- };
197
- var windows = () => {
198
- const { env } = process;
199
- const object = {};
200
- object.home = () => normalize_path(
201
- os.homedir ? os.homedir() : env.USERPROFILE || paths.join(env.HOMEDRIVE, env.HOMEPATH) || env.HOME
202
- );
203
- object.temp = () => normalize_path(
204
- os.tmpdir ? os.tmpdir() : env.TEMP || env.TMP || paths.join(env.LOCALAPPDATA || env.SystemRoot || env.windir, "Temp")
205
- );
206
- return object;
207
- };
208
- var _OSPaths = class __OSPaths {
209
- constructor() {
210
- const OSPaths = function() {
211
- return new __OSPaths();
212
- };
213
- this._fn = OSPaths;
214
- const extension = isWinOS ? windows() : base();
215
- Object.keys(extension).forEach((key) => {
216
- this._fn[key] = extension[key];
217
- });
218
- return this._fn;
219
- }
220
- };
221
- module.exports = new _OSPaths();
222
- }
223
- });
224
-
225
- // ../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js
226
- var require_lib3 = __commonJS({
227
- "../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports, module) {
228
- "use strict";
229
- var path2 = __require("path");
230
- var osPaths = require_lib2();
231
- var linux = () => {
232
- const object = {};
233
- object.cache = () => process.env.XDG_CACHE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".cache");
234
- object.config = () => process.env.XDG_CONFIG_HOME || path2.join(osPaths.home() || osPaths.temp(), ".config");
235
- object.data = () => process.env.XDG_DATA_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "share");
236
- object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
237
- object.state = () => process.env.XDG_STATE_HOME || path2.join(osPaths.home() || osPaths.temp(), ".local", "state");
238
- return object;
239
- };
240
- var macos = () => {
241
- const object = {};
242
- object.cache = () => process.env.XDG_CACHE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Caches");
243
- object.config = () => process.env.XDG_CONFIG_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Preferences");
244
- object.data = () => process.env.XDG_DATA_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "Application Support");
245
- object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
246
- object.state = () => process.env.XDG_STATE_HOME || path2.join(path2.join(osPaths.home() || osPaths.temp(), "Library"), "State");
247
- return object;
248
- };
249
- var windows = () => {
250
- const object = {};
251
- object.cache = () => {
252
- const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
253
- return process.env.XDG_CACHE_HOME || path2.join(localAppData, "xdg.cache");
254
- };
255
- object.config = () => {
256
- const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
257
- return process.env.XDG_CONFIG_HOME || path2.join(appData, "xdg.config");
258
- };
259
- object.data = () => {
260
- const appData = process.env.APPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Roaming");
261
- return process.env.XDG_DATA_HOME || path2.join(appData, "xdg.data");
262
- };
263
- object.runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
264
- object.state = () => {
265
- const localAppData = process.env.LOCALAPPDATA || path2.join(osPaths.home() || osPaths.temp(), "AppData", "Local");
266
- return process.env.XDG_STATE_HOME || path2.join(localAppData, "xdg.state");
267
- };
268
- return object;
269
- };
270
- var _XDGPortable = () => {
271
- const XDGPortable = function() {
272
- return _XDGPortable();
273
- };
274
- let extension = {};
275
- if (/^darwin$/i.test(process.platform)) {
276
- extension = macos();
277
- } else if (/^win/i.test(process.platform)) {
278
- extension = windows();
279
- } else {
280
- extension = linux();
281
- }
282
- extension.configDirs = () => {
283
- const dirs = [];
284
- dirs.push(extension.config());
285
- if (process.env.XDG_CONFIG_DIRS) {
286
- dirs.push(...process.env.XDG_CONFIG_DIRS.split(path2.delimiter));
287
- }
288
- return dirs;
289
- };
290
- extension.dataDirs = () => {
291
- const dirs = [];
292
- dirs.push(extension.data());
293
- if (process.env.XDG_DATA_DIRS) {
294
- dirs.push(...process.env.XDG_DATA_DIRS.split(path2.delimiter));
295
- }
296
- return dirs;
297
- };
298
- Object.keys(extension).forEach((key) => {
299
- XDGPortable[key] = extension[key];
300
- });
301
- return XDGPortable;
302
- };
303
- module.exports = _XDGPortable();
304
- }
305
- });
306
-
307
- // ../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js
308
- var require_xdg_app_paths = __commonJS({
309
- "../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports, module) {
310
- "use strict";
311
- var path2 = __require("path");
312
- var os = __require("os");
313
- var xdg = require_lib3();
314
- var isWinOS = /^win/i.test(process.platform);
315
- function _normalizeOptions(options, isolated) {
316
- options = options || {};
317
- if (typeof options !== "object") {
318
- options = { isolated: options };
319
- }
320
- options.isolated = options.isolated === void 0 || options.isolated === null ? isolated : options.isolated;
321
- if (typeof options.isolated !== "boolean") {
322
- throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);
323
- }
324
- return options;
325
- }
326
- var base = (name, isolated) => {
327
- const object = {};
328
- object.cache = (options = { isolated: null }) => {
329
- options = _normalizeOptions(options, isolated);
330
- return path2.join(xdg.cache(), options.isolated ? name : "");
331
- };
332
- object.config = (options = { isolated: null }) => {
333
- options = _normalizeOptions(options, isolated);
334
- return path2.join(xdg.config(), options.isolated ? name : "");
335
- };
336
- object.data = (options = { isolated: null }) => {
337
- options = _normalizeOptions(options, isolated);
338
- return path2.join(xdg.data(), options.isolated ? name : "");
339
- };
340
- object.runtime = (options = { isolated: null }) => {
341
- options = _normalizeOptions(options, isolated);
342
- return xdg.runtime() ? path2.join(xdg.runtime(), options.isolated ? name : "") : void 0;
343
- };
344
- object.state = (options = { isolated: null }) => {
345
- options = _normalizeOptions(options, isolated);
346
- return path2.join(xdg.state(), options.isolated ? name : "");
347
- };
348
- object.configDirs = (options = { isolated: null }) => {
349
- options = _normalizeOptions(options, isolated);
350
- return xdg.configDirs().map((s) => path2.join(s, options.isolated ? name : ""));
351
- };
352
- object.dataDirs = (options = { isolated: null }) => {
353
- options = _normalizeOptions(options, isolated);
354
- return xdg.dataDirs().map((s) => path2.join(s, options.isolated ? name : ""));
355
- };
356
- return object;
357
- };
358
- var windows = (name, isolated) => {
359
- const { env } = process;
360
- const homedir2 = os.homedir();
361
- const tmpdir = os.tmpdir();
362
- const appData = env.APPDATA || path2.join(homedir2 || tmpdir, "AppData", "Roaming");
363
- const localAppData = env.LOCALAPPDATA || path2.join(homedir2 || tmpdir, "AppData", "Local");
364
- const object = {};
365
- object.cache = (options = { isolated: null }) => {
366
- options = _normalizeOptions(options, isolated);
367
- return !options.isolated || env.XDG_CACHE_HOME ? path2.join(xdg.cache(), options.isolated ? name : "") : path2.join(localAppData, options.isolated ? name : "", "Cache");
368
- };
369
- object.config = (options = { isolated: null }) => {
370
- options = _normalizeOptions(options, isolated);
371
- const config2 = !options.isolated || env.XDG_CONFIG_HOME ? path2.join(xdg.config(), options.isolated ? name : "") : path2.join(appData, options.isolated ? name : "", "Config");
372
- return config2;
373
- };
374
- object.data = (options = { isolated: null }) => {
375
- options = _normalizeOptions(options, isolated);
376
- const data = !options.isolated || env.XDG_DATA_HOME ? path2.join(xdg.data(), options.isolated ? name : "") : path2.join(appData, options.isolated ? name : "", "Data");
377
- return data;
378
- };
379
- object.runtime = (options = { isolated: null }) => {
380
- options = _normalizeOptions(options, isolated);
381
- return xdg.runtime() ? path2.join(xdg.runtime(), options.isolated ? name : "") : void 0;
382
- };
383
- object.state = (options = { isolated: null }) => {
384
- options = _normalizeOptions(options, isolated);
385
- return !options.isolated || env.XDG_STATE_HOME ? path2.join(xdg.state(), options.isolated ? name : "") : path2.join(localAppData, options.isolated ? name : "", "State");
386
- };
387
- object.configDirs = (options = { isolated: null }) => {
388
- options = _normalizeOptions(options, isolated);
389
- const dirs = [object.config(options)];
390
- if (env.XDG_CONFIG_DIRS) {
391
- dirs.push(...env.XDG_CONFIG_DIRS.split(path2.delimiter).map((s) => path2.join(s, options.isolated ? name : "")));
392
- }
393
- return dirs;
394
- };
395
- object.dataDirs = (options = { isolated: null }) => {
396
- options = _normalizeOptions(options, isolated);
397
- const dirs = [object.data(options)];
398
- if (env.XDG_DATA_DIRS) {
399
- dirs.push(...env.XDG_DATA_DIRS.split(path2.delimiter).map((s) => path2.join(s, options.isolated ? name : "")));
400
- }
401
- return dirs;
402
- };
403
- return object;
404
- };
405
- var _XDGAppPaths = class __XDGAppPaths {
406
- constructor(options = { name: null, suffix: null, isolated: true }) {
407
- const XDGAppPaths2 = function(options2 = { name: null, suffix: null, isolated: true }) {
408
- return new __XDGAppPaths(options2);
409
- };
410
- this._fn = XDGAppPaths2;
411
- options = options || {};
412
- if (typeof options !== "object") {
413
- options = { name: options };
414
- }
415
- let name = options.name || "";
416
- if (typeof name !== "string") {
417
- throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);
418
- }
419
- const suffix = options.suffix || "";
420
- if (typeof suffix !== "string") {
421
- throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);
422
- }
423
- const isolated = options.isolated === void 0 || options.isolated === null ? true : options.isolated;
424
- if (typeof isolated !== "boolean") {
425
- throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);
426
- }
427
- if (!name) {
428
- name = path2.parse(process.pkg ? process.execPath : __require.main ? __require.main.filename : process.argv[0]).name;
429
- }
430
- if (suffix) {
431
- name += suffix;
432
- }
433
- this._fn.$name = () => name;
434
- this._fn.$isolated = () => isolated;
435
- const extension = isWinOS ? windows(name, isolated) : base(name, isolated);
436
- Object.keys(extension).forEach((key) => {
437
- this._fn[key] = extension[key];
438
- });
439
- return this._fn;
440
- }
441
- };
442
- module.exports = new _XDGAppPaths();
443
- }
444
- });
445
-
446
- // src/util/get-latest-version/fetch-dist-tags.cjs
447
- var require_fetch_dist_tags = __commonJS({
448
- "src/util/get-latest-version/fetch-dist-tags.cjs"(exports, module) {
449
- "use strict";
450
- var https = __require("https");
451
- function fetchDistTags2(name, options) {
452
- const timeout = options && options.timeout || 3e3;
453
- const agent = new https.Agent({
454
- keepAlive: true,
455
- maxSockets: 15
456
- // See: `npm config get maxsockets`
457
- });
458
- const headers = {
459
- accept: "application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"
460
- };
461
- const url = `https://registry.npmjs.org/-/package/${name}/dist-tags`;
462
- return new Promise((resolve) => {
463
- const timer = setTimeout(() => {
464
- req.destroy();
465
- resolve(void 0);
466
- }, timeout);
467
- const req = https.get(url, { agent, headers }, (res) => {
468
- let buf = "";
469
- res.on("data", (chunk) => {
470
- buf += chunk;
471
- });
472
- res.on("end", () => {
473
- clearTimeout(timer);
474
- try {
475
- if (res.statusCode && res.statusCode >= 400) {
476
- resolve(void 0);
477
- return;
478
- }
479
- resolve(JSON.parse(buf));
480
- } catch {
481
- resolve(void 0);
482
- }
483
- });
484
- });
485
- req.on("error", () => {
486
- clearTimeout(timer);
487
- resolve(void 0);
488
- });
489
- });
490
- }
491
- module.exports = { fetchDistTags: fetchDistTags2 };
492
- }
493
- });
494
-
495
- // src/index.ts
496
- var import_error_utils3 = __toESM(require_dist(), 1);
497
- var import_fs_extra2 = __toESM(require_lib(), 1);
498
- var import_chalk = __toESM(require_source(), 1);
499
- var import_semver2 = __toESM(require_semver(), 1);
500
- var import_epipebomb = __toESM(require_epipebomb(), 1);
501
- import { join as join2 } from "path";
502
- import { existsSync as existsSync2 } from "fs";
503
-
504
- // src/util/get-latest-version/index.ts
505
- var import_semver = __toESM(require_semver(), 1);
506
- var import_xdg_app_paths = __toESM(require_xdg_app_paths(), 1);
507
- var import_fs_extra = __toESM(require_lib(), 1);
508
- import { dirname, parse as parsePath, resolve as resolvePath } from "path";
509
- import { spawn } from "child_process";
510
- var import_fetch_dist_tags = __toESM(require_fetch_dist_tags(), 1);
511
- function getLatestVersion({
512
- cacheDir = (0, import_xdg_app_paths.default)("com.vercel.cli").cache(),
513
- distTag = "latest",
514
- notifyInterval = 1e3 * 60 * 60 * 24 * 3,
515
- // 3 days
516
- pkg,
517
- updateCheckInterval = 1e3 * 60 * 60 * 24,
518
- // 1 day
519
- consumeNotification = true
520
- }) {
521
- if (!pkg || typeof pkg !== "object" || !pkg.name || typeof pkg.name !== "string") {
522
- throw new TypeError("Expected package to be an object with a package name");
523
- }
524
- const cacheFile = resolvePath(
525
- cacheDir,
526
- "package-updates",
527
- `${pkg.name}-${distTag}.json`
528
- );
529
- let cache;
530
- try {
531
- cache = (0, import_fs_extra.readJSONSync)(cacheFile);
532
- } catch (err) {
533
- if (err.code !== "ENOENT") {
534
- output_manager_default?.debug(`Error reading latest package cache file: ${err}`);
535
- }
536
- }
537
- if (!cache || !cache.expireAt || cache.expireAt <= Date.now()) {
538
- spawnWorker({
539
- cacheFile,
540
- distTag,
541
- name: pkg.name,
542
- updateCheckInterval
543
- });
544
- }
545
- if (cache) {
546
- const shouldNotify = !cache.notifyAt || cache.notifyAt <= Date.now();
547
- let updateAvailable = false;
548
- if (cache.version && pkg.version) {
549
- updateAvailable = import_semver.default.lt(pkg.version, cache.version);
550
- }
551
- if (shouldNotify && updateAvailable) {
552
- if (consumeNotification) {
553
- cache.notifyAt = Date.now() + notifyInterval;
554
- (0, import_fs_extra.outputJSONSync)(cacheFile, cache);
555
- }
556
- return cache.version;
557
- }
558
- }
559
- }
560
- function spawnWorker(payload) {
561
- let dir = dirname(__filename);
562
- let script = resolvePath(dir, "dist", "get-latest-worker.cjs");
563
- const { root } = parsePath(dir);
564
- while (!(0, import_fs_extra.existsSync)(script)) {
565
- dir = dirname(dir);
566
- if (dir === root) {
567
- output_manager_default?.debug("Failed to find the get latest worker script!");
568
- return;
569
- }
570
- script = resolvePath(dir, "dist", "get-latest-worker.cjs");
571
- }
572
- output_manager_default?.debug(`Spawning ${script}`);
573
- const args = [script];
574
- if (output_manager_default?.debugEnabled) {
575
- args.push("--debug");
576
- }
577
- const worker = spawn(process.execPath, args, {
578
- stdio: ["inherit", "inherit", "inherit", "ipc"],
579
- windowsHide: true
580
- });
581
- const workerReadyTimer = setTimeout(() => worker.kill(), 2e3);
582
- const onClose = (code) => {
583
- output_manager_default?.debug(`Get latest worker exited (code ${code})`);
584
- };
585
- worker.on("close", onClose);
586
- worker.on("error", (err) => {
587
- output_manager_default?.log(`Failed to spawn get latest worker: ${err.stack}`);
588
- });
589
- worker.once("message", () => {
590
- clearTimeout(workerReadyTimer);
591
- worker.removeListener("close", onClose);
592
- worker.send(payload);
593
- worker.unref();
594
- });
595
- }
596
- async function fetchLatestVersion({
597
- name,
598
- distTag = "latest",
599
- timeout = 3e3
600
- }) {
601
- const tags = await (0, import_fetch_dist_tags.fetchDistTags)(name, { timeout });
602
- return tags?.[distTag];
603
- }
604
- function updateLatestVersionCache({
605
- cacheDir = (0, import_xdg_app_paths.default)("com.vercel.cli").cache(),
606
- distTag = "latest",
607
- name,
608
- version,
609
- updateCheckInterval = 1e3 * 60 * 60 * 24
610
- // 1 day
611
- }) {
612
- const cacheFile = resolvePath(
613
- cacheDir,
614
- "package-updates",
615
- `${name}-${distTag}.json`
616
- );
617
- let notifyAt;
618
- try {
619
- const existing = (0, import_fs_extra.readJSONSync)(cacheFile);
620
- notifyAt = existing?.notifyAt;
621
- } catch {
622
- }
623
- (0, import_fs_extra.outputJSONSync)(cacheFile, {
624
- expireAt: Date.now() + updateCheckInterval,
625
- notifyAt,
626
- version
627
- });
628
- }
629
-
630
- // src/index.ts
631
- import { URL } from "url";
632
-
633
- // src/util/get-sentry.ts
634
- var sentry;
635
- async function getSentry() {
636
- if (!sentry) {
637
- const [SentryModule, { SENTRY_DSN }, { default: pkg }] = await Promise.all([
638
- import("./chunks/cjs-DV4RM7XU.js"),
639
- import("./chunks/constants-YMCRE6IG.js"),
640
- import("./chunks/pkg-56KRLZ5K.js")
641
- ]);
642
- const Sentry = "init" in SentryModule ? SentryModule : SentryModule.default;
643
- Sentry.init({
644
- dsn: SENTRY_DSN,
645
- release: `vercel-cli@${pkg.version}`,
646
- environment: "stable",
647
- autoSessionTracking: false
648
- });
649
- sentry = Sentry;
650
- }
651
- return sentry;
652
- }
653
-
654
- // src/util/handle-command-typo.ts
655
- function handleCommandTypo({
656
- command,
657
- availableCommands,
658
- threshold = 0.7
659
- }) {
660
- if (!command || command.startsWith("-")) {
661
- return false;
662
- }
663
- const suggestion = did_you_mean_default(command, availableCommands, threshold);
664
- if (suggestion) {
665
- output_manager_default.error(
666
- `${param(command)} is not a valid target directory or subcommand. Did you mean ${param(suggestion)}?`
667
- );
668
- return true;
669
- }
670
- return false;
671
- }
672
-
673
- // src/util/report-error.ts
674
- var import_error_utils = __toESM(require_dist(), 1);
675
- async function reportError(sentry2, client2, error) {
676
- if (ignoreError(error)) {
677
- return;
678
- }
679
- let user;
680
- let team;
681
- let scopeError;
682
- try {
683
- ({ user, team } = await getScope(client2));
684
- } catch (err) {
685
- if ((0, import_error_utils.isError)(err)) {
686
- scopeError = err;
687
- }
688
- }
689
- sentry2.withScope((scope) => {
690
- if (user) {
691
- const spec = {
692
- email: user.email,
693
- id: user.id,
694
- username: user.username,
695
- name: user.name
696
- };
697
- scope.setUser(spec);
698
- }
699
- if (team) {
700
- scope.setTag("currentTeam", team.id);
701
- }
702
- if (scopeError) {
703
- scope.setExtra("scopeError", {
704
- name: scopeError.name,
705
- message: scopeError.message,
706
- stack: scopeError.stack
707
- });
708
- }
709
- let args;
710
- let argsError;
711
- try {
712
- args = getArgs(process.argv.slice(2), {});
713
- } catch (err) {
714
- if ((0, import_error_utils.isError)(err)) {
715
- argsError = err;
716
- }
717
- }
718
- if (args) {
719
- const flags = ["--env", "--build-env", "--token"];
720
- for (const flag of flags) {
721
- if (args[flag])
722
- args[flag] = "REDACTED";
723
- }
724
- if (args._.length >= 4 && args._[0].startsWith("secret") && args._[1] === "add") {
725
- args._[3] = "REDACTED";
726
- }
727
- scope.setExtra("args", args);
728
- } else {
729
- let msg = "Unable to parse args";
730
- if (argsError) {
731
- msg += `: ${argsError}`;
732
- }
733
- scope.setExtra("args", msg);
734
- }
735
- scope.setExtra("node", {
736
- execPath: process.execPath,
737
- version: process.version,
738
- platform: process.platform
739
- });
740
- sentry2.captureException(error);
741
- });
742
- const sentryClient = sentry2.getCurrentHub().getClient();
743
- if (sentryClient) {
744
- await sentryClient.close();
745
- }
746
- }
747
- function ignoreError(error) {
748
- return (0, import_error_utils.isError)(error) && error.message.includes("uv_cwd");
749
- }
750
-
751
- // src/util/get-config.ts
752
- var import_client = __toESM(require_dist2(), 1);
753
- import path from "path";
754
- var import_error_utils2 = __toESM(require_dist(), 1);
755
- var config;
756
- async function earlyGetConfig(configFile) {
757
- if (config) {
758
- return config;
759
- }
760
- let localPath;
761
- try {
762
- localPath = process.cwd();
763
- } catch (err) {
764
- if ((0, import_error_utils2.isErrnoException)(err) && err.code === "ENOENT") {
765
- return new WorkingDirectoryDoesNotExist();
766
- }
767
- throw err;
768
- }
769
- if (configFile) {
770
- const localFilePath = path.resolve(localPath, configFile);
771
- output_manager_default.debug(
772
- `Found config in provided --local-config path ${localFilePath}`
773
- );
774
- const localConfig = await readJSONFile(localFilePath);
775
- if (localConfig instanceof CantParseJSONFile) {
776
- return localConfig;
777
- }
778
- if (localConfig === null) {
779
- return new CantFindConfig([humanizePath(localFilePath)]);
780
- }
781
- config = localConfig;
782
- config[import_client.fileNameSymbol] = configFile;
783
- return config;
784
- }
785
- const vercelFilePath = path.resolve(localPath, "vercel.json");
786
- const nowFilePath = path.resolve(localPath, "now.json");
787
- const [vercelConfig, nowConfig] = await Promise.all([
788
- readJSONFile(vercelFilePath),
789
- readJSONFile(nowFilePath)
790
- ]);
791
- if (vercelConfig instanceof CantParseJSONFile) {
792
- return vercelConfig;
793
- }
794
- if (nowConfig instanceof CantParseJSONFile) {
795
- return nowConfig;
796
- }
797
- if (vercelConfig !== null) {
798
- output_manager_default.debug(`Found config in file "${vercelFilePath}"`);
799
- config = vercelConfig;
800
- config[import_client.fileNameSymbol] = "vercel.json";
801
- return config;
802
- }
803
- if (nowConfig !== null) {
804
- return new DeprecatedNowJson(nowFilePath);
805
- }
806
- return new CantFindConfig([vercelFilePath].map(humanizePath));
807
- }
808
-
809
- // src/index.ts
810
- import { getDefaultAuthConfig, defaultGlobalConfig } from "@vercel/cli-config";
811
-
812
- // src/util/telemetry/root.ts
813
- var import_ci_info = __toESM(require_ci_info(), 1);
814
- var RootTelemetryClient = class extends TelemetryClient {
815
- trackCliExtension() {
816
- this.trackExtension();
817
- }
818
- trackCliDefaultDeploy(defaultDeploy) {
819
- if (defaultDeploy) {
820
- this.trackDefaultDeploy();
821
- }
822
- }
823
- trackCliCommandAgent(actual) {
824
- this.trackCliCommand({
825
- command: "agent",
826
- value: actual
827
- });
828
- }
829
- trackCliCommandAgentRuns(actual) {
830
- this.trackCliCommand({
831
- command: "agent-runs",
832
- value: actual
833
- });
834
- }
835
- trackCliCommandAiGateway(actual) {
836
- this.trackCliCommand({
837
- command: "ai-gateway",
838
- value: actual
839
- });
840
- }
841
- trackCliCommandAlias(actual) {
842
- this.trackCliCommand({
843
- command: "alias",
844
- value: actual
845
- });
846
- }
847
- trackCliCommandActivity(actual) {
848
- this.trackCliCommand({
849
- command: "activity",
850
- value: actual
851
- });
852
- }
853
- trackCliCommandAlerts(actual) {
854
- this.trackCliCommand({
855
- command: "alerts",
856
- value: actual
857
- });
858
- }
859
- trackCliCommandApi(actual) {
860
- this.trackCliCommand({
861
- command: "api",
862
- value: actual
863
- });
864
- }
865
- trackCliCommandBisect(actual) {
866
- this.trackCliCommand({
867
- command: "bisect",
868
- value: actual
869
- });
870
- }
871
- trackCliCommandBlob(actual) {
872
- this.trackCliCommand({
873
- command: "blob",
874
- value: actual
875
- });
876
- }
877
- trackCliCommandBuild(actual) {
878
- this.trackCliCommand({
879
- command: "build",
880
- value: actual
881
- });
882
- }
883
- trackCliCommandBuy(actual) {
884
- this.trackCliCommand({
885
- command: "buy",
886
- value: actual
887
- });
888
- }
889
- trackCliCommandCache(actual) {
890
- this.trackCliCommand({
891
- command: "cache",
892
- value: actual
893
- });
894
- }
895
- trackCliCommandCerts(actual) {
896
- this.trackCliCommand({
897
- command: "certs",
898
- value: actual
899
- });
900
- }
901
- trackCliCommandChangelog(actual) {
902
- this.trackCliCommand({
903
- command: "changelog",
904
- value: actual
905
- });
906
- }
907
- trackCliCommandComments(actual) {
908
- this.trackCliCommand({
909
- command: "comments",
910
- value: actual
911
- });
912
- }
913
- trackCliCommandConnex(actual) {
914
- this.trackCliCommand({
915
- command: "connect",
916
- value: actual
917
- });
918
- }
919
- trackCliCommandContract(actual) {
920
- this.trackCliCommand({
921
- command: "contract",
922
- value: actual
923
- });
924
- }
925
- trackCliCommandCrons(actual) {
926
- this.trackCliCommand({
927
- command: "crons",
928
- value: actual
929
- });
930
- }
931
- trackCliCommandCurl(actual) {
932
- this.trackCliCommand({
933
- command: "curl",
934
- value: actual
935
- });
936
- }
937
- trackCliCommandDeploy(actual) {
938
- this.trackCliCommand({
939
- command: "deploy",
940
- value: actual
941
- });
942
- }
943
- trackCliCommandDeployHooks(actual) {
944
- this.trackCliCommand({
945
- command: "deploy-hooks",
946
- value: actual
947
- });
948
- }
949
- trackCliCommandDev(actual) {
950
- this.trackCliCommand({
951
- command: "dev",
952
- value: actual
953
- });
954
- }
955
- trackCliCommandDomains(actual) {
956
- this.trackCliCommand({
957
- command: "domains",
958
- value: actual
959
- });
960
- }
961
- trackCliCommandDns(actual) {
962
- this.trackCliCommand({
963
- command: "dns",
964
- value: actual
965
- });
966
- }
967
- trackCliCommandEnv(actual) {
968
- this.trackCliCommand({
969
- command: "env",
970
- value: actual
971
- });
972
- }
973
- trackCliCommandFirewall(actual) {
974
- this.trackCliCommand({
975
- command: "firewall",
976
- value: actual
977
- });
978
- }
979
- trackCliCommandFlags(actual) {
980
- this.trackCliCommand({
981
- command: "flags",
982
- value: actual
983
- });
984
- }
985
- trackCliCommandGit(actual) {
986
- this.trackCliCommand({
987
- command: "git",
988
- value: actual
989
- });
990
- }
991
- trackCliCommandGlobalConfig(actual) {
992
- this.trackCliCommand({
993
- command: "global-config",
994
- value: actual
995
- });
996
- }
997
- trackCliCommandGuidance(actual) {
998
- this.trackCliCommand({
999
- command: "guidance",
1000
- value: actual
1001
- });
1002
- }
1003
- trackCliCommandHelp(actual) {
1004
- this.trackCliCommand({
1005
- command: "help",
1006
- value: actual
1007
- });
1008
- }
1009
- trackCliCommandHttpstat(actual) {
1010
- this.trackCliCommand({
1011
- command: "httpstat",
1012
- value: actual
1013
- });
1014
- }
1015
- trackCliCommandInit(actual) {
1016
- this.trackCliCommand({
1017
- command: "init",
1018
- value: actual
1019
- });
1020
- }
1021
- trackCliCommandInspect(actual) {
1022
- this.trackCliCommand({
1023
- command: "inspect",
1024
- value: actual
1025
- });
1026
- }
1027
- trackCliCommandInstall(actual) {
1028
- this.trackCliCommand({
1029
- command: "install",
1030
- value: actual
1031
- });
1032
- }
1033
- trackCliCommandIntegration(actual) {
1034
- this.trackCliCommand({
1035
- command: "integration",
1036
- value: actual
1037
- });
1038
- }
1039
- trackCliCommandIntegrationResource(actual) {
1040
- this.trackCliCommand({
1041
- command: "integration-resource",
1042
- value: actual
1043
- });
1044
- }
1045
- trackCliCommandKms(actual) {
1046
- this.trackCliCommand({
1047
- command: "kms",
1048
- value: actual
1049
- });
1050
- }
1051
- trackCliCommandLink(actual) {
1052
- this.trackCliCommand({
1053
- command: "link",
1054
- value: actual
1055
- });
1056
- }
1057
- trackCliCommandList(actual) {
1058
- this.trackCliCommand({
1059
- command: "list",
1060
- value: actual
1061
- });
1062
- }
1063
- trackCliCommandLogin(actual) {
1064
- this.trackCliCommand({
1065
- command: "login",
1066
- value: actual
1067
- });
1068
- }
1069
- trackCliCommandLogout(actual) {
1070
- this.trackCliCommand({
1071
- command: "logout",
1072
- value: actual
1073
- });
1074
- }
1075
- trackCliCommandLogs(actual) {
1076
- this.trackCliCommand({
1077
- command: "logs",
1078
- value: actual
1079
- });
1080
- }
1081
- trackCliCommandMetrics(actual) {
1082
- this.trackCliCommand({
1083
- command: "metrics",
1084
- value: actual
1085
- });
1086
- }
1087
- trackCliCommandMicrofrontends(actual) {
1088
- this.trackCliCommand({
1089
- command: "microfrontends",
1090
- value: actual
1091
- });
1092
- }
1093
- trackCliCommandOpen(actual) {
1094
- this.trackCliCommand({
1095
- command: "open",
1096
- value: actual
1097
- });
1098
- }
1099
- trackCliCommandProject(actual) {
1100
- this.trackCliCommand({
1101
- command: "project",
1102
- value: actual
1103
- });
1104
- }
1105
- trackCliCommandPromote(actual) {
1106
- this.trackCliCommand({
1107
- command: "promote",
1108
- value: actual
1109
- });
1110
- }
1111
- trackCliCommandPull(actual) {
1112
- this.trackCliCommand({
1113
- command: "pull",
1114
- value: actual
1115
- });
1116
- }
1117
- trackCliCommandRollback(actual) {
1118
- this.trackCliCommand({
1119
- command: "rollback",
1120
- value: actual
1121
- });
1122
- }
1123
- trackCliCommandRollingRelease(actual) {
1124
- this.trackCliCommand({
1125
- command: "rolling-release",
1126
- value: actual
1127
- });
1128
- }
1129
- trackCliCommandRedeploy(actual) {
1130
- this.trackCliCommand({
1131
- command: "redeploy",
1132
- value: actual
1133
- });
1134
- }
1135
- trackCliCommandRedirects(actual) {
1136
- this.trackCliCommand({
1137
- command: "redirects",
1138
- value: actual
1139
- });
1140
- }
1141
- trackCliCommandRoutes(actual) {
1142
- this.trackCliCommand({
1143
- command: "routes",
1144
- value: actual
1145
- });
1146
- }
1147
- trackCliCommandRemove(actual) {
1148
- this.trackCliCommand({
1149
- command: "remove",
1150
- value: actual
1151
- });
1152
- }
1153
- trackCliCommandSkills(actual) {
1154
- this.trackCliCommand({
1155
- command: "skills",
1156
- value: actual
1157
- });
1158
- }
1159
- trackCliCommandSandbox(actual) {
1160
- this.trackCliCommand({
1161
- command: "sandbox",
1162
- value: actual
1163
- });
1164
- }
1165
- trackCliCommandSecurity(actual) {
1166
- this.trackCliCommand({
1167
- command: "security",
1168
- value: actual
1169
- });
1170
- }
1171
- trackCliCommandStorage(actual) {
1172
- this.trackCliCommand({
1173
- command: "storage",
1174
- value: actual
1175
- });
1176
- }
1177
- trackCliCommandTarget(actual) {
1178
- this.trackCliCommand({
1179
- command: "target",
1180
- value: actual
1181
- });
1182
- }
1183
- trackCliCommandTeams(actual) {
1184
- this.trackCliCommand({
1185
- command: "teams",
1186
- value: actual
1187
- });
1188
- }
1189
- trackCliCommandTokens(actual) {
1190
- this.trackCliCommand({
1191
- command: "tokens",
1192
- value: actual
1193
- });
1194
- }
1195
- trackCliCommandTelemetry(actual) {
1196
- this.trackCliCommand({
1197
- command: "telemetry",
1198
- value: actual
1199
- });
1200
- }
1201
- trackCliCommandTraces(actual) {
1202
- this.trackCliCommand({
1203
- command: "traces",
1204
- value: actual
1205
- });
1206
- }
1207
- trackCliCommandWhoami(actual) {
1208
- this.trackCliCommand({
1209
- command: "whoami",
1210
- value: actual
1211
- });
1212
- }
1213
- trackCliCommandUpgrade(actual) {
1214
- this.trackCliCommand({
1215
- command: "upgrade",
1216
- value: actual
1217
- });
1218
- }
1219
- trackCliCommandVersion(actual) {
1220
- this.trackCliCommand({
1221
- command: "version",
1222
- value: actual
1223
- });
1224
- }
1225
- trackCliCommandWebhooks(actual) {
1226
- this.trackCliCommand({
1227
- command: "webhooks",
1228
- value: actual
1229
- });
1230
- }
1231
- trackCliCommandUsage(actual) {
1232
- this.trackCliCommand({
1233
- command: "usage",
1234
- value: actual
1235
- });
1236
- }
1237
- trackCliCommandVcr(actual) {
1238
- this.trackCliCommand({
1239
- command: "vcr",
1240
- value: actual
1241
- });
1242
- }
1243
- trackCPUs() {
1244
- super.trackCPUs();
1245
- }
1246
- trackAgenticUse(agent) {
1247
- super.trackAgenticUse(agent);
1248
- }
1249
- trackArch() {
1250
- super.trackArch();
1251
- }
1252
- trackPlatform() {
1253
- super.trackPlatform();
1254
- }
1255
- trackCIVendorName() {
1256
- this.trackCI(import_ci_info.default.id);
1257
- }
1258
- trackStdinIsTTY(isTTY2) {
1259
- super.trackStdinIsTTY(isTTY2);
1260
- }
1261
- trackVersion(version) {
1262
- super.trackVersion(version);
1263
- }
1264
- trackProjectId(projectId) {
1265
- super.trackProjectId(projectId);
1266
- }
1267
- trackInvocationId(invocationId) {
1268
- super.trackInvocationId(invocationId);
1269
- }
1270
- trackDeviceId(deviceId) {
1271
- super.trackDeviceId(deviceId);
1272
- }
1273
- trackVercelPluginActiveSession() {
1274
- super.trackVercelPluginActiveSession();
1275
- }
1276
- trackVercelPluginVersion(version) {
1277
- super.trackVercelPluginVersion(version);
1278
- }
1279
- trackErrorStatus(status) {
1280
- super.trackErrorStatus(status);
1281
- }
1282
- trackErrorCode(code) {
1283
- super.trackErrorCode(code);
1284
- }
1285
- trackErrorSlug(slug) {
1286
- super.trackErrorSlug(slug);
1287
- }
1288
- trackErrorAction(action) {
1289
- super.trackErrorAction(action);
1290
- }
1291
- trackErrorServerMessage(serverMessage) {
1292
- super.trackErrorServerMessage(serverMessage);
1293
- }
1294
- trackCliOptionCwd(cwd) {
1295
- if (cwd) {
1296
- this.trackCliOption({ option: "cwd", value: this.redactedValue });
1297
- }
1298
- }
1299
- trackCliOptionLocalConfig(localConfig) {
1300
- if (localConfig) {
1301
- this.trackCliOption({
1302
- option: "local-config",
1303
- value: this.redactedValue
1304
- });
1305
- }
1306
- }
1307
- trackCliOptionGlobalConfig(globalConfig) {
1308
- if (globalConfig) {
1309
- this.trackCliOption({
1310
- option: "global-config",
1311
- value: this.redactedValue
1312
- });
1313
- }
1314
- }
1315
- trackCliOptionScope(scope) {
1316
- if (scope) {
1317
- this.trackCliOption({
1318
- option: "scope",
1319
- value: this.redactedValue
1320
- });
1321
- }
1322
- }
1323
- trackCliOptionToken(token) {
1324
- if (token) {
1325
- this.trackCliOption({
1326
- option: "token",
1327
- value: this.redactedValue
1328
- });
1329
- }
1330
- }
1331
- trackCliOptionTeam(team) {
1332
- if (team) {
1333
- this.trackCliOption({
1334
- option: "team",
1335
- value: this.redactedValue
1336
- });
1337
- }
1338
- }
1339
- trackCliOptionApi(api) {
1340
- if (api) {
1341
- this.trackCliOption({
1342
- option: "api",
1343
- value: this.redactedValue
1344
- });
1345
- }
1346
- }
1347
- trackCliFlagDebug(debug) {
1348
- if (debug) {
1349
- this.trackCliFlag("debug");
1350
- }
1351
- }
1352
- trackCliFlagNoColor(noColor) {
1353
- if (noColor) {
1354
- this.trackCliFlag("no-color");
1355
- }
1356
- }
1357
- };
1358
-
1359
- // src/util/telemetry/vercel-plugin.ts
1360
- import { readFileSync } from "fs";
1361
- import { homedir } from "os";
1362
- import { join } from "path";
1363
- var ACTIVE_SESSION_MARKER_PATH = join(
1364
- homedir(),
1365
- ".config",
1366
- "vercel-plugin",
1367
- "active-session.json"
1368
- );
1369
- var SEMVERISH_RE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
1370
- function isRecord(value) {
1371
- return typeof value === "object" && value !== null;
1372
- }
1373
- function readVercelPluginActiveSessionMarker(opts = {}) {
1374
- const filePath = opts.filePath ?? ACTIVE_SESSION_MARKER_PATH;
1375
- const now = opts.now?.() ?? Date.now();
1376
- try {
1377
- const marker = JSON.parse(readFileSync(filePath, "utf-8"));
1378
- if (!isRecord(marker)) {
1379
- return null;
1380
- }
1381
- if (marker.schema !== 1 || marker.active !== true) {
1382
- return null;
1383
- }
1384
- if (typeof marker.expiresAt !== "number" || marker.expiresAt <= now) {
1385
- return null;
1386
- }
1387
- if (typeof marker.pluginVersion !== "string" || !SEMVERISH_RE.test(marker.pluginVersion)) {
1388
- return null;
1389
- }
1390
- return {
1391
- pluginVersion: marker.pluginVersion
1392
- };
1393
- } catch {
1394
- return null;
1395
- }
1396
- }
1397
-
1398
- // src/util/telemetry/check-status.ts
1399
- function checkTelemetryStatus({ config: config2 }) {
1400
- if (config2.telemetry) {
1401
- return;
1402
- }
1403
- if (process.env.VERCEL_TELEMETRY_DISABLED) {
1404
- return;
1405
- }
1406
- output_manager_default.note(
1407
- "The Vercel CLI now collects telemetry regarding usage of the CLI."
1408
- );
1409
- output_manager_default.log(
1410
- "This information is used to shape the CLI roadmap and prioritize features."
1411
- );
1412
- output_manager_default.log(
1413
- "You can learn more, including how to opt-out if you'd not like to participate in this program, by visiting the following URL:"
1414
- );
1415
- output_manager_default.log("https://vercel.com/docs/cli/about-telemetry");
1416
- config2.telemetry = {
1417
- enabled: true
1418
- };
1419
- writeToConfigFile(config2);
1420
- }
1421
-
1422
- // src/util/guidance/check-status.ts
1423
- function checkGuidanceStatus({ config: config2 }) {
1424
- if (!process.env.FF_GUIDANCE_MODE) {
1425
- return;
1426
- }
1427
- if (process.env.CI) {
1428
- return;
1429
- }
1430
- if (process.env.VERCEL_GUIDANCE_DISABLED) {
1431
- return;
1432
- }
1433
- if (config2.guidance) {
1434
- return;
1435
- }
1436
- output_manager_default.note(
1437
- "The Vercel CLI can suggest common follow-up commands and steps to help guide new users."
1438
- );
1439
- output_manager_default.log("You can disable this feature by running:");
1440
- output_manager_default.log("vercel guidance disable");
1441
- output_manager_default.log("or by setting VERCEL_GUIDANCE_DISABLED=1");
1442
- config2.guidance = {
1443
- enabled: true
1444
- };
1445
- writeToConfigFile(config2);
1446
- }
1447
-
1448
- // src/index.ts
1449
- import { determineAgent } from "@vercel/detect-agent";
1450
- import {
1451
- getPlatformEnv,
1452
- Span
1453
- } from "@vercel/build-utils";
1454
- import { mkdir, writeFile } from "fs/promises";
1455
- try {
1456
- process.cwd();
1457
- } catch (err) {
1458
- if ((0, import_error_utils3.isError)(err) && err.message.includes("uv_cwd")) {
1459
- console.error("Error: The current working directory does not exist.");
1460
- process.exit(1);
1461
- }
1462
- }
1463
- {
1464
- const SILENCED_ERRORS = [
1465
- "DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."
1466
- ];
1467
- const originalError = console.error;
1468
- console.error = (msg) => {
1469
- const isSilencedError = SILENCED_ERRORS.some(
1470
- (error) => typeof msg === "string" && msg.includes(error)
1471
- );
1472
- if (isSilencedError) {
1473
- return;
1474
- }
1475
- originalError(msg);
1476
- };
1477
- }
1478
- var VERCEL_DIR = getGlobalPathConfig();
1479
- var VERCEL_CONFIG_PATH = getConfigFilePath();
1480
- var VERCEL_AUTH_CONFIG_PATH = getAuthConfigFilePath();
1481
- var GLOBAL_COMMANDS = /* @__PURE__ */ new Set(["help"]);
1482
- function hasProxyConfig() {
1483
- return [
1484
- "HTTP_PROXY",
1485
- "HTTPS_PROXY",
1486
- "http_proxy",
1487
- "https_proxy",
1488
- "ALL_PROXY",
1489
- "all_proxy"
1490
- ].some((v) => process.env[v]);
1491
- }
1492
- (0, import_epipebomb.default)();
1493
- var client;
1494
- var resolvedCommandForUpdate;
1495
- var handleRejection = async (err) => {
1496
- if (err) {
1497
- if (err instanceof Error) {
1498
- await handleUnexpected(err);
1499
- } else {
1500
- output_manager_default.error(`An unexpected rejection occurred
1501
- ${err}`);
1502
- await reportError(await getSentry(), client, err);
1503
- }
1504
- } else {
1505
- output_manager_default.error("An unexpected empty rejection occurred");
1506
- }
1507
- process.exit(1);
1508
- };
1509
- var handleUnexpected = async (err) => {
1510
- const { message } = err;
1511
- if (message.includes("sentry") && message.includes("ENOTFOUND")) {
1512
- output_manager_default.debug(`Sentry is not reachable: ${err}`);
1513
- return;
1514
- }
1515
- output_manager_default.error(`An unexpected error occurred!
1516
- ${err.stack}`);
1517
- await reportError(await getSentry(), client, err);
1518
- process.exit(1);
1519
- };
1520
- process.on("unhandledRejection", handleRejection);
1521
- process.on("uncaughtException", handleUnexpected);
1522
- if (process.env.CLAUDECODE) {
1523
- process.stderr.write(
1524
- '<claude-code-hint v="1" type="plugin" value="vercel@claude-plugins-official" />\n'
1525
- );
1526
- }
1527
- var SHOULD_CHECK_FOR_UPDATES = !process.env.NO_UPDATE_NOTIFIER && !process.env.VERCEL;
1528
- var { isTTY } = process.stdout;
1529
- var apiUrl = "https://api.vercel.com";
1530
- var InMemoryReporter = class {
1531
- constructor() {
1532
- this.events = [];
1533
- }
1534
- report(event) {
1535
- this.events.push(event);
1536
- }
1537
- };
1538
- var main = async () => {
1539
- const traceReporter = new InMemoryReporter();
1540
- const rootSpan = new Span({ name: "vc.cli", reporter: traceReporter });
1541
- const isTelemetryFlushCommand = process.argv[2] === "telemetry" && process.argv[3] === "flush";
1542
- if (process.env.FORCE_TTY === "1") {
1543
- isTTY = true;
1544
- process.stdout.isTTY = true;
1545
- process.stdin.isTTY = true;
1546
- }
1547
- const parseInitialArgs = () => parseArguments(
1548
- process.argv,
1549
- {
1550
- "--version": Boolean,
1551
- "-v": "--version",
1552
- "--changelog": Boolean,
1553
- "--non-interactive": Boolean
1554
- },
1555
- { permissive: true }
1556
- );
1557
- let parsedArgs;
1558
- try {
1559
- parsedArgs = parseInitialArgs();
1560
- const isDebugging = parsedArgs.flags["--debug"];
1561
- const isNoColor = parsedArgs.flags["--no-color"];
1562
- output_manager_default.initialize({
1563
- debug: isDebugging,
1564
- noColor: isNoColor
1565
- });
1566
- } catch (err) {
1567
- printError(err);
1568
- return 1;
1569
- }
1570
- const localConfigPath = parsedArgs.flags["--local-config"];
1571
- let localConfig = await earlyGetConfig(localConfigPath);
1572
- if (localConfig instanceof CantParseJSONFile) {
1573
- output_manager_default.error(`Couldn't parse JSON file ${localConfig.meta.file}.`);
1574
- return 1;
1575
- }
1576
- if (localConfig instanceof CantFindConfig) {
1577
- if (localConfigPath) {
1578
- output_manager_default.error(
1579
- `Couldn't find a project configuration file at
1580
- ${localConfig.meta.paths.join(
1581
- " or\n "
1582
- )}`
1583
- );
1584
- return 1;
1585
- } else {
1586
- localConfig = void 0;
1587
- }
1588
- }
1589
- if (localConfig instanceof Error) {
1590
- output_manager_default.prettyError(localConfig);
1591
- return 1;
1592
- }
1593
- const targetOrSubcommand = parsedArgs.args[2] || (parsedArgs.flags["--changelog"] ? "changelog" : void 0);
1594
- const subSubCommand = parsedArgs.args[3];
1595
- const betaCommands = ["api", "crons", "curl", "kms", "webhooks"];
1596
- const shortBuildLabel = BUILD_LABEL ? ` (${BUILD_LABEL.split(" ")[0]})` : "";
1597
- const versionBanner = isNativeBinaryInstall() ? `${getTitleName()} CLI ${pkg_default.version}${shortBuildLabel}` : `${getTitleName()} CLI ${pkg_default.version}${shortBuildLabel} (Node.js ${process.versions.node})`;
1598
- const msg = targetOrSubcommand && betaCommands.includes(targetOrSubcommand) ? `${versionBanner} | ${targetOrSubcommand} is in beta \u2014 https://vercel.com/feedback` : versionBanner;
1599
- if (shouldPrintVersionBanner(targetOrSubcommand, process.argv)) {
1600
- output_manager_default.print(`${import_chalk.default.dim(msg)}
1601
- `);
1602
- }
1603
- if (!targetOrSubcommand && parsedArgs.flags["--version"]) {
1604
- console.log(pkg_default.version);
1605
- return 0;
1606
- }
1607
- const bareHelpOption = !targetOrSubcommand && parsedArgs.flags["--help"];
1608
- const bareHelpSubcommand = targetOrSubcommand === "help" && !subSubCommand;
1609
- if (bareHelpOption || bareHelpSubcommand) {
1610
- output_manager_default.print(help());
1611
- return 0;
1612
- }
1613
- try {
1614
- await (0, import_fs_extra2.mkdirp)(VERCEL_DIR);
1615
- } catch (err) {
1616
- output_manager_default.error(
1617
- `An unexpected error occurred while trying to create the global directory "${humanizePath(
1618
- VERCEL_DIR
1619
- )}" ${(0, import_error_utils3.errorToString)(err)}`
1620
- );
1621
- return 1;
1622
- }
1623
- let config2;
1624
- try {
1625
- config2 = readConfigFile();
1626
- } catch (err) {
1627
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "ENOENT") {
1628
- config2 = defaultGlobalConfig;
1629
- try {
1630
- writeToConfigFile(config2);
1631
- } catch (err2) {
1632
- output_manager_default.error(
1633
- `An unexpected error occurred while trying to save the config to "${humanizePath(
1634
- VERCEL_CONFIG_PATH
1635
- )}" ${(0, import_error_utils3.errorToString)(err2)}`
1636
- );
1637
- return 1;
1638
- }
1639
- } else {
1640
- output_manager_default.error(
1641
- `An unexpected error occurred while trying to read the config in "${humanizePath(
1642
- VERCEL_CONFIG_PATH
1643
- )}" ${(0, import_error_utils3.errorToString)(err)}`
1644
- );
1645
- return 1;
1646
- }
1647
- }
1648
- let tokenSource;
1649
- let explicitToken;
1650
- if (typeof parsedArgs.flags["--token"] === "string") {
1651
- explicitToken = parsedArgs.flags["--token"];
1652
- tokenSource = "flag";
1653
- } else if (process.env.VERCEL_TOKEN) {
1654
- explicitToken = process.env.VERCEL_TOKEN;
1655
- tokenSource = "env";
1656
- }
1657
- let authConfig;
1658
- if (tokenSource) {
1659
- authConfig = getDefaultAuthConfig();
1660
- } else {
1661
- try {
1662
- authConfig = readAuthConfigFile(config2);
1663
- } catch (err) {
1664
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "ENOENT") {
1665
- authConfig = getDefaultAuthConfig();
1666
- } else {
1667
- output_manager_default.error(
1668
- `An unexpected error occurred while trying to read the auth config in "${humanizePath(
1669
- VERCEL_AUTH_CONFIG_PATH
1670
- )}" ${(0, import_error_utils3.errorToString)(err)}`
1671
- );
1672
- return 1;
1673
- }
1674
- }
1675
- }
1676
- const telemetryEventStore = new TelemetryEventStore({
1677
- isDebug: process.env.VERCEL_TELEMETRY_DEBUG === "1",
1678
- config: config2.telemetry,
1679
- cliDevice: isTelemetryFlushCommand ? void 0 : {
1680
- filePath: join2(VERCEL_DIR, "telemetry-device.json")
1681
- },
1682
- cliSession: isTelemetryFlushCommand ? void 0 : {
1683
- filePath: join2(VERCEL_DIR, "telemetry-session.json")
1684
- }
1685
- });
1686
- checkTelemetryStatus({
1687
- config: config2
1688
- });
1689
- if (process.env.FF_GUIDANCE_MODE) {
1690
- checkGuidanceStatus({
1691
- config: config2
1692
- });
1693
- }
1694
- const telemetry = new RootTelemetryClient({
1695
- opts: {
1696
- store: telemetryEventStore
1697
- }
1698
- });
1699
- const { isAgent, agent: detectedAgent } = await determineAgent();
1700
- telemetry.trackInvocationId(telemetryEventStore.currentInvocationId);
1701
- telemetry.trackDeviceId(telemetryEventStore.currentDeviceId);
1702
- const vercelPluginMarker = readVercelPluginActiveSessionMarker();
1703
- if (vercelPluginMarker) {
1704
- telemetry.trackVercelPluginActiveSession();
1705
- telemetry.trackVercelPluginVersion(vercelPluginMarker.pluginVersion);
1706
- }
1707
- telemetry.trackAgenticUse(detectedAgent?.name);
1708
- telemetry.trackCPUs();
1709
- telemetry.trackPlatform();
1710
- telemetry.trackArch();
1711
- telemetry.trackCIVendorName();
1712
- telemetry.trackStdinIsTTY(process.stdin?.isTTY === true);
1713
- telemetry.trackVersion(pkg_default.version);
1714
- telemetry.trackCliOptionCwd(parsedArgs.flags["--cwd"]);
1715
- telemetry.trackCliOptionLocalConfig(parsedArgs.flags["--local-config"]);
1716
- telemetry.trackCliOptionGlobalConfig(parsedArgs.flags["--global-config"]);
1717
- telemetry.trackCliFlagDebug(parsedArgs.flags["--debug"]);
1718
- telemetry.trackCliFlagNoColor(parsedArgs.flags["--no-color"]);
1719
- telemetry.trackCliOptionScope(parsedArgs.flags["--scope"]);
1720
- telemetry.trackCliOptionToken(parsedArgs.flags["--token"]);
1721
- telemetry.trackCliOptionTeam(parsedArgs.flags["--team"]);
1722
- telemetry.trackCliOptionApi(parsedArgs.flags["--api"]);
1723
- let earlyGetUserPromise;
1724
- let telemetrySaved = false;
1725
- const getStringProperty = (value, key) => {
1726
- if (typeof value === "object" && value !== null && key in value) {
1727
- const property = value[key];
1728
- if (typeof property === "string") {
1729
- return property;
1730
- }
1731
- }
1732
- return void 0;
1733
- };
1734
- const getNumberProperty = (value, key) => {
1735
- if (typeof value === "object" && value !== null && key in value) {
1736
- const property = value[key];
1737
- if (typeof property === "number") {
1738
- return property;
1739
- }
1740
- }
1741
- return void 0;
1742
- };
1743
- const trackAgenticErrorTelemetry = (err) => {
1744
- if (!isAgent) {
1745
- return;
1746
- }
1747
- telemetry.trackErrorStatus(getNumberProperty(err, "status"));
1748
- telemetry.trackErrorCode(getStringProperty(err, "code"));
1749
- telemetry.trackErrorSlug(getStringProperty(err, "slug"));
1750
- telemetry.trackErrorAction(getStringProperty(err, "action"));
1751
- const serverMessage = getStringProperty(err, "serverMessage") ?? ((0, import_error_utils3.isError)(err) ? err.message : void 0);
1752
- telemetry.trackErrorServerMessage(serverMessage);
1753
- };
1754
- const saveTelemetry = async () => {
1755
- if (telemetrySaved) {
1756
- return;
1757
- }
1758
- const postCommandSpan = rootSpan.child("vc.postCommand");
1759
- telemetryEventStore.updateTeamId(
1760
- client?.config.currentTeam ?? config2.currentTeam
1761
- );
1762
- telemetryEventStore.updateUserId(
1763
- client?.authConfig.userId ?? authConfig.userId
1764
- );
1765
- if (!telemetryEventStore.hasUserId) {
1766
- const getUserSpan = postCommandSpan.child("vc.postCommand.getUser");
1767
- try {
1768
- const user = await earlyGetUserPromise;
1769
- if (user) {
1770
- telemetryEventStore.updateUserId(user.id);
1771
- }
1772
- } catch {
1773
- } finally {
1774
- getUserSpan.stop();
1775
- }
1776
- }
1777
- try {
1778
- const envProjectId = getPlatformEnv("PROJECT_ID");
1779
- if (envProjectId) {
1780
- telemetryEventStore.updateProjectId(envProjectId);
1781
- } else {
1782
- const cwdForProjectId = client?.cwd || (typeof parsedArgs.flags["--cwd"] === "string" ? parsedArgs.flags["--cwd"] : process.cwd());
1783
- const link = await getLinkFromDir(getVercelDirectory(cwdForProjectId));
1784
- if (link) {
1785
- telemetryEventStore.updateProjectId(link.projectId);
1786
- }
1787
- }
1788
- } catch {
1789
- }
1790
- telemetry.trackProjectId(telemetryEventStore.currentProjectId);
1791
- await telemetryEventStore.save();
1792
- postCommandSpan.stop();
1793
- telemetrySaved = true;
1794
- };
1795
- const finishWithExitCode = async (code) => {
1796
- await saveTelemetry();
1797
- return code;
1798
- };
1799
- if (typeof parsedArgs.flags["--api"] === "string") {
1800
- apiUrl = parsedArgs.flags["--api"];
1801
- } else if (config2 && config2.api) {
1802
- apiUrl = config2.api;
1803
- }
1804
- try {
1805
- new URL(apiUrl);
1806
- } catch (_err) {
1807
- output_manager_default.error(`Please provide a valid URL instead of ${highlight(apiUrl)}.`);
1808
- return finishWithExitCode(1);
1809
- }
1810
- const stdinIsTTY = process.stdin?.isTTY === true;
1811
- const nonInteractiveFlag = parsedArgs.flags["--non-interactive"] === true;
1812
- const argv = process.argv;
1813
- const explicitNonInteractiveFalse = argv.includes("--non-interactive=false") || argv.includes("--non-interactive") && argv[argv.indexOf("--non-interactive") + 1] === "false";
1814
- const nonInteractive = explicitNonInteractiveFalse ? false : nonInteractiveFlag || isAgent && !stdinIsTTY;
1815
- output_manager_default.debug(
1816
- `Agent/TTY/nonInteractive: isAgent=${isAgent} agentName=${detectedAgent?.name ?? "none"} stdin.isTTY=${String(process.stdin?.isTTY)} --non-interactive=${nonInteractiveFlag} explicitFalse=${explicitNonInteractiveFalse} => nonInteractive=${nonInteractive}`
1817
- );
1818
- if (hasProxyConfig()) {
1819
- const { EnvProxyDispatcher } = await import("./chunks/fetch-proxy-R3JZNXBZ.js");
1820
- setFetchDispatcher(new EnvProxyDispatcher());
1821
- }
1822
- client = new Client({
1823
- apiUrl,
1824
- stdin: process.stdin,
1825
- stdout: process.stdout,
1826
- stderr: output_manager_default.stream,
1827
- config: config2,
1828
- authConfig,
1829
- localConfig,
1830
- localConfigPath,
1831
- argv: process.argv,
1832
- telemetryEventStore,
1833
- isAgent,
1834
- agentName: detectedAgent?.name,
1835
- nonInteractive
1836
- });
1837
- client.rootSpan = rootSpan;
1838
- if (parsedArgs.flags["--cwd"]) {
1839
- client.cwd = parsedArgs.flags["--cwd"];
1840
- }
1841
- const { cwd } = client;
1842
- let defaultDeploy = false;
1843
- let subcommand = void 0;
1844
- let userSuppliedSubCommand = "";
1845
- if (targetOrSubcommand) {
1846
- const targetPath = join2(cwd, targetOrSubcommand);
1847
- const targetPathExists = existsSync2(targetPath);
1848
- const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands.has(targetOrSubcommand);
1849
- if (targetPathExists && subcommandExists && !parsedArgs.flags["--cwd"] && !process.env.NOW_BUILDER && !wantsMachineReadableOutput(targetOrSubcommand, process.argv) && !await hasLocalProjectLink(client, cwd)) {
1850
- output_manager_default.warn(
1851
- `Did you mean to deploy the subdirectory "${targetOrSubcommand}"? Use \`vc --cwd ${targetOrSubcommand}\` instead.`
1852
- );
1853
- }
1854
- if (subcommandExists) {
1855
- output_manager_default.debug(`user supplied known subcommand: "${targetOrSubcommand}"`);
1856
- subcommand = targetOrSubcommand;
1857
- userSuppliedSubCommand = targetOrSubcommand;
1858
- } else {
1859
- output_manager_default.debug(
1860
- "user supplied a possible target for deployment or an extension"
1861
- );
1862
- if (process.env.VERCEL_AUTO_API && await matchesCliApiTag(targetOrSubcommand)) {
1863
- output_manager_default.debug(
1864
- `first token "${targetOrSubcommand}" matches an OpenAPI tag; routing to api`
1865
- );
1866
- const tag = targetOrSubcommand;
1867
- const result = await tryOpenApiFallback(
1868
- client,
1869
- parsedArgs.args.slice(3),
1870
- async () => tag
1871
- );
1872
- return finishWithExitCode(result ?? 1);
1873
- } else if (targetPathExists) {
1874
- subcommand = "deploy";
1875
- userSuppliedSubCommand = targetOrSubcommand;
1876
- output_manager_default.debug(
1877
- `first token "${targetOrSubcommand}" is an existing path; routing to deploy`
1878
- );
1879
- }
1880
- }
1881
- } else {
1882
- output_manager_default.debug("user supplied no target, defaulting to deploy");
1883
- subcommand = "deploy";
1884
- defaultDeploy = true;
1885
- }
1886
- if (subcommand === "help") {
1887
- telemetry.trackCliCommandHelp("help");
1888
- subcommand = subSubCommand || "deploy";
1889
- client.argv.push("-h");
1890
- }
1891
- const subcommandsWithoutToken = [
1892
- "login",
1893
- "logout",
1894
- "help",
1895
- "init",
1896
- "build",
1897
- "changelog",
1898
- "deploy",
1899
- "sandbox",
1900
- "telemetry",
1901
- "upgrade",
1902
- "version",
1903
- "skills",
1904
- "agent",
1905
- "whoami"
1906
- ];
1907
- if (process.env.FF_GUIDANCE_MODE) {
1908
- subcommandsWithoutToken.push("guidance");
1909
- }
1910
- if (subcommand === "dev" && (client.argv.includes("--local") || client.argv.includes("-L"))) {
1911
- subcommandsWithoutToken.push("dev");
1912
- }
1913
- if (subcommand === "flags" && subSubCommand === "prepare") {
1914
- subcommandsWithoutToken.push("flags");
1915
- }
1916
- if (tokenSource === "env" && explicitToken) {
1917
- parsedArgs.flags["--token"] = explicitToken;
1918
- }
1919
- if ((!authConfig || !authConfig.token) && !client.argv.includes("-h") && !client.argv.includes("--help") && typeof parsedArgs.flags["--token"] !== "string" && subcommand && !subcommandsWithoutToken.includes(subcommand)) {
1920
- const result = await promptMissingCredentials(
1921
- client,
1922
- trackAgenticErrorTelemetry
1923
- );
1924
- if (result !== 0) {
1925
- return finishWithExitCode(result);
1926
- }
1927
- }
1928
- if (typeof parsedArgs.flags["--token"] === "string" && subcommand === "switch") {
1929
- output_manager_default.prettyError({
1930
- message: `This command doesn't work with ${param(
1931
- "--token"
1932
- )}. Please use ${param("--scope")}.`,
1933
- link: "https://err.sh/vercel/no-token-allowed"
1934
- });
1935
- return finishWithExitCode(1);
1936
- }
1937
- if (typeof parsedArgs.flags["--token"] === "string") {
1938
- const token = parsedArgs.flags["--token"];
1939
- if (token.length === 0) {
1940
- output_manager_default.prettyError({
1941
- message: `You defined ${param("--token")}, but it's missing a value`,
1942
- link: "https://err.sh/vercel/missing-token-value"
1943
- });
1944
- return finishWithExitCode(1);
1945
- }
1946
- const invalid = token.match(/(\W)/g);
1947
- if (invalid) {
1948
- const notContain = Array.from(new Set(invalid)).sort();
1949
- output_manager_default.prettyError({
1950
- message: `You defined ${param(
1951
- "--token"
1952
- )}, but its contents are invalid. Must not contain: ${notContain.map((c) => JSON.stringify(c)).join(", ")}`,
1953
- link: "https://err.sh/vercel/invalid-token-value"
1954
- });
1955
- return finishWithExitCode(1);
1956
- }
1957
- client.authConfig = { token, skipWrite: true, tokenSource };
1958
- if (client.config && client.config.currentTeam) {
1959
- delete client.config.currentTeam;
1960
- }
1961
- }
1962
- if (parsedArgs.flags["--team"]) {
1963
- output_manager_default.warn(
1964
- `The ${param("--team")} option is deprecated. Please use ${param(
1965
- "--scope"
1966
- )} instead.`
1967
- );
1968
- }
1969
- let targetCommand = typeof subcommand === "string" ? commands.get(subcommand) : void 0;
1970
- const scope = parsedArgs.flags["--scope"] || parsedArgs.flags["--team"] || localConfig?.scope;
1971
- const separatorIndex = client.argv.indexOf("--");
1972
- const cliArgs = separatorIndex === -1 ? client.argv : client.argv.slice(0, separatorIndex);
1973
- const buildNeedsRemoteProjectScope = targetCommand === "build" && cliArgs.some((arg) => arg === "--project" || arg.startsWith("--project="));
1974
- if (typeof scope === "string" && targetCommand !== "login" && (targetCommand !== "build" || buildNeedsRemoteProjectScope) && targetCommand !== "sandbox") {
1975
- let user = null;
1976
- try {
1977
- user = await getUser(client);
1978
- telemetryEventStore.updateUserId(user.id);
1979
- } catch (err) {
1980
- if (err instanceof Error) {
1981
- output_manager_default.debug(err.stack || err.toString());
1982
- }
1983
- const appTokenScopeResolved = (0, import_error_utils3.isErrnoException)(err) && err.code === "NOT_AUTHORIZED" && isAppPrincipalEnabled() && await resolveAppTokenScope(client, scope);
1984
- if (!appTokenScopeResolved) {
1985
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "NOT_AUTHORIZED") {
1986
- output_manager_default.prettyError({
1987
- message: `You do not have access to the specified account`,
1988
- link: "https://err.sh/vercel/scope-not-accessible"
1989
- });
1990
- trackAgenticErrorTelemetry(err);
1991
- return finishWithExitCode(1);
1992
- }
1993
- output_manager_default.error(
1994
- `Not able to load user because of unexpected error: ${(0, import_error_utils3.errorToString)(err)}`
1995
- );
1996
- trackAgenticErrorTelemetry(err);
1997
- return finishWithExitCode(1);
1998
- }
1999
- }
2000
- if (user) {
2001
- const scopeMatchesUserIdentity = user.id === scope || user.email === scope || user.username === scope;
2002
- let teams = [];
2003
- try {
2004
- teams = await getTeams(client);
2005
- } catch (err) {
2006
- if (scopeMatchesUserIdentity) {
2007
- output_manager_default.debug(
2008
- `Ignoring failure to load teams; scope matches the current user's identity`
2009
- );
2010
- } else if ((0, import_error_utils3.isErrnoException)(err) && err.code === "not_authorized") {
2011
- output_manager_default.prettyError({
2012
- message: `You do not have access to the specified team`,
2013
- link: "https://err.sh/vercel/scope-not-accessible"
2014
- });
2015
- trackAgenticErrorTelemetry(err);
2016
- return finishWithExitCode(1);
2017
- } else if ((0, import_error_utils3.isErrnoException)(err) && err.code === "rate_limited") {
2018
- output_manager_default.prettyError({
2019
- message: "Rate limited. Too many requests to the same endpoint: /teams"
2020
- });
2021
- trackAgenticErrorTelemetry(err);
2022
- return finishWithExitCode(1);
2023
- } else {
2024
- output_manager_default.error("Not able to load teams");
2025
- trackAgenticErrorTelemetry(err);
2026
- return finishWithExitCode(1);
2027
- }
2028
- }
2029
- let related = teams.find(
2030
- (team) => team.id === scope || team.slug === scope
2031
- );
2032
- if (!related && !scopeMatchesUserIdentity) {
2033
- try {
2034
- related = await getTeamByIdOrSlug(client, scope, {
2035
- useCurrentTeam: false
2036
- });
2037
- } catch (err) {
2038
- output_manager_default.debug(
2039
- `Direct team lookup for scope "${scope}" failed: ${(0, import_error_utils3.errorToString)(err)}`
2040
- );
2041
- }
2042
- }
2043
- if (related) {
2044
- client.config.currentTeam = related.id;
2045
- } else if (scopeMatchesUserIdentity) {
2046
- if (user.version === "northstar") {
2047
- output_manager_default.error("You cannot set your Personal Account as the scope.");
2048
- return finishWithExitCode(1);
2049
- }
2050
- delete client.config.currentTeam;
2051
- } else {
2052
- output_manager_default.prettyError({
2053
- message: "The specified scope does not exist",
2054
- link: "https://err.sh/vercel/scope-not-existent"
2055
- });
2056
- return finishWithExitCode(1);
2057
- }
2058
- }
2059
- }
2060
- let exitCode;
2061
- try {
2062
- if (!targetCommand) {
2063
- targetCommand = parsedArgs.args[2];
2064
- try {
2065
- const { execExtension } = await import("./chunks/exec-4IPHZ55G.js");
2066
- exitCode = await execExtension(
2067
- client,
2068
- targetCommand,
2069
- parsedArgs.args.slice(3),
2070
- cwd
2071
- );
2072
- telemetry.trackCliExtension();
2073
- } catch (err) {
2074
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "ENOENT") {
2075
- if (handleCommandTypo({
2076
- command: targetCommand,
2077
- availableCommands: commandNames
2078
- })) {
2079
- return 1;
2080
- }
2081
- targetCommand = subcommand = "deploy";
2082
- } else {
2083
- throw err;
2084
- }
2085
- }
2086
- }
2087
- if (subcommand) {
2088
- let func;
2089
- switch (targetCommand) {
2090
- case "deploy":
2091
- telemetry.trackCliCommandDeploy(userSuppliedSubCommand);
2092
- telemetry.trackCliDefaultDeploy(defaultDeploy);
2093
- func = (await import("./commands/deploy/index.js")).default;
2094
- break;
2095
- case "dev":
2096
- telemetry.trackCliCommandDev(userSuppliedSubCommand);
2097
- func = (await import("./commands/dev/index.js")).default;
2098
- break;
2099
- case "env":
2100
- telemetry.trackCliCommandEnv(userSuppliedSubCommand);
2101
- func = (await import("./commands/env/index.js")).default;
2102
- break;
2103
- case "build":
2104
- telemetry.trackCliCommandBuild(userSuppliedSubCommand);
2105
- func = (await import("./commands/build/index.js")).default;
2106
- break;
2107
- case "list":
2108
- telemetry.trackCliCommandList(userSuppliedSubCommand);
2109
- func = (await import("./commands/list/index.js")).default;
2110
- break;
2111
- case "link":
2112
- telemetry.trackCliCommandLink(userSuppliedSubCommand);
2113
- func = (await import("./commands/link/index.js")).default;
2114
- break;
2115
- case "agent":
2116
- telemetry.trackCliCommandAgent(userSuppliedSubCommand);
2117
- func = (await import("./commands-bulk.js")).agent;
2118
- break;
2119
- case "agent-runs":
2120
- telemetry.trackCliCommandAgentRuns(userSuppliedSubCommand);
2121
- func = (await import("./commands-bulk.js")).agentRuns;
2122
- break;
2123
- case "ai-gateway":
2124
- telemetry.trackCliCommandAiGateway(userSuppliedSubCommand);
2125
- func = (await import("./commands-bulk.js")).aiGateway;
2126
- break;
2127
- case "alias":
2128
- telemetry.trackCliCommandAlias(userSuppliedSubCommand);
2129
- func = (await import("./commands-bulk.js")).alias;
2130
- break;
2131
- case "activity":
2132
- telemetry.trackCliCommandActivity(userSuppliedSubCommand);
2133
- func = (await import("./commands-bulk.js")).activity;
2134
- break;
2135
- case "alerts":
2136
- telemetry.trackCliCommandAlerts(userSuppliedSubCommand);
2137
- func = (await import("./commands-bulk.js")).alerts;
2138
- break;
2139
- case "api":
2140
- telemetry.trackCliCommandApi(userSuppliedSubCommand);
2141
- func = (await import("./commands-bulk.js")).api;
2142
- break;
2143
- case "bisect":
2144
- telemetry.trackCliCommandBisect(userSuppliedSubCommand);
2145
- func = (await import("./commands-bulk.js")).bisect;
2146
- break;
2147
- case "blob":
2148
- telemetry.trackCliCommandBlob(userSuppliedSubCommand);
2149
- func = (await import("./commands-bulk.js")).blob;
2150
- break;
2151
- case "buy":
2152
- telemetry.trackCliCommandBuy(userSuppliedSubCommand);
2153
- func = (await import("./commands-bulk.js")).buy;
2154
- break;
2155
- case "init":
2156
- telemetry.trackCliCommandInit(userSuppliedSubCommand);
2157
- func = (await import("./commands-bulk.js")).init;
2158
- break;
2159
- case "cache":
2160
- telemetry.trackCliCommandCache(userSuppliedSubCommand);
2161
- func = (await import("./commands-bulk.js")).cache;
2162
- break;
2163
- case "connect":
2164
- telemetry.trackCliCommandConnex(userSuppliedSubCommand);
2165
- func = (await import("./commands-bulk.js")).connex;
2166
- break;
2167
- case "contract":
2168
- telemetry.trackCliCommandContract(userSuppliedSubCommand);
2169
- func = (await import("./commands-bulk.js")).contract;
2170
- break;
2171
- case "certs":
2172
- telemetry.trackCliCommandCerts(userSuppliedSubCommand);
2173
- func = (await import("./commands-bulk.js")).certs;
2174
- break;
2175
- case "changelog":
2176
- telemetry.trackCliCommandChangelog(userSuppliedSubCommand);
2177
- func = (await import("./commands-bulk.js")).changelog;
2178
- break;
2179
- case "comments":
2180
- telemetry.trackCliCommandComments(userSuppliedSubCommand);
2181
- func = (await import("./commands-bulk.js")).comments;
2182
- break;
2183
- case "crons":
2184
- case "cron":
2185
- telemetry.trackCliCommandCrons(userSuppliedSubCommand);
2186
- func = (await import("./commands-bulk.js")).crons;
2187
- break;
2188
- case "curl":
2189
- telemetry.trackCliCommandCurl(userSuppliedSubCommand);
2190
- func = (await import("./commands-bulk.js")).curl;
2191
- break;
2192
- case "dns":
2193
- telemetry.trackCliCommandDns(userSuppliedSubCommand);
2194
- func = (await import("./commands-bulk.js")).dns;
2195
- break;
2196
- case "deploy-hooks":
2197
- case "deploy-hook":
2198
- telemetry.trackCliCommandDeployHooks(userSuppliedSubCommand);
2199
- func = (await import("./commands-bulk.js")).deployHooks;
2200
- break;
2201
- case "global-config":
2202
- telemetry.trackCliCommandGlobalConfig(userSuppliedSubCommand);
2203
- func = (await import("./commands-bulk.js")).globalConfig;
2204
- break;
2205
- case "domains":
2206
- telemetry.trackCliCommandDomains(userSuppliedSubCommand);
2207
- func = (await import("./commands-bulk.js")).domains;
2208
- break;
2209
- case "firewall":
2210
- telemetry.trackCliCommandFirewall(userSuppliedSubCommand);
2211
- func = (await import("./commands-bulk.js")).firewall;
2212
- break;
2213
- case "flags":
2214
- telemetry.trackCliCommandFlags(userSuppliedSubCommand);
2215
- func = (await import("./commands-bulk.js")).flags;
2216
- break;
2217
- case "git":
2218
- telemetry.trackCliCommandGit(userSuppliedSubCommand);
2219
- func = (await import("./commands-bulk.js")).git;
2220
- break;
2221
- case "guidance":
2222
- if (process.env.FF_GUIDANCE_MODE) {
2223
- telemetry.trackCliCommandGuidance(userSuppliedSubCommand);
2224
- func = (await import("./commands-bulk.js")).guidance;
2225
- break;
2226
- } else {
2227
- func = null;
2228
- break;
2229
- }
2230
- case "httpstat":
2231
- telemetry.trackCliCommandHttpstat(userSuppliedSubCommand);
2232
- func = (await import("./commands-bulk.js")).httpstat;
2233
- break;
2234
- case "install":
2235
- telemetry.trackCliCommandInstall(userSuppliedSubCommand);
2236
- func = (await import("./commands-bulk.js")).install;
2237
- break;
2238
- case "integration":
2239
- telemetry.trackCliCommandIntegration(userSuppliedSubCommand);
2240
- func = (await import("./commands-bulk.js")).integration;
2241
- break;
2242
- case "integration-resource":
2243
- telemetry.trackCliCommandIntegrationResource(userSuppliedSubCommand);
2244
- func = (await import("./commands-bulk.js")).integrationResource;
2245
- break;
2246
- case "kms":
2247
- telemetry.trackCliCommandKms(userSuppliedSubCommand);
2248
- func = (await import("./commands-bulk.js")).kms;
2249
- break;
2250
- case "mcp":
2251
- func = (await import("./commands-bulk.js")).mcp;
2252
- break;
2253
- case "logout":
2254
- telemetry.trackCliCommandLogout(userSuppliedSubCommand);
2255
- func = (await import("./commands-bulk.js")).logout;
2256
- break;
2257
- case "login":
2258
- telemetry.trackCliCommandLogin(userSuppliedSubCommand);
2259
- func = (c) => import("./commands-bulk.js").then(
2260
- (m) => m.login(c, { shouldParseArgs: true })
2261
- );
2262
- break;
2263
- case "inspect":
2264
- telemetry.trackCliCommandInspect(userSuppliedSubCommand);
2265
- func = (await import("./commands-bulk.js")).inspect;
2266
- break;
2267
- case "logs":
2268
- telemetry.trackCliCommandLogs(userSuppliedSubCommand);
2269
- func = (await import("./commands-bulk.js")).logs;
2270
- break;
2271
- case "metrics":
2272
- telemetry.trackCliCommandMetrics(userSuppliedSubCommand);
2273
- func = (await import("./commands-bulk.js")).metrics;
2274
- break;
2275
- case "microfrontends":
2276
- telemetry.trackCliCommandMicrofrontends(userSuppliedSubCommand);
2277
- func = (await import("./commands-bulk.js")).microfrontends;
2278
- break;
2279
- case "open":
2280
- telemetry.trackCliCommandOpen(userSuppliedSubCommand);
2281
- func = (await import("./commands-bulk.js")).open;
2282
- break;
2283
- case "project":
2284
- telemetry.trackCliCommandProject(userSuppliedSubCommand);
2285
- func = (await import("./commands-bulk.js")).project;
2286
- break;
2287
- case "promote":
2288
- telemetry.trackCliCommandPromote(userSuppliedSubCommand);
2289
- func = (await import("./commands-bulk.js")).promote;
2290
- break;
2291
- case "pull":
2292
- telemetry.trackCliCommandPull(userSuppliedSubCommand);
2293
- func = (await import("./commands-bulk.js")).pull;
2294
- break;
2295
- case "redeploy":
2296
- telemetry.trackCliCommandRedeploy(userSuppliedSubCommand);
2297
- func = (await import("./commands-bulk.js")).redeploy;
2298
- break;
2299
- case "redirects":
2300
- telemetry.trackCliCommandRedirects(userSuppliedSubCommand);
2301
- func = (await import("./commands-bulk.js")).redirects;
2302
- break;
2303
- case "routes":
2304
- telemetry.trackCliCommandRoutes(userSuppliedSubCommand);
2305
- func = (await import("./commands-bulk.js")).routes;
2306
- break;
2307
- case "remove":
2308
- telemetry.trackCliCommandRemove(userSuppliedSubCommand);
2309
- func = (await import("./commands-bulk.js")).remove;
2310
- break;
2311
- case "rollback":
2312
- telemetry.trackCliCommandRollback(userSuppliedSubCommand);
2313
- func = (await import("./commands-bulk.js")).rollback;
2314
- break;
2315
- case "rr":
2316
- case "release":
2317
- case "rolling-release":
2318
- telemetry.trackCliCommandRollingRelease(userSuppliedSubCommand);
2319
- func = (await import("./commands-bulk.js")).rollingRelease;
2320
- break;
2321
- case "sandbox":
2322
- telemetry.trackCliCommandSandbox(userSuppliedSubCommand);
2323
- func = (await import("./commands-bulk.js")).sandbox;
2324
- break;
2325
- case "security":
2326
- telemetry.trackCliCommandSecurity(userSuppliedSubCommand);
2327
- func = (await import("./commands-bulk.js")).security;
2328
- break;
2329
- case "skills":
2330
- telemetry.trackCliCommandSkills(userSuppliedSubCommand);
2331
- func = (await import("./commands-bulk.js")).skills;
2332
- break;
2333
- case "storage":
2334
- telemetry.trackCliCommandStorage(userSuppliedSubCommand);
2335
- func = (await import("./commands-bulk.js")).storage;
2336
- break;
2337
- case "target":
2338
- telemetry.trackCliCommandTarget(userSuppliedSubCommand);
2339
- func = (await import("./commands-bulk.js")).target;
2340
- break;
2341
- case "teams":
2342
- telemetry.trackCliCommandTeams(userSuppliedSubCommand);
2343
- func = (await import("./commands-bulk.js")).teams;
2344
- break;
2345
- case "tokens":
2346
- telemetry.trackCliCommandTokens(userSuppliedSubCommand);
2347
- func = (await import("./commands-bulk.js")).tokens;
2348
- break;
2349
- case "telemetry":
2350
- telemetry.trackCliCommandTelemetry(userSuppliedSubCommand);
2351
- func = (await import("./commands-bulk.js")).telemetry;
2352
- break;
2353
- case "traces":
2354
- telemetry.trackCliCommandTraces(userSuppliedSubCommand);
2355
- func = (await import("./commands-bulk.js")).traces;
2356
- break;
2357
- case "upgrade":
2358
- telemetry.trackCliCommandUpgrade(userSuppliedSubCommand);
2359
- func = (await import("./commands-bulk.js")).upgrade;
2360
- break;
2361
- case "version":
2362
- telemetry.trackCliCommandVersion(userSuppliedSubCommand);
2363
- func = (await import("./commands-bulk.js")).version;
2364
- break;
2365
- case "webhooks":
2366
- telemetry.trackCliCommandWebhooks(userSuppliedSubCommand);
2367
- func = (await import("./commands-bulk.js")).webhooks;
2368
- break;
2369
- case "usage":
2370
- telemetry.trackCliCommandUsage(userSuppliedSubCommand);
2371
- func = (await import("./commands-bulk.js")).usage;
2372
- break;
2373
- case "vcr":
2374
- telemetry.trackCliCommandVcr(userSuppliedSubCommand);
2375
- func = (await import("./commands-bulk.js")).vcr;
2376
- break;
2377
- case "whoami":
2378
- telemetry.trackCliCommandWhoami(userSuppliedSubCommand);
2379
- func = (await import("./commands-bulk.js")).whoami;
2380
- break;
2381
- default:
2382
- func = null;
2383
- break;
2384
- }
2385
- if (!func || !targetCommand) {
2386
- if (!handleCommandTypo({
2387
- command: subcommand,
2388
- availableCommands: commandNames
2389
- })) {
2390
- output_manager_default.error(`The ${param(subcommand)} subcommand does not exist`);
2391
- }
2392
- return 1;
2393
- }
2394
- if (func.default) {
2395
- func = func.default;
2396
- }
2397
- if (!telemetryEventStore.hasUserId && !client.authConfig.userId) {
2398
- earlyGetUserPromise = getUser(client).catch(() => void 0);
2399
- }
2400
- resolvedCommandForUpdate = targetCommand;
2401
- exitCode = await rootSpan.child("vc.cli.command", { command: subcommand || "deploy" }).trace(() => func(client));
2402
- }
2403
- } catch (err) {
2404
- trackAgenticErrorTelemetry(err);
2405
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "ENOTFOUND") {
2406
- const matches = /getaddrinfo ENOTFOUND (.*)$/.exec(err.message || "");
2407
- if (matches && matches[1]) {
2408
- const hostname = matches[1];
2409
- output_manager_default.error(
2410
- `The hostname ${highlight(
2411
- hostname
2412
- )} could not be resolved. Please verify your internet connectivity and DNS configuration.`
2413
- );
2414
- }
2415
- if (typeof err.stack === "string") {
2416
- output_manager_default.debug(err.stack);
2417
- }
2418
- return finishWithExitCode(1);
2419
- }
2420
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "ECONNRESET") {
2421
- const matches = /request to https:\/\/(.*?)\//.exec(err.message || "");
2422
- const hostname = matches?.[1];
2423
- if (hostname) {
2424
- output_manager_default.error(
2425
- `Connection to ${highlight(
2426
- hostname
2427
- )} interrupted. Please verify your internet connectivity and DNS configuration.`
2428
- );
2429
- }
2430
- return finishWithExitCode(1);
2431
- }
2432
- if ((0, import_error_utils3.isErrnoException)(err) && (err.code === "NOT_AUTHORIZED" || err.code === "TEAM_DELETED")) {
2433
- output_manager_default.prettyError(err);
2434
- return finishWithExitCode(1);
2435
- }
2436
- if (err instanceof APIError && 400 <= err.status && err.status <= 499) {
2437
- err.message = err.serverMessage;
2438
- output_manager_default.prettyError(err);
2439
- return finishWithExitCode(1);
2440
- }
2441
- if ((0, import_error_utils3.isErrnoException)(err)) {
2442
- if (typeof err.stack === "string") {
2443
- output_manager_default.debug(err.stack);
2444
- }
2445
- output_manager_default.prettyError(err);
2446
- } else {
2447
- await reportError(await getSentry(), client, err);
2448
- output_manager_default.error(`An unexpected error occurred in ${subcommand}: ${err}`);
2449
- }
2450
- return finishWithExitCode(1);
2451
- }
2452
- await saveTelemetry();
2453
- rootSpan.stop();
2454
- if (client.traceDiagnosticsPath) {
2455
- try {
2456
- await mkdir(join2(client.traceDiagnosticsPath, ".."), { recursive: true });
2457
- await writeFile(
2458
- client.traceDiagnosticsPath,
2459
- JSON.stringify(traceReporter.events)
2460
- );
2461
- } catch (err) {
2462
- output_manager_default.error("Failed to write diagnostics trace file");
2463
- output_manager_default.prettyError(err);
2464
- }
2465
- }
2466
- return exitCode;
2467
- };
2468
- var cachedLatest;
2469
- var freshLookupPromise;
2470
- if (SHOULD_CHECK_FOR_UPDATES && !isNativeBinaryInstall()) {
2471
- cachedLatest = getLatestVersion({ pkg: pkg_default, consumeNotification: false });
2472
- if (cachedLatest) {
2473
- output_manager_default.debug("Update may be available, fetching fresh version...");
2474
- freshLookupPromise = fetchLatestVersion({
2475
- name: pkg_default.name,
2476
- timeout: 3e3
2477
- }).catch(() => void 0);
2478
- }
2479
- }
2480
- async function promptAndUpgrade(client2, targetVersion) {
2481
- try {
2482
- const shouldUpgrade = await client2.input.confirm(
2483
- "Would you like to upgrade now?",
2484
- true
2485
- );
2486
- if (!shouldUpgrade)
2487
- return;
2488
- const upgradeExitCode = await executeUpgrade(targetVersion);
2489
- if (upgradeExitCode === 0 && !hasAutoUpdatePreference(client2.config)) {
2490
- const enableAutoUpdates = await client2.input.confirm(
2491
- "Enable automatic CLI updates for future releases?",
2492
- false
2493
- );
2494
- setAutoUpdate(client2, enableAutoUpdates);
2495
- }
2496
- return upgradeExitCode;
2497
- } catch (err) {
2498
- if (err instanceof Error && err.message.includes("User force closed the prompt")) {
2499
- return;
2500
- }
2501
- throw err;
2502
- }
2503
- }
2504
- main().then(async (exitCode) => {
2505
- if (cachedLatest && resolvedCommandForUpdate !== "upgrade" && !await isVersionPinned()) {
2506
- const originalExitCode = typeof exitCode === "number" ? exitCode : 0;
2507
- const fresh = freshLookupPromise ? await freshLookupPromise : void 0;
2508
- output_manager_default.debug(`Fresh lookup result: ${fresh ?? "failed"}`);
2509
- let latest;
2510
- let userUpToDate = false;
2511
- if (fresh) {
2512
- updateLatestVersionCache({ name: pkg_default.name, version: fresh });
2513
- if (import_semver2.default.lt(pkg_default.version, fresh)) {
2514
- latest = fresh;
2515
- } else {
2516
- userUpToDate = true;
2517
- }
2518
- }
2519
- getLatestVersion({ pkg: pkg_default });
2520
- if (!userUpToDate && await canAutoUpdate(
2521
- client,
2522
- originalExitCode,
2523
- resolvedCommandForUpdate
2524
- )) {
2525
- const upgradeExitCode = await executeUpgrade();
2526
- process.exitCode = originalExitCode;
2527
- if (upgradeExitCode !== 0) {
2528
- output_manager_default.log(
2529
- `Automatic update failed. Continuing with original exit code ${originalExitCode}.`
2530
- );
2531
- }
2532
- return;
2533
- }
2534
- if (latest) {
2535
- const changelog = `https://github.com/vercel/vercel/releases/tag/vercel%40${latest}`;
2536
- if (isTTY) {
2537
- const errorMsg = exitCode && exitCode !== 2 ? import_chalk.default.magenta(
2538
- ` The latest update ${import_chalk.default.italic(
2539
- "may"
2540
- )} fix any errors that occurred.`
2541
- ) : "";
2542
- output_manager_default.print(
2543
- `
2544
- Update available for Vercel CLI (${import_chalk.default.gray(
2545
- `v${pkg_default.version}`
2546
- )} \u2192 ${import_chalk.default.green(`v${latest}`)})${errorMsg}
2547
- `
2548
- );
2549
- output_manager_default.print(
2550
- `Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
2551
- `
2552
- );
2553
- const upgradeExitCode = await promptAndUpgrade(client, latest);
2554
- if (upgradeExitCode !== void 0) {
2555
- process.exitCode = upgradeExitCode;
2556
- return;
2557
- }
2558
- } else {
2559
- const errorMsg = exitCode && exitCode !== 2 ? import_chalk.default.magenta(
2560
- `
2561
-
2562
- The latest update ${import_chalk.default.italic(
2563
- "may"
2564
- )} fix any errors that occurred.`
2565
- ) : "";
2566
- output_manager_default.print(
2567
- box(
2568
- `Update available! ${import_chalk.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk.default.green(
2569
- `v${latest}`
2570
- )}
2571
- Changelog: ${output_manager_default.link(changelog, changelog, { fallback: false })}
2572
- Run ${import_chalk.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`
2573
- )
2574
- );
2575
- output_manager_default.print("\n");
2576
- }
2577
- } else if (!fresh) {
2578
- if (isTTY) {
2579
- output_manager_default.print("\nA newer version of Vercel CLI may be available.\n");
2580
- const upgradeExitCode = await promptAndUpgrade(client);
2581
- if (upgradeExitCode !== void 0) {
2582
- process.exitCode = upgradeExitCode;
2583
- return;
2584
- }
2585
- } else {
2586
- output_manager_default.print(
2587
- box(
2588
- `A newer version of Vercel CLI may be available.
2589
- Run ${import_chalk.default.cyan(cmd(await getUpdateCommand()))} to update.`
2590
- )
2591
- );
2592
- output_manager_default.print("\n");
2593
- }
2594
- }
2595
- }
2596
- process.exitCode = exitCode;
2597
- }).catch(handleUnexpected);
7
+ import{BUILD_LABEL}from"./chunks/chunk-WKZ6JSGZ.js";import{help}from"./chunks/chunk-3FMJYJUR.js";import{box,canAutoUpdate,did_you_mean_default,executeUpgrade,hasAutoUpdatePreference,isVersionPinned,setAutoUpdate}from"./chunks/chunk-ADUYPK2G.js";import{matchesCliApiTag}from"./chunks/chunk-RAIBQIKB.js";import{getUpdateCommand}from"./chunks/chunk-OD6RZ3XZ.js";import"./chunks/chunk-U56NHYAH.js";import{Client,getAuthConfigFilePath,getConfigFilePath,readAuthConfigFile,readConfigFile,writeToConfigFile}from"./chunks/chunk-2PPXY24N.js";import"./chunks/chunk-TRTEXGVN.js";import"./chunks/chunk-T3GQAMBJ.js";import{require_ci_info}from"./chunks/chunk-T52FMXWC.js";import{highlight}from"./chunks/chunk-J3U3L45Y.js";import{getGlobalPathConfig}from"./chunks/chunk-ZIPVX7LD.js";import"./chunks/chunk-NHTF332K.js";import{shouldPrintVersionBanner,wantsMachineReadableOutput}from"./chunks/chunk-D4MW3RDW.js";import"./chunks/chunk-P2O5DOYE.js";import{commandNames,commands}from"./chunks/chunk-BATE73HA.js";import"./chunks/chunk-3QT7VOE3.js";import"./chunks/chunk-O7G3CZ42.js";import"./chunks/chunk-N3N5UHIL.js";import"./chunks/chunk-YMVDWVMO.js";import"./chunks/chunk-M5AV545M.js";import"./chunks/chunk-IVWPQYIH.js";import"./chunks/chunk-3QHJYVCY.js";import"./chunks/chunk-NBVY237X.js";import"./chunks/chunk-WUZD4KBL.js";import"./chunks/chunk-MEAY2K5Z.js";import"./chunks/chunk-EQ52F4LH.js";import"./chunks/chunk-7R5FEXZ5.js";import"./chunks/chunk-FKCOBJFH.js";import"./chunks/chunk-CVKB54WW.js";import"./chunks/chunk-JKTQV2QJ.js";import"./chunks/chunk-JEIMW3CO.js";import"./chunks/chunk-ZKYS7EAB.js";import{require_semver}from"./chunks/chunk-KKS7XWEX.js";import{readJSONFile}from"./chunks/chunk-JIYY3B4C.js";import{require_types}from"./chunks/chunk-GHM7V3GG.js";import"./chunks/chunk-QR7QPUFN.js";import"./chunks/chunk-N6CNMMSZ.js";import{getTeams}from"./chunks/chunk-CN2QZO4U.js";import"./chunks/chunk-XQ73QIQ3.js";import"./chunks/chunk-K3KJZLBD.js";import{param}from"./chunks/chunk-SXUEGVWB.js";import{getScope,isAppPrincipalEnabled,resolveAppTokenScope}from"./chunks/chunk-5QQNYN4N.js";import{TelemetryClient,TelemetryEventStore}from"./chunks/chunk-57GHYR4Y.js";import"./chunks/chunk-RCTYVKM5.js";import{getArgs,parseArguments}from"./chunks/chunk-HTC6KO2B.js";import"./chunks/chunk-5XJNPXQK.js";import{printError}from"./chunks/chunk-LNPMDXBJ.js";import{setFetchDispatcher}from"./chunks/chunk-MY4MONOH.js";import{isNativeBinaryInstall}from"./chunks/chunk-7T6TL3GQ.js";import{require_cli_config}from"./chunks/chunk-BRK4OB4B.js";import{getLinkFromDir,getVercelDirectory,hasLocalProjectLink,require_lib}from"./chunks/chunk-VLZ47RWM.js";import"./chunks/chunk-F2ZWW2IO.js";import"./chunks/chunk-B4ATVYZW.js";import{humanizePath}from"./chunks/chunk-PPCFQQSU.js";import"./chunks/chunk-OSCCYU74.js";import"./chunks/chunk-JAJW3P42.js";import"./chunks/chunk-XSVBYDYI.js";import{getTeamByIdOrSlug,getUser}from"./chunks/chunk-EVZRQGNK.js";import{APIError,CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist}from"./chunks/chunk-R2TGGVCT.js";import{cmd,getTitleName}from"./chunks/chunk-FI772UVH.js";import{require_build_utils}from"./chunks/chunk-XFVGX5HG.js";import{output_manager_default}from"./chunks/chunk-Z6Y55QJW.js";import{require_dist}from"./chunks/chunk-QGIQK47P.js";import{pkg_default}from"./chunks/chunk-AVSPFBLM.js";import"./chunks/chunk-XCJDGQO7.js";import"./chunks/chunk-YPTLSODC.js";import"./chunks/chunk-7HL2RPUO.js";import{require_source}from"./chunks/chunk-U7KCDTCH.js";import"./chunks/chunk-N3ZZ7FHQ.js";import"./chunks/chunk-GU6VIFR5.js";import{__commonJS,__require,__toESM}from"./chunks/chunk-6L236MNA.js";var require_epipebomb=__commonJS({"../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports,module){module.exports=epipeBomb;function epipeBomb(stream,callback){stream==null&&(stream=process.stdout),callback==null&&(callback=process.exit);function epipeFilter(err){if(err.code==="EPIPE")return callback();stream.listeners("error").length<=1&&(stream.removeAllListeners(),stream.emit("error",err),stream.on("error",epipeFilter))}stream.on("error",epipeFilter)}}});var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path2){return paths.normalize(paths.join(path2,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path2=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path2.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path2.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path2.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path2.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path2.join(path2.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path2.join(path2.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path2.join(path2.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path2.join(path2.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path2.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path2.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path2.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path2.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path2.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path2.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path2.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path2.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path2.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path2.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path2=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path2.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path2.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path2.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path2.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path2.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path2.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path2.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir2=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path2.join(homedir2||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path2.join(homedir2||tmpdir,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path2.join(xdg.cache(),options.isolated?name:""):path2.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path2.join(xdg.config(),options.isolated?name:""):path2.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path2.join(xdg.data(),options.isolated?name:""):path2.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path2.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path2.join(xdg.state(),options.isolated?name:""):path2.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path2.delimiter).map(s=>path2.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path2.delimiter).map(s=>path2.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path2.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_fetch_dist_tags=__commonJS({"src/util/get-latest-version/fetch-dist-tags.cjs"(exports,module){"use strict";var https=__require("https");function fetchDistTags2(name,options){let timeout=options&&options.timeout||3e3,agent=new https.Agent({keepAlive:!0,maxSockets:15}),headers={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},url=`https://registry.npmjs.org/-/package/${name}/dist-tags`;return new Promise(resolve=>{let timer=setTimeout(()=>{req.destroy(),resolve(void 0)},timeout),req=https.get(url,{agent,headers},res=>{let buf="";res.on("data",chunk=>{buf+=chunk}),res.on("end",()=>{clearTimeout(timer);try{if(res.statusCode&&res.statusCode>=400){resolve(void 0);return}resolve(JSON.parse(buf))}catch{resolve(void 0)}})});req.on("error",()=>{clearTimeout(timer),resolve(void 0)})})}module.exports={fetchDistTags:fetchDistTags2}}});var import_error_utils3=__toESM(require_dist(),1),import_fs_extra2=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1),import_semver2=__toESM(require_semver(),1),import_epipebomb=__toESM(require_epipebomb(),1);import{join as join2}from"path";import{existsSync as existsSync2}from"fs";var import_semver=__toESM(require_semver(),1),import_xdg_app_paths=__toESM(require_xdg_app_paths(),1),import_fs_extra=__toESM(require_lib(),1);import{dirname,parse as parsePath,resolve as resolvePath}from"path";import{spawn}from"child_process";var import_fetch_dist_tags=__toESM(require_fetch_dist_tags(),1);function getLatestVersion({cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),distTag="latest",notifyInterval=1e3*60*60*24*3,pkg,updateCheckInterval=1e3*60*60*24,consumeNotification=!0}){if(!pkg||typeof pkg!="object"||!pkg.name||typeof pkg.name!="string")throw new TypeError("Expected package to be an object with a package name");let cacheFile=resolvePath(cacheDir,"package-updates",`${pkg.name}-${distTag}.json`),cache;try{cache=(0,import_fs_extra.readJSONSync)(cacheFile)}catch(err){err.code!=="ENOENT"&&output_manager_default?.debug(`Error reading latest package cache file: ${err}`)}if((!cache||!cache.expireAt||cache.expireAt<=Date.now())&&spawnWorker({cacheFile,distTag,name:pkg.name,updateCheckInterval}),cache){let shouldNotify=!cache.notifyAt||cache.notifyAt<=Date.now(),updateAvailable=!1;if(cache.version&&pkg.version&&(updateAvailable=import_semver.default.lt(pkg.version,cache.version)),shouldNotify&&updateAvailable)return consumeNotification&&(cache.notifyAt=Date.now()+notifyInterval,(0,import_fs_extra.outputJSONSync)(cacheFile,cache)),cache.version}}function spawnWorker(payload){let dir=dirname(__filename),script=resolvePath(dir,"dist","get-latest-worker.cjs"),{root}=parsePath(dir);for(;!(0,import_fs_extra.existsSync)(script);){if(dir=dirname(dir),dir===root){output_manager_default?.debug("Failed to find the get latest worker script!");return}script=resolvePath(dir,"dist","get-latest-worker.cjs")}output_manager_default?.debug(`Spawning ${script}`);let args=[script];output_manager_default?.debugEnabled&&args.push("--debug");let worker=spawn(process.execPath,args,{stdio:["inherit","inherit","inherit","ipc"],windowsHide:!0}),workerReadyTimer=setTimeout(()=>worker.kill(),2e3),onClose=code=>{output_manager_default?.debug(`Get latest worker exited (code ${code})`)};worker.on("close",onClose),worker.on("error",err=>{output_manager_default?.log(`Failed to spawn get latest worker: ${err.stack}`)}),worker.once("message",()=>{clearTimeout(workerReadyTimer),worker.removeListener("close",onClose),worker.send(payload),worker.unref()})}async function fetchLatestVersion({name,distTag="latest",timeout=3e3}){return(await(0,import_fetch_dist_tags.fetchDistTags)(name,{timeout}))?.[distTag]}function updateLatestVersionCache({cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),distTag="latest",name,version,updateCheckInterval=1e3*60*60*24}){let cacheFile=resolvePath(cacheDir,"package-updates",`${name}-${distTag}.json`),notifyAt;try{notifyAt=(0,import_fs_extra.readJSONSync)(cacheFile)?.notifyAt}catch{}(0,import_fs_extra.outputJSONSync)(cacheFile,{expireAt:Date.now()+updateCheckInterval,notifyAt,version})}import{URL}from"url";var sentry;async function getSentry(){if(!sentry){let[SentryModule,{SENTRY_DSN},{default:pkg}]=await Promise.all([import("./chunks/cjs-GOQHXIHX.js"),import("./chunks/constants-G4UYVLOF.js"),import("./chunks/pkg-YFU67U7I.js")]),Sentry="init"in SentryModule?SentryModule:SentryModule.default;Sentry.init({dsn:SENTRY_DSN,release:`vercel-cli@${pkg.version}`,environment:"stable",autoSessionTracking:!1}),sentry=Sentry}return sentry}function handleCommandTypo({command,availableCommands,threshold=.7}){if(!command||command.startsWith("-"))return!1;let suggestion=did_you_mean_default(command,availableCommands,threshold);return suggestion?(output_manager_default.error(`${param(command)} is not a valid target directory or subcommand. Did you mean ${param(suggestion)}?`),!0):!1}var import_error_utils=__toESM(require_dist(),1);async function reportError(sentry2,client2,error){if(ignoreError(error))return;let user,team,scopeError;try{({user,team}=await getScope(client2))}catch(err){(0,import_error_utils.isError)(err)&&(scopeError=err)}sentry2.withScope(scope=>{if(user){let spec={email:user.email,id:user.id,username:user.username,name:user.name};scope.setUser(spec)}team&&scope.setTag("currentTeam",team.id),scopeError&&scope.setExtra("scopeError",{name:scopeError.name,message:scopeError.message,stack:scopeError.stack});let args,argsError;try{args=getArgs(process.argv.slice(2),{})}catch(err){(0,import_error_utils.isError)(err)&&(argsError=err)}if(args){let flags=["--env","--build-env","--token"];for(let flag of flags)args[flag]&&(args[flag]="REDACTED");args._.length>=4&&args._[0].startsWith("secret")&&args._[1]==="add"&&(args._[3]="REDACTED"),scope.setExtra("args",args)}else{let msg="Unable to parse args";argsError&&(msg+=`: ${argsError}`),scope.setExtra("args",msg)}scope.setExtra("node",{execPath:process.execPath,version:process.version,platform:process.platform}),sentry2.captureException(error)});let sentryClient=sentry2.getCurrentHub().getClient();sentryClient&&await sentryClient.close()}function ignoreError(error){return(0,import_error_utils.isError)(error)&&error.message.includes("uv_cwd")}var import_types=__toESM(require_types(),1);import path from"path";var import_error_utils2=__toESM(require_dist(),1);var config;async function earlyGetConfig(configFile){if(config)return config;let localPath;try{localPath=process.cwd()}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")return new WorkingDirectoryDoesNotExist;throw err}if(configFile){let localFilePath=path.resolve(localPath,configFile);output_manager_default.debug(`Found config in provided --local-config path ${localFilePath}`);let localConfig=await readJSONFile(localFilePath);return localConfig instanceof CantParseJSONFile?localConfig:localConfig===null?new CantFindConfig([humanizePath(localFilePath)]):(config=localConfig,config[import_types.fileNameSymbol]=configFile,config)}let vercelFilePath=path.resolve(localPath,"vercel.json"),nowFilePath=path.resolve(localPath,"now.json"),[vercelConfig,nowConfig]=await Promise.all([readJSONFile(vercelFilePath),readJSONFile(nowFilePath)]);return vercelConfig instanceof CantParseJSONFile?vercelConfig:nowConfig instanceof CantParseJSONFile?nowConfig:vercelConfig!==null?(output_manager_default.debug(`Found config in file "${vercelFilePath}"`),config=vercelConfig,config[import_types.fileNameSymbol]="vercel.json",config):nowConfig!==null?new DeprecatedNowJson(nowFilePath):new CantFindConfig([vercelFilePath].map(humanizePath))}var import_cli_config=__toESM(require_cli_config(),1);var import_ci_info=__toESM(require_ci_info(),1);var RootTelemetryClient=class extends TelemetryClient{trackCliExtension(){this.trackExtension()}trackCliDefaultDeploy(defaultDeploy){defaultDeploy&&this.trackDefaultDeploy()}trackCliCommandAgent(actual){this.trackCliCommand({command:"agent",value:actual})}trackCliCommandAgentRuns(actual){this.trackCliCommand({command:"agent-runs",value:actual})}trackCliCommandAiGateway(actual){this.trackCliCommand({command:"ai-gateway",value:actual})}trackCliCommandAlias(actual){this.trackCliCommand({command:"alias",value:actual})}trackCliCommandActivity(actual){this.trackCliCommand({command:"activity",value:actual})}trackCliCommandAlerts(actual){this.trackCliCommand({command:"alerts",value:actual})}trackCliCommandApi(actual){this.trackCliCommand({command:"api",value:actual})}trackCliCommandBisect(actual){this.trackCliCommand({command:"bisect",value:actual})}trackCliCommandBlob(actual){this.trackCliCommand({command:"blob",value:actual})}trackCliCommandBuild(actual){this.trackCliCommand({command:"build",value:actual})}trackCliCommandBuy(actual){this.trackCliCommand({command:"buy",value:actual})}trackCliCommandCache(actual){this.trackCliCommand({command:"cache",value:actual})}trackCliCommandCerts(actual){this.trackCliCommand({command:"certs",value:actual})}trackCliCommandChangelog(actual){this.trackCliCommand({command:"changelog",value:actual})}trackCliCommandComments(actual){this.trackCliCommand({command:"comments",value:actual})}trackCliCommandConnex(actual){this.trackCliCommand({command:"connect",value:actual})}trackCliCommandContract(actual){this.trackCliCommand({command:"contract",value:actual})}trackCliCommandCrons(actual){this.trackCliCommand({command:"crons",value:actual})}trackCliCommandCurl(actual){this.trackCliCommand({command:"curl",value:actual})}trackCliCommandDeploy(actual){this.trackCliCommand({command:"deploy",value:actual})}trackCliCommandDeployHooks(actual){this.trackCliCommand({command:"deploy-hooks",value:actual})}trackCliCommandDev(actual){this.trackCliCommand({command:"dev",value:actual})}trackCliCommandDomains(actual){this.trackCliCommand({command:"domains",value:actual})}trackCliCommandDns(actual){this.trackCliCommand({command:"dns",value:actual})}trackCliCommandEnv(actual){this.trackCliCommand({command:"env",value:actual})}trackCliCommandFirewall(actual){this.trackCliCommand({command:"firewall",value:actual})}trackCliCommandFlags(actual){this.trackCliCommand({command:"flags",value:actual})}trackCliCommandGit(actual){this.trackCliCommand({command:"git",value:actual})}trackCliCommandGlobalConfig(actual){this.trackCliCommand({command:"global-config",value:actual})}trackCliCommandGuidance(actual){this.trackCliCommand({command:"guidance",value:actual})}trackCliCommandHelp(actual){this.trackCliCommand({command:"help",value:actual})}trackCliCommandHttpstat(actual){this.trackCliCommand({command:"httpstat",value:actual})}trackCliCommandInit(actual){this.trackCliCommand({command:"init",value:actual})}trackCliCommandInspect(actual){this.trackCliCommand({command:"inspect",value:actual})}trackCliCommandInstall(actual){this.trackCliCommand({command:"install",value:actual})}trackCliCommandIntegration(actual){this.trackCliCommand({command:"integration",value:actual})}trackCliCommandIntegrationResource(actual){this.trackCliCommand({command:"integration-resource",value:actual})}trackCliCommandKms(actual){this.trackCliCommand({command:"kms",value:actual})}trackCliCommandLink(actual){this.trackCliCommand({command:"link",value:actual})}trackCliCommandList(actual){this.trackCliCommand({command:"list",value:actual})}trackCliCommandLogin(actual){this.trackCliCommand({command:"login",value:actual})}trackCliCommandLogout(actual){this.trackCliCommand({command:"logout",value:actual})}trackCliCommandLogs(actual){this.trackCliCommand({command:"logs",value:actual})}trackCliCommandMetrics(actual){this.trackCliCommand({command:"metrics",value:actual})}trackCliCommandMicrofrontends(actual){this.trackCliCommand({command:"microfrontends",value:actual})}trackCliCommandOpen(actual){this.trackCliCommand({command:"open",value:actual})}trackCliCommandProject(actual){this.trackCliCommand({command:"project",value:actual})}trackCliCommandPromote(actual){this.trackCliCommand({command:"promote",value:actual})}trackCliCommandPull(actual){this.trackCliCommand({command:"pull",value:actual})}trackCliCommandRollback(actual){this.trackCliCommand({command:"rollback",value:actual})}trackCliCommandRollingRelease(actual){this.trackCliCommand({command:"rolling-release",value:actual})}trackCliCommandRedeploy(actual){this.trackCliCommand({command:"redeploy",value:actual})}trackCliCommandRedirects(actual){this.trackCliCommand({command:"redirects",value:actual})}trackCliCommandRoutes(actual){this.trackCliCommand({command:"routes",value:actual})}trackCliCommandRemove(actual){this.trackCliCommand({command:"remove",value:actual})}trackCliCommandSkills(actual){this.trackCliCommand({command:"skills",value:actual})}trackCliCommandSandbox(actual){this.trackCliCommand({command:"sandbox",value:actual})}trackCliCommandSecurity(actual){this.trackCliCommand({command:"security",value:actual})}trackCliCommandStorage(actual){this.trackCliCommand({command:"storage",value:actual})}trackCliCommandTarget(actual){this.trackCliCommand({command:"target",value:actual})}trackCliCommandTeams(actual){this.trackCliCommand({command:"teams",value:actual})}trackCliCommandTokens(actual){this.trackCliCommand({command:"tokens",value:actual})}trackCliCommandTelemetry(actual){this.trackCliCommand({command:"telemetry",value:actual})}trackCliCommandTraces(actual){this.trackCliCommand({command:"traces",value:actual})}trackCliCommandWhoami(actual){this.trackCliCommand({command:"whoami",value:actual})}trackCliCommandUpgrade(actual){this.trackCliCommand({command:"upgrade",value:actual})}trackCliCommandVersion(actual){this.trackCliCommand({command:"version",value:actual})}trackCliCommandWebhooks(actual){this.trackCliCommand({command:"webhooks",value:actual})}trackCliCommandUsage(actual){this.trackCliCommand({command:"usage",value:actual})}trackCliCommandVcr(actual){this.trackCliCommand({command:"vcr",value:actual})}trackCPUs(){super.trackCPUs()}trackAgenticUse(agent){super.trackAgenticUse(agent)}trackArch(){super.trackArch()}trackPlatform(){super.trackPlatform()}trackCIVendorName(){this.trackCI(import_ci_info.default.id)}trackStdinIsTTY(isTTY2){super.trackStdinIsTTY(isTTY2)}trackVersion(version){super.trackVersion(version)}trackProjectId(projectId){super.trackProjectId(projectId)}trackInvocationId(invocationId){super.trackInvocationId(invocationId)}trackDeviceId(deviceId){super.trackDeviceId(deviceId)}trackVercelPluginActiveSession(){super.trackVercelPluginActiveSession()}trackVercelPluginVersion(version){super.trackVercelPluginVersion(version)}trackErrorStatus(status){super.trackErrorStatus(status)}trackErrorCode(code){super.trackErrorCode(code)}trackErrorSlug(slug){super.trackErrorSlug(slug)}trackErrorAction(action){super.trackErrorAction(action)}trackErrorServerMessage(serverMessage){super.trackErrorServerMessage(serverMessage)}trackCliOptionCwd(cwd){cwd&&this.trackCliOption({option:"cwd",value:this.redactedValue})}trackCliOptionLocalConfig(localConfig){localConfig&&this.trackCliOption({option:"local-config",value:this.redactedValue})}trackCliOptionGlobalConfig(globalConfig){globalConfig&&this.trackCliOption({option:"global-config",value:this.redactedValue})}trackCliOptionScope(scope){scope&&this.trackCliOption({option:"scope",value:this.redactedValue})}trackCliOptionToken(token){token&&this.trackCliOption({option:"token",value:this.redactedValue})}trackCliOptionTeam(team){team&&this.trackCliOption({option:"team",value:this.redactedValue})}trackCliOptionApi(api){api&&this.trackCliOption({option:"api",value:this.redactedValue})}trackCliFlagDebug(debug){debug&&this.trackCliFlag("debug")}trackCliFlagNoColor(noColor){noColor&&this.trackCliFlag("no-color")}};import{readFileSync}from"node:fs";import{homedir}from"node:os";import{join}from"node:path";var ACTIVE_SESSION_MARKER_PATH=join(homedir(),".config","vercel-plugin","active-session.json"),SEMVERISH_RE=/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;function isRecord(value){return typeof value=="object"&&value!==null}function readVercelPluginActiveSessionMarker(opts={}){let filePath=opts.filePath??ACTIVE_SESSION_MARKER_PATH,now=opts.now?.()??Date.now();try{let marker=JSON.parse(readFileSync(filePath,"utf-8"));return!isRecord(marker)||marker.schema!==1||marker.active!==!0||typeof marker.expiresAt!="number"||marker.expiresAt<=now||typeof marker.pluginVersion!="string"||!SEMVERISH_RE.test(marker.pluginVersion)?null:{pluginVersion:marker.pluginVersion}}catch{return null}}function checkTelemetryStatus({config:config2}){config2.telemetry||process.env.VERCEL_TELEMETRY_DISABLED||(output_manager_default.note("The Vercel CLI now collects telemetry regarding usage of the CLI."),output_manager_default.log("This information is used to shape the CLI roadmap and prioritize features."),output_manager_default.log("You can learn more, including how to opt-out if you'd not like to participate in this program, by visiting the following URL:"),output_manager_default.log("https://vercel.com/docs/cli/about-telemetry"),config2.telemetry={enabled:!0},writeToConfigFile(config2))}function checkGuidanceStatus({config:config2}){process.env.FF_GUIDANCE_MODE&&(process.env.CI||process.env.VERCEL_GUIDANCE_DISABLED||config2.guidance||(output_manager_default.note("The Vercel CLI can suggest common follow-up commands and steps to help guide new users."),output_manager_default.log("You can disable this feature by running:"),output_manager_default.log("vercel guidance disable"),output_manager_default.log("or by setting VERCEL_GUIDANCE_DISABLED=1"),config2.guidance={enabled:!0},writeToConfigFile(config2)))}import{determineAgent}from"@vercel/detect-agent";var import_build_utils=__toESM(require_build_utils(),1);import{mkdir,writeFile}from"fs/promises";try{process.cwd()}catch(err){(0,import_error_utils3.isError)(err)&&err.message.includes("uv_cwd")&&(console.error("Error: The current working directory does not exist."),process.exit(1))}{let SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)}}var VERCEL_DIR=getGlobalPathConfig(),VERCEL_CONFIG_PATH=getConfigFilePath(),VERCEL_AUTH_CONFIG_PATH=getAuthConfigFilePath(),GLOBAL_COMMANDS=new Set(["help"]);function hasProxyConfig(){return["HTTP_PROXY","HTTPS_PROXY","http_proxy","https_proxy","ALL_PROXY","all_proxy"].some(v=>process.env[v])}(0,import_epipebomb.default)();var client,resolvedCommandForUpdate,handleRejection=async err=>{err?err instanceof Error?await handleUnexpected(err):(output_manager_default.error(`An unexpected rejection occurred
8
+ ${err}`),await reportError(await getSentry(),client,err)):output_manager_default.error("An unexpected empty rejection occurred"),process.exit(1)},handleUnexpected=async err=>{let{message}=err;if(message.includes("sentry")&&message.includes("ENOTFOUND")){output_manager_default.debug(`Sentry is not reachable: ${err}`);return}output_manager_default.error(`An unexpected error occurred!
9
+ ${err.stack}`),await reportError(await getSentry(),client,err),process.exit(1)};process.on("unhandledRejection",handleRejection);process.on("uncaughtException",handleUnexpected);process.env.CLAUDECODE&&process.stderr.write(`<claude-code-hint v="1" type="plugin" value="vercel@claude-plugins-official" />
10
+ `);var SHOULD_CHECK_FOR_UPDATES=!process.env.NO_UPDATE_NOTIFIER&&!process.env.VERCEL,{isTTY}=process.stdout,apiUrl="https://api.vercel.com",InMemoryReporter=class{constructor(){this.events=[]}report(event){this.events.push(event)}},main=async()=>{let traceReporter=new InMemoryReporter,rootSpan=new import_build_utils.Span({name:"vc.cli",reporter:traceReporter}),isTelemetryFlushCommand=process.argv[2]==="telemetry"&&process.argv[3]==="flush";process.env.FORCE_TTY==="1"&&(isTTY=!0,process.stdout.isTTY=!0,process.stdin.isTTY=!0);let parseInitialArgs=()=>parseArguments(process.argv,{"--version":Boolean,"-v":"--version","--changelog":Boolean,"--non-interactive":Boolean},{permissive:!0}),parsedArgs;try{parsedArgs=parseInitialArgs();let isDebugging=parsedArgs.flags["--debug"],isNoColor=parsedArgs.flags["--no-color"];output_manager_default.initialize({debug:isDebugging,noColor:isNoColor})}catch(err){return printError(err),1}let localConfigPath=parsedArgs.flags["--local-config"],localConfig=await earlyGetConfig(localConfigPath);if(localConfig instanceof CantParseJSONFile)return output_manager_default.error(`Couldn't parse JSON file ${localConfig.meta.file}.`),1;if(localConfig instanceof CantFindConfig){if(localConfigPath)return output_manager_default.error(`Couldn't find a project configuration file at
11
+ ${localConfig.meta.paths.join(` or
12
+ `)}`),1;localConfig=void 0}if(localConfig instanceof Error)return output_manager_default.prettyError(localConfig),1;let targetOrSubcommand=parsedArgs.args[2]||(parsedArgs.flags["--changelog"]?"changelog":void 0),subSubCommand=parsedArgs.args[3],betaCommands=["api","crons","curl","kms","webhooks"],shortBuildLabel=void 0?` (${(void 0).split(" ")[0]})`:"",versionBanner=isNativeBinaryInstall()?`${getTitleName()} CLI ${pkg_default.version}${shortBuildLabel}`:`${getTitleName()} CLI ${pkg_default.version}${shortBuildLabel} (Node.js ${process.versions.node})`,msg=targetOrSubcommand&&betaCommands.includes(targetOrSubcommand)?`${versionBanner} | ${targetOrSubcommand} is in beta \u2014 https://vercel.com/feedback`:versionBanner;if(shouldPrintVersionBanner(targetOrSubcommand,process.argv)&&output_manager_default.print(`${import_chalk.default.dim(msg)}
13
+ `),!targetOrSubcommand&&parsedArgs.flags["--version"])return console.log(pkg_default.version),0;if(!targetOrSubcommand&&parsedArgs.flags["--help"]||targetOrSubcommand==="help"&&!subSubCommand)return output_manager_default.print(help()),0;try{await(0,import_fs_extra2.mkdirp)(VERCEL_DIR)}catch(err){return output_manager_default.error(`An unexpected error occurred while trying to create the global directory "${humanizePath(VERCEL_DIR)}" ${(0,import_error_utils3.errorToString)(err)}`),1}let config2;try{config2=readConfigFile()}catch(err){if((0,import_error_utils3.isErrnoException)(err)&&err.code==="ENOENT"){config2=import_cli_config.defaultGlobalConfig;try{writeToConfigFile(config2)}catch(err2){return output_manager_default.error(`An unexpected error occurred while trying to save the config to "${humanizePath(VERCEL_CONFIG_PATH)}" ${(0,import_error_utils3.errorToString)(err2)}`),1}}else return output_manager_default.error(`An unexpected error occurred while trying to read the config in "${humanizePath(VERCEL_CONFIG_PATH)}" ${(0,import_error_utils3.errorToString)(err)}`),1}let tokenSource,explicitToken;typeof parsedArgs.flags["--token"]=="string"?(explicitToken=parsedArgs.flags["--token"],tokenSource="flag"):process.env.VERCEL_TOKEN&&(explicitToken=process.env.VERCEL_TOKEN,tokenSource="env");let authConfig;if(tokenSource)authConfig=(0,import_cli_config.getDefaultAuthConfig)();else try{authConfig=readAuthConfigFile(config2)}catch(err){if((0,import_error_utils3.isErrnoException)(err)&&err.code==="ENOENT")authConfig=(0,import_cli_config.getDefaultAuthConfig)();else return output_manager_default.error(`An unexpected error occurred while trying to read the auth config in "${humanizePath(VERCEL_AUTH_CONFIG_PATH)}" ${(0,import_error_utils3.errorToString)(err)}`),1}let telemetryEventStore=new TelemetryEventStore({isDebug:process.env.VERCEL_TELEMETRY_DEBUG==="1",config:config2.telemetry,cliDevice:isTelemetryFlushCommand?void 0:{filePath:join2(VERCEL_DIR,"telemetry-device.json")},cliSession:isTelemetryFlushCommand?void 0:{filePath:join2(VERCEL_DIR,"telemetry-session.json")}});checkTelemetryStatus({config:config2}),process.env.FF_GUIDANCE_MODE&&checkGuidanceStatus({config:config2});let telemetry=new RootTelemetryClient({opts:{store:telemetryEventStore}}),{isAgent,agent:detectedAgent}=await determineAgent();telemetry.trackInvocationId(telemetryEventStore.currentInvocationId),telemetry.trackDeviceId(telemetryEventStore.currentDeviceId);let vercelPluginMarker=readVercelPluginActiveSessionMarker();vercelPluginMarker&&(telemetry.trackVercelPluginActiveSession(),telemetry.trackVercelPluginVersion(vercelPluginMarker.pluginVersion)),telemetry.trackAgenticUse(detectedAgent?.name),telemetry.trackCPUs(),telemetry.trackPlatform(),telemetry.trackArch(),telemetry.trackCIVendorName(),telemetry.trackStdinIsTTY(process.stdin?.isTTY===!0),telemetry.trackVersion(pkg_default.version),telemetry.trackCliOptionCwd(parsedArgs.flags["--cwd"]),telemetry.trackCliOptionLocalConfig(parsedArgs.flags["--local-config"]),telemetry.trackCliOptionGlobalConfig(parsedArgs.flags["--global-config"]),telemetry.trackCliFlagDebug(parsedArgs.flags["--debug"]),telemetry.trackCliFlagNoColor(parsedArgs.flags["--no-color"]),telemetry.trackCliOptionScope(parsedArgs.flags["--scope"]),telemetry.trackCliOptionToken(parsedArgs.flags["--token"]),telemetry.trackCliOptionTeam(parsedArgs.flags["--team"]),telemetry.trackCliOptionApi(parsedArgs.flags["--api"]);let earlyGetUserPromise,telemetrySaved=!1,getStringProperty=(value,key)=>{if(typeof value=="object"&&value!==null&&key in value){let property=value[key];if(typeof property=="string")return property}},getNumberProperty=(value,key)=>{if(typeof value=="object"&&value!==null&&key in value){let property=value[key];if(typeof property=="number")return property}},trackAgenticErrorTelemetry=err=>{if(!isAgent)return;telemetry.trackErrorStatus(getNumberProperty(err,"status")),telemetry.trackErrorCode(getStringProperty(err,"code")),telemetry.trackErrorSlug(getStringProperty(err,"slug")),telemetry.trackErrorAction(getStringProperty(err,"action"));let serverMessage=getStringProperty(err,"serverMessage")??((0,import_error_utils3.isError)(err)?err.message:void 0);telemetry.trackErrorServerMessage(serverMessage)},saveTelemetry=async()=>{if(telemetrySaved)return;let postCommandSpan=rootSpan.child("vc.postCommand");if(telemetryEventStore.updateTeamId(client?.config.currentTeam??config2.currentTeam),telemetryEventStore.updateUserId(client?.authConfig.userId??authConfig.userId),!telemetryEventStore.hasUserId){let getUserSpan=postCommandSpan.child("vc.postCommand.getUser");try{let user=await earlyGetUserPromise;user&&telemetryEventStore.updateUserId(user.id)}catch{}finally{getUserSpan.stop()}}try{let envProjectId=(0,import_build_utils.getPlatformEnv)("PROJECT_ID");if(envProjectId)telemetryEventStore.updateProjectId(envProjectId);else{let cwdForProjectId=client?.cwd||(typeof parsedArgs.flags["--cwd"]=="string"?parsedArgs.flags["--cwd"]:process.cwd()),link=await getLinkFromDir(getVercelDirectory(cwdForProjectId));link&&telemetryEventStore.updateProjectId(link.projectId)}}catch{}telemetry.trackProjectId(telemetryEventStore.currentProjectId),await telemetryEventStore.save(),postCommandSpan.stop(),telemetrySaved=!0},finishWithExitCode=async code=>(await saveTelemetry(),code);typeof parsedArgs.flags["--api"]=="string"?apiUrl=parsedArgs.flags["--api"]:config2&&config2.api&&(apiUrl=config2.api);try{new URL(apiUrl)}catch{return output_manager_default.error(`Please provide a valid URL instead of ${highlight(apiUrl)}.`),finishWithExitCode(1)}let stdinIsTTY=process.stdin?.isTTY===!0,nonInteractiveFlag=parsedArgs.flags["--non-interactive"]===!0,argv=process.argv,explicitNonInteractiveFalse=argv.includes("--non-interactive=false")||argv.includes("--non-interactive")&&argv[argv.indexOf("--non-interactive")+1]==="false",nonInteractive=explicitNonInteractiveFalse?!1:nonInteractiveFlag||isAgent&&!stdinIsTTY;if(output_manager_default.debug(`Agent/TTY/nonInteractive: isAgent=${isAgent} agentName=${detectedAgent?.name??"none"} stdin.isTTY=${String(process.stdin?.isTTY)} --non-interactive=${nonInteractiveFlag} explicitFalse=${explicitNonInteractiveFalse} => nonInteractive=${nonInteractive}`),hasProxyConfig()){let{EnvProxyDispatcher}=await import("./chunks/fetch-proxy-AEAWC6MD.js");setFetchDispatcher(new EnvProxyDispatcher)}client=new Client({apiUrl,stdin:process.stdin,stdout:process.stdout,stderr:output_manager_default.stream,config:config2,authConfig,localConfig,localConfigPath,argv:process.argv,telemetryEventStore,isAgent,agentName:detectedAgent?.name,nonInteractive}),client.rootSpan=rootSpan,parsedArgs.flags["--cwd"]&&(client.cwd=parsedArgs.flags["--cwd"]);let{cwd}=client,defaultDeploy=!1,subcommand,userSuppliedSubCommand="";if(targetOrSubcommand){let targetPath=join2(cwd,targetOrSubcommand),targetPathExists=existsSync2(targetPath),subcommandExists=GLOBAL_COMMANDS.has(targetOrSubcommand)||commands.has(targetOrSubcommand);if(targetPathExists&&subcommandExists&&!parsedArgs.flags["--cwd"]&&!process.env.NOW_BUILDER&&!wantsMachineReadableOutput(targetOrSubcommand,process.argv)&&!await hasLocalProjectLink(client,cwd)&&output_manager_default.warn(`Did you mean to deploy the subdirectory "${targetOrSubcommand}"? Use \`vc --cwd ${targetOrSubcommand}\` instead.`),subcommandExists)output_manager_default.debug(`user supplied known subcommand: "${targetOrSubcommand}"`),subcommand=targetOrSubcommand,userSuppliedSubCommand=targetOrSubcommand;else if(output_manager_default.debug("user supplied a possible target for deployment or an extension"),process.env.VERCEL_AUTO_API&&await matchesCliApiTag(targetOrSubcommand)){output_manager_default.debug(`first token "${targetOrSubcommand}" matches an OpenAPI tag; routing to api`);let tag=targetOrSubcommand,{tryOpenApiFallback}=await import("./chunks/openapi-MO5HYMHR.js"),result=await tryOpenApiFallback(client,parsedArgs.args.slice(3),async()=>tag);return finishWithExitCode(result??1)}else targetPathExists&&(subcommand="deploy",userSuppliedSubCommand=targetOrSubcommand,output_manager_default.debug(`first token "${targetOrSubcommand}" is an existing path; routing to deploy`))}else output_manager_default.debug("user supplied no target, defaulting to deploy"),subcommand="deploy",defaultDeploy=!0;subcommand==="help"&&(telemetry.trackCliCommandHelp("help"),subcommand=subSubCommand||"deploy",client.argv.push("-h"));let subcommandsWithoutToken=["login","logout","help","init","build","changelog","deploy","sandbox","telemetry","upgrade","version","skills","agent","whoami"];if(process.env.FF_GUIDANCE_MODE&&subcommandsWithoutToken.push("guidance"),subcommand==="dev"&&(client.argv.includes("--local")||client.argv.includes("-L"))&&subcommandsWithoutToken.push("dev"),subcommand==="flags"&&subSubCommand==="prepare"&&subcommandsWithoutToken.push("flags"),tokenSource==="env"&&explicitToken&&(parsedArgs.flags["--token"]=explicitToken),(!authConfig||!authConfig.token)&&!client.argv.includes("-h")&&!client.argv.includes("--help")&&typeof parsedArgs.flags["--token"]!="string"&&subcommand&&!subcommandsWithoutToken.includes(subcommand)){let{default:promptMissingCredentials}=await import("./chunks/prompt-missing-credentials-IUHLYSQU.js"),result=await promptMissingCredentials(client,trackAgenticErrorTelemetry);if(result!==0)return finishWithExitCode(result)}if(typeof parsedArgs.flags["--token"]=="string"&&subcommand==="switch")return output_manager_default.prettyError({message:`This command doesn't work with ${param("--token")}. Please use ${param("--scope")}.`,link:"https://err.sh/vercel/no-token-allowed"}),finishWithExitCode(1);if(typeof parsedArgs.flags["--token"]=="string"){let token=parsedArgs.flags["--token"];if(token.length===0)return output_manager_default.prettyError({message:`You defined ${param("--token")}, but it's missing a value`,link:"https://err.sh/vercel/missing-token-value"}),finishWithExitCode(1);let invalid=token.match(/(\W)/g);if(invalid){let notContain=Array.from(new Set(invalid)).sort();return output_manager_default.prettyError({message:`You defined ${param("--token")}, but its contents are invalid. Must not contain: ${notContain.map(c=>JSON.stringify(c)).join(", ")}`,link:"https://err.sh/vercel/invalid-token-value"}),finishWithExitCode(1)}client.authConfig={token,skipWrite:!0,tokenSource},client.config&&client.config.currentTeam&&delete client.config.currentTeam}parsedArgs.flags["--team"]&&output_manager_default.warn(`The ${param("--team")} option is deprecated. Please use ${param("--scope")} instead.`);let targetCommand=typeof subcommand=="string"?commands.get(subcommand):void 0,scope=parsedArgs.flags["--scope"]||parsedArgs.flags["--team"]||localConfig?.scope,separatorIndex=client.argv.indexOf("--"),cliArgs=separatorIndex===-1?client.argv:client.argv.slice(0,separatorIndex),buildNeedsRemoteProjectScope=targetCommand==="build"&&cliArgs.some(arg=>arg==="--project"||arg.startsWith("--project="));if(typeof scope=="string"&&targetCommand!=="login"&&(targetCommand!=="build"||buildNeedsRemoteProjectScope)&&targetCommand!=="sandbox"){let user=null;try{user=await getUser(client),telemetryEventStore.updateUserId(user.id)}catch(err){if(err instanceof Error&&output_manager_default.debug(err.stack||err.toString()),!((0,import_error_utils3.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED"&&isAppPrincipalEnabled()&&await resolveAppTokenScope(client,scope)))return(0,import_error_utils3.isErrnoException)(err)&&err.code==="NOT_AUTHORIZED"?(output_manager_default.prettyError({message:"You do not have access to the specified account",link:"https://err.sh/vercel/scope-not-accessible"}),trackAgenticErrorTelemetry(err),finishWithExitCode(1)):(output_manager_default.error(`Not able to load user because of unexpected error: ${(0,import_error_utils3.errorToString)(err)}`),trackAgenticErrorTelemetry(err),finishWithExitCode(1))}if(user){let scopeMatchesUserIdentity=user.id===scope||user.email===scope||user.username===scope,teams=[];try{teams=await getTeams(client)}catch(err){if(scopeMatchesUserIdentity)output_manager_default.debug("Ignoring failure to load teams; scope matches the current user's identity");else return(0,import_error_utils3.isErrnoException)(err)&&err.code==="not_authorized"?(output_manager_default.prettyError({message:"You do not have access to the specified team",link:"https://err.sh/vercel/scope-not-accessible"}),trackAgenticErrorTelemetry(err),finishWithExitCode(1)):(0,import_error_utils3.isErrnoException)(err)&&err.code==="rate_limited"?(output_manager_default.prettyError({message:"Rate limited. Too many requests to the same endpoint: /teams"}),trackAgenticErrorTelemetry(err),finishWithExitCode(1)):(output_manager_default.error("Not able to load teams"),trackAgenticErrorTelemetry(err),finishWithExitCode(1))}let related=teams.find(team=>team.id===scope||team.slug===scope);if(!related&&!scopeMatchesUserIdentity)try{related=await getTeamByIdOrSlug(client,scope,{useCurrentTeam:!1})}catch(err){output_manager_default.debug(`Direct team lookup for scope "${scope}" failed: ${(0,import_error_utils3.errorToString)(err)}`)}if(related)client.config.currentTeam=related.id;else if(scopeMatchesUserIdentity){if(user.version==="northstar")return output_manager_default.error("You cannot set your Personal Account as the scope."),finishWithExitCode(1);delete client.config.currentTeam}else return output_manager_default.prettyError({message:"The specified scope does not exist",link:"https://err.sh/vercel/scope-not-existent"}),finishWithExitCode(1)}}let exitCode;try{if(!targetCommand){targetCommand=parsedArgs.args[2];try{let{execExtension}=await import("./chunks/exec-4AISDHUV.js");exitCode=await execExtension(client,targetCommand,parsedArgs.args.slice(3),cwd),telemetry.trackCliExtension()}catch(err){if((0,import_error_utils3.isErrnoException)(err)&&err.code==="ENOENT"){if(handleCommandTypo({command:targetCommand,availableCommands:commandNames}))return 1;targetCommand=subcommand="deploy"}else throw err}}if(subcommand){let func;switch(targetCommand){case"deploy":telemetry.trackCliCommandDeploy(userSuppliedSubCommand),telemetry.trackCliDefaultDeploy(defaultDeploy),func=(await import("./commands/deploy/index.js")).default;break;case"dev":telemetry.trackCliCommandDev(userSuppliedSubCommand),func=(await import("./commands/dev/index.js")).default;break;case"env":telemetry.trackCliCommandEnv(userSuppliedSubCommand),func=(await import("./commands/env/index.js")).default;break;case"build":telemetry.trackCliCommandBuild(userSuppliedSubCommand),func=(await import("./commands/build/index.js")).default;break;case"list":telemetry.trackCliCommandList(userSuppliedSubCommand),func=(await import("./commands/list/index.js")).default;break;case"link":telemetry.trackCliCommandLink(userSuppliedSubCommand),func=(await import("./commands/link/index.js")).default;break;case"agent":telemetry.trackCliCommandAgent(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).agent;break;case"agent-runs":telemetry.trackCliCommandAgentRuns(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).agentRuns;break;case"ai-gateway":telemetry.trackCliCommandAiGateway(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).aiGateway;break;case"alias":telemetry.trackCliCommandAlias(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).alias;break;case"activity":telemetry.trackCliCommandActivity(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).activity;break;case"alerts":telemetry.trackCliCommandAlerts(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).alerts;break;case"api":telemetry.trackCliCommandApi(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).api;break;case"bisect":telemetry.trackCliCommandBisect(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).bisect;break;case"blob":telemetry.trackCliCommandBlob(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).blob;break;case"buy":telemetry.trackCliCommandBuy(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).buy;break;case"init":telemetry.trackCliCommandInit(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).init;break;case"cache":telemetry.trackCliCommandCache(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).cache;break;case"connect":telemetry.trackCliCommandConnex(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).connex;break;case"contract":telemetry.trackCliCommandContract(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).contract;break;case"certs":telemetry.trackCliCommandCerts(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).certs;break;case"changelog":telemetry.trackCliCommandChangelog(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).changelog;break;case"comments":telemetry.trackCliCommandComments(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).comments;break;case"crons":case"cron":telemetry.trackCliCommandCrons(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).crons;break;case"curl":telemetry.trackCliCommandCurl(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).curl;break;case"dns":telemetry.trackCliCommandDns(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).dns;break;case"deploy-hooks":case"deploy-hook":telemetry.trackCliCommandDeployHooks(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).deployHooks;break;case"global-config":telemetry.trackCliCommandGlobalConfig(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).globalConfig;break;case"domains":telemetry.trackCliCommandDomains(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).domains;break;case"firewall":telemetry.trackCliCommandFirewall(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).firewall;break;case"flags":telemetry.trackCliCommandFlags(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).flags;break;case"git":telemetry.trackCliCommandGit(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).git;break;case"guidance":if(process.env.FF_GUIDANCE_MODE){telemetry.trackCliCommandGuidance(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).guidance;break}else{func=null;break}case"httpstat":telemetry.trackCliCommandHttpstat(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).httpstat;break;case"install":telemetry.trackCliCommandInstall(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).install;break;case"integration":telemetry.trackCliCommandIntegration(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).integration;break;case"integration-resource":telemetry.trackCliCommandIntegrationResource(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).integrationResource;break;case"kms":telemetry.trackCliCommandKms(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).kms;break;case"mcp":func=(await import("./commands-bulk.js")).mcp;break;case"logout":telemetry.trackCliCommandLogout(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).logout;break;case"login":telemetry.trackCliCommandLogin(userSuppliedSubCommand),func=c=>import("./commands-bulk.js").then(m=>m.login(c,{shouldParseArgs:!0}));break;case"inspect":telemetry.trackCliCommandInspect(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).inspect;break;case"logs":telemetry.trackCliCommandLogs(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).logs;break;case"metrics":telemetry.trackCliCommandMetrics(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).metrics;break;case"microfrontends":telemetry.trackCliCommandMicrofrontends(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).microfrontends;break;case"open":telemetry.trackCliCommandOpen(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).open;break;case"project":telemetry.trackCliCommandProject(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).project;break;case"promote":telemetry.trackCliCommandPromote(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).promote;break;case"pull":telemetry.trackCliCommandPull(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).pull;break;case"redeploy":telemetry.trackCliCommandRedeploy(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).redeploy;break;case"redirects":telemetry.trackCliCommandRedirects(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).redirects;break;case"routes":telemetry.trackCliCommandRoutes(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).routes;break;case"remove":telemetry.trackCliCommandRemove(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).remove;break;case"rollback":telemetry.trackCliCommandRollback(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).rollback;break;case"rr":case"release":case"rolling-release":telemetry.trackCliCommandRollingRelease(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).rollingRelease;break;case"sandbox":telemetry.trackCliCommandSandbox(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).sandbox;break;case"security":telemetry.trackCliCommandSecurity(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).security;break;case"skills":telemetry.trackCliCommandSkills(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).skills;break;case"storage":telemetry.trackCliCommandStorage(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).storage;break;case"target":telemetry.trackCliCommandTarget(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).target;break;case"teams":telemetry.trackCliCommandTeams(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).teams;break;case"tokens":telemetry.trackCliCommandTokens(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).tokens;break;case"telemetry":telemetry.trackCliCommandTelemetry(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).telemetry;break;case"traces":telemetry.trackCliCommandTraces(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).traces;break;case"upgrade":telemetry.trackCliCommandUpgrade(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).upgrade;break;case"version":telemetry.trackCliCommandVersion(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).version;break;case"webhooks":telemetry.trackCliCommandWebhooks(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).webhooks;break;case"usage":telemetry.trackCliCommandUsage(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).usage;break;case"vcr":telemetry.trackCliCommandVcr(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).vcr;break;case"whoami":telemetry.trackCliCommandWhoami(userSuppliedSubCommand),func=(await import("./commands-bulk.js")).whoami;break;default:func=null;break}if(!func||!targetCommand)return handleCommandTypo({command:subcommand,availableCommands:commandNames})||output_manager_default.error(`The ${param(subcommand)} subcommand does not exist`),1;func.default&&(func=func.default),!telemetryEventStore.hasUserId&&!client.authConfig.userId&&(earlyGetUserPromise=getUser(client).catch(()=>{})),resolvedCommandForUpdate=targetCommand,exitCode=await rootSpan.child("vc.cli.command",{command:subcommand||"deploy"}).trace(()=>func(client))}}catch(err){if(trackAgenticErrorTelemetry(err),(0,import_error_utils3.isErrnoException)(err)&&err.code==="ENOTFOUND"){let matches=/getaddrinfo ENOTFOUND (.*)$/.exec(err.message||"");if(matches&&matches[1]){let hostname=matches[1];output_manager_default.error(`The hostname ${highlight(hostname)} could not be resolved. Please verify your internet connectivity and DNS configuration.`)}return typeof err.stack=="string"&&output_manager_default.debug(err.stack),finishWithExitCode(1)}if((0,import_error_utils3.isErrnoException)(err)&&err.code==="ECONNRESET"){let hostname=/request to https:\/\/(.*?)\//.exec(err.message||"")?.[1];return hostname&&output_manager_default.error(`Connection to ${highlight(hostname)} interrupted. Please verify your internet connectivity and DNS configuration.`),finishWithExitCode(1)}return(0,import_error_utils3.isErrnoException)(err)&&(err.code==="NOT_AUTHORIZED"||err.code==="TEAM_DELETED")?(output_manager_default.prettyError(err),finishWithExitCode(1)):err instanceof APIError&&400<=err.status&&err.status<=499?(err.message=err.serverMessage,output_manager_default.prettyError(err),finishWithExitCode(1)):((0,import_error_utils3.isErrnoException)(err)?(typeof err.stack=="string"&&output_manager_default.debug(err.stack),output_manager_default.prettyError(err)):(await reportError(await getSentry(),client,err),output_manager_default.error(`An unexpected error occurred in ${subcommand}: ${err}`)),finishWithExitCode(1))}if(await saveTelemetry(),rootSpan.stop(),client.traceDiagnosticsPath)try{await mkdir(join2(client.traceDiagnosticsPath,".."),{recursive:!0}),await writeFile(client.traceDiagnosticsPath,JSON.stringify(traceReporter.events))}catch(err){output_manager_default.error("Failed to write diagnostics trace file"),output_manager_default.prettyError(err)}return exitCode},cachedLatest,freshLookupPromise;SHOULD_CHECK_FOR_UPDATES&&!isNativeBinaryInstall()&&(cachedLatest=getLatestVersion({pkg:pkg_default,consumeNotification:!1}),cachedLatest&&(output_manager_default.debug("Update may be available, fetching fresh version..."),freshLookupPromise=fetchLatestVersion({name:pkg_default.name,timeout:3e3}).catch(()=>{})));async function promptAndUpgrade(client2,targetVersion){try{if(!await client2.input.confirm("Would you like to upgrade now?",!0))return;let upgradeExitCode=await executeUpgrade(targetVersion);if(upgradeExitCode===0&&!hasAutoUpdatePreference(client2.config)){let enableAutoUpdates=await client2.input.confirm("Enable automatic CLI updates for future releases?",!1);setAutoUpdate(client2,enableAutoUpdates)}return upgradeExitCode}catch(err){if(err instanceof Error&&err.message.includes("User force closed the prompt"))return;throw err}}main().then(async exitCode=>{if(cachedLatest&&resolvedCommandForUpdate!=="upgrade"&&!await isVersionPinned()){let originalExitCode=typeof exitCode=="number"?exitCode:0,fresh=freshLookupPromise?await freshLookupPromise:void 0;output_manager_default.debug(`Fresh lookup result: ${fresh??"failed"}`);let latest,userUpToDate=!1;if(fresh&&(updateLatestVersionCache({name:pkg_default.name,version:fresh}),import_semver2.default.lt(pkg_default.version,fresh)?latest=fresh:userUpToDate=!0),getLatestVersion({pkg:pkg_default}),!userUpToDate&&await canAutoUpdate(client,originalExitCode,resolvedCommandForUpdate)){let upgradeExitCode=await executeUpgrade();process.exitCode=originalExitCode,upgradeExitCode!==0&&output_manager_default.log(`Automatic update failed. Continuing with original exit code ${originalExitCode}.`);return}if(latest){let changelog=`https://github.com/vercel/vercel/releases/tag/vercel%40${latest}`;if(isTTY){let errorMsg=exitCode&&exitCode!==2?import_chalk.default.magenta(` The latest update ${import_chalk.default.italic("may")} fix any errors that occurred.`):"";output_manager_default.print(`
14
+ Update available for Vercel CLI (${import_chalk.default.gray(`v${pkg_default.version}`)} \u2192 ${import_chalk.default.green(`v${latest}`)})${errorMsg}
15
+ `),output_manager_default.print(`Changelog: ${output_manager_default.link(changelog,changelog,{fallback:!1})}
16
+ `);let upgradeExitCode=await promptAndUpgrade(client,latest);if(upgradeExitCode!==void 0){process.exitCode=upgradeExitCode;return}}else{let errorMsg=exitCode&&exitCode!==2?import_chalk.default.magenta(`
17
+
18
+ The latest update ${import_chalk.default.italic("may")} fix any errors that occurred.`):"";output_manager_default.print(box(`Update available! ${import_chalk.default.gray(`v${pkg_default.version}`)} \u226B ${import_chalk.default.green(`v${latest}`)}
19
+ Changelog: ${output_manager_default.link(changelog,changelog,{fallback:!1})}
20
+ Run ${import_chalk.default.cyan(cmd(await getUpdateCommand()))} to update.${errorMsg}`)),output_manager_default.print(`
21
+ `)}}else if(!fresh)if(isTTY){output_manager_default.print(`
22
+ A newer version of Vercel CLI may be available.
23
+ `);let upgradeExitCode=await promptAndUpgrade(client);if(upgradeExitCode!==void 0){process.exitCode=upgradeExitCode;return}}else output_manager_default.print(box(`A newer version of Vercel CLI may be available.
24
+ Run ${import_chalk.default.cyan(cmd(await getUpdateCommand()))} to update.`)),output_manager_default.print(`
25
+ `)}process.exitCode=exitCode}).catch(handleUnexpected);