@vercel/cli-support 65.8.0 → 65.9.0-snapshot-c4002eb2617b

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 (310) hide show
  1. package/dist/chunks/add-EHNDQSPH.js +8 -0
  2. package/dist/chunks/add-QINN2GTA.js +8 -0
  3. package/dist/chunks/add-SEQOVWYP.js +8 -0
  4. package/dist/chunks/build-ATYGR3HB.js +7 -0
  5. package/dist/chunks/{chunk-O7IYJGOR.js → chunk-25B5SV4V.js} +1 -1
  6. package/dist/chunks/chunk-2CSCY66I.js +11 -0
  7. package/dist/chunks/{chunk-FQVSBXRY.js → chunk-2H4DUZJZ.js} +1 -1
  8. package/dist/chunks/{chunk-44XDCARR.js → chunk-2RXUQ72I.js} +1 -1
  9. package/dist/chunks/{chunk-EZL4AJXH.js → chunk-32AS5X7G.js} +1 -1
  10. package/dist/chunks/chunk-32NXYHYC.js +10 -0
  11. package/dist/chunks/{chunk-OTJNOMRV.js → chunk-375JVQYK.js} +1 -1
  12. package/dist/chunks/chunk-3H7HEK63.js +10 -0
  13. package/dist/chunks/{chunk-CJLRNGWY.js → chunk-3QECUY4S.js} +1 -1
  14. package/dist/chunks/{chunk-GKUHMS3A.js → chunk-3Y3FZLFN.js} +1 -1
  15. package/dist/chunks/{chunk-BLFPDEXE.js → chunk-46XT5J5W.js} +1 -1
  16. package/dist/chunks/{chunk-IECNFRTK.js → chunk-4BZ3DNGM.js} +1 -1
  17. package/dist/chunks/chunk-4CQKN5TW.js +10 -0
  18. package/dist/chunks/{chunk-FNOCIKAU.js → chunk-4HIRAB5V.js} +1 -1
  19. package/dist/chunks/{chunk-4UIMSZZB.js → chunk-4KM733OB.js} +1 -1
  20. package/dist/chunks/chunk-4ND2DRU5.js +15 -0
  21. package/dist/chunks/{chunk-6KCYUYUM.js → chunk-4VF5BZJP.js} +1 -1
  22. package/dist/chunks/{chunk-XUJA3RZD.js → chunk-4XFUHNFR.js} +1 -1
  23. package/dist/chunks/chunk-4Z3APEBF.js +7 -0
  24. package/dist/chunks/chunk-5CVEW3HD.js +12 -0
  25. package/dist/chunks/{chunk-LFOWP74R.js → chunk-5DXC4TE2.js} +1 -1
  26. package/dist/chunks/{chunk-KARAZGCO.js → chunk-5KKRDN5F.js} +1 -1
  27. package/dist/chunks/{constants-JAB7MRSK.js → chunk-5MDNVAE6.js} +1 -1
  28. package/dist/chunks/{chunk-HA2ICIB5.js → chunk-5TI3ZXW3.js} +1 -1
  29. package/dist/chunks/{chunk-PY5A73YH.js → chunk-5WFOL3XX.js} +1 -1
  30. package/dist/chunks/{chunk-IHNEF3BG.js → chunk-5XPWRDZN.js} +1 -1
  31. package/dist/chunks/chunk-5ZEROVK5.js +7 -0
  32. package/dist/chunks/{chunk-3LQ2ADXO.js → chunk-64UCX5JM.js} +1 -1
  33. package/dist/chunks/{chunk-A67TLHES.js → chunk-7FAO6DXJ.js} +1 -1
  34. package/dist/chunks/{chunk-AQA4JVKA.js → chunk-7JNBF5SB.js} +1 -1
  35. package/dist/chunks/{chunk-A6F3EE2O.js → chunk-7ULVGK67.js} +1 -1
  36. package/dist/chunks/{chunk-MCP63EVQ.js → chunk-7WY7ASKE.js} +1 -1
  37. package/dist/chunks/{chunk-LD42X7ZH.js → chunk-AX3V7N44.js} +1 -1
  38. package/dist/chunks/{chunk-753RQ6WV.js → chunk-BEAH4TA2.js} +1 -1
  39. package/dist/chunks/chunk-BRETAWE7.js +10 -0
  40. package/dist/chunks/{chunk-T2SRGJPU.js → chunk-BT5C6MCY.js} +1 -1
  41. package/dist/chunks/{chunk-H4DE2OFO.js → chunk-BV2JBHT5.js} +1 -1
  42. package/dist/chunks/{chunk-D3GYYGSS.js → chunk-BWS3ZOHJ.js} +1 -1
  43. package/dist/chunks/{chunk-QZEZCUUZ.js → chunk-CBA2KGXG.js} +13 -13
  44. package/dist/chunks/chunk-CBVVVYUP.js +10 -0
  45. package/dist/chunks/{chunk-KIMIK4SG.js → chunk-CGTD4QFC.js} +1 -1
  46. package/dist/chunks/{chunk-QR7PY5JS.js → chunk-CH5325V5.js} +1 -1
  47. package/dist/chunks/{chunk-5MHRCRIN.js → chunk-CMHL66LK.js} +1 -1
  48. package/dist/chunks/{chunk-WRC5CTUD.js → chunk-D4TD2KWH.js} +1 -1
  49. package/dist/chunks/{chunk-XBOGVOV5.js → chunk-D4ZEJM3T.js} +1 -1
  50. package/dist/chunks/{chunk-5O7CRJE5.js → chunk-D6REP5QQ.js} +1 -1
  51. package/dist/chunks/chunk-DASHFOKO.js +8 -0
  52. package/dist/chunks/{chunk-63DO6KMD.js → chunk-DL5B5I2H.js} +3 -3
  53. package/dist/chunks/{chunk-M4TIOVOP.js → chunk-DUPAU76G.js} +1 -1
  54. package/dist/chunks/{chunk-APNR444T.js → chunk-E7DYXF6G.js} +1 -1
  55. package/dist/chunks/{chunk-GP5MFCGO.js → chunk-ECQKK4JU.js} +1 -1
  56. package/dist/chunks/{chunk-JULKMXVP.js → chunk-EEFLZK52.js} +1 -1
  57. package/dist/chunks/{chunk-GP2FXUFE.js → chunk-EJ2RWXUL.js} +1 -1
  58. package/dist/chunks/{chunk-U3J7VS56.js → chunk-FBYA6LLM.js} +1 -1
  59. package/dist/chunks/{chunk-SOCGBVML.js → chunk-FVVOHGQE.js} +1 -1
  60. package/dist/chunks/{chunk-QLW5DCM4.js → chunk-FWTBSC7Z.js} +1 -1
  61. package/dist/chunks/{chunk-2OET5FWH.js → chunk-G2BNLRPU.js} +1 -1
  62. package/dist/chunks/{chunk-DBV6AB6T.js → chunk-G3LWP5CH.js} +1 -1
  63. package/dist/chunks/{chunk-YIOT5B5Z.js → chunk-G6HUSV7F.js} +1 -1
  64. package/dist/chunks/{chunk-7V2PXIVW.js → chunk-GCPPL24C.js} +1 -1
  65. package/dist/chunks/{chunk-3AXMZRAB.js → chunk-GCXUSXB4.js} +1 -1
  66. package/dist/chunks/{chunk-GZWYJT4C.js → chunk-GHEGWXH2.js} +1 -1
  67. package/dist/chunks/{chunk-YKNHA3RN.js → chunk-GIFIOAOW.js} +1 -1
  68. package/dist/chunks/{chunk-JRBPVMQO.js → chunk-GJCVOEC2.js} +1 -1
  69. package/dist/chunks/{chunk-ELQBQ2O5.js → chunk-GN5IAG3M.js} +1 -1
  70. package/dist/chunks/{chunk-HTFQFHPR.js → chunk-H34SGIVS.js} +1 -1
  71. package/dist/chunks/chunk-IDP63TCP.js +10 -0
  72. package/dist/chunks/{pkg-EDJQLCNP.js → chunk-ITQPDXXA.js} +1 -1
  73. package/dist/chunks/{chunk-XK3W6Q5I.js → chunk-IZ4GFKGR.js} +1 -1
  74. package/dist/chunks/{chunk-62FZFXPJ.js → chunk-JB6T3XEF.js} +1 -1
  75. package/dist/chunks/{chunk-TSKFDJ77.js → chunk-JJ2JHAGW.js} +1 -1
  76. package/dist/chunks/{chunk-V5A4EBV3.js → chunk-JOXGYP5S.js} +1 -1
  77. package/dist/chunks/{chunk-3DDEBTCC.js → chunk-JYWHC7YX.js} +1 -1
  78. package/dist/chunks/{chunk-YTZPQVGF.js → chunk-K3VUXKMV.js} +1 -1
  79. package/dist/chunks/{chunk-2QSNFVB6.js → chunk-K5YO4UD7.js} +1 -1
  80. package/dist/chunks/{chunk-TCEEQLD4.js → chunk-KHG6CZLZ.js} +1 -1
  81. package/dist/chunks/{chunk-KL6HNOFN.js → chunk-KOLCO2RH.js} +1 -1
  82. package/dist/chunks/{chunk-WZ2R4Z7N.js → chunk-KRPY5FHJ.js} +1 -1
  83. package/dist/chunks/{chunk-7E6UJXLR.js → chunk-KV2DYFUG.js} +1 -1
  84. package/dist/chunks/{chunk-3KSTUMR6.js → chunk-M73W4XNR.js} +1 -1
  85. package/dist/chunks/{chunk-EKB2DYCQ.js → chunk-MCJ5OFNP.js} +1 -1
  86. package/dist/chunks/{chunk-LOEU4R4Z.js → chunk-MOW3KNCP.js} +1 -1
  87. package/dist/chunks/chunk-MY4MONOH.js +7 -0
  88. package/dist/chunks/{chunk-SBBD2Q5A.js → chunk-NAU6URTI.js} +1 -1
  89. package/dist/chunks/{chunk-B3ETPBO4.js → chunk-NEUQZYBL.js} +2 -2
  90. package/dist/chunks/chunk-NFASCUXE.js +8 -0
  91. package/dist/chunks/{chunk-3P4Y46MS.js → chunk-NIS66BFX.js} +2 -2
  92. package/dist/chunks/chunk-NTUDWWSL.js +14 -0
  93. package/dist/chunks/{chunk-AEOG4E5G.js → chunk-O4CQRV2G.js} +1 -1
  94. package/dist/chunks/{chunk-4MP4HVBG.js → chunk-O7NJQXN6.js} +1 -1
  95. package/dist/chunks/{chunk-5GOQ3FBV.js → chunk-OVWDOWRV.js} +1 -1
  96. package/dist/chunks/{chunk-7EJ3BZ67.js → chunk-PLJKMCXU.js} +1 -1
  97. package/dist/chunks/{chunk-P2HBUDGR.js → chunk-Q4WEODW3.js} +1 -1
  98. package/dist/chunks/{chunk-KUNFE2M6.js → chunk-QANIGEPP.js} +1 -1
  99. package/dist/chunks/{chunk-T3S63EA3.js → chunk-QBOY2CXL.js} +1 -1
  100. package/dist/chunks/{chunk-37DIJCWK.js → chunk-QQA2OMXJ.js} +1 -1
  101. package/dist/chunks/{chunk-HNOZM6D4.js → chunk-QYNJCJYZ.js} +1 -1
  102. package/dist/chunks/{chunk-K2R3QPOC.js → chunk-R5ZLTWKB.js} +1 -1
  103. package/dist/chunks/chunk-RBIHS5QI.js +7 -0
  104. package/dist/chunks/{chunk-QTCS2HDX.js → chunk-RCFJTXSB.js} +1 -1
  105. package/dist/chunks/{chunk-T34C75TI.js → chunk-RCUDI7OF.js} +1 -1
  106. package/dist/chunks/{chunk-KDRCBWRY.js → chunk-RTJOQK2R.js} +1 -1
  107. package/dist/chunks/{chunk-FXEMEIST.js → chunk-T2FCF46I.js} +1 -1
  108. package/dist/chunks/{chunk-IHRM7L23.js → chunk-T5TOBY4D.js} +1 -1
  109. package/dist/chunks/{chunk-YRK2BCTJ.js → chunk-TD7AL545.js} +1 -1
  110. package/dist/chunks/{chunk-MDWYXLDB.js → chunk-TGQSMRQZ.js} +3 -3
  111. package/dist/chunks/{chunk-6V67VZJD.js → chunk-TMXIVQ45.js} +1 -1
  112. package/dist/chunks/{chunk-J52UJYOK.js → chunk-TRZDIAX3.js} +1 -1
  113. package/dist/chunks/{chunk-7BML2OR6.js → chunk-U6KJOCXX.js} +1 -1
  114. package/dist/chunks/{chunk-Y55DGB3L.js → chunk-UIJYRI3G.js} +1 -1
  115. package/dist/chunks/{chunk-NAXFG37F.js → chunk-UNASHUWQ.js} +1 -1
  116. package/dist/chunks/{chunk-3RXEJWYM.js → chunk-UZTDRGCW.js} +1 -1
  117. package/dist/chunks/{chunk-BHJLCFQ4.js → chunk-VMMSNGPS.js} +1 -1
  118. package/dist/chunks/{chunk-F76MNMH3.js → chunk-VR5ROBAO.js} +1 -1
  119. package/dist/chunks/{chunk-JESNVRVR.js → chunk-VRH7LWOC.js} +1 -1
  120. package/dist/chunks/{chunk-QIPUFI6P.js → chunk-VU3RBRDH.js} +1 -1
  121. package/dist/chunks/{chunk-ZRJKGAUT.js → chunk-W634OFUG.js} +3 -3
  122. package/dist/chunks/{chunk-SKLRHAGH.js → chunk-WFCGAYP5.js} +1 -1
  123. package/dist/chunks/{chunk-C4XT3PG4.js → chunk-WKYFWE37.js} +1 -1
  124. package/dist/chunks/{chunk-G7X2TVUO.js → chunk-WQQTVQZK.js} +1 -1
  125. package/dist/chunks/{chunk-YHFZIUXF.js → chunk-XBWISZCG.js} +1 -1
  126. package/dist/chunks/{chunk-RIAOB3RF.js → chunk-XOBLL6JP.js} +1 -1
  127. package/dist/chunks/chunk-XRIM4BUF.js +7 -0
  128. package/dist/chunks/{chunk-ZBJ44DRL.js → chunk-Y3ZO6WB7.js} +1 -1
  129. package/dist/chunks/chunk-Y5YXAXK3.js +13 -0
  130. package/dist/chunks/{chunk-YEPB52XE.js → chunk-Y6WXTTZS.js} +1 -1
  131. package/dist/chunks/{chunk-OV7G6RIQ.js → chunk-Y7YULJK7.js} +1 -1
  132. package/dist/chunks/{chunk-UAUVCOGS.js → chunk-YJQW3DDY.js} +1 -1
  133. package/dist/chunks/chunk-YYMLVSE2.js +12 -0
  134. package/dist/chunks/{chunk-45UDRX4C.js → chunk-ZBZPCKTW.js} +1 -1
  135. package/dist/chunks/{chunk-2B7U6BB5.js → chunk-ZGKJLJ47.js} +1 -1
  136. package/dist/chunks/chunk-ZS2WS4AM.js +7 -0
  137. package/dist/chunks/clear-BJBNWJJB.js +8 -0
  138. package/dist/chunks/compile-vercel-config-QH77NQ4B.js +7 -0
  139. package/dist/chunks/config-354DFLQE.js +8 -0
  140. package/dist/chunks/config-AXK2BGCA.js +7 -0
  141. package/dist/chunks/connect-git-provider-AWEOEEOO.js +7 -0
  142. package/dist/chunks/delete-GO7DLOJ3.js +9 -0
  143. package/dist/chunks/delete-IYWVEDBG.js +10 -0
  144. package/dist/chunks/{detect-projects-A4H2ZEAP.js → detect-projects-K7SVMH5T.js} +1 -1
  145. package/dist/chunks/detect-services-5P7KCKFK.js +7 -0
  146. package/dist/chunks/disable-LGVOQE3T.js +7 -0
  147. package/dist/chunks/discard-27X77XQE.js +14 -0
  148. package/dist/chunks/edit-2XY4JHTX.js +8 -0
  149. package/dist/chunks/edit-IECKJW64.js +9 -0
  150. package/dist/chunks/enable-AFDKCU3L.js +7 -0
  151. package/dist/chunks/{exec-7LB36K52.js → exec-UV73J2ZB.js} +1 -1
  152. package/dist/chunks/{export-AI2O22W5.js → export-K7JNA5NA.js} +1 -1
  153. package/dist/chunks/future-FFWMSADT.js +7 -0
  154. package/dist/chunks/generate-cert-for-deploy-SY44OYEY.js +7 -0
  155. package/dist/chunks/image-D54UXO4P.js +7 -0
  156. package/dist/chunks/import-builders-4DYFWAOD.js +7 -0
  157. package/dist/chunks/{inspect-OM5S5YQ2.js → inspect-3DLXFK6E.js} +1 -1
  158. package/dist/chunks/{inspect-4A67JORH.js → inspect-A2LKZQMT.js} +1 -1
  159. package/dist/chunks/{inspect-3NMNI7GY.js → inspect-H2EHB6IO.js} +1 -1
  160. package/dist/chunks/inspect-HCBQIEZG.js +13 -0
  161. package/dist/chunks/inspect-XRCF2YRP.js +9 -0
  162. package/dist/chunks/{list-TUJ7HCQK.js → list-AB25WHGO.js} +1 -1
  163. package/dist/chunks/list-CU66L4ZB.js +12 -0
  164. package/dist/chunks/{list-NEV4FBTY.js → list-HUCI73LP.js} +1 -1
  165. package/dist/chunks/login-5GIPMHCM.js +9 -0
  166. package/dist/chunks/login-XD3H356W.js +7 -0
  167. package/dist/chunks/logs-MCYUVB2U.js +7 -0
  168. package/dist/chunks/ls-46HG3NM2.js +8 -0
  169. package/dist/chunks/{ls-COOTTCRW.js → ls-DZTI7O7V.js} +1 -1
  170. package/dist/chunks/ls-FVI4QA2G.js +11 -0
  171. package/dist/chunks/{ls-OVM2DZYL.js → ls-GFWMSKJI.js} +1 -1
  172. package/dist/chunks/{ls-UY3KCDSF.js → ls-GVHHJ6PD.js} +1 -1
  173. package/dist/chunks/{ls-CVO4MCX5.js → ls-IMQKQEA5.js} +1 -1
  174. package/dist/chunks/ls-SNGWJI57.js +8 -0
  175. package/dist/chunks/mutate-AATP3ZZW.js +9 -0
  176. package/dist/chunks/native-self-update-75UJCHGZ.js +7 -0
  177. package/dist/chunks/notifications-X76ITPCJ.js +7 -0
  178. package/dist/chunks/open-FVOQGEWM.js +7 -0
  179. package/dist/chunks/openapi-KYC6JIXI.js +7 -0
  180. package/dist/chunks/permissions-N6JJSYGS.js +7 -0
  181. package/dist/chunks/{plugin-offer-4YTKDZGS.js → plugin-offer-UXUZ3PRE.js} +1 -1
  182. package/dist/chunks/prompt-missing-credentials-7UX2S26W.js +7 -0
  183. package/dist/chunks/publish-BG3UKM2Q.js +15 -0
  184. package/dist/chunks/pull-3NAMWMU6.js +7 -0
  185. package/dist/chunks/purchase-domain-if-available-7UQPSITN.js +7 -0
  186. package/dist/chunks/push-TZAIOAX5.js +7 -0
  187. package/dist/chunks/{query-NIMDIFLO.js → query-R7M64JYQ.js} +1 -1
  188. package/dist/chunks/reauthenticate-TOILE7L6.js +7 -0
  189. package/dist/chunks/reorder-V47PIQFO.js +10 -0
  190. package/dist/chunks/reply-5QZVOLHI.js +9 -0
  191. package/dist/chunks/resolve-7VONHDWK.js +12 -0
  192. package/dist/chunks/resolve-agent-team-DHPOJEQE.js +7 -0
  193. package/dist/chunks/restore-JLME37UW.js +16 -0
  194. package/dist/chunks/rm-2GT4SSDQ.js +8 -0
  195. package/dist/chunks/rm-4EPE3LBT.js +8 -0
  196. package/dist/chunks/rm-5B7XAOK3.js +8 -0
  197. package/dist/chunks/rm-JY3ACRPF.js +8 -0
  198. package/dist/chunks/rm-V2A5HTIT.js +8 -0
  199. package/dist/chunks/routes-S75L7Z7A.js +7 -0
  200. package/dist/chunks/rule-inspect-VPH5ZZ23.js +8 -0
  201. package/dist/chunks/schema-DYNINJQ7.js +14 -0
  202. package/dist/chunks/{schema-44U7GOQE.js → schema-I73FHHZS.js} +1 -1
  203. package/dist/chunks/select-org-DUL7FO5S.js +7 -0
  204. package/dist/chunks/set-YZA622KE.js +7 -0
  205. package/dist/chunks/setup-and-link-ZDP5OPLK.js +7 -0
  206. package/dist/chunks/{skills-XOH4Q7KK.js → skills-DZYJV7BE.js} +3 -3
  207. package/dist/chunks/statuspage-45LJ2XYT.js +7 -0
  208. package/dist/chunks/tags-DYVP7Q2S.js +7 -0
  209. package/dist/chunks/{types-6W3KAE2A.js → types-YA6BOCRV.js} +1 -1
  210. package/dist/chunks/{update-YLFMSPQF.js → update-T3W6JMTU.js} +1 -1
  211. package/dist/chunks/validate-config-XWZ7ZZ3G.js +7 -0
  212. package/dist/commands/build/index.js +1 -6
  213. package/dist/commands/deploy/index.js +14 -14
  214. package/dist/commands/dev/index.js +3 -3
  215. package/dist/commands/env/index.js +1 -1
  216. package/dist/commands/link/index.js +1 -1
  217. package/dist/commands/list/index.js +1 -1
  218. package/dist/commands/project/index.js +1 -1
  219. package/dist/commands-account.js +112 -91
  220. package/dist/commands-ai.js +2 -2
  221. package/dist/commands-blob.js +1 -1
  222. package/dist/commands-core.js +62 -44
  223. package/dist/commands-deployments.js +9 -6
  224. package/dist/commands-flags.js +4 -3
  225. package/dist/commands-integrations.js +98 -74
  226. package/dist/commands-observability.js +5 -5
  227. package/dist/commands-routing.js +154 -162
  228. package/dist/help.js +1 -1
  229. package/dist/index.js +5 -5
  230. package/dist/internal-build.js +1 -1
  231. package/dist/native-download.js +1 -1
  232. package/dist/package.json +57 -58
  233. package/dist/root-help-commands.mjs +1 -1
  234. package/dist/version.mjs +1 -1
  235. package/package.json +50 -51
  236. package/dist/chunks/add-3MWFJH54.js +0 -8
  237. package/dist/chunks/add-CJWCA3MM.js +0 -8
  238. package/dist/chunks/add-GLCVYEEN.js +0 -8
  239. package/dist/chunks/build-6RK6VECG.js +0 -7
  240. package/dist/chunks/chunk-2PYFJXKS.js +0 -14
  241. package/dist/chunks/chunk-5SMV2PPI.js +0 -10
  242. package/dist/chunks/chunk-7A5WO5KA.js +0 -8
  243. package/dist/chunks/chunk-CJHVHB2F.js +0 -8
  244. package/dist/chunks/chunk-EGPVNTKP.js +0 -7
  245. package/dist/chunks/chunk-GJB72ITS.js +0 -12
  246. package/dist/chunks/chunk-H3SJJO6S.js +0 -10
  247. package/dist/chunks/chunk-INH6RXBH.js +0 -9
  248. package/dist/chunks/chunk-IU6PHFPQ.js +0 -7
  249. package/dist/chunks/chunk-KAUKCHQF.js +0 -10
  250. package/dist/chunks/chunk-NDWGYZRT.js +0 -10
  251. package/dist/chunks/chunk-OLAG7Y3P.js +0 -10
  252. package/dist/chunks/chunk-TK2ILW2O.js +0 -21
  253. package/dist/chunks/chunk-WKZ6JSGZ.js +0 -7
  254. package/dist/chunks/chunk-X65XZSWS.js +0 -10
  255. package/dist/chunks/cjs-2SMN43VH.js +0 -54
  256. package/dist/chunks/clear-375VKVXY.js +0 -8
  257. package/dist/chunks/compile-vercel-config-LNRUSKTH.js +0 -7
  258. package/dist/chunks/config-GOYBATSI.js +0 -8
  259. package/dist/chunks/config-VAW454ZH.js +0 -7
  260. package/dist/chunks/connect-git-provider-7KRYVDFS.js +0 -7
  261. package/dist/chunks/delete-3SN6XFOW.js +0 -10
  262. package/dist/chunks/delete-W6BZHLGP.js +0 -9
  263. package/dist/chunks/detect-services-6L57MV5F.js +0 -7
  264. package/dist/chunks/disable-UUV5MYYH.js +0 -7
  265. package/dist/chunks/discard-Y6ZITZ2P.js +0 -14
  266. package/dist/chunks/edit-CVMUITFG.js +0 -9
  267. package/dist/chunks/edit-LLRI57RF.js +0 -8
  268. package/dist/chunks/enable-TFA6XWAA.js +0 -7
  269. package/dist/chunks/future-EZEU2CBY.js +0 -7
  270. package/dist/chunks/generate-cert-for-deploy-QP5BUOJL.js +0 -7
  271. package/dist/chunks/image-YLUF7SHR.js +0 -7
  272. package/dist/chunks/import-builders-ANLKHIYK.js +0 -7
  273. package/dist/chunks/inspect-3TRAN3SP.js +0 -9
  274. package/dist/chunks/inspect-VEUY4QJ2.js +0 -13
  275. package/dist/chunks/list-DJKKVFUL.js +0 -12
  276. package/dist/chunks/login-4HCFKDKL.js +0 -7
  277. package/dist/chunks/login-EPBJQDEK.js +0 -9
  278. package/dist/chunks/logs-Q7XXVFR3.js +0 -7
  279. package/dist/chunks/ls-3TKRCF4T.js +0 -8
  280. package/dist/chunks/ls-LS5J5ERG.js +0 -11
  281. package/dist/chunks/ls-OQQTUQFN.js +0 -8
  282. package/dist/chunks/mutate-I6QWCURL.js +0 -9
  283. package/dist/chunks/notifications-UKC5Z6AH.js +0 -7
  284. package/dist/chunks/open-CYATUDTT.js +0 -7
  285. package/dist/chunks/openapi-B7WSK7AU.js +0 -7
  286. package/dist/chunks/permissions-4ZYPHPOZ.js +0 -7
  287. package/dist/chunks/prompt-missing-credentials-4OKJMYW5.js +0 -7
  288. package/dist/chunks/publish-N6E7VTRK.js +0 -15
  289. package/dist/chunks/pull-LPIT3XUR.js +0 -7
  290. package/dist/chunks/purchase-domain-if-available-IS6UDPJT.js +0 -7
  291. package/dist/chunks/push-ETLU6OCC.js +0 -7
  292. package/dist/chunks/reauthenticate-TESIUM6U.js +0 -7
  293. package/dist/chunks/reorder-PQU2BQEE.js +0 -10
  294. package/dist/chunks/reply-RKDDYV5I.js +0 -9
  295. package/dist/chunks/resolve-ZF7BFXIW.js +0 -12
  296. package/dist/chunks/resolve-agent-team-QSIJ665W.js +0 -7
  297. package/dist/chunks/restore-U5A3BEFQ.js +0 -16
  298. package/dist/chunks/rm-7H5O3T7G.js +0 -8
  299. package/dist/chunks/rm-EPPMQEAV.js +0 -8
  300. package/dist/chunks/rm-FNMW2FPM.js +0 -8
  301. package/dist/chunks/rm-OZIA3DFM.js +0 -8
  302. package/dist/chunks/rm-W3VOR2ED.js +0 -8
  303. package/dist/chunks/routes-BLE5XZJE.js +0 -7
  304. package/dist/chunks/rule-inspect-YAVRRGAP.js +0 -8
  305. package/dist/chunks/schema-6SAZ7T2S.js +0 -14
  306. package/dist/chunks/select-org-L5FJVL5Q.js +0 -7
  307. package/dist/chunks/set-3NQXDGJV.js +0 -7
  308. package/dist/chunks/setup-and-link-H36NRP3A.js +0 -7
  309. package/dist/chunks/tags-CRG27GFL.js +0 -7
  310. /package/dist/chunks/{chunk-OO572JUC.js → chunk-DBT6PGEH.js} +0 -0
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{commands,commandsStructs}from"./chunk-2PYFJXKS.js";import{printError}from"./chunk-D3GYYGSS.js";import{createHelpTheme,help,helpCommand,resolveHelpTarget}from"./chunk-33U57CNE.js";import{TelemetryClient,readLaunch}from"./chunk-SBBD2Q5A.js";import{require_ci_info}from"./chunk-2EYYB6YN.js";import{AGENT_STATUS,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-KAUKCHQF.js";import{parseArguments,takeCommand}from"./chunk-KIMIK4SG.js";import{getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{getFlagsSpecification,globalCliFlagTakesValue}from"./chunk-YPPDRKVC.js";import{__toESM}from"./chunk-BZENIQ7N.js";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})}trackCliCommandTokenPass(actual){this.trackCliCommand({command:"token-pass",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})}trackCliCommandBudgets(actual){this.trackCliCommand({command:"budgets",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})}trackCliCommandCi(actual){this.trackCliCommand({command:"ci",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})}trackCliCommandDaemons(actual){this.trackCliCommand({command:"daemons",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})}trackCliCommandDrains(actual){this.trackCliCommand({command:"drains",value:actual})}trackCliCommandDns(actual){this.trackCliCommand({command:"dns",value:actual})}trackCliCommandEnv(actual){this.trackCliCommand({command:"env",value:actual})}trackCliCommandExperiments(actual){this.trackCliCommand({command:"experiments",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})}trackCliCommandHealth(actual){this.trackCliCommand({command:"health",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})}trackCliCommandMonitors(actual){this.trackCliCommand({command:"monitors",value:actual})}trackCliCommandOpen(actual){this.trackCliCommand({command:"open",value:actual})}trackCliCommandPageIntegrity(actual){this.trackCliCommand({command:"page-integrity",value:actual})}trackCliCommandFeedback(actual){this.trackCliCommand({command:"feedback",value:actual})}trackCliCommandPricing(actual){this.trackCliCommand({command:"pricing",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})}trackCliCommandSignup(actual){this.trackCliCommand({command:"signup",value:actual})}trackCliCommandSkills(actual){this.trackCliCommand({command:"skills",value:actual})}trackCliCommandSetup(actual){this.trackCliCommand({command:"setup",value:actual})}trackCliCommandSandbox(actual){this.trackCliCommand({command:"sandbox",value:actual})}trackCliCommandSchedules(actual){this.trackCliCommand({command:"schedules",value:actual})}trackCliCommandSecurity(actual){this.trackCliCommand({command:"security",value:actual})}trackCliCommandStorage(actual){this.trackCliCommand({command:"storage",value:actual})}trackCliCommandEnvironments(actual){this.trackCliCommand({command:"environments",value:actual})}trackCliCommandTeams(actual){this.trackCliCommand({command:"teams",value:actual})}trackCliCommandOrganizations(actual){this.trackCliCommand({command:"organizations",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()}trackLibc(libc){super.trackLibc(libc)}trackCliLaunch(){let launch=readLaunch();launch&&this.trackLaunch(launch)}trackCIVendorName(){this.trackCI(import_ci_info.default.id)}trackStdinIsTTY(isTTY){super.trackStdinIsTTY(isTTY)}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")}trackCliDeprecatedShorthands(shorthands){for(let shorthand of shorthands)this.trackDeprecatedShorthand(shorthand)}};function printCommandHelp(client,commandName,tokens){let found=findBuiltInCommand(commandName,tokens);if(!found)return;let{root}=found,target=resolveHelpTarget(root,found.tokens);return target.unknownSegment!==void 0?(printUnknownCommand(client,target.unknownSegment,[root.name,...target.typedPath]),2):target.command.dynamicHelp?void 0:(new RootTelemetryClient({opts:{store:client.telemetryEventStore}}).trackCliFlagHelp([root.name,...target.typedPath].join(":")),client.stdout.write(help(target.command,{parent:target.parent,columns:client.stdout.columns??client.stderr.columns,stream:client.stdout})),0)}function printGroupHelp(client,commandName,tokens){let found=findBuiltInCommand(commandName,tokens);if(!found)return;let{root}=found,target=resolveHelpTarget(root,found.tokens),{command}=target;if(!(target.unknownSegment!==void 0||!command.subcommands?.length||command.arguments.length>0||command.runsWithoutSubcommand||command.subcommands.some(subcommand=>subcommand.default))){try{parseArguments([...found.tokens],getFlagsSpecification(getCommandsAlongPath(root,target.typedPath).flatMap(({options})=>options)))}catch(err){return printError(err,client),2}return client.stdout.write(help(command,{parent:target.parent,columns:client.stdout.columns??client.stderr.columns,stream:client.stdout})),0}}function getCommandPathOptions(commandName,tokens){let found=findBuiltInCommand(commandName,tokens);if(!found)return;let{typedPath}=resolveHelpTarget(found.root,found.tokens);return getCommandsAlongPath(found.root,typedPath).flatMap(({options})=>options)}function asksForVersion(commandName,argv){let flags;try{({flags}=parseArguments(argv.slice(2),{"--version":Boolean,"-v":Boolean},{permissive:!0}))}catch{return!1}let typedLong=flags["--version"]===!0,typedShort=flags["-v"]===!0;if(!typedLong&&!typedShort)return!1;let found=findBuiltInCommand(commandName,tokensAfterCommand(argv));if(!found)return!1;let{command,typedPath}=resolveHelpTarget(found.root,found.tokens),defaultSubcommand=command.subcommands?.find(subcommand=>subcommand.default);if(command.forwardsUnknownOptions||defaultSubcommand?.forwardsUnknownOptions)return!1;let options=getCommandsAlongPath(found.root,typedPath).flatMap(({options:options2})=>options2);defaultSubcommand&&options.push(...defaultSubcommand.options);let definesLong=options.some(option=>option.name==="version"),definesShort=definesLong||options.some(option=>option.shorthand==="v"||option.deprecatedShorthand==="v");return typedLong&&!definesLong||typedShort&&!definesShort}function deployAcceptsOptions(argv){let deploy=findBuiltInCommand("deploy",[]);if(!deploy)return!1;try{return parseArguments(argv.slice(2),getFlagsSpecification(deploy.root.options),{warnDeprecated:!1}),!0}catch{return!1}}function getCommandsAlongPath(root,typedPath){let path=[root];for(let token of typedPath){let subcommand=path[path.length-1].subcommands?.find(candidate=>candidate.name===token||candidate.aliases.includes(token));if(!subcommand)break;path.push(subcommand)}return path}function findBuiltInCommand(commandName,tokens){let name=commandName?commands.get(commandName):void 0;if(!commandName||!name||name==="sandbox")return;let findRoot=rootName=>commandsStructs.find(command=>command.name===rootName&&"options"in command),root=findRoot(name);if(!root)return;let monitors=root.name==="alerts"?findRoot("monitors"):void 0;if(monitors){let alias=takeAlertsRulesAlias(root,tokens);if(alias)return{root:monitors,tokens:alias}}let namesSubcommand=commandName!==root.name&&root.subcommands?.some(subcommand=>subcommand.name===commandName||subcommand.aliases.includes(commandName));return{root,tokens:namesSubcommand?[commandName,...tokens]:tokens}}function takeAlertsRulesAlias(alerts,tokens){try{let{command,args}=takeCommand([...tokens],getFlagsSpecification(alerts.options));return command==="rules"?args:void 0}catch{return}}function printUnknownCommand(client,segment,groupPath=[]){let group=groupPath.join(" "),message=`Unknown command ${segment} for ${getCommandNamePlain(group||void 0)}.`,helpCommand2=group?`${group} --help`:"--help";if(shouldEmitNonInteractiveCommandError(client)){writeAgentError(client,{status:AGENT_STATUS.ERROR,reason:"unknown_command",message,next:[{command:getCommandNamePlain(helpCommand2),when:"See all commands"}]});return}output_manager_default.fatal(message),output_manager_default.print(`
8
- See all commands:
9
- ${helpCommand(getCommandNamePlain(helpCommand2),[],createHelpTheme(client.stderr))}
10
- `)}function tokensAfterCommand(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--")return[];if(arg.startsWith("-")){!arg.includes("=")&&globalCliFlagTakesValue(arg)&&i++;continue}return args.slice(i+1)}return[]}export{RootTelemetryClient,printCommandHelp,printGroupHelp,getCommandPathOptions,asksForVersion,deployAcceptsOptions,printUnknownCommand,tokensAfterCommand};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{getTeams}from"./chunk-YEPB52XE.js";import{param}from"./chunk-3G3FQYMW.js";import{outputActionRequired}from"./chunk-KAUKCHQF.js";import{getUser}from"./chunk-QZEZCUUZ.js";import{printAlignedLabel}from"./chunk-3LQ2ADXO.js";import{getCommandName,packageName}from"./chunk-JESNVRVR.js";import{emoji,output_manager_default,require_build_utils}from"./chunk-ZRJKGAUT.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_build_utils=__toESM(require_build_utils(),1);function getScopeOrTeamFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"){let next=args[i+1];if(typeof next=="string"&&!next.startsWith("-"))return next;continue}if(arg.startsWith("--scope="))return arg.slice(8);if(arg.startsWith("--team="))return arg.slice(7)}return null}async function selectOrg(client,question,autoConfirm,searchable=!1,meta,description){let{config:{currentTeam}}=client;output_manager_default.spinner("Loading teams\u2026",1e3);let user,teams;try{[user,teams]=await Promise.all([getUser(client),getTeams(client)])}finally{output_manager_default.stopSpinner()}let formatChoiceName=(name,slug,isCurrent,limited)=>{let title=`${name} (${slug})`;return isCurrent&&(title+=` ${import_chalk.default.bold("(current)")}`),limited&&(title+=` ${emoji("locked")}`),title},personalAccountChoice=user.version==="northstar"?[]:[{name:formatChoiceName(user.name||user.username,user.username,!currentTeam,user.limited),value:{type:"user",id:user.id,slug:user.username}}],orderedTeams=client.ignoresSavedTeam?teams:teams.sort(a=>a.id===user.defaultTeamId?-1:1),choices=[...personalAccountChoice,...orderedTeams.map(team=>({name:formatChoiceName(team.name||team.slug,team.slug,team.id===currentTeam,team.limited),value:{type:"team",id:team.id,slug:team.slug}}))],defaultChoiceIndex=Math.max(choices.findIndex(choice=>choice.value.id===currentTeam),0);meta&&(meta.choiceCount=choices.length);let localConfigScope=client.localConfig?.scope,explicitScope=getScopeOrTeamFromArgv(client.argv)??(typeof localConfigScope=="string"?localConfigScope:null)??(0,import_build_utils.getPlatformEnv)("ORG_ID")??null,matchExplicitScope=()=>{if(!explicitScope)return;let match=choices.find(c=>c.value.id===explicitScope||c.value.slug===explicitScope);if(match)return match.value;if(user.id===explicitScope||user.email===explicitScope||user.username===explicitScope)return choices.find(c=>c.value.type==="user")?.value};if(client.nonInteractive||!client.stdin.isTTY){let match=matchExplicitScope();if(match)return match;if(choices.length===1)return choices[0].value;let actionRequired={status:"action_required",reason:"missing_scope",message:choices.length>0?"Provide --scope explicitly. No default is applied in non-interactive mode.":"No teams available.",...choices.length>0&&{userActionRequired:!0,hint:"Ask the user which team to use, then run the matching command in next[]. Do not choose a team yourself."},choices:choices.map(c=>({id:c.value.id,name:c.value.slug})),next:choices.map(c=>({command:`${packageName} link --scope ${c.value.slug}`}))};outputActionRequired(client,actionRequired),output_manager_default.error(choices.length>0?`Multiple teams found. Teams are never auto-selected when the CLI runs without an interactive terminal. Re-run this command with ${param("--scope <slug>")}, or run ${getCommandName("teams ls")} to list your teams.`:"No teams available."),process.exit(1)}let explicitOrg=matchExplicitScope();if(explicitOrg)return explicitOrg;if(choices.length===1)return printAlignedLabel("Team",choices[0].value.slug),choices[0].value;let descriptionLine=description?`
8
- ${import_chalk.default.dim(` ${description}`)}`:"";if(!searchable)return await client.input.select({message:`${question}${descriptionLine}`,choices,default:choices[defaultChoiceIndex].value});let defaultChoice=choices[defaultChoiceIndex],initialChoices=defaultChoice?[defaultChoice,...choices.filter(choice=>choice!==defaultChoice)]:choices,pageSize=15,countHint=choices.length>pageSize?` ${import_chalk.default.dim(`(${choices.length} teams)`)}`:"";return await client.input.search({message:`${question}${countHint}${descriptionLine}`,pageSize,source:term=>{let searchTerm=term?.trim().toLowerCase();return searchTerm?choices.filter(choice=>choice.name.toLowerCase().includes(searchTerm)||choice.value.slug.toLowerCase().includes(searchTerm)):initialChoices}})}export{selectOrg};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{recordLine}from"./chunk-OLAG7Y3P.js";import{external_exports}from"./chunk-2NABMKFV.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function recordLine2(type,event){return recordLine(type,event)}function warningLine(warning){let line={type:"warning",reason:warning.reason,message:(0,import_strip_ansi.default)(warning.message),...warning.data?{data:warning.data}:{}};return`${JSON.stringify(line)}
8
- `}function serializeTimeRange(range){return{start:range.start.toISOString(),end:range.end.toISOString()}}var CONTINUATION_VERSION=1,continuationSchema=external_exports.object({v:external_exports.literal(CONTINUATION_VERSION),event:external_exports.string().min(1),ownerId:external_exports.string().min(1),projectIds:external_exports.array(external_exports.string().min(1)).optional(),timeRange:external_exports.object({start:external_exports.string().min(1),end:external_exports.string().min(1)}),filter:external_exports.string().optional(),order:external_exports.enum(["asc","desc"]),cursor:external_exports.string().min(1)});function encodeContinuation(continuation){let payload={v:CONTINUATION_VERSION,event:continuation.event,ownerId:continuation.ownerId,...continuation.projectIds?{projectIds:[...continuation.projectIds]}:{},timeRange:{start:continuation.timeRange.start,end:continuation.timeRange.end},...continuation.filter!==void 0?{filter:continuation.filter}:{},order:continuation.order,cursor:continuation.cursor};return Buffer.from(JSON.stringify(payload),"utf8").toString("base64url")}function decodeContinuation(token){if(!/^[A-Za-z0-9_-]+$/.test(token))return;let raw;try{raw=JSON.parse(Buffer.from(token,"base64url").toString("utf8"))}catch{return}let parsed=continuationSchema.safeParse(raw);if(!parsed.success)return;let{v:_version,...continuation}=parsed.data;return continuation}export{recordLine2 as recordLine,warningLine,serializeTimeRange,encodeContinuation,decodeContinuation};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{require_dist,require_dist2}from"./chunk-3P4Y46MS.js";import{require_types}from"./chunk-QZEZCUUZ.js";import{require_build_utils}from"./chunk-ZRJKGAUT.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectDaemons:()=>import_fs_detectors2.detectDaemons,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,required:["schedule"],properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},command:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs `command`. `entrypoint` is relative to it. Only valid with `command`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"],command:["entrypoint","root"],root:["command"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=100,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=path=>/(docker|container)file/i.test(path.split(/[\\/]/).pop()??"");function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),invalidCommand=message=>new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_COMMAND",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`});for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("command"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.command\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidCommand(`\`${path}\` runs a command, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidCommand(`\`${path}\` runs a command as service "${name}", which is already the name of a service or daemon.`)}if(schedule.timezone!==void 0)try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{require_dist as require_dist2,validateConfig}from"./chunk-EGPVNTKP.js";import{require_dist2 as require_dist}from"./chunk-3P4Y46MS.js";import{readJSONFile}from"./chunk-KARAZGCO.js";import{compileVercelConfig}from"./chunk-BHJLCFQ4.js";import{init_dist,parse,stringify}from"./chunk-U4Z2MMOF.js";import{CantParseJSONFile}from"./chunk-FXEMEIST.js";import{require_build_utils}from"./chunk-ZRJKGAUT.js";import{__toESM}from"./chunk-BZENIQ7N.js";init_dist();var import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename,join as join2}from"path";var import_build_utils=__toESM(require_build_utils(),1);import{join}from"path";function createDetectEntrypoint(projectRoot){return async({workPath,framework})=>{let absWorkPath=(0,import_build_utils.normalizePath)(join(projectRoot,workPath)),builderName;if((0,import_build_utils.isPythonFramework)(framework))builderName="@vercel/python";else if((0,import_build_utils.isNodeBackendFramework)(framework))builderName="@vercel/backends";else if(framework==="go")builderName="@vercel/go";else if(framework==="rust")builderName="@vercel/rust";else return null;let detectEntrypoint=await loadBuilderDetectEntrypoint(builderName,projectRoot);return detectEntrypoint?detectEntrypoint(builderName==="@vercel/python"?{workPath:absWorkPath,framework}:{workPath:absWorkPath}):null}}async function loadBuilderDetectEntrypoint(name,projectRoot){let{importBuilders}=await import("./import-builders-ANLKHIYK.js"),loaded=(await importBuilders(new Set([name]),projectRoot)).get(name);if(!loaded)return;let detect=loaded.builder.detectEntrypoint;return typeof detect=="function"?detect:void 0}function getServicesConfiguration(config){let configuredServices=config?.services??config?.experimentalServicesV2??config?.experimentalServices,configuredServicesType=config?.services?"services":config?.experimentalServicesV2?"experimentalServicesV2":config?.experimentalServices?"experimentalServices":void 0;return{configuredServices,configuredServicesType}}async function loadVercelConfig(cwd){try{let{configPath}=await compileVercelConfig(cwd);if(!configPath)return null;let config=await readJSONFile(configPath);return config instanceof Error?null:config}catch{return null}}function isServicesEnvEnabled(){let value=process.env.VERCEL_USE_EXPERIMENTAL_SERVICES;return value==="1"||value?.toLowerCase()==="true"}async function isExperimentalServicesEnabled(cwd){let{configuredServices}=getServicesConfiguration(await loadVercelConfig(cwd));return isServicesEnvEnabled()||configuredServices!==void 0}async function tryDetectServices(cwd,config){config===void 0&&(config=await loadVercelConfig(cwd));let configuration=getServicesConfiguration(config);if(!isServicesEnvEnabled()&&!configuration.configuredServices)return null;let fs=new import_fs_detectors.LocalFileSystemDetector(cwd),result=await(0,import_service_topology.detectServices)({fs,configuredServices:configuration.configuredServices,configuredServicesType:configuration.configuredServicesType,detectEntrypoint:createDetectEntrypoint(cwd)});return result.errors.some(e=>e.code==="NO_SERVICES_CONFIGURED")?null:result}async function writeServicesConfig(cwd,config){let prepared=await prepareServicesConfigWrite(cwd,config);return await writeFile(prepared.configPath,prepared.content,"utf8"),{configFileName:basename(prepared.configPath)}}async function getServicesConfigWriteBlocker(cwd,config){try{return await prepareServicesConfigWrite(cwd,config),null}catch(error){return getServicesConfigWriteBlockerFromError(error)}}function toProjectServicesConfigPatch(config){let services={};for(let[name,svc]of Object.entries(config)){let buildCommand=svc.preDeployCommand&&svc.buildCommand?`${svc.buildCommand} && ${svc.preDeployCommand}`:svc.preDeployCommand||svc.buildCommand;services[name]={root:svc.root,...svc.framework?{framework:svc.framework}:{},...svc.entrypoint?{entrypoint:svc.entrypoint}:{},...buildCommand?{buildCommand}:{}}}let rewrites=(0,import_service_topology.generateServiceRewrites)(config);return{services,...rewrites.length>0?{rewrites}:{}}}async function prepareServicesConfigWrite(cwd,config){let compileResult=await compileVercelConfig(cwd),configPath=join2(cwd,"vercel.json");if(compileResult.sourceFile==="vercel.toml")return prepareTomlServicesConfigWrite(join2(cwd,"vercel.toml"),config);if(compileResult.wasCompiled)throw new Error(`Cannot automatically update ${compileResult.sourceFile??"the current Vercel config"}.`);let existingConfig={};if(compileResult.configPath&&basename(compileResult.configPath)==="vercel.json"){let result=await readJSONFile(configPath);if(result instanceof CantParseJSONFile)throw result;existingConfig=result??{}}let patch=toProjectServicesConfigPatch(config),nextConfig={...existingConfig,...patch,...patch.rewrites?{rewrites:[...existingConfig.rewrites??[],...patch.rewrites]}:{}},validationError=validateConfig(nextConfig);if(validationError)throw validationError;return{configPath,content:JSON.stringify(nextConfig,null,2)+`
8
- `}}async function prepareTomlServicesConfigWrite(configPath,config){let patch=toProjectServicesConfigPatch(config),patchKeys=Object.keys(patch),existingContent;try{existingContent=await readFile(configPath,"utf8")}catch{existingContent=""}if(existingContent.trim()){let existingParsed=parse(existingContent),overlapping=patchKeys.filter(key=>key in existingParsed);if(overlapping.length>0){let plural=overlapping.length>1,keyList=overlapping.map(k=>`"${k}"`).join(", ");throw new Error(`Cannot automatically update vercel.toml: key${plural?"s":""} ${keyList} already exist${plural?"":"s"}.`)}}let patchToml=stringify(patch),content=existingContent.trim()?existingContent.trimEnd()+`
9
-
10
- `+patchToml+`
11
- `:patchToml+`
12
- `;return{configPath,content}}function getServicesConfigWriteBlockerFromError(error){switch(error?.code){case"EXPERIMENTAL_SERVICES_AND_BUILDS":case"SERVICES_AND_BUILDS":return"builds";case"EXPERIMENTAL_SERVICES_AND_FUNCTIONS":case"SERVICES_AND_FUNCTIONS":return"functions";default:return null}}export{createDetectEntrypoint,loadVercelConfig,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig,getServicesConfigWriteBlocker};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{buildCommandExampleLines,buildCommandOptionLines,createHelpTheme,helpColumns,helpCommandNames,helpLiterals,helpRows,helpSection,helpUsage}from"./chunk-33U57CNE.js";import{globalCommandOptions}from"./chunk-YPPDRKVC.js";var BETA_COMMANDS=new Set(["budget","budgets","crons","daemons","kms","schedules"]);var ROOT_HELP_GROUPS={"Deploy and Develop":["deploy","build","dev","init","inspect","list","promote","redeploy","rollback","remove","rolling-release","bisect","ci","curl","httpstat"],"Projects and Configuration":["project","link","open","pull","env","git","cache","target","environments","flags","microfrontends","deploy-hooks"],"Domains and Traffic":["domains","dns","alias","certs","redirects","routes"],"Data and Compute":["storage","blob","global-config","sandbox","vcr","daemons","crons","schedules","ai-gateway"],"Operations and Security":["activity","health","agent-runs","alerts","monitors","comments","logs","drains","metrics","traces","security","firewall","kms","webhooks"],"Account and Billing":["login","logout","signup","switch","teams","organizations","tokens","whoami","budgets","buy","contract","pricing","usage"],"CLI and Integrations":["help","feedback","api","install","integration","integration-resource","connect","agent","mcp","setup","skills","changelog","telemetry","upgrade","version","token-pass"]};function commandGroup(name,fallback="CLI and Integrations"){return Object.entries(ROOT_HELP_GROUPS).find(([,names])=>names.includes(name))?.[0]??fallback}var DEPRECATED_COMMANDS=new Set(["integration-resource"]),DEFAULT_COMMAND="deploy",HELP_ROW={names:["help"],description:"Show help for a command",group:commandGroup("help"),default:!1};function summarize(description){let firstLine=description.trim().split(/\n\s*\n/)[0].replace(/\s*\n\s*/g," "),abbreviations=new Set(["e.g.","i.e.","vs.","etc."]),sentenceEnd=[...firstLine.matchAll(/[^.]\.(\s|$)/g)].find(match=>{let prefix=firstLine.slice(0,match.index+2);return!abbreviations.has((prefix.split(/\s/).at(-1)??"").replace(/^[^a-z]+/i,""))});return(sentenceEnd?firstLine.slice(0,sentenceEnd.index+1):firstLine).replace(/\.$/,"")}function getRootHelpCommands(commands){let rows=[HELP_ROW];for(let command of commands){if(!("description"in command)||command.hidden||command.name==="help"||DEPRECATED_COMMANDS.has(command.name))continue;let names=helpCommandNames(command),description=command.summary?command.summary.replace(/\.$/,""):summarize(command.description);BETA_COMMANDS.has(command.name)&&(description+=" [beta]"),rows.push({names,description,group:commandGroup(command.name),default:command.name===DEFAULT_COMMAND});for(let alias of command.aliases){let subcommand=command.subcommands?.find(candidate=>candidate.name===alias&&!candidate.hidden);subcommand&&rows.push({names:[alias],description:subcommand.summary?subcommand.summary.replace(/\.$/,""):summarize(subcommand.description),group:commandGroup(alias,commandGroup(command.name)),default:!1})}}return rows.sort((a,b)=>{if(a.default!==b.default)return a.default?-1:1;let aName=a.names[a.names.length-1],bName=b.names[b.names.length-1];return aName<bName?-1:aName>bName?1:0})}var ROOT_HELP_EXAMPLES=[{name:"Deploy the current directory",value:"vercel"},{name:"Deploy a linked project without prompts",value:"vercel deploy --yes --non-interactive"},{name:"Show help for a command",value:"vercel domains --help"}];function help(commands,columns=80,theme=createHelpTheme()){columns=helpColumns(columns);let sections=Object.keys(ROOT_HELP_GROUPS).flatMap(group=>{let rows=commands.filter(command=>command.group===group);return rows.length?[helpSection(group,helpRows(rows.map(command=>({syntax:helpLiterals(command.names),description:`${command.description}${command.default?" (default)":""}`})),columns,theme),theme)]:[]});return[`${helpUsage(theme)} ${theme.reference("vercel")} [options] [command | path]`,...sections,buildCommandOptionLines([...globalCommandOptions,{name:"changelog",shorthand:null,type:Boolean,deprecated:!1,description:"Show the 5 latest Vercel product updates"}],{columns,theme},"Global Options"),buildCommandExampleLines({examples:ROOT_HELP_EXAMPLES},columns,theme)].filter(Boolean).join(`
8
-
9
- `)+`
10
- `}export{BETA_COMMANDS,getRootHelpCommands,ROOT_HELP_EXAMPLES,help};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{readJSONFile}from"./chunk-KARAZGCO.js";import{getScope}from"./chunk-IU6PHFPQ.js";import{humanizePath,require_types}from"./chunk-QZEZCUUZ.js";import{getArgs}from"./chunk-KIMIK4SG.js";import{CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist}from"./chunk-FXEMEIST.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-ZRJKGAUT.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.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 sentry;async function getSentry(){if(!sentry){let[SentryModule,{SENTRY_DSN},{default:pkg}]=await Promise.all([import("./cjs-2SMN43VH.js"),import("./constants-JAB7MRSK.js"),import("./pkg-EDJQLCNP.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 isOutputDebugEnabled(debugFlag){return debugFlag===!0||process.env.VERCEL_CLI_DEBUG==="1"}var import_epipebomb=__toESM(require_epipebomb(),1),SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],installed=!1;function installProcessGuards(){if(installed)return;installed=!0;let originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)},(0,import_epipebomb.default)()}var import_error_utils=__toESM(require_dist(),1);async function reportError(sentry2,client,error){if(ignoreError(error))return;let user,team,scopeError;try{({user,team}=await getScope(client))}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 fatalErrorHandlerSymbol=Symbol.for("vercel.cli.fatal-error-handler");async function exitWithUnexpectedError(error){let handler=globalThis[fatalErrorHandlerSymbol];if(typeof handler=="function")try{await handler(error)}catch{}process.exit(1)}async function handleUnexpectedError(client,err){let{message}=err;return message.includes("sentry")&&message.includes("ENOTFOUND")?(output_manager_default.debug(`Sentry is not reachable: ${err}`),!1):(output_manager_default.error(`An unexpected error occurred!
8
- ${err.stack}`),await reportError(await getSentry(),client,err),!0)}function registerUnexpectedErrorHandlers(getClient){process.on("unhandledRejection",async err=>{recordCliError(cliErrorFromUnknown(err)),err?err instanceof Error?await handleUnexpectedError(getClient(),err):(output_manager_default.error(`An unexpected rejection occurred
9
- ${err}`),await reportError(await getSentry(),getClient(),err)):output_manager_default.error("An unexpected empty rejection occurred"),await exitWithUnexpectedError(err)}),process.on("uncaughtException",async error=>{await handleUnexpectedError(getClient(),error)&&await exitWithUnexpectedError(error)})}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 fallbackReason;function recordDirectBuildFallback(reason){fallbackReason=reason}function getDirectBuildFallbackAttributes(){return fallbackReason===void 0?void 0:{directBuild:"false",fallbackReason}}export{getSentry,isOutputDebugEnabled,installProcessGuards,reportError,exitWithUnexpectedError,handleUnexpectedError,registerUnexpectedErrorHandlers,earlyGetConfig,recordDirectBuildFallback,getDirectBuildFallbackAttributes};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{AGENT_REASON,outputAgentError}from"./chunk-KAUKCHQF.js";import{findProjectsFromPath,getConfigFilePath,getLinkFromDir,getRepoLink,getUser,getVercelDirectory,inspectTokenRequest,processInspectTokenResponse}from"./chunk-QZEZCUUZ.js";import{getTeamByIdOrSlug}from"./chunk-F53OKXYI.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-FXEMEIST.js";import{output_manager_default,require_build_utils}from"./chunk-ZRJKGAUT.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function getAppTokenTeamId(client){try{await getUser(client);return}catch{let token=await introspectToken(client).catch(()=>null);return token&&resolveAppFromToken(token)?token.team?.id:void 0}}function assertOrgIdMatchesAppTeam(client,appTeamId){let envOrgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");if(!envOrgId||envOrgId===appTeamId)return;let message=`This token only works with team ${appTeamId}, but VERCEL_ORG_ID is set to ${envOrgId}.`;throw outputAgentError(client,{status:"error",reason:AGENT_REASON.SCOPE_NOT_ACCESSIBLE,message}),new Error(message)}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}async function isActiveAppToken(client){let token=await introspectToken(client).catch(()=>null);return!!(token&&resolveAppFromToken(token))}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils2=__toESM(require_build_utils(),1);import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils2.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!1}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{introspectToken,isAppPrincipalEnabled,resolveAppFromToken,getAppTokenTeamId,assertOrgIdMatchesAppTeam,resolveAppTokenScope,isActiveAppToken,forgetCachedTeamSlug,getScope,getContextName,getLocalOrgId,scopeFlagPassed,detectExplicitScope};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{linkCommand}from"./chunk-QLW5DCM4.js";import{quoteArg,teamCache}from"./chunk-F53OKXYI.js";import{InvalidToken,LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-FXEMEIST.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-JESNVRVR.js";import{recordCliError}from"./chunk-ZRJKGAUT.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{arg_common_default,getFlagsSpecification,getGlobalFlagsFromArgs,normalizeFlagName,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-YPPDRKVC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",AGENT_CANNOT_SWITCH:"agent_cannot_switch",API_ERROR:"api_error",STDIN_ERROR:"stdin_error",RATE_LIMITED:"rate_limited",NETWORK_ERROR:"network_error",UNKNOWN_COMMAND:"unknown_command",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",PRICE_CHANGED:"price_changed",CONFLICT:"conflict",DOMAIN_NOT_AVAILABLE:"domain_not_available",TLD_NOT_SUPPORTED:"tld_not_supported",PAYMENT_FAILED:"payment_failed",UNKNOWN_OUTCOME:"unknown_outcome",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",PAGE_INTEGRITY_NOT_AVAILABLE:"page_integrity_not_available",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_SINGLE_AT_PASSED:"schedule_single_at_passed",SCHEDULE_ALREADY_ACTIVE:"schedule_already_active",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",PLAN_LIMIT:"plan_limit",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination",TARGET_CONFLICT:"target_conflict",DEPRECATED:"deprecated",LIMIT_CLAMPED:"limit_clamped",METRICS_UNAVAILABLE:"metrics_unavailable",STREAM_GAP:"stream_gap",INCOMPLETE_RESULTS:"incomplete_results"},USAGE_ERROR_REASONS=new Set(["invalid_arguments","missing_arguments","unknown_command","missing_command","invalid_environment","invalid_type","missing_id","missing_value","missing_name","missing_flags","missing_clients","invalid_clients","conflicting_type_flags","missing_environment","invalid_slug","invalid_name","invalid_alert_thresholds","invalid_budget","invalid_dns_type","invalid_event","invalid_expiration","invalid_port","invalid_refresh_period","invalid_role_combination","invalid_url","missing_events","missing_issuer_id","missing_key_id","missing_key","missing_url"]);function getExitCodeForReason(reason){return reason!==void 0&&USAGE_ERROR_REASONS.has(reason)?2:1}var AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus",PRIORITY_PROJECT_ENABLE_COMMAND="project priority enable",BUY_PRO_COMMAND="buy pro",PROJECT_ENABLE_COMMAND="project observability enable";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function mentionsPriorityProject(message){return/priority\s+project/i.test(message)||/priority\s+tier/i.test(message)}function observabilityPlusDenialReason(error){if(!error||typeof error!="object"||!("meta"in error))return;let meta=error.meta;if(meta&&typeof meta=="object"&&"reason"in meta&&typeof meta.reason=="string")return meta.reason}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function isHobbyLikePlan(plan){return plan==="hobby"||plan==="oss"}function isProOrEnterprisePlan(plan){return plan==="pro"||plan==="enterprise"}function currentTeamPlan(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.billing?.plan}function planForTeam(idOrSlug){return teamCache.get(idOrSlug)?.billing?.plan}function buyProFix(hint){return{command:BUY_PRO_COMMAND,hint:hint??`Upgrade with ${getCommandName(BUY_PRO_COMMAND)}.`,when:"a person has approved upgrading the plan"}}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function inferDenialReason(message){if(/(?:disabled|switched off|re-enable)/i.test(message))return"subscription_disabled";if(/excluded from it|include the project/i.test(message))return"project_excluded";if(/upgrade your plan/i.test(message)&&/pro and enterprise/i.test(message))return"plan_upgrade_required";if(/(?:quota|usage limit|query limit)/i.test(message))return"quota"}function plusNeedsPlanUpgradeHint(){return`Observability Plus is available on Pro and Enterprise. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}. The add-on cannot be purchased on Hobby.`}function observabilityPlusRecovery(message,denialReason,plan){if(mentionsObservabilityPlus(message))switch(denialReason??inferDenialReason(message)){case"subscription_disabled":return{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."};case"project_excluded":return{command:PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:`Observability Plus is on for the team, but this project is excluded. Enable it with ${getCommandName(PROJECT_ENABLE_COMMAND)}. A new subscription is not needed.`,preserveProject:!1,when:"a person has approved enabling Observability Plus for this project"};case"plan_upgrade_required":return buyProFix(plusNeedsPlanUpgradeHint());case"quota":return{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."};default:return isHobbyLikePlan(plan)?buyProFix(plusNeedsPlanUpgradeHint()):{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}}function priorityProjectRecovery(message,plan){if(mentionsPriorityProject(message))return isHobbyLikePlan(plan)?buyProFix(`Priority Projects are only available on Pro or Enterprise team plans. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}, then run ${getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND)}.`):{command:PRIORITY_PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND),preserveProject:!1,when:"user runs this command in an interactive terminal"}}function observabilityPlanRecovery(message,denialReason,plan){return priorityProjectRecovery(message,plan)??observabilityPlusRecovery(message,denialReason,plan)}var PROJECT_POSITIONAL_COMMANDS=new Set([PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND]);function currentTeamScope(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.slug??id}function targetRecovery(fix,target){if(!fix)return;let targeted=command=>{let out=command;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(command)&&(out+=` ${quoteArg(target.projectName)}`),target.scope&&(out+=` --scope ${quoteArg(target.scope)}`),out},hint=fix.hint;for(let command of[BUY_PRO_COMMAND,OBSERVABILITY_PLUS_PURCHASE_COMMAND,PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND])hint=hint.split(getCommandName(command)).join(getCommandName(targeted(command)));if(!fix.command)return{...fix,hint};let excludeFlags=new Set(fix.excludeFlags??[]),preserveProject=fix.preserveProject;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(fix.command)&&(excludeFlags.add("--project"),preserveProject=!1),fix.command===BUY_PRO_COMMAND&&excludeFlags.add("--project"),target.scope&&(excludeFlags.add("--scope"),excludeFlags.add("--team")),{...fix,command:targeted(fix.command),hint,...excludeFlags.size?{excludeFlags:Array.from(excludeFlags)}:{},...preserveProject!==void 0?{preserveProject}:{}}}function clientObservabilityPlanRecovery(client,error,message,projectName,scope){return targetRecovery(observabilityPlanRecovery(message,observabilityPlusDenialReason(error),scope?planForTeam(scope):currentTeamPlan(client)),{projectName,scope:scope??currentTeamScope(client)})}function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}var TOKENS_URL="https://vercel.com/account/tokens";function isInvalidTokenApiError(error){if(typeof error!="object"||error===null)return!1;let{status,invalidToken,missingToken}=error;return(status===401||status===403)&&(invalidToken===!0||missingToken===!0)}function isInvalidTokenError(error){return error instanceof InvalidToken||isInvalidTokenApiError(error)}function getInvalidTokenRecovery(client){let source=client?.authConfig?.tokenSource,create=`Create a token at ${TOKENS_URL}.`;return{hint:source==="env"?`Replace the token in VERCEL_TOKEN with a valid one, or unset it to use the saved login, then retry. ${create}`:source==="flag"?`Pass a valid token with --token, or set VERCEL_TOKEN, then retry. ${create}`:`Set VERCEL_TOKEN or pass --token with a valid token, then retry. A person can also run \`${getCommandNamePlain("login")}\` in an interactive terminal to sign in again. ${create}`,retryable:!1,userActionRequired:!0}}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(isInvalidTokenApiError(error))return getInvalidTokenRecovery(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||reason==="not_authorized")return{hint:"Provide valid credentials for the intended account and team, then retry.",retryable:!1,userActionRequired:!0};if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlanRecovery(message,observabilityPlusDenialReason(error),currentTeamPlan(client))?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}var import_error_utils=__toESM(require_dist(),1);import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function isHelpInvocation(argv){let args=argv.slice(2),separator=args.indexOf("--");return args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h")}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let help=isHelpInvocation(client.argv);client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){let flag=arg==="-e"?"--environment":arg;preserved.push(flag),!flag.includes("=")&&suggestionFlagTakesSeparateValue(flag)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}var LINK_FLAGS={...arg_common_default(),...getFlagsSpecification(linkCommand.options)};function getLinkSuggestionArgs(args){let out=[];for(let i=0;i<args.length;i++){let arg=args[i];if(!arg.startsWith("-"))continue;let spec=LINK_FLAGS[normalizeFlagName(arg)],handler=typeof spec=="string"?LINK_FLAGS[spec]:spec,hasSeparateValue=!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-");if(handler===void 0){hasSeparateValue&&suggestionFlagTakesSeparateValue(arg)&&i++;continue}out.push(arg),hasSeparateValue&&handler!==Boolean&&out.push(args[++i])}return out}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkCommand2=buildCommandWithGlobalFlags(argv,"link",packageName,{preserveProject:!0,excludeFlags:["--scope","--team"]});for(let choice of payload.choices){let slug=choice.name;next.push({command:`${linkCommand2} --scope ${slug}`,when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeActionRequired(client,payload),process.exit(exitCode))}function writeActionRequired(client,payload){let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),recordCliError({code:payload.reason}),client.stdout.write(`${JSON.stringify(enriched,null,2)}
8
- `)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function buildInvalidTokenAgentError(client){let source=client.authConfig?.tokenSource;return{status:"error",reason:AGENT_REASON.LOGIN_REQUIRED,message:source==="flag"?"The token passed with --token is not valid.":source==="env"?"The token in VERCEL_TOKEN is not valid.":"The saved login is not valid or has expired.",...getInvalidTokenRecovery(client)}}function outputAgentError(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client),...client.isAgent&&{feedback:{message:"Please send one brief feedback report about this error while helping the user resolve it. Don't delay the user's request for feedback.",command:"Run the 'vercel feedback --help' command to see how to report feedback. Make sure all feedback, including text copied from errors or logs, excludes personal data, account identifiers (e.g., usernames, team IDs, project names), and secrets (e.g., API keys, tokens, env values, credentials)."}}};recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,enriched),client.stdout.write(`${JSON.stringify(enriched,null,2)}
9
- `)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
10
- `),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --query ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --query <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isInvalidTokenError(err)){writeAgentErrorPayloadAndExit(client,buildInvalidTokenAgentError(client),exitCode,variant);return}if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{AGENT_STATUS,AGENT_REASON,getExitCodeForReason,AGENT_ACTION,PRIORITY_PROJECT_ENABLE_COMMAND,BUY_PRO_COMMAND,isProOrEnterprisePlan,buyProFix,targetRecovery,clientObservabilityPlanRecovery,isInvalidTokenApiError,isInvalidTokenError,getErrorRecovery,agentErrorMetadata,trackAgentError,isHelpInvocation,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getLinkSuggestionArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,writeActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,buildInvalidTokenAgentError,outputAgentError,writeAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{printProjectNotFoundError}from"./chunk-ZBJ44DRL.js";import{param}from"./chunk-3G3FQYMW.js";import{detectExplicitScope}from"./chunk-IU6PHFPQ.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputActionRequired,outputAgentError}from"./chunk-KAUKCHQF.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-QZEZCUUZ.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default,require_build_utils}from"./chunk-ZRJKGAUT.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);async function ensureLink(commandName,client,cwd,opts={}){opts.singleFile||(cwd=await resolveProjectCwd(cwd));let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup,skipProjectRootResolution:!!opts.singleFile}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName){let pinnedProjectId=(0,import_build_utils.getPlatformEnv)("PROJECT_ID"),creatable=!opts.projectName.startsWith("prj_")&&!pinnedProjectId;if(!opts.createIfNotFound||opts.projectName.startsWith("prj_")||pinnedProjectId===opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId,{createCommand:creatable?opts.createCommand:void 0}),1;if(pinnedProjectId){let message=`Can't use --project with VERCEL_PROJECT_ID. --project is "${opts.projectName}" and VERCEL_PROJECT_ID is "${pinnedProjectId}". Remove one of them.`,helpCommand=getCommandNamePlain(`${commandName} --help`);return output_manager_default.error(`${message}
8
-
9
- See all options:
10
- ${helpCommand}`),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:helpCommand,when:"see all options"}]}),2}}if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-H36NRP3A.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{ensureLink};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{external_exports}from"./chunk-2NABMKFV.js";import{agentErrorMetadata,getExitCodeForReason,trackAgentError}from"./chunk-KAUKCHQF.js";import{isAPIError}from"./chunk-FXEMEIST.js";import{recordCliError}from"./chunk-ZRJKGAUT.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function recordLine(type,data){return`${JSON.stringify({type,data})}
8
- `}function summaryLine(progress){return`${JSON.stringify({type:"summary",...progress})}
9
- `}function writeJsonError(client,payload,exitCode=getExitCodeForReason(payload.reason)){let{status,reason,message,...rest}=payload,document={status,reason,message:(0,import_strip_ansi.default)(message),...rest,...rest.hint?{hint:(0,import_strip_ansi.default)(rest.hint)}:{},...agentErrorMetadata(client)};return recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,document),client.stderr.write(`${JSON.stringify(document)}
10
- `),exitCode}var MAX_PAGE_SIZE=1e3,QUERY_REASON_HEADER="x-vercel-observability-query-reason",responseSchema=external_exports.object({events:external_exports.array(external_exports.record(external_exports.string(),external_exports.unknown())),pagination:external_exports.object({hasMore:external_exports.boolean(),nextCursor:external_exports.string().nullable()}),meta:external_exports.object({excludedIntervals:external_exports.array(external_exports.object({start:external_exports.string(),end:external_exports.string()})).optional()}).passthrough().optional()}),InvalidEventsResponseError=class extends Error{constructor(){super("The Observability API returned an invalid events response."),this.name="InvalidEventsResponseError"}},RecordTooLargeError=class extends Error{constructor(){super("A single record exceeds the API response size limit and cannot be returned."),this.name="RecordTooLargeError"}};function isResultTooLarge(err){return isAPIError(err)&&err.status===413&&err.code==="result_too_large"}async function fetchEventsPage(client,request,limit,cursor){let body={event:request.event,scope:{ownerId:request.ownerId,...request.projectIds?{projectIds:[...request.projectIds]}:{}},timeRange:{start:request.timeRange.start,end:request.timeRange.end},select:[...request.select],order:request.order??"desc",limit};request.filter&&(body.filter=request.filter),cursor&&(body.cursor=cursor);let params=new URLSearchParams({teamId:request.ownerId}),response=await client.fetch(`/v1/observability/events?${params}`,{method:"POST",headers:{[QUERY_REASON_HEADER]:request.queryReason},body,useCurrentTeam:!1,...request.signal?{signal:request.signal}:{},...request.retry?{retry:request.retry}:{},...request.bailOn429?{bailOn429:!0}:{}}),parsed=responseSchema.safeParse(response);if(!parsed.success)throw new InvalidEventsResponseError;return parsed.data}async function*fetchEventPages(client,request,limit,startCursor){let remaining=limit,maxPageSize=MAX_PAGE_SIZE,cursor=startCursor,lastNextCursor=null;for(;remaining>0;){let pageSize=Math.min(remaining,maxPageSize),response;for(;;){request.signal?.throwIfAborted();try{response=await fetchEventsPage(client,request,pageSize,cursor);break}catch(err){if(!isResultTooLarge(err))throw err;if(pageSize===1)throw new RecordTooLargeError;pageSize=Math.max(1,Math.floor(pageSize/2)),maxPageSize=pageSize}}let events=response.events.slice(0,remaining);remaining-=events.length;let{hasMore,nextCursor}=response.pagination,continues=hasMore&&!!nextCursor&&nextCursor!==cursor;if(lastNextCursor=continues?nextCursor:null,yield{events,excludedIntervals:response.meta?.excludedIntervals??[],nextCursor:lastNextCursor},!continues)return{hasMore,nextCursor:null};cursor=nextCursor??void 0}return{hasMore:!0,nextCursor:lastNextCursor}}function sortIntervals(intervals){return[...intervals].sort((a,b)=>Date.parse(a.start)-Date.parse(b.start)||Date.parse(a.end)-Date.parse(b.end))}export{recordLine,summaryLine,writeJsonError,InvalidEventsResponseError,RecordTooLargeError,fetchEventPages,sortIntervals};
@@ -1,21 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{HOMEBREW_UPGRADE_COMMAND,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-GKUHMS3A.js";import{require_semver}from"./chunk-BPUANOGW.js";import{progress}from"./chunk-U56NHYAH.js";import{require_tar_fs}from"./chunk-WZ2R4Z7N.js";import{require_ci_info}from"./chunk-2EYYB6YN.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{getCachedUsername,require_lib}from"./chunk-QZEZCUUZ.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{pkg_default}from"./chunk-OO572JUC.js";import{fetch,toNodeReadable}from"./chunk-U3J7VS56.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";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(path){return paths.normalize(paths.join(path,"."))}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 path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.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(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.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 path=__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),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir2=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir2,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir2,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.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(path.delimiter).map(s=>path.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(path.delimiter).map(s=>path.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=path.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}});function getWhoamiCachedAnswer(args,authConfig){return args.includes("--cached")?getCachedUsername(authConfig):void 0}var import_semver=__toESM(require_semver(),1);import{spawn,execFile}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return new Promise((resolve3,reject)=>{execFile(command,args,{encoding:"utf8",windowsHide:!0,cwd,timeout:15e3,env:{...env}},(error,stdout)=>{if(error){reject(error);return}resolve3(stdout.toString())})})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
8
- `).reverse()])try{let value=JSON.parse(line),parsed=Array.isArray(value)&&value.length===1?value[0]:value,version=typeof parsed=="string"?parsed:typeof parsed?.data=="string"?parsed.data:void 0;if(version&&import_semver.default.valid(version))return version}catch{let version=line.trim();if(import_semver.default.valid(version))return version}}async function getLatestPackageVersion(packageManager,installArgs,cwd,global,env,bypassMinReleaseAge=!0){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let manager=getUpgradePackageManager(packageManager),queryArgs=[...manager.metadataArgs(packageSpecifier),...bypassMinReleaseAge?manager.releaseAgeBypassArgs:[]];try{let stdout=await execFileStdout(packageManager,queryArgs,cwd,env);return parseVersionOutput(stdout)}catch(error){output_manager_default.debug(`Failed to resolve the latest Vercel CLI version: ${error instanceof Error?error.message:String(error)}`);return}}async function getInstalledPackageVersion(packageManager,installArgs,cwd,global){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let packageName=packageSpecifier.slice(0,-7);try{let stdout=await execFileStdout(packageManager,["list",packageName,"--depth=0","--json",...global?["--global"]:[]],cwd),parsed=JSON.parse(stdout),projects=Array.isArray(parsed)?parsed:[parsed];for(let project of projects){let version=project?.dependencies?.[packageName]?.version??project?.devDependencies?.[packageName]?.version??project?.optionalDependencies?.[packageName]?.version;if(typeof version=="string"&&import_semver.default.valid(version))return version}}catch(error){output_manager_default.debug(`Failed to read the installed Vercel CLI version: ${error instanceof Error?error.message:String(error)}`)}}function isVersionCurrent(current,latest){return import_semver.default.valid(current)&&import_semver.default.valid(latest)?import_semver.default.gte(current,latest):current===latest}function pinPackageVersion(args,version){return args.map(arg=>arg.endsWith("@latest")?`${arg.slice(0,-6)}${version}`:arg)}async function getMinReleaseAgeContext(packageManager,cwd,global){let setting=packageManager==="pnpm"?"minimumReleaseAge":"min-release-age";try{let raw=(await execFileStdout(packageManager,["config","get",setting,"--json",...global?["--global"]:[]],cwd)).trim(),value=raw===""||raw==="undefined"?void 0:JSON.parse(raw);if(!(value==null||value===""||value==="undefined")){let age=typeof value=="number"||typeof value=="string"&&value.trim()!==""?Number(value):NaN;if(!Number.isFinite(age)||age<0)return`Could not determine ${packageManager}'s configured minimum release age.`;let minutes=packageManager==="pnpm"?age:age*1440,duration=minutes>0&&minutes%60===0?`${minutes/60} ${minutes===60?"hour":"hours"}`:`${minutes} ${minutes===1?"minute":"minutes"}`;return`${packageManager} ${setting} is configured to ${duration}.`}if(packageManager==="pnpm"){let version=parseVersionOutput(await execFileStdout(packageManager,["--version"],cwd));if(version&&!import_semver.default.prerelease(version)&&import_semver.default.gte(version,"11.0.0"))return`pnpm ${version} defaults to a minimum release age of 24 hours (1440 minutes); no explicit minimumReleaseAge setting was reported.`}return`${packageManager} did not report a configured minimum release age.`}catch{return`Could not determine ${packageManager}'s configured minimum release age.`}}function isMinReleaseAgeError(packageManager,stdout,stderr){let installerOutput=`${stdout}
9
- ${stderr}`;return packageManager==="pnpm"?installerOutput.includes("ERR_PNPM_NO_MATURE_MATCHING_VERSION")||installerOutput.includes("ERR_PNPM_NO_MATCHING_VERSION")&&installerOutput.includes("satisfies the specs but was released at"):packageManager==="npm"?/\bETARGET\b/.test(installerOutput)&&installerOutput.includes("with a date before")||/min-release-age cannot be provided/i.test(installerOutput):!1}function setMinReleaseAgeBypass(client,enabled){client.config={...client.config,updates:{...client.config.updates,bypassMinReleaseAge:enabled}},client.writeToConfigFile()}async function executeHomebrewUpgrade(env=trustedUpgradeEnvironment){let[brew,...args]=HOMEBREW_UPGRADE_COMMAND.split(" ");output_manager_default.debug(`Executing: ${HOMEBREW_UPGRADE_COMMAND}`);let result=await new Promise(resolve3=>{let settled=!1,brewProcess=spawn(brew,args,{cwd:trustedUpgradeDirectory,env:{...env},stdio:"inherit",shell:!1});brewProcess.on("error",spawnError=>{settled||(settled=!0,resolve3({code:1,spawnError}))}),brewProcess.on("close",code=>{settled||(settled=!0,resolve3({code:code??1}))})});return result.spawnError?(output_manager_default.error(`Failed to run Homebrew: ${result.spawnError.message}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`),1):(result.code!==0&&(output_manager_default.error(`Homebrew upgrade failed with exit code ${result.code}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`)),result.code)}function executeAutomaticUpgrade(client,env=trustedUpgradeEnvironment){return executeUpgrade("latest",client,!1,!0,env,"package-manager")}async function executeUpgrade(targetVersion,client,bypassMinReleaseAge=!1,explicitTarget=!1,env=trustedUpgradeEnvironment,releaseAgePolicy="newest"){let totalSteps=targetVersion?2:3;renderUpgradeProgress(0,totalSteps,"Resolving installer\u2026");let{command:updateCommand,global,packageManager}=await getUpdateCommandInfo(env).catch(error=>{throw output_manager_default.stopSpinner(),error}),[command,...args]=updateCommand.split(" "),cwd=global?trustedUpgradeDirectory:process.cwd(),bypassArgs=getUpgradePackageManager(packageManager).releaseAgeBypassArgs;if(bypassMinReleaseAge&&bypassArgs.length===0)return output_manager_default.stopSpinner(),output_manager_default.error(`Minimum release-age bypass is not supported for ${packageManager}. Run the upgrade without --bypass-min-release-age, or configure release-age settings in ${packageManager} directly.`),1;bypassMinReleaseAge&&client&&client.config.updates?.bypassMinReleaseAge!==!0&&setMinReleaseAgeBypass(client,!0);let versionBefore=pkg_default.version,installLatestTag=explicitTarget&&targetVersion==="latest",resolvedTargetVersion=installLatestTag?void 0:targetVersion;if(targetVersion||(renderUpgradeProgress(1,totalSteps,"Checking for updates\u2026"),resolvedTargetVersion=await getLatestPackageVersion(packageManager,args,cwd,global,env,releaseAgePolicy==="newest")),!resolvedTargetVersion&&!installLatestTag)return output_manager_default.stopSpinner(),output_manager_default.error("Failed to resolve the latest Vercel CLI version."),1;if(!explicitTarget&&resolvedTargetVersion&&isVersionCurrent(versionBefore,resolvedTargetVersion))return renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.log(`No upgrade available. Vercel CLI is already up to date (v${versionBefore}).`),0;let installArgs=resolvedTargetVersion?pinPackageVersion(args,resolvedTargetVersion):args,shouldBypass=releaseAgePolicy==="newest"&&bypassArgs.length>0&&(bypassMinReleaseAge||client?.config.updates?.bypassMinReleaseAge===!0);shouldBypass&&(installArgs=[...installArgs,...bypassArgs]);let runInstall=currentArgs=>{let installCommand=[command,...currentArgs].join(" ");return output_manager_default.debug(`Executing: ${installCommand} (cwd: ${cwd})`),new Promise(resolve3=>{let stdout=[],stderr=[],upgradeProcess=spawn(command,currentArgs,{cwd,env:{...env},stdio:["inherit","pipe","pipe"],shell:!1});upgradeProcess.stdout?.on("data",data=>{stdout.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stdout] ${data.toString().trimEnd()}`)}),upgradeProcess.stderr?.on("data",data=>{stderr.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stderr] ${data.toString().trimEnd()}`)});let settled=!1;upgradeProcess.on("error",spawnError=>{settled||(settled=!0,resolve3({code:1,stdout:"",stderr:"",spawnError}))}),upgradeProcess.on("close",code=>{settled||(settled=!0,resolve3({code:code??1,stdout:Buffer.concat(stdout).toString(),stderr:Buffer.concat(stderr).toString()}))})})};renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026");let result=await runInstall(installArgs),usedAllowedRelease=!1;if(result.code!==0&&!result.spawnError&&releaseAgePolicy==="newest"&&!shouldBypass&&bypassArgs.length>0&&isMinReleaseAgeError(packageManager,result.stdout,result.stderr)){let context=await getMinReleaseAgeContext(packageManager,cwd,global);output_manager_default.stopSpinner();let blockedMessage=`The package manager blocked this Vercel CLI release because of its minimum release-age setting. ${context}`;if(!client||client.nonInteractive||!client.stdin.isTTY)return output_manager_default.error(`${blockedMessage}
10
- To install the newest release allowed by your settings:
11
- vc upgrade latest
12
- To bypass the minimum release age for this and future foreground upgrades:
13
- vc upgrade --bypass-min-release-age`),1;output_manager_default.print(`! ${blockedMessage}
14
- `);let action=await client.input.select({message:"Which upgrade option?",choices:[{name:"Install the newest release allowed by my settings",value:"allowed"},{name:"Bypass the minimum release age for this and future foreground upgrades",value:"bypass"},{name:"Cancel",value:"cancel"}],default:"allowed"});if(action==="allowed")resolvedTargetVersion=void 0,installArgs=args,usedAllowedRelease=!0;else if(action==="bypass")setMinReleaseAgeBypass(client,!0),output_manager_default.log("To restore release-age checks, run `vc upgrade --no-bypass-min-release-age`."),installArgs=[...installArgs,...bypassArgs];else return output_manager_default.log("Upgrade canceled."),0;renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026"),result=await runInstall(installArgs)}return result.spawnError?(output_manager_default.stopSpinner(),output_manager_default.error(`Failed to execute upgrade command: ${result.spawnError.message}`),output_manager_default.log(`You can try running the command manually: ${[command,...installArgs].join(" ")}`),1):result.code!==0?(output_manager_default.stopSpinner(),result.stdout&&output_manager_default.print(result.stdout),result.stderr&&output_manager_default.print(result.stderr),output_manager_default.error(`Upgrade failed with exit code ${result.code}`),output_manager_default.log(`You can try running the command manually: ${[command,...installArgs].join(" ")}`),result.code):usedAllowedRelease&&(resolvedTargetVersion=await getInstalledPackageVersion(packageManager,args,cwd,global),resolvedTargetVersion===versionBefore)?(output_manager_default.stopSpinner(),output_manager_default.log(`Vercel CLI remains at v${versionBefore} under your package manager settings.`),0):(renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.success(resolvedTargetVersion?`Upgraded Vercel CLI to v${resolvedTargetVersion}.`:"Upgraded Vercel CLI."),0)}var import_semver3=__toESM(require_semver(),1),import_ci_info=__toESM(require_ci_info(),1),import_xdg_app_paths=__toESM(require_xdg_app_paths(),1),import_fs_extra=__toESM(require_lib(),1);import{randomUUID as randomUUID3}from"node:crypto";import{mkdir as mkdir4,rename as rename4,rm as rm4,writeFile as writeFile4}from"node:fs/promises";import{dirname as dirname2,isAbsolute,relative as relative2,resolve as resolve2}from"node:path";import{createHash,randomUUID}from"node:crypto";import{dirname}from"node:path";import{link,mkdir,readFile,rename,rm,writeFile}from"node:fs/promises";var DEFAULT_WAIT_MS=3e4,DEFAULT_RETRY_MS=50,RELEASE_OWNER_CHECK_ATTEMPTS=3,RELEASE_OWNER_CHECK_RETRY_MS=10;async function readOwnerRaw(lockPath){let value=JSON.parse(await readFile(lockPath,"utf8"));if(!(typeof value.token!="string"||value.token.length===0||!Number.isSafeInteger(value.pid)||(value.pid??0)<=0||typeof value.createdAt!="number"||!Number.isFinite(value.createdAt)||value.createdAt<=0))return value}async function readOwner(lockPath){try{return await readOwnerRaw(lockPath)}catch{return}}async function stillOwnsLock(ownerPath,token){for(let attempt=0;;attempt++)try{return(await readOwnerRaw(ownerPath))?.token===token}catch(error){if(error.code==="ENOENT")return!1;if(attempt>=RELEASE_OWNER_CHECK_ATTEMPTS-1)return!0;await new Promise(resolve3=>setTimeout(resolve3,RELEASE_OWNER_CHECK_RETRY_MS))}}function processExists(pid){try{return process.kill(pid,0),!0}catch(error){return error.code==="EPERM"}}async function moveAbandonedDirectoryLock(lockPath,abandonedAfterMs){let owner=await readOwner(`${lockPath}/owner.json`);if(!owner||Date.now()-owner.createdAt<abandonedAfterMs||processExists(owner.pid))return!1;let generation=createHash("sha256").update(owner.token).digest("hex"),tombstone=`${lockPath}.abandoned-${generation}`;try{return await rename(lockPath,tombstone),!0}catch(error){if(isContentionError(error,["ENOENT","EEXIST","ENOTEMPTY"]))return!1;throw error}}function isContentionError(error,expectedCodes){let code=error.code;return!!(code&&expectedCodes.includes(code)||process.platform==="win32"&&code==="EPERM")}async function waitForRetry(startedAt,lockPath,{waitMs,retryMs,busyMessage}){if(waitMs===0||Date.now()-startedAt>=waitMs)throw new Error(busyMessage(lockPath,waitMs!==0));await new Promise(resolveTimeout=>setTimeout(resolveTimeout,Math.min(retryMs,waitMs)))}async function withFileLock(lockPath,action,{waitMs=DEFAULT_WAIT_MS,retryMs=DEFAULT_RETRY_MS,busyMessage}){await mkdir(dirname(lockPath),{recursive:!0});let owner={token:randomUUID(),pid:process.pid,createdAt:Date.now()},claim=`${lockPath}.claim-${owner.token}`,released=`${lockPath}.released-${owner.token}`,startedAt=Date.now(),acquired=!1;await writeFile(claim,`${JSON.stringify(owner)}
15
- `,{flag:"wx"});try{for(;;)try{await link(claim,lockPath),acquired=!0;break}catch(error){if(!isContentionError(error,["EEXIST"]))throw error;await waitForRetry(startedAt,lockPath,{waitMs,retryMs,busyMessage})}return await rm(claim,{force:!0}).catch(()=>{}),await action()}finally{acquired&&await stillOwnsLock(lockPath,owner.token)&&(await rename(lockPath,released).then(()=>!0).catch(()=>!1)?await rm(released,{force:!0}):await rm(lockPath,{force:!0})),await rm(claim,{force:!0})}}async function withDirectoryLock(lockPath,action,{waitMs=DEFAULT_WAIT_MS,retryMs=DEFAULT_RETRY_MS,busyMessage,abandonedAfterMs}){await mkdir(dirname(lockPath),{recursive:!0});let owner={token:randomUUID(),pid:process.pid,createdAt:Date.now()},claim=`${lockPath}.claim-${owner.token}`,ownerPath=`${claim}/owner.json`,startedAt=Date.now(),acquired=!1;await mkdir(claim),await writeFile(ownerPath,`${JSON.stringify(owner)}
16
- `);try{for(;;)try{await rename(claim,lockPath),acquired=!0;break}catch(error){if(!isContentionError(error,["EEXIST","ENOTEMPTY"]))throw error;if(abandonedAfterMs!==void 0&&await moveAbandonedDirectoryLock(lockPath,abandonedAfterMs))continue;await waitForRetry(startedAt,lockPath,{waitMs,retryMs,busyMessage})}return await action()}finally{if(acquired&&await stillOwnsLock(`${lockPath}/owner.json`,owner.token)){let released=`${lockPath}.released-${owner.token}`;await rename(lockPath,released).then(()=>!0).catch(()=>!1)?await rm(released,{recursive:!0,force:!0}):await rm(lockPath,{recursive:!0,force:!0})}await rm(claim,{recursive:!0,force:!0})}}var import_tar_fs=__toESM(require_tar_fs(),1),import_semver2=__toESM(require_semver(),1);import{createGunzip}from"node:zlib";import{createHash as createHash2}from"node:crypto";import{createWriteStream}from"node:fs";import{tmpdir}from"node:os";import{join as join2,sep as sep2}from"node:path";import{pipeline}from"node:stream/promises";import{chmod,copyFile,mkdir as mkdir3,mkdtemp,realpath,rename as rename3,rm as rm3,stat as stat2,writeFile as writeFile3}from"node:fs/promises";import{randomUUID as randomUUID2}from"node:crypto";import{join,relative,resolve,sep}from"node:path";import{mkdir as mkdir2,readFile as readFile2,readlink,rename as rename2,rm as rm2,stat,symlink,writeFile as writeFile2}from"node:fs/promises";var SLOTS=["a","b"],LOCK_RETRY_MS=50;function tracksDir(root){return join(root,"versions","tracks")}function slotDir(root,track,slot){return join(tracksDir(root),track,slot)}function isTrack(value){return value==="production"||value==="pr"}function isSlot(value){return value==="a"||value==="b"}async function atomicSymlink(target,path){let temporary=`${path}.tmp-${randomUUID2()}`;await symlink(target,temporary);try{await rename2(temporary,path)}catch(error){throw await rm2(temporary,{force:!0}),error}}async function atomicWrite(path,contents){let temporary=`${path}.tmp-${randomUUID2()}`;await writeFile2(temporary,contents);try{await rename2(temporary,path)}catch(error){throw await rm2(temporary,{force:!0}),error}}async function readSlotMetadata(root,track,slot){try{let value=JSON.parse(await readFile2(join(slotDir(root,track,slot),"metadata.json"),"utf8"));return value.track!==track||value.slot!==slot||typeof value.version!="string"?void 0:value}catch{return}}async function readPointer(root,path){try{let target=resolve(root,await readlink(path)),rel=relative(tracksDir(root),target).split(sep);return rel.length!==2||!isTrack(rel[0])||!isSlot(rel[1])?void 0:{track:rel[0],slot:rel[1]}}catch{return}}async function readActivePointer(root){return readPointer(root,join(root,"active"))}async function readTrackPointer(root,track){try{let slot=(await readlink(join(tracksDir(root),track,"active"))).split(sep).pop();return slot&&isSlot(slot)?slot:void 0}catch{return}}async function readNativeInstallState(root){let pointer=await readActivePointer(root);if(!pointer)return;let active=await readSlotMetadata(root,pointer.track,pointer.slot);if(!active)return;let pendingProduction;try{let pending=JSON.parse(await readFile2(join(root,"pending-production.json"),"utf8"));pending.slot&&isSlot(pending.slot)&&pending.version&&(await readSlotMetadata(root,"production",pending.slot))?.version===pending.version&&!(pointer.track==="production"&&pointer.slot===pending.slot)&&(pendingProduction={slot:pending.slot,version:pending.version})}catch{}return{...active,pendingProduction}}async function ensureNativeBinLinks(root){let bin=join(root,"bin");await mkdir2(bin,{recursive:!0});for(let name of["vercel","vc"]){let path=join(bin,name),expected=join("..","active","vercel");await readlink(path).catch(()=>{})!==expected&&await atomicSymlink(expected,path)}}async function markPendingProduction(root,slot,version){await atomicWrite(join(root,"pending-production.json"),`${JSON.stringify({slot,version})}
17
- `)}async function activateSlot(root,track,slot){let metadata=await readSlotMetadata(root,track,slot),binary=await stat(join(slotDir(root,track,slot),"vercel")).catch(()=>{});if(!metadata||!binary?.isFile())throw new Error(`Cannot activate incomplete ${track}/${slot} slot`);let trackDir=join(tracksDir(root),track);await mkdir2(trackDir,{recursive:!0}),await atomicSymlink(slot,join(trackDir,"active")),await atomicSymlink(relative(root,slotDir(root,track,slot)),join(root,"active")),track==="production"&&await rm2(join(root,"pending-production.json"),{force:!0}),await ensureNativeBinLinks(root)}async function getInactiveSlot(root,track){let active=await readActivePointer(root);return(active?.track===track?active.slot:await readTrackPointer(root,track))==="a"?"b":"a"}async function writeTrackSlot(root,metadata,prepare,{signal}={}){signal?.throwIfAborted();let slot=await getInactiveSlot(root,metadata.track),trackDir=join(tracksDir(root),metadata.track),destination=slotDir(root,metadata.track,slot),temporary=join(trackDir,`.slot-${slot}-${randomUUID2()}`),backup=join(trackDir,`.old-${slot}-${randomUUID2()}`);signal?.throwIfAborted(),await mkdir2(temporary,{recursive:!0});try{if(signal?.throwIfAborted(),await prepare(temporary),signal?.throwIfAborted(),!(await stat(join(temporary,"vercel")).catch(()=>{}))?.isFile())throw new Error("Prepared slot does not contain a Vercel CLI binary");signal?.throwIfAborted(),await atomicWrite(join(temporary,"metadata.json"),`${JSON.stringify({...metadata,slot})}
18
- `),signal?.throwIfAborted();let hadDestination=!1;try{await rename2(destination,backup),hadDestination=!0}catch(error){if(error.code!=="ENOENT")throw error}try{signal?.throwIfAborted(),await rename2(temporary,destination)}catch(error){throw hadDestination&&await rename2(backup,destination).catch(()=>{}),error}return hadDestination&&await rm2(backup,{recursive:!0,force:!0}),slot}finally{await rm2(temporary,{recursive:!0,force:!0})}}async function withNativeInstallLock(root,action,{wait=!0,waitMs=3e4}={}){let lock=join(root,"update.lock");return withFileLock(lock,action,{waitMs:wait?waitMs:0,retryMs:LOCK_RETRY_MS,busyMessage:(path,timedOut)=>timedOut?`Timed out waiting for another Vercel CLI update. If no update is running, remove the lock at ${path} and retry.`:"Native update already in progress"})}async function listNativeTrackSlots(root){let installed=[];for(let track of["production","pr"])for(let slot of SLOTS){let metadata=await readSlotMetadata(root,track,slot),binary=await stat(join(slotDir(root,track,slot),"vercel")).catch(()=>{});metadata&&binary?.isFile()&&installed.push(metadata)}return installed}var REGISTRY="https://registry.npmjs.org";function discardResponseBody(response){response.body?.cancel().catch(()=>{})}async function moveFile(source,destination){try{await rename3(source,destination)}catch(err){if(err.code!=="EXDEV")throw err;await copyFile(source,destination),await rm3(source,{force:!0})}}var CURL_INSTALL_COMMAND="curl -fsSL https://api-frameworks.vercel.sh/install | bash",SUPPORTED_PLATFORMS=new Set(["darwin-arm64","darwin-x64","linux-arm64","linux-arm64-musl","linux-x64","linux-x64-musl"]);function isMuslRuntime(){if(process.platform!=="linux")return!1;try{let report=process.report?.getReport();return report!==void 0&&!report.header?.glibcVersionRuntime}catch{return!1}}function platformTarget(){let target=`${process.platform}-${process.arch}`;return isMuslRuntime()?`${target}-musl`:target}function isSupportedPlatform(){return SUPPORTED_PLATFORMS.has(platformTarget())}function unsupportedPlatformMessage(){let supported=Array.from(SUPPORTED_PLATFORMS).join(", ");return`The native Vercel CLI binary is not available for your platform (${platformTarget()}). Supported platforms: ${supported}. You can install the CLI with a package manager instead: npm i -g vercel@latest`}function nativePackageSuffix(){return`vc-native-${platformTarget()}`}function getNativePackageName(){return`@vercel/${nativePackageSuffix()}`}async function isCurlInstall(){if(!isNativeBinaryInstall())return!1;let root=getInstallRoot(),managedPrefixes=[join2(root,"versions")+sep2];if(managedPrefixes.some(prefix=>process.execPath.startsWith(prefix)))return!0;try{let real=await realpath(process.execPath);return managedPrefixes.some(prefix=>real.startsWith(prefix))}catch{return!1}}async function resolveLatestVersion(pkgName,{signal}={}){let res=await fetch(`${REGISTRY}/${pkgName}/latest`,{signal});if(!res.ok)throw discardResponseBody(res),new Error(`Failed to fetch package metadata from the npm registry (HTTP ${res.status})`);let manifest=await res.json();if(!manifest.version||!import_semver2.default.valid(manifest.version))throw new Error("Could not resolve the latest native binary version");return manifest.version}async function resolveLatestNativeVersion(options){return resolveLatestVersion(getNativePackageName(),options)}async function listAvailableVersions(pkgName){let res=await fetch(`${REGISTRY}/${pkgName}`,{headers:{accept:"application/vnd.npm.install-v1+json"}});if(!res.ok)throw new Error(`Failed to fetch package metadata from the npm registry (HTTP ${res.status})`);let manifest=await res.json();return Object.keys(manifest.versions??{}).filter(v=>import_semver2.default.valid(v)).sort(import_semver2.default.rcompare)}async function downloadAndExtractBinary(version,destination,{signal}={}){if(!isSupportedPlatform())throw new Error(unsupportedPlatformMessage());let suffix=nativePackageSuffix(),tarballUrl=`${REGISTRY}/@vercel/${suffix}/-/${suffix}-${version}.tgz`,res=await fetch(tarballUrl,{signal});if(res.status===404)throw discardResponseBody(res),new Error(`No native binary is available for Vercel CLI v${version} on ${platformTarget()}. Older versions may predate native binary builds. You can install that version with a package manager instead: npm i -g vercel@${version}`);if(!res.ok)throw discardResponseBody(res),new Error(`Failed to download ${tarballUrl} (HTTP ${res.status})`);let tmpDir=await mkdtemp(join2(tmpdir(),"vercel-upgrade-"));try{await pipeline(toNodeReadable(res.body),createGunzip(),import_tar_fs.default.extract(tmpDir,{ignore:(_name,header)=>header?.type!=="file"&&header?.type!=="directory"}),{signal}),signal?.throwIfAborted();let binary=join2(tmpDir,"package","bin","vercel");if(!(await stat2(binary).catch(()=>null))?.isFile())throw new Error("Downloaded tarball did not contain the expected binary (package/bin/vercel)");signal?.throwIfAborted(),await mkdir3(destination,{recursive:!0}),await chmod(binary,493),await moveFile(binary,join2(destination,"vercel"))}finally{await rm3(tmpDir,{recursive:!0,force:!0})}}var PR_BINARIES_URL=process.env.VERCEL_PR_BINARIES_URL||"https://api-frameworks.vercel.sh/pr-binaries";function parsePrTarget(target){let match=/^pr[/-](\d+)$/i.exec(target.trim());if(!match)return;let pr=Number(match[1]);return Number.isSafeInteger(pr)&&pr>0?pr:void 0}async function fetchPrBuildSha(pr){let url=`${PR_BINARIES_URL}/${pr}/current-sha`,res=await fetch(url);if(res.status===404)throw new Error(`Couldn't find a binary for PR #${pr}. The current-sha pointer is not published yet.`);if(!res.ok)throw new Error(`Failed to fetch the current build for PR #${pr} (HTTP ${res.status}).`);let sha=(await res.text()).trim().toLowerCase();if(!/^[0-9a-f]{40}$/.test(sha))throw new Error(`Unexpected build SHA format for PR #${pr}.`);return sha}function missingPrPlatformMessage(pr,buildSha){let platform=platformTarget(),shortSha=buildSha.slice(0,12);return`Couldn't find a ${platform} binary for PR #${pr} (${shortSha}). This SHA exists, but this platform isn't ready yet.`}function getPrBinaryBaseUrl(pr,buildSha){return`${PR_BINARIES_URL}/${pr}/shas/${buildSha}`}async function fetchPrChecksum(pr,buildSha){let url=`${getPrBinaryBaseUrl(pr,buildSha)}/vercel-${platformTarget()}.sha256`,res=await fetch(url);if(res.status===404)throw new Error(missingPrPlatformMessage(pr,buildSha));if(!res.ok)throw new Error(`Failed to fetch the checksum for PR #${pr} (HTTP ${res.status}).`);let sha=(await res.text()).trim().split(/\s+/)[0]?.toLowerCase();if(!/^[0-9a-f]{64}$/.test(sha??""))throw new Error(`Unexpected checksum format for PR #${pr}.`);return sha}async function downloadPrBinary(pr,buildSha,expectedSha,destination){if(!isSupportedPlatform())throw new Error(unsupportedPlatformMessage());let url=`${getPrBinaryBaseUrl(pr,buildSha)}/vercel-${platformTarget()}`,res=await fetch(url);if(res.status===404)throw new Error(missingPrPlatformMessage(pr,buildSha));if(!res.ok)throw new Error(`Failed to download ${url} (HTTP ${res.status})`);let tmpDir=await mkdtemp(join2(tmpdir(),"vercel-pr-"));try{let tmpBinary=join2(tmpDir,"vercel"),hash=createHash2("sha256"),body=toNodeReadable(res.body);body.on("data",chunk=>hash.update(chunk)),await pipeline(body,createWriteStream(tmpBinary));let actualSha=hash.digest("hex");if(actualSha!==expectedSha)throw new Error(`Checksum mismatch for PR #${pr} binary. The build may have been updated mid-download; try again.`);await mkdir3(destination,{recursive:!0}),await chmod(tmpBinary,493),await moveFile(tmpBinary,join2(destination,"vercel")),await writeFile3(join2(destination,"vercel.sha256"),`${actualSha}
19
- `)}finally{await rm3(tmpDir,{recursive:!0,force:!0})}}async function findTrackSlot(track,matches){let root=getInstallRoot();for(let slot of["a","b"]){let metadata=await readSlotMetadata(root,track,slot),binary=await stat2(join2(root,"versions","tracks",track,slot,"vercel")).catch(()=>{});if(metadata&&binary?.isFile()&&matches(metadata))return slot}}async function findNewestProductionSlotAtLeast(version){let root=getInstallRoot(),newest;for(let slot of["a","b"]){let metadata=await readSlotMetadata(root,"production",slot),binary=await stat2(join2(root,"versions","tracks","production",slot,"vercel")).catch(()=>{});metadata&&binary?.isFile()&&import_semver2.default.valid(metadata.version)&&import_semver2.default.gte(metadata.version,version)&&(!newest||import_semver2.default.gt(metadata.version,newest.version))&&(newest={slot,version:metadata.version})}return newest}async function installAndActivateProductionVersion(version){let root=getInstallRoot();return withNativeInstallLock(root,async()=>{let existing=await findTrackSlot("production",metadata=>metadata.version===version);if(existing)return await activateSlot(root,"production",existing),{slot:existing,downloaded:!1};output_manager_default.spinner(`Downloading Vercel CLI v${version}\u2026`,0);let slot=await writeTrackSlot(root,{track:"production",version},directory=>downloadAndExtractBinary(version,directory));return await activateSlot(root,"production",slot),{slot,downloaded:!0}})}async function installAndActivatePrBinary(pr){let root=getInstallRoot();return withNativeInstallLock(root,async()=>{output_manager_default.spinner(`Checking latest build for PR #${pr}\u2026`,0);let buildSha=await fetchPrBuildSha(pr),remoteSha=await fetchPrChecksum(pr,buildSha),existing=await findTrackSlot("pr",metadata=>metadata.pr===pr&&metadata.buildSha===buildSha);if(existing)return await activateSlot(root,"pr",existing),{updated:!1,buildSha,slot:existing};output_manager_default.spinner(`Downloading Vercel CLI build for PR #${pr}\u2026`,0);let slot=await writeTrackSlot(root,{track:"pr",version:`pr/${pr}`,pr,buildSha},async directory=>{await downloadPrBinary(pr,buildSha,remoteSha,directory),await writeFile3(join2(directory,"build-sha"),`${buildSha}
20
- `)});return await activateSlot(root,"pr",slot),{updated:!0,buildSha,slot}})}async function stageProductionUpdate(version,selectProduction=!1,options={}){let root=getInstallRoot();return withNativeInstallLock(root,async()=>{options.signal?.throwIfAborted();let active=await readActivePointer(root);options.signal?.throwIfAborted();let activated=selectProduction||active?.track!=="pr",installed=await findNewestProductionSlotAtLeast(version);if(options.signal?.throwIfAborted(),installed)return await markPendingProduction(root,installed.slot,installed.version),activated&&(options.signal?.throwIfAborted(),await activateSlot(root,"production",installed.slot)),{slot:installed.slot,downloaded:!1,activated};let slot=await writeTrackSlot(root,{track:"production",version},directory=>downloadAndExtractBinary(version,directory,options),options);return options.signal?.throwIfAborted(),await markPendingProduction(root,slot,version),activated&&(options.signal?.throwIfAborted(),await activateSlot(root,"production",slot)),{slot,downloaded:!0,activated}},{wait:!1})}import{spawn as spawn2}from"node:child_process";var NATIVE_UPDATE_CHILD_ENV="VERCEL_NATIVE_UPDATE_CHILD",NATIVE_UPDATE_VERSION_ENV="VERCEL_NATIVE_UPDATE_VERSION",NATIVE_UPDATE_SELECT_PRODUCTION_ENV="VERCEL_NATIVE_UPDATE_SELECT_PRODUCTION";function isNativeUpdateChild(){return process.env[NATIVE_UPDATE_CHILD_ENV]==="1"}function spawnDetachedUpdate(env){let child=spawn2(process.execPath,["version","check"],{detached:!0,stdio:"ignore",windowsHide:!0,env});child.on("error",()=>{}),child.unref()}function spawnNativeUpdateCheck(){let env={...process.env,[NATIVE_UPDATE_CHILD_ENV]:"1",[NATIVE_UPDATE_SELECT_PRODUCTION_ENV]:"0"};delete env[NATIVE_UPDATE_VERSION_ENV],spawnDetachedUpdate(env)}function spawnNativeUpdateChild(version,selectProduction){spawnDetachedUpdate({...process.env,[NATIVE_UPDATE_CHILD_ENV]:"1",[NATIVE_UPDATE_VERSION_ENV]:version,[NATIVE_UPDATE_SELECT_PRODUCTION_ENV]:selectProduction?"1":"0"})}var NATIVE_UPDATE_CHECK_INTERVAL=1e3*60*60*24,NATIVE_UPDATE_DISCOVERY_LEASE=1e3*60;function isNativeAutoUpdateEnabled(config){return config.updates?.auto!==!1}var CACHE_LOCK_RETRY_MS=10,CACHE_LOCK_ABANDONED_MS=1e4;function getNativeUpdateCacheFile(cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache()){let packageName=getNativePackageName().replaceAll("/","-");return resolve2(cacheDir,"package-updates",`${packageName}-latest.json`)}function readNativeUpdateCache(cacheDir){try{let cache=(0,import_fs_extra.readJSONSync)(getNativeUpdateCacheFile(cacheDir));if(typeof cache?.expireAt=="number"&&(cache.version===void 0||typeof cache.version=="string"&&import_semver3.default.valid(cache.version)))return cache}catch{}}async function atomicWriteCache(cacheDir,cache){let cacheFile=getNativeUpdateCacheFile(cacheDir);await mkdir4(dirname2(cacheFile),{recursive:!0});let temporary=`${cacheFile}.tmp-${randomUUID3()}`;await writeFile4(temporary,`${JSON.stringify(cache)}
21
- `);try{await rename4(temporary,cacheFile)}catch(error){throw await rm4(temporary,{force:!0}),error}}async function withNativeUpdateCacheLock(cacheDir,action,{waitMs=5e3}={}){let lock=`${getNativeUpdateCacheFile(cacheDir)}.lock`;await withDirectoryLock(lock,action,{waitMs,retryMs:CACHE_LOCK_RETRY_MS,abandonedAfterMs:CACHE_LOCK_ABANDONED_MS,busyMessage:path=>`Timed out waiting for the native update cache. If no Vercel update is running, remove the lock at ${path} and retry.`})}async function cacheNativeUpdateVersion(version,{cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),now=Date.now(),selectProduction=!1}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let existing=readNativeUpdateCache(cacheDir),keepNewerExisting=!!(existing?.version&&import_semver3.default.gt(existing.version,version)),nextVersion=keepNewerExisting?existing?.version:version,shouldSelectProduction=selectProduction||existing?.selectProduction===!0,staged=shouldSelectProduction?!1:keepNewerExisting||existing?.version===version?existing?.staged===!0:!1;await atomicWriteCache(cacheDir,{expireAt:now+NATIVE_UPDATE_CHECK_INTERVAL,selectProduction:shouldSelectProduction,staged,version:nextVersion})})}async function cacheNativeUpdateDiscoveryAttempt({cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),now=Date.now()}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let existing=readNativeUpdateCache(cacheDir);await atomicWriteCache(cacheDir,{...existing,discoveryStartedAt:now,expireAt:now+NATIVE_UPDATE_CHECK_INTERVAL,staged:existing?.selectProduction===!0?existing.staged===!0:!0})})}async function restoreNativeUpdateAfterDiscoveryFailure({cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache()}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let cache=readNativeUpdateCache(cacheDir);cache?.version&&await atomicWriteCache(cacheDir,{...cache,discoveryStartedAt:void 0,staged:!1})})}async function markNativeUpdateStaged(version,{cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),selectedProduction=!1}={}){await withNativeUpdateCacheLock(cacheDir,async()=>{let cache=readNativeUpdateCache(cacheDir);cache?.version===version&&(cache.selectProduction!==!0||selectedProduction)&&await atomicWriteCache(cacheDir,{...cache,discoveryStartedAt:void 0,selectProduction:!1,staged:!0})})}function isWithinInstallRoot(executablePath,installRoot){let pathFromRoot=relative2(resolve2(installRoot),resolve2(executablePath));return pathFromRoot!==""&&pathFromRoot!==".."&&!pathFromRoot.startsWith(`..${process.platform==="win32"?"\\":"/"}`)&&!isAbsolute(pathFromRoot)}function scheduleNativeAutoUpdate(client,exitCode,{cacheDir=(0,import_xdg_app_paths.default)("com.vercel.cli").cache(),executablePath=process.execPath,installRoot=getInstallRoot(),now=Date.now()}={}){if(exitCode!==0||import_ci_info.default.isCI||client.isAgent||client.nonInteractive||isNativeUpdateChild()||!isNativeBinaryInstall()||!isWithinInstallRoot(executablePath,installRoot))return;let cache=readNativeUpdateCache(cacheDir);if(!isNativeAutoUpdateEnabled(client.config)&&cache?.selectProduction!==!0)return;if(!cache?.expireAt||cache.expireAt<=now){spawnNativeUpdateCheck();return}let abandonedDiscovery=!!(cache.version&&cache.staged===!0&&cache.discoveryStartedAt&&cache.discoveryStartedAt+NATIVE_UPDATE_DISCOVERY_LEASE<=now);cache.version&&(cache.staged!==!0||abandonedDiscovery)&&spawnNativeUpdateChild(cache.version,cache.selectProduction===!0)}var import_ci_info2=__toESM(require_ci_info(),1);function isAutoUpdateEnabled(config){return config.updates?.auto===!0}function hasAutoUpdatePreference(config){return typeof config.updates?.auto=="boolean"}function setAutoUpdate(client,enabled){client.config={...client.config,updates:{...client.config.updates,auto:enabled}},client.writeToConfigFile()}async function canAutoUpdate(client,exitCode,command){return isNativeBinaryInstall()||!isAutoUpdateEnabled(client.config)||exitCode!==0||import_ci_info2.default.isCI||client.nonInteractive||client.isAgent||command==="upgrade"?!1:isGlobal()}export{require_xdg_app_paths,getWhoamiCachedAnswer,pinPackageVersion,setMinReleaseAgeBypass,executeHomebrewUpgrade,executeAutomaticUpgrade,executeUpgrade,withDirectoryLock,readActivePointer,readNativeInstallState,listNativeTrackSlots,CURL_INSTALL_COMMAND,isCurlInstall,resolveLatestNativeVersion,listAvailableVersions,parsePrTarget,installAndActivateProductionVersion,installAndActivatePrBinary,stageProductionUpdate,NATIVE_UPDATE_VERSION_ENV,NATIVE_UPDATE_SELECT_PRODUCTION_ENV,isNativeUpdateChild,spawnNativeUpdateChild,isNativeAutoUpdateEnabled,cacheNativeUpdateVersion,cacheNativeUpdateDiscoveryAttempt,restoreNativeUpdateAfterDiscoveryFailure,markNativeUpdateStaged,scheduleNativeAutoUpdate,isAutoUpdateEnabled,hasAutoUpdatePreference,setAutoUpdate,canAutoUpdate};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- var SENTRY_DSN="https://26a24e59ba954011919a524b341b6ab5@o205439.ingest.us.sentry.io/1323225",BUILD_LABEL=void 0;export{SENTRY_DSN,BUILD_LABEL};
@@ -1,10 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{fetchEventPages}from"./chunk-OLAG7Y3P.js";import{require_format}from"./chunk-PFD7LETF.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";function quoteFilterValue(value){return JSON.stringify(value)}function composeFilter({source,deploymentId,environment,filter}){let clauses=[];if(deploymentId&&clauses.push(`deploymentId:${quoteFilterValue(deploymentId)}`),environment&&clauses.push(`environment:${quoteFilterValue(environment)}`),clauses.push(...source.fixedFilters),filter&&clauses.push(filter),clauses.length!==0)return clauses.map(clause=>`(${clause})`).join(" AND ")}function fetchEventPages2(client,query,limit,startCursor){return fetchEventPages(client,{event:query.source.event,ownerId:query.teamId,projectIds:[query.projectId],timeRange:{start:query.timeRange.start.toISOString(),end:query.timeRange.end.toISOString()},filter:query.filter,select:query.source.select,queryReason:query.source.queryReason},limit,startCursor)}var import_chalk=__toESM(require_source(),1),import_format=__toESM(require_format(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),TIME_ONLY_FORMAT="HH:mm:ss.SSS",DATE_TIME_FORMAT="MMM DD HH:mm:ss.SSS",LEVEL_WIDTH=7,PRODUCER_WIDTH=16,STATUS_WIDTH=6,METHOD_WIDTH=7,CACHE_WIDTH=9,REQUEST_ID_WIDTH=32,CONTROL_CHARACTERS=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function sanitize(value){return(0,import_strip_ansi.default)(value.replace(/\r\n?/g,`
8
- `)).replace(CONTROL_CHARACTERS,"")}function text(event,field){let value=event[field];return value==null?"":sanitize(typeof value=="string"?value:String(value))}function cell(value,width){return(value||"-").padEnd(width)}function timeFormatFor(range){return range.start.toDateString()===new Date(range.end.getTime()-1).toDateString()&&range.end.toDateString()===new Date().toDateString()?TIME_ONLY_FORMAT:DATE_TIME_FORMAT}function formatTime(event,timeFormat){let value=event.timestamp,date=typeof value=="string"||typeof value=="number"?new Date(value):void 0;return!date||isNaN(date.getTime())?text(event,"timestamp")||"-":(0,import_format.default)(date,timeFormat)}function colorizeLevel(value,level){switch(level){case"fatal":return import_chalk.default.red.bold(value);case"error":return import_chalk.default.red(value);case"warning":return import_chalk.default.yellow(value);default:return import_chalk.default.dim(value)}}function colorizeStatus(value,status){return status>=500?import_chalk.default.red(value):status>=400?import_chalk.default.yellow(value):status>=300?import_chalk.default.cyan(value):status>=200?import_chalk.default.green(value):import_chalk.default.gray(value)}function runtimeRenderer(timeFormat,timeWidth,producer){let producerWidth=producer?.width??PRODUCER_WIDTH,messageIndent=" ".repeat(timeWidth+LEVEL_WIDTH+producerWidth+6);return{header:()=>import_chalk.default.dim(["TIME".padEnd(timeWidth),"LEVEL".padEnd(LEVEL_WIDTH),(producer?.label??"SERVICE/SOURCE").padEnd(producerWidth),"MESSAGE"].join(" ")),row:event=>{let level=text(event,"level"),producerText=producer?text(event,producer.field):text(event,"service")||text(event,"source"),message=text(event,"message").replace(/\n+$/,""),[first="",...rest]=message.split(`
9
- `),truncated=event.truncated===!0,lines=[[import_chalk.default.dim(formatTime(event,timeFormat).padEnd(timeWidth)),colorizeLevel(cell(level,LEVEL_WIDTH),level),cell(producerText,producerWidth),first||(rest.length===0?import_chalk.default.dim("(no message)"):"")].join(" "),...rest.map(line=>`${messageIndent}${line}`)];return truncated&&lines.push(`${messageIndent}${import_chalk.default.yellow("[message truncated]")}`),lines.join(`
10
- `)}}}function requestsRenderer(timeFormat,timeWidth){return{header:()=>import_chalk.default.dim(["TIME".padEnd(timeWidth),"STATUS".padEnd(STATUS_WIDTH),"METHOD".padEnd(METHOD_WIDTH),"CACHE".padEnd(CACHE_WIDTH),"REQUEST ID".padEnd(REQUEST_ID_WIDTH),"HOST AND PATH"].join(" ")),row:event=>{let status=event.httpStatus,statusCell=(typeof status=="number"&&status>0?String(status):"-").padEnd(STATUS_WIDTH);return[import_chalk.default.dim(formatTime(event,timeFormat).padEnd(timeWidth)),typeof status=="number"?colorizeStatus(statusCell,status):statusCell,cell(text(event,"requestMethod"),METHOD_WIDTH),cell(text(event,"cacheResult"),CACHE_WIDTH),cell(text(event,"requestId"),REQUEST_ID_WIDTH),`${text(event,"requestHostname")}${text(event,"requestPath")}`||"-"].join(" ")}}}function createRenderer(source,range,producer){let timeFormat=timeFormatFor(range),timeWidth=(0,import_format.default)(new Date(0),timeFormat).length;return source==="runtime"?runtimeRenderer(timeFormat,timeWidth,producer):requestsRenderer(timeFormat,timeWidth)}function formatWindow(range){let sameDay=range.start.toDateString()===range.end.toDateString(),start=(0,import_format.default)(range.start,"YYYY-MM-DD HH:mm:ss"),end=(0,import_format.default)(range.end,sameDay?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss"),zone=(0,import_format.default)(range.end,"Z");return`${start} to ${end} (UTC${zone})`}export{quoteFilterValue,composeFilter,fetchEventPages2 as fetchEventPages,sanitize,createRenderer,formatWindow};