@vercel/cli-support 65.8.0-snapshot-c4f338842961 → 65.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/dist/chunks/add-3MWFJH54.js +8 -0
  2. package/dist/chunks/add-CJWCA3MM.js +8 -0
  3. package/dist/chunks/add-GLCVYEEN.js +8 -0
  4. package/dist/chunks/build-6RK6VECG.js +7 -0
  5. package/dist/chunks/{chunk-UF7QYHFU.js → chunk-2B7U6BB5.js} +1 -1
  6. package/dist/chunks/{chunk-UMMQR6WI.js → chunk-2OET5FWH.js} +1 -1
  7. package/dist/chunks/chunk-2PYFJXKS.js +14 -0
  8. package/dist/chunks/{chunk-FVIVFDCB.js → chunk-2QSNFVB6.js} +1 -1
  9. package/dist/chunks/{chunk-SLDWAIO3.js → chunk-33U57CNE.js} +1 -1
  10. package/dist/chunks/{chunk-N5CXIFE2.js → chunk-37DIJCWK.js} +1 -1
  11. package/dist/chunks/{chunk-HMWDOAWO.js → chunk-3AXMZRAB.js} +1 -1
  12. package/dist/chunks/{chunk-4JE57EBL.js → chunk-3DDEBTCC.js} +1 -1
  13. package/dist/chunks/{chunk-O7COT3YB.js → chunk-3KSTUMR6.js} +1 -1
  14. package/dist/chunks/{chunk-26QK3I2S.js → chunk-3LQ2ADXO.js} +1 -1
  15. package/dist/chunks/{chunk-QFUCWOCL.js → chunk-3RXEJWYM.js} +1 -1
  16. package/dist/chunks/{chunk-FAELJM4F.js → chunk-44XDCARR.js} +1 -1
  17. package/dist/chunks/{chunk-M7LUSXMG.js → chunk-45UDRX4C.js} +1 -1
  18. package/dist/chunks/{chunk-EAUDC24V.js → chunk-4ELZOAQH.js} +1 -1
  19. package/dist/chunks/{chunk-CCD7E322.js → chunk-4MP4HVBG.js} +1 -1
  20. package/dist/chunks/{chunk-64VMAYM6.js → chunk-5GOQ3FBV.js} +1 -1
  21. package/dist/chunks/{chunk-OGSTNJJ5.js → chunk-5MHRCRIN.js} +1 -1
  22. package/dist/chunks/{chunk-JAOYF7AW.js → chunk-5SMV2PPI.js} +1 -1
  23. package/dist/chunks/{chunk-QAYWROXQ.js → chunk-62FZFXPJ.js} +1 -1
  24. package/dist/chunks/{chunk-WGPYUXIC.js → chunk-63DO6KMD.js} +2 -2
  25. package/dist/chunks/{chunk-OKNDHNH6.js → chunk-6KCYUYUM.js} +1 -1
  26. package/dist/chunks/{chunk-IUMJJFEP.js → chunk-6V67VZJD.js} +1 -1
  27. package/dist/chunks/{chunk-JYK7ZIZW.js → chunk-753RQ6WV.js} +1 -1
  28. package/dist/chunks/{chunk-EMORYAJQ.js → chunk-7A5WO5KA.js} +1 -1
  29. package/dist/chunks/chunk-7BML2OR6.js +33 -0
  30. package/dist/chunks/{chunk-FNA4MIOH.js → chunk-7E6UJXLR.js} +1 -1
  31. package/dist/chunks/{chunk-ET5ARPPO.js → chunk-7EJ3BZ67.js} +1 -1
  32. package/dist/chunks/{chunk-VWHIWUGJ.js → chunk-7V2PXIVW.js} +1 -1
  33. package/dist/chunks/{chunk-RKWPLZJX.js → chunk-A67TLHES.js} +1 -1
  34. package/dist/chunks/{chunk-OTYF3ZZW.js → chunk-A6F3EE2O.js} +1 -1
  35. package/dist/chunks/{chunk-V6NMCQUQ.js → chunk-AEOG4E5G.js} +1 -1
  36. package/dist/chunks/{chunk-F4KY2TOK.js → chunk-AKOYIH3A.js} +1 -1
  37. package/dist/chunks/{chunk-RMW2FDXS.js → chunk-APNR444T.js} +1 -1
  38. package/dist/chunks/{chunk-OCRNZT7G.js → chunk-AQA4JVKA.js} +1 -1
  39. package/dist/chunks/{chunk-KHADRPBJ.js → chunk-B3ETPBO4.js} +1 -1
  40. package/dist/chunks/{chunk-CS6E5XNQ.js → chunk-BHJLCFQ4.js} +1 -1
  41. package/dist/chunks/{chunk-RPWGUQSE.js → chunk-BLFPDEXE.js} +1 -1
  42. package/dist/chunks/chunk-BULSRTQE.js +7 -0
  43. package/dist/chunks/{chunk-SXRZZDON.js → chunk-C4XT3PG4.js} +1 -1
  44. package/dist/chunks/chunk-CJHVHB2F.js +8 -0
  45. package/dist/chunks/{chunk-DPZFKHW3.js → chunk-CJLRNGWY.js} +1 -1
  46. package/dist/chunks/chunk-D3GYYGSS.js +9 -0
  47. package/dist/chunks/{chunk-GVPVWHFK.js → chunk-DBV6AB6T.js} +1 -1
  48. package/dist/chunks/{chunk-APWCVJAG.js → chunk-EGPVNTKP.js} +1 -1
  49. package/dist/chunks/{chunk-RVXE4MXS.js → chunk-EKB2DYCQ.js} +1 -1
  50. package/dist/chunks/{chunk-JW57JYRO.js → chunk-ELQBQ2O5.js} +1 -1
  51. package/dist/chunks/{chunk-2FHZYQPY.js → chunk-EZL4AJXH.js} +1 -1
  52. package/dist/chunks/{chunk-QHM6OK76.js → chunk-F76MNMH3.js} +1 -1
  53. package/dist/chunks/{chunk-4K3O7QWS.js → chunk-FNOCIKAU.js} +1 -1
  54. package/dist/chunks/{chunk-QNL22LAW.js → chunk-FQVSBXRY.js} +1 -1
  55. package/dist/chunks/{chunk-YCJHUYBJ.js → chunk-FXEMEIST.js} +1 -1
  56. package/dist/chunks/{chunk-4NDWIUKJ.js → chunk-G7X2TVUO.js} +1 -1
  57. package/dist/chunks/{chunk-JQTSETXH.js → chunk-GJB72ITS.js} +1 -1
  58. package/dist/chunks/{chunk-K3TCWYVX.js → chunk-GKUHMS3A.js} +1 -1
  59. package/dist/chunks/{chunk-H73G2ROF.js → chunk-GP2FXUFE.js} +1 -1
  60. package/dist/chunks/{chunk-UWMPVTXG.js → chunk-GP5MFCGO.js} +1 -1
  61. package/dist/chunks/{chunk-TZT3VYZ3.js → chunk-GZWYJT4C.js} +1 -1
  62. package/dist/chunks/{chunk-XCKUJZUG.js → chunk-H3SJJO6S.js} +1 -1
  63. package/dist/chunks/{chunk-GSXTCMKC.js → chunk-H4DE2OFO.js} +1 -1
  64. package/dist/chunks/{chunk-CZINAGH6.js → chunk-HA2ICIB5.js} +1 -1
  65. package/dist/chunks/{chunk-SUMMI76H.js → chunk-HNOZM6D4.js} +1 -1
  66. package/dist/chunks/{chunk-UJQ6PBRF.js → chunk-HTFQFHPR.js} +1 -1
  67. package/dist/chunks/{chunk-AUY363W7.js → chunk-IECNFRTK.js} +1 -1
  68. package/dist/chunks/{chunk-2EYHCJQO.js → chunk-IHNEF3BG.js} +1 -1
  69. package/dist/chunks/{chunk-BGWS5R5R.js → chunk-IHRM7L23.js} +1 -1
  70. package/dist/chunks/{chunk-3IRPFJ2G.js → chunk-INH6RXBH.js} +1 -1
  71. package/dist/chunks/chunk-IU6PHFPQ.js +7 -0
  72. package/dist/chunks/{chunk-C6IITJ5S.js → chunk-J52UJYOK.js} +1 -1
  73. package/dist/chunks/{chunk-7SAEZ4NC.js → chunk-JRBPVMQO.js} +1 -1
  74. package/dist/chunks/chunk-JUAHDOL6.js +7 -0
  75. package/dist/chunks/{chunk-FJ5CNQDD.js → chunk-JULKMXVP.js} +1 -1
  76. package/dist/chunks/{chunk-3H36RI7C.js → chunk-K2R3QPOC.js} +1 -1
  77. package/dist/chunks/{chunk-QGGJ5VVZ.js → chunk-KARAZGCO.js} +1 -1
  78. package/dist/chunks/chunk-KAUKCHQF.js +10 -0
  79. package/dist/chunks/{chunk-F34TG2V3.js → chunk-KDRCBWRY.js} +1 -1
  80. package/dist/chunks/{chunk-F22QLVTX.js → chunk-KIMIK4SG.js} +1 -1
  81. package/dist/chunks/{chunk-BPR5CLQM.js → chunk-KL6HNOFN.js} +1 -1
  82. package/dist/chunks/{chunk-LBTMGBAK.js → chunk-KUNFE2M6.js} +1 -1
  83. package/dist/chunks/{chunk-XSQVCDSD.js → chunk-LD42X7ZH.js} +1 -1
  84. package/dist/chunks/{chunk-RLKS5G6C.js → chunk-LM3YPF3K.js} +1 -1
  85. package/dist/chunks/{chunk-J4OVLASZ.js → chunk-LOEU4R4Z.js} +1 -1
  86. package/dist/chunks/{chunk-DSY2S2YT.js → chunk-M4TIOVOP.js} +1 -1
  87. package/dist/chunks/{chunk-55H6G46X.js → chunk-MCP63EVQ.js} +1 -1
  88. package/dist/chunks/{chunk-CNOJCW2I.js → chunk-MDWYXLDB.js} +2 -2
  89. package/dist/chunks/{chunk-J6L5MDTX.js → chunk-NAXFG37F.js} +1 -1
  90. package/dist/chunks/{chunk-VM3R6MAM.js → chunk-NDWGYZRT.js} +2 -2
  91. package/dist/chunks/{chunk-C7D43G3N.js → chunk-O7IYJGOR.js} +1 -1
  92. package/dist/chunks/chunk-OLAG7Y3P.js +10 -0
  93. package/dist/chunks/{chunk-5SIC5273.js → chunk-OTJNOMRV.js} +2 -2
  94. package/dist/chunks/{chunk-RGQZXLV4.js → chunk-OV7G6RIQ.js} +1 -1
  95. package/dist/chunks/{chunk-MBJT3CNI.js → chunk-P2HBUDGR.js} +1 -1
  96. package/dist/chunks/{chunk-OER4YAWM.js → chunk-PY5A73YH.js} +1 -1
  97. package/dist/chunks/{chunk-VAWZZK3Y.js → chunk-QIPUFI6P.js} +1 -1
  98. package/dist/chunks/{chunk-EPO7P734.js → chunk-QLW5DCM4.js} +1 -1
  99. package/dist/chunks/{chunk-RUXABBNV.js → chunk-QR7PY5JS.js} +1 -1
  100. package/dist/chunks/{chunk-AA3JM33J.js → chunk-QTCS2HDX.js} +1 -1
  101. package/dist/chunks/{chunk-RHFPMM4R.js → chunk-QZEZCUUZ.js} +7 -7
  102. package/dist/chunks/{chunk-SOGL2HOD.js → chunk-RIAOB3RF.js} +1 -1
  103. package/dist/chunks/{chunk-4BIGNS67.js → chunk-SBBD2Q5A.js} +1 -1
  104. package/dist/chunks/{chunk-A3RU52F4.js → chunk-SKLRHAGH.js} +1 -1
  105. package/dist/chunks/{chunk-SKSOCUDZ.js → chunk-SOCGBVML.js} +1 -1
  106. package/dist/chunks/{chunk-XTKGBVSF.js → chunk-T2SRGJPU.js} +1 -1
  107. package/dist/chunks/{chunk-7VTPAXDC.js → chunk-T3S63EA3.js} +1 -1
  108. package/dist/chunks/{chunk-SJA2LZ4O.js → chunk-TCEEQLD4.js} +1 -1
  109. package/dist/chunks/{chunk-2NMEPXG3.js → chunk-TK2ILW2O.js} +1 -1
  110. package/dist/chunks/{chunk-ID663OJ7.js → chunk-TOTTVS5P.js} +1 -1
  111. package/dist/chunks/{chunk-KPO6VDR2.js → chunk-TSKFDJ77.js} +1 -1
  112. package/dist/chunks/{chunk-FOQK3VTY.js → chunk-UAUVCOGS.js} +1 -1
  113. package/dist/chunks/chunk-UI2H2EIM.js +23 -0
  114. package/dist/chunks/{chunk-5RMIM4S2.js → chunk-UUBPAYTG.js} +1 -1
  115. package/dist/chunks/{chunk-SACGQMVQ.js → chunk-UUDE44NV.js} +1 -1
  116. package/dist/chunks/{chunk-5CZNUB7Y.js → chunk-V5A4EBV3.js} +1 -1
  117. package/dist/chunks/{chunk-KY7LDQRX.js → chunk-VBKFCR5W.js} +1 -1
  118. package/dist/chunks/{chunk-EQT2VHL2.js → chunk-WRC5CTUD.js} +1 -1
  119. package/dist/chunks/chunk-X65XZSWS.js +10 -0
  120. package/dist/chunks/{chunk-LOO42IMZ.js → chunk-XBOGVOV5.js} +1 -1
  121. package/dist/chunks/{chunk-MFW6IJIK.js → chunk-XK3W6Q5I.js} +1 -1
  122. package/dist/chunks/{chunk-UKJAWDQX.js → chunk-XUJA3RZD.js} +1 -1
  123. package/dist/chunks/{chunk-6GSI4VMJ.js → chunk-Y55DGB3L.js} +1 -1
  124. package/dist/chunks/{chunk-P6ZTEDX2.js → chunk-YEPB52XE.js} +1 -1
  125. package/dist/chunks/{chunk-7CNJTFWP.js → chunk-YHFZIUXF.js} +1 -1
  126. package/dist/chunks/{chunk-P2SVNHTJ.js → chunk-YIOT5B5Z.js} +1 -1
  127. package/dist/chunks/{chunk-OETX5QG4.js → chunk-YKNHA3RN.js} +1 -1
  128. package/dist/chunks/chunk-YPPDRKVC.js +7 -0
  129. package/dist/chunks/{chunk-75JI2SZX.js → chunk-YRK2BCTJ.js} +1 -1
  130. package/dist/chunks/{chunk-EDLTSAD2.js → chunk-YTZPQVGF.js} +1 -1
  131. package/dist/chunks/{chunk-D2XEF6G4.js → chunk-ZBJ44DRL.js} +1 -1
  132. package/dist/chunks/chunk-ZRJKGAUT.js +25 -0
  133. package/dist/chunks/clear-375VKVXY.js +8 -0
  134. package/dist/chunks/compile-vercel-config-LNRUSKTH.js +7 -0
  135. package/dist/chunks/config-GOYBATSI.js +8 -0
  136. package/dist/chunks/config-VAW454ZH.js +7 -0
  137. package/dist/chunks/connect-git-provider-7KRYVDFS.js +7 -0
  138. package/dist/chunks/delete-3SN6XFOW.js +10 -0
  139. package/dist/chunks/delete-W6BZHLGP.js +9 -0
  140. package/dist/chunks/detect-services-6L57MV5F.js +7 -0
  141. package/dist/chunks/disable-UUV5MYYH.js +7 -0
  142. package/dist/chunks/discard-Y6ZITZ2P.js +14 -0
  143. package/dist/chunks/edit-CVMUITFG.js +9 -0
  144. package/dist/chunks/edit-LLRI57RF.js +8 -0
  145. package/dist/chunks/enable-TFA6XWAA.js +7 -0
  146. package/dist/chunks/esm-4ZHGYTUV.js +7 -0
  147. package/dist/chunks/esm-7FVTQHRH.js +9 -0
  148. package/dist/chunks/esm-GTSUYLKG.js +7 -0
  149. package/dist/chunks/{esm-DFFBNKNU.js → esm-IBY43SSX.js} +1 -1
  150. package/dist/chunks/esm-LNIAU767.js +7 -0
  151. package/dist/chunks/esm-TEM4KPXZ.js +7 -0
  152. package/dist/chunks/esm-TLAM7FSK.js +9 -0
  153. package/dist/chunks/{exec-R5BDGSGP.js → exec-7LB36K52.js} +1 -1
  154. package/dist/chunks/{export-FV6WM43O.js → export-AI2O22W5.js} +1 -1
  155. package/dist/chunks/future-EZEU2CBY.js +7 -0
  156. package/dist/chunks/generate-cert-for-deploy-QP5BUOJL.js +7 -0
  157. package/dist/chunks/image-YLUF7SHR.js +7 -0
  158. package/dist/chunks/import-builders-ANLKHIYK.js +7 -0
  159. package/dist/chunks/{inspect-DLADA2SX.js → inspect-3NMNI7GY.js} +1 -1
  160. package/dist/chunks/inspect-3TRAN3SP.js +9 -0
  161. package/dist/chunks/{inspect-W3RVFJLM.js → inspect-4A67JORH.js} +1 -1
  162. package/dist/chunks/{inspect-ZUHCIZFW.js → inspect-OM5S5YQ2.js} +1 -1
  163. package/dist/chunks/inspect-VEUY4QJ2.js +13 -0
  164. package/dist/chunks/list-DJKKVFUL.js +12 -0
  165. package/dist/chunks/{list-6EZHEJGK.js → list-NEV4FBTY.js} +1 -1
  166. package/dist/chunks/{list-L4ZCXNAN.js → list-TUJ7HCQK.js} +1 -1
  167. package/dist/chunks/login-4HCFKDKL.js +7 -0
  168. package/dist/chunks/login-EPBJQDEK.js +9 -0
  169. package/dist/chunks/logs-Q7XXVFR3.js +7 -0
  170. package/dist/chunks/ls-3TKRCF4T.js +8 -0
  171. package/dist/chunks/{ls-IGICS6HZ.js → ls-COOTTCRW.js} +1 -1
  172. package/dist/chunks/{ls-EIGVX2LB.js → ls-CVO4MCX5.js} +1 -1
  173. package/dist/chunks/ls-LS5J5ERG.js +11 -0
  174. package/dist/chunks/ls-OQQTUQFN.js +8 -0
  175. package/dist/chunks/{ls-36K3OMRV.js → ls-OVM2DZYL.js} +1 -1
  176. package/dist/chunks/{ls-GSMTVAMC.js → ls-UY3KCDSF.js} +1 -1
  177. package/dist/chunks/mutate-I6QWCURL.js +9 -0
  178. package/dist/chunks/notifications-UKC5Z6AH.js +7 -0
  179. package/dist/chunks/open-CYATUDTT.js +7 -0
  180. package/dist/chunks/openapi-B7WSK7AU.js +7 -0
  181. package/dist/chunks/permissions-4ZYPHPOZ.js +7 -0
  182. package/dist/chunks/plugin-offer-4YTKDZGS.js +9 -0
  183. package/dist/chunks/prompt-missing-credentials-4OKJMYW5.js +7 -0
  184. package/dist/chunks/publish-N6E7VTRK.js +15 -0
  185. package/dist/chunks/pull-LPIT3XUR.js +7 -0
  186. package/dist/chunks/purchase-domain-if-available-IS6UDPJT.js +7 -0
  187. package/dist/chunks/push-ETLU6OCC.js +7 -0
  188. package/dist/chunks/{query-CUU7RRG6.js → query-NIMDIFLO.js} +1 -1
  189. package/dist/chunks/reauthenticate-TESIUM6U.js +7 -0
  190. package/dist/chunks/reorder-PQU2BQEE.js +10 -0
  191. package/dist/chunks/reply-RKDDYV5I.js +9 -0
  192. package/dist/chunks/resolve-ZF7BFXIW.js +12 -0
  193. package/dist/chunks/resolve-agent-team-QSIJ665W.js +7 -0
  194. package/dist/chunks/restore-U5A3BEFQ.js +16 -0
  195. package/dist/chunks/rm-7H5O3T7G.js +8 -0
  196. package/dist/chunks/rm-EPPMQEAV.js +8 -0
  197. package/dist/chunks/rm-FNMW2FPM.js +8 -0
  198. package/dist/chunks/rm-OZIA3DFM.js +8 -0
  199. package/dist/chunks/rm-W3VOR2ED.js +8 -0
  200. package/dist/chunks/routes-BLE5XZJE.js +7 -0
  201. package/dist/chunks/rule-inspect-YAVRRGAP.js +8 -0
  202. package/dist/chunks/{schema-5G57LHUD.js → schema-44U7GOQE.js} +1 -1
  203. package/dist/chunks/schema-6SAZ7T2S.js +14 -0
  204. package/dist/chunks/select-org-L5FJVL5Q.js +7 -0
  205. package/dist/chunks/set-3NQXDGJV.js +7 -0
  206. package/dist/chunks/setup-and-link-H36NRP3A.js +7 -0
  207. package/dist/chunks/{skills-4WEJZT7E.js → skills-XOH4Q7KK.js} +1 -1
  208. package/dist/chunks/tags-CRG27GFL.js +7 -0
  209. package/dist/chunks/{types-EK3C4EHF.js → types-6W3KAE2A.js} +1 -1
  210. package/dist/chunks/{update-IKZXIUYB.js → update-YLFMSPQF.js} +1 -1
  211. package/dist/commands/build/index.js +1 -1
  212. package/dist/commands/deploy/index.js +10 -6
  213. package/dist/commands/dev/index.js +2 -2
  214. package/dist/commands/env/index.js +5 -3
  215. package/dist/commands/link/index.js +1 -1
  216. package/dist/commands/list/index.js +1 -1
  217. package/dist/commands/project/index.js +1 -1
  218. package/dist/commands-account.js +1 -1
  219. package/dist/commands-ai.js +2 -2
  220. package/dist/commands-blob.js +1 -1
  221. package/dist/commands-core.js +6 -6
  222. package/dist/commands-deployments.js +6 -9
  223. package/dist/commands-flags.js +1 -1
  224. package/dist/commands-integrations.js +1 -1
  225. package/dist/commands-observability.js +2 -2
  226. package/dist/commands-routing.js +162 -153
  227. package/dist/help.js +1 -1
  228. package/dist/index.js +5 -5
  229. package/dist/internal-build.js +1 -1
  230. package/dist/package.json +57 -57
  231. package/dist/root-help-commands.mjs +1 -1
  232. package/dist/version.mjs +1 -1
  233. package/package.json +50 -50
  234. package/dist/chunks/add-6R2L3B6P.js +0 -8
  235. package/dist/chunks/add-O4YI4D5H.js +0 -8
  236. package/dist/chunks/add-W7MDOZMC.js +0 -8
  237. package/dist/chunks/build-UOKGUTFN.js +0 -7
  238. package/dist/chunks/chunk-2GHZGOWT.js +0 -7
  239. package/dist/chunks/chunk-3UD4MZMH.js +0 -8
  240. package/dist/chunks/chunk-67GZ5REA.js +0 -7
  241. package/dist/chunks/chunk-A2UZ2O7H.js +0 -7
  242. package/dist/chunks/chunk-BS32OUOC.js +0 -7
  243. package/dist/chunks/chunk-D3AHZ5LI.js +0 -7
  244. package/dist/chunks/chunk-DWOJP4ST.js +0 -27
  245. package/dist/chunks/chunk-FXF3NEJM.js +0 -14
  246. package/dist/chunks/chunk-I7U2XP4X.js +0 -10
  247. package/dist/chunks/chunk-IEZKTS2C.js +0 -10
  248. package/dist/chunks/chunk-IFXMG2WQ.js +0 -7
  249. package/dist/chunks/chunk-LCMNJNSQ.js +0 -9
  250. package/dist/chunks/chunk-MVGTMPMI.js +0 -23
  251. package/dist/chunks/chunk-RRDNKB2X.js +0 -7
  252. package/dist/chunks/chunk-YEOOTTBB.js +0 -33
  253. package/dist/chunks/clear-P2GBQ7OM.js +0 -8
  254. package/dist/chunks/compile-vercel-config-SPFLKB2T.js +0 -7
  255. package/dist/chunks/config-BI7WYZWB.js +0 -7
  256. package/dist/chunks/config-PR2PEOA7.js +0 -8
  257. package/dist/chunks/connect-git-provider-IQ7N2NPY.js +0 -7
  258. package/dist/chunks/delete-BZ3NLCTU.js +0 -9
  259. package/dist/chunks/delete-PUEGS2CP.js +0 -10
  260. package/dist/chunks/detect-services-HHGBWOND.js +0 -7
  261. package/dist/chunks/disable-UYLN3HPM.js +0 -7
  262. package/dist/chunks/discard-NMRN5PS4.js +0 -14
  263. package/dist/chunks/edit-KA7OSMJA.js +0 -9
  264. package/dist/chunks/edit-UQ4J2OQ7.js +0 -8
  265. package/dist/chunks/enable-7FM67BEJ.js +0 -7
  266. package/dist/chunks/esm-33752ISR.js +0 -7
  267. package/dist/chunks/esm-4JKEE7PC.js +0 -7
  268. package/dist/chunks/esm-BYG5BWYH.js +0 -9
  269. package/dist/chunks/esm-IF453UWS.js +0 -7
  270. package/dist/chunks/esm-LABWDJ72.js +0 -7
  271. package/dist/chunks/esm-TG37FXTU.js +0 -9
  272. package/dist/chunks/future-3WF7CSGN.js +0 -7
  273. package/dist/chunks/generate-cert-for-deploy-3OBDQ2R3.js +0 -7
  274. package/dist/chunks/image-SYY2IBOV.js +0 -7
  275. package/dist/chunks/import-builders-IJYZSEBY.js +0 -7
  276. package/dist/chunks/inspect-3NZE4UWJ.js +0 -13
  277. package/dist/chunks/inspect-J4WU7N2Z.js +0 -9
  278. package/dist/chunks/list-GLYYBTWD.js +0 -12
  279. package/dist/chunks/login-4OUKTVIZ.js +0 -7
  280. package/dist/chunks/login-E6L7CG3P.js +0 -9
  281. package/dist/chunks/logs-XHJPPHQ7.js +0 -7
  282. package/dist/chunks/ls-E75T2PHD.js +0 -8
  283. package/dist/chunks/ls-PA4OVQ43.js +0 -11
  284. package/dist/chunks/ls-RKILAXZ4.js +0 -8
  285. package/dist/chunks/mutate-4L6XPD7X.js +0 -9
  286. package/dist/chunks/notifications-IAKFNMTC.js +0 -7
  287. package/dist/chunks/open-62S7LSPT.js +0 -7
  288. package/dist/chunks/openapi-SO34WDBK.js +0 -7
  289. package/dist/chunks/permissions-T2KL34JP.js +0 -7
  290. package/dist/chunks/plugin-offer-HMNGWYIC.js +0 -9
  291. package/dist/chunks/prompt-missing-credentials-WTRJREZF.js +0 -7
  292. package/dist/chunks/publish-EFZO7IO2.js +0 -15
  293. package/dist/chunks/pull-GVFCZAHC.js +0 -7
  294. package/dist/chunks/purchase-domain-if-available-PJMKV5BI.js +0 -7
  295. package/dist/chunks/push-PHTW37LC.js +0 -7
  296. package/dist/chunks/reauthenticate-7P3C7ASY.js +0 -7
  297. package/dist/chunks/reorder-EBYXIVUZ.js +0 -10
  298. package/dist/chunks/reply-CBBADKE5.js +0 -9
  299. package/dist/chunks/resolve-KKFBXTIX.js +0 -12
  300. package/dist/chunks/resolve-agent-team-BBBIQWFZ.js +0 -7
  301. package/dist/chunks/restore-D4JUHPJ7.js +0 -16
  302. package/dist/chunks/rm-CRDLGD4Y.js +0 -8
  303. package/dist/chunks/rm-DSAXELZD.js +0 -8
  304. package/dist/chunks/rm-HXDTYZ3G.js +0 -8
  305. package/dist/chunks/rm-TDI6GXCE.js +0 -8
  306. package/dist/chunks/rm-XAUKTN2C.js +0 -8
  307. package/dist/chunks/routes-RWILS4LA.js +0 -7
  308. package/dist/chunks/rule-inspect-RKUBC35D.js +0 -8
  309. package/dist/chunks/schema-WSHKYL5H.js +0 -14
  310. package/dist/chunks/select-org-OKHCDXNF.js +0 -7
  311. package/dist/chunks/set-PBM7ZMZ7.js +0 -7
  312. package/dist/chunks/setup-and-link-PVMEKIYD.js +0 -7
  313. package/dist/chunks/tags-WUAMDEUU.js +0 -7
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{getExitCodeForErrorCode}from"./chunk-XSQVCDSD.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-I7U2XP4X.js";import{isJSONObject}from"./chunk-RHFPMM4R.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import{readFileSync}from"fs";import{resolve}from"path";var MONITORS_API={basePath:"/alerts/v3/monitors",itemKey:"monitor",listKey:"monitors",typesKey:"monitorTypes",idKey:"monitorId"},ALERT_RULES_API={basePath:"/alerts/v3/alert-rules",itemKey:"rule",listKey:"rules",typesKey:"ruleTypes",idKey:"ruleId"};function rulesCollectionPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`${api.basePath}?${query.toString()}`}function rulesItemPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`${api.basePath}/notifications?${query.toString()}`}function rulesNotificationLinksPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(api,teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`${api.basePath}/schema?${query.toString()}`}async function fetchRule(client,api,scope,ruleId){return(await client.fetch(rulesItemPath(api,scope.teamId,ruleId)))[api.itemKey]}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
7
+ import{getExitCodeForErrorCode}from"./chunk-LD42X7ZH.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-KAUKCHQF.js";import{isJSONObject}from"./chunk-QZEZCUUZ.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{readFileSync}from"fs";import{resolve}from"path";var MONITORS_API={basePath:"/alerts/v3/monitors",itemKey:"monitor",listKey:"monitors",typesKey:"monitorTypes",idKey:"monitorId"},ALERT_RULES_API={basePath:"/alerts/v3/alert-rules",itemKey:"rule",listKey:"rules",typesKey:"ruleTypes",idKey:"ruleId"};function rulesCollectionPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`${api.basePath}?${query.toString()}`}function rulesItemPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`${api.basePath}/notifications?${query.toString()}`}function rulesNotificationLinksPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(api,teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`${api.basePath}/schema?${query.toString()}`}async function fetchRule(client,api,scope,ruleId){return(await client.fetch(rulesItemPath(api,scope.teamId,ruleId)))[api.itemKey]}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
8
8
  `):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
9
9
  `)),exitCode}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to monitors in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage monitors in this team.":err.status>=500?`The monitors endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the monitor belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel monitors schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"monitors --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `monitors` subcommands"}]},2)}export{MONITORS_API,ALERT_RULES_API,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
@@ -0,0 +1,9 @@
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{buildInvalidTokenAgentError,getErrorRecovery,isInvalidTokenApiError,isInvalidTokenError,shouldEmitNonInteractiveCommandError,trackAgentError,writeAgentError}from"./chunk-KAUKCHQF.js";import{buildCorrectedCommand,isArgumentError}from"./chunk-KIMIK4SG.js";import{parseRetryAfterHeaderAsMillis,require_bytes}from"./chunk-FXEMEIST.js";import{getCommandName}from"./chunk-JESNVRVR.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-ZRJKGAUT.js";import{pkg_default}from"./chunk-OO572JUC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_bytes=__toESM(require_bytes(),1);async function responseError(res,fallbackMessage=null,parsedBody={}){let message="",bodyError;if(res.status>=400&&res.status<500){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||{},message=bodyError.message}message||(message=fallbackMessage===null?"Response Error":fallbackMessage);let err=new Error(`${message} (${res.status})`);if(err.status=res.status,err.serverMessage=message,bodyError)for(let field of Object.keys(bodyError))field!=="message"&&(err[field]=bodyError[field]);if(res.status===429||res.status===503){let parsed=parseRetryAfterHeaderAsMillis(res.headers.get("Retry-After"));err.retryAfterMs=parsed??(res.status===429?0:void 0)}return err}var MAX_SERIALIZED_ERROR_DEPTH=5;function isPlainObject(value){let proto=Object.getPrototypeOf(value);return proto===null||proto===Object.prototype}function toJsonSafe(value,ancestors,depth){if(typeof value=="bigint")return value.toString();if(!(typeof value=="function"||typeof value=="symbol")){if(value===null||typeof value!="object")return value;if(ancestors.has(value))return"[Circular]";if(depth>=MAX_SERIALIZED_ERROR_DEPTH)return"[Truncated]";if(value instanceof Error)return serializeError(value,ancestors,depth+1);if(!Array.isArray(value)&&!isPlainObject(value))return`[${value.constructor?.name||"Object"}]`;ancestors.add(value);try{if(Array.isArray(value))return value.map(item=>toJsonSafe(item,ancestors,depth+1));let copy={};for(let[key,child]of Object.entries(value))copy[key]=toJsonSafe(child,ancestors,depth+1);return copy}finally{ancestors.delete(value)}}}function serializeError(err,ancestors,depth){ancestors.add(err);try{let enumerable={name:err.name};for(let key of Object.getOwnPropertyNames(err))enumerable[key]=toJsonSafe(err[key],ancestors,depth);return enumerable}finally{ancestors.delete(err)}}function toEnumerableError(err){return err===null||typeof err!="object"?{name:"Error",message:String(err)}:serializeError(err,new WeakSet,0)}function printError(error2,client){if(typeof error2=="string"&&(error2=new Error(error2)),recordCliError(cliErrorFromUnknown(error2)),client&&shouldEmitNonInteractiveCommandError(client)&&isInvalidTokenError(error2)){output_manager_default.stopSpinner(),writeAgentError(client,buildInvalidTokenAgentError(client));return}let apiError=error2,{message,stack,status,code,sizeLimit}=apiError,argumentError=isArgumentError(error2)?error2:void 0,suggestion=argumentError?.suggestedOption&&argumentError.invalidOption,correction=suggestion&&client&&argumentError?buildCorrectedCommand(client.argv,argumentError.invalidOption,argumentError.suggestedOption,argumentError.flagsSpecification):void 0,recovery=getErrorRecovery(apiError,client),reason=isInvalidTokenApiError(error2)?"login_required":status===403?"forbidden":status===402?"payment_required":status===401?"not_authorized":status===429?"rate_limited":argumentError?"invalid_arguments":"api_error",hint=argumentError?.allowedOptions?`Vercel CLI ${pkg_default.version} accepts: ${argumentError.allowedOptions.join(", ")}.${suggestion?` Did you mean ${argumentError.suggestedOption}?`:""}`:recovery.hint;if(client&&(status||argumentError?.allowedOptions)){let payload={...recovery,status:"error",reason,message:apiError.serverMessage||message,hint,...argumentError?.allowedOptions&&{allowedOptions:argumentError.allowedOptions,suggestedOption:argumentError.suggestedOption,cliVersion:pkg_default.version},...correction&&{next:[{command:correction,when:correction.includes("<")?"Replace placeholders with the intended values, then run the corrected command":"Run the corrected command"}]}};if(shouldEmitNonInteractiveCommandError(client)){output_manager_default.stopSpinner(),writeAgentError(client,payload);return}trackAgentError(client,payload)}if(hint){output_manager_default.stopSpinner(),output_manager_default.fatal(apiError.serverMessage||message||"The request failed."),output_manager_default.print(` ${hint}
8
+ `),correction&&output_manager_default.print(` ${correction}
9
+ `);return}output_manager_default.debug(`handling error: ${stack}`),message!=="User force closed the prompt with 0 null"&&(status===403?output_manager_default.error(message||`Authentication error. Run ${getCommandName("login")} to log-in again.`):status===429?output_manager_default.error(message):code==="size_limit_exceeded"?output_manager_default.error(`File size limit exceeded (${(0,import_bytes.default)(sizeLimit)})`):message?output_manager_default.prettyError(apiError):status===500?output_manager_default.error("Unexpected server error. Please retry."):code==="USER_ABORT"?output_manager_default.log("Canceled"):output_manager_default.error(`Unexpected error. Please try again later. (${message})`))}export{responseError,toEnumerableError,printError};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{packageName}from"./chunk-JESNVRVR.js";import{allOption,confirmOption,formatOption,jsonOption,limitOption,nextCursorOption,yesOption}from"./chunk-A2UZ2O7H.js";var listCommand={name:"list",aliases:["ls"],description:"List deployments.",arguments:[{name:"app",required:!1}],options:[allOption,{name:"meta",description:"Filter deployments by metadata (e.g. `--meta KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:null,deprecatedShorthand:"m",type:[String],deprecated:!1},{name:"policy",description:"See deployments with provided Deployment Retention policies (e.g. `--policy KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:null,deprecatedShorthand:"p",type:[String],deprecated:!1},{name:"environment",description:"Filter deployments by environment",argument:"ENVIRONMENT",shorthand:"e",type:String,deprecated:!1},{name:"status",description:"Filter deployments by their status. Can be comma-separated for multiple statuses (e.g.: `--status BUILDING,READY`)",argument:"STATUS",shorthand:null,deprecatedShorthand:"s",type:String,deprecated:!1},nextCursorOption,limitOption,{name:"prod",shorthand:null,type:Boolean,deprecated:!0},yesOption,confirmOption,formatOption,jsonOption],examples:[{name:"List all deployments for the currently linked project",value:`${packageName} list`},{name:"List all deployments across all projects",value:`${packageName} list --all`},{name:"List all deployments for the project `my-app`",value:`${packageName} list my-app`},{name:"Filter deployments by metadata",value:`${packageName} list --meta key1=value1 --meta key2=value2`},{name:"Show the next page, using the cursor from the previous output",placeholders:["<CURSOR>"],value:`${packageName} list my-app --next <CURSOR>`},{name:"Filter deployments by status",value:`${packageName} list --status READY`},{name:"Filter deployments by multiple statuses",value:`${packageName} list --status BUILDING,ERROR`}]};export{listCommand};
7
+ import{packageName}from"./chunk-JESNVRVR.js";import{allOption,confirmOption,formatOption,jsonOption,limitOption,nextCursorOption,yesOption}from"./chunk-YPPDRKVC.js";var listCommand={name:"list",aliases:["ls"],description:"List deployments.",arguments:[{name:"app",required:!1}],options:[allOption,{name:"meta",description:"Filter deployments by metadata (e.g. `--meta KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:null,deprecatedShorthand:"m",type:[String],deprecated:!1},{name:"policy",description:"See deployments with provided Deployment Retention policies (e.g. `--policy KEY=value`). Can appear many times.",argument:"KEY=VALUE",shorthand:null,deprecatedShorthand:"p",type:[String],deprecated:!1},{name:"environment",description:"Filter deployments by environment",argument:"ENVIRONMENT",shorthand:"e",type:String,deprecated:!1},{name:"status",description:"Filter deployments by their status. Can be comma-separated for multiple statuses (e.g.: `--status BUILDING,READY`)",argument:"STATUS",shorthand:null,deprecatedShorthand:"s",type:String,deprecated:!1},nextCursorOption,limitOption,{name:"prod",shorthand:null,type:Boolean,deprecated:!0},yesOption,confirmOption,formatOption,jsonOption],examples:[{name:"List all deployments for the currently linked project",value:`${packageName} list`},{name:"List all deployments across all projects",value:`${packageName} list --all`},{name:"List all deployments for the project `my-app`",value:`${packageName} list my-app`},{name:"Filter deployments by metadata",value:`${packageName} list --meta key1=value1 --meta key2=value2`},{name:"Show the next page, using the cursor from the previous output",placeholders:["<CURSOR>"],value:`${packageName} list my-app --next <CURSOR>`},{name:"Filter deployments by status",value:`${packageName} list --status READY`},{name:"Filter deployments by multiple statuses",value:`${packageName} list --status BUILDING,ERROR`}]};export{listCommand};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_dist,require_dist2}from"./chunk-3P4Y46MS.js";import{require_types}from"./chunk-RHFPMM4R.js";import{require_build_utils}from"./chunk-DWOJP4ST.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};
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};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{events_default}from"./chunk-JYK7ZIZW.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function displayBuildLogs(client,deployment,follow=!0,onAliasAssigned){let abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>printBuildLog(event,output_manager_default.print),onAliasAssigned,quiet:!1,findOpts:{direction:"forward",follow}},abortController),abortController}}function collectBuildLogs(client,deployment,follow=!0){let logs=[],abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>{event.created&&logs.push(event)},quiet:!0,findOpts:{direction:"forward",follow}},abortController).then(()=>logs),abortController}}async function displayBuildLogsUntilFinalError(client,deployment,error){let abortController=new AbortController;return events_default(client,deployment.id,{mode:"logs",onEvent:event=>{printBuildLog(event,output_manager_default.print),event.level==="error"&&event.text?.includes(error)&&abortController.abort()},quiet:!1,findOpts:{direction:"forward",follow:!0}},abortController)}function printBuildLog(log,print){if(!log.created)return;let date=new Date(log.created).toISOString(),cleanText=parseLogLines(log).join(`
7
+ import{events_default}from"./chunk-753RQ6WV.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function displayBuildLogs(client,deployment,follow=!0,onAliasAssigned){let abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>printBuildLog(event,output_manager_default.print),onAliasAssigned,quiet:!1,findOpts:{direction:"forward",follow}},abortController),abortController}}function collectBuildLogs(client,deployment,follow=!0){let logs=[],abortController=new AbortController;return{promise:events_default(client,deployment.id,{mode:"logs",onEvent:event=>{event.created&&logs.push(event)},quiet:!0,findOpts:{direction:"forward",follow}},abortController).then(()=>logs),abortController}}async function displayBuildLogsUntilFinalError(client,deployment,error){let abortController=new AbortController;return events_default(client,deployment.id,{mode:"logs",onEvent:event=>{printBuildLog(event,output_manager_default.print),event.level==="error"&&event.text?.includes(error)&&abortController.abort()},quiet:!1,findOpts:{direction:"forward",follow:!0}},abortController)}function printBuildLog(log,print){if(!log.created)return;let date=new Date(log.created).toISOString(),cleanText=parseLogLines(log).join(`
8
8
  `);for(let line of colorize(cleanText,log).split(`
9
9
  `))print(`${import_chalk.default.dim(date)} ${line}
10
10
  `)}function sanitize(log){return(0,import_strip_ansi.default)(log.text||"").replace(/\n$/,"").replace(/^\n/,"")}function parseLogLines(log){return sanitize(log).split(`
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{RULE_ENVIRONMENTS}from"./chunk-M7LUSXMG.js";import{AGENT_STATUS}from"./chunk-I7U2XP4X.js";import{warnDeprecatedInput}from"./chunk-7SAEZ4NC.js";function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
7
+ import{RULE_ENVIRONMENTS}from"./chunk-45UDRX4C.js";import{AGENT_STATUS}from"./chunk-KAUKCHQF.js";import{warnDeprecatedInput}from"./chunk-JRBPVMQO.js";function writeConfigJson(client,{project,bare,envelope,message,next}){if(!client.nonInteractive){client.stdout.write(`${JSON.stringify(bare,null,2)}
8
8
  `);return}client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.OK,projectId:project.id,projectName:project.name,...envelope,message,next},null,2)}
9
9
  `)}var RULE_LIMIT=10,MIN_SAMPLE_RATE=1,MAX_SAMPLE_RATE=100;function isRuleEnvironment(value){return RULE_ENVIRONMENTS.includes(value)}var ENVIRONMENT_ERROR=`\`environment\` must be one of: ${RULE_ENVIRONMENTS.join(", ")}.`,RATE_ERROR=`\`rate\` must be a whole number from ${MIN_SAMPLE_RATE} to ${MAX_SAMPLE_RATE}.`,EMPTY_PATH_ERROR="`requestPath` cannot be empty.";function parseSampleRate(value){if(!/^\d+$/.test(value.trim()))return;let rate=Number(value);return rate>=MIN_SAMPLE_RATE&&rate<=MAX_SAMPLE_RATE?rate:void 0}function toRow(rule){return{environment:rule.env??"any",requestPath:rule.requestPath??null,sampleRate:Math.round(rule.rate*100)}}function toApiRate(sampleRate){return sampleRate/100}function toRule(row){return{type:"head_sampling",rate:toApiRate(row.sampleRate),...row.environment==="any"?{}:{env:row.environment},...row.requestPath===null?{}:{requestPath:row.requestPath}}}var ALL_PATHS_LABEL="(all paths)";function formatPath(requestPath){return requestPath??ALL_PATHS_LABEL}function formatRate(sampleRate){return`${sampleRate}%`}function formatRuleTarget(environment,requestPath){return`${environment} ${formatPath(requestPath)}`}function formatRuleLine(row){return`${formatRuleTarget(row.environment,row.requestPath)} ${formatRate(row.sampleRate)}`}var COMMAND_WORD_COUNT=3;function subcommandArguments(positional){return positional.slice(COMMAND_WORD_COUNT)}function resolveRuleEnvironment(client,environmentFlag,args){if(environmentFlag===void 0){let[environment,...rest]=args;return environment!==void 0&&isRuleEnvironment(environment)?(warnDeprecatedInput(client,"The environment argument","--environment"),{environment,args:rest}):{environment:void 0,args}}return args[0]!==void 0&&isRuleEnvironment(args[0])?{error:"Can't use an environment argument with --environment. Use --environment."}:{environment:environmentFlag,args}}function hasSameKey(a,b){return a.environment===b.environment&&a.requestPath===b.requestPath}async function readTracingConfig({client,teamId,projectId,projectName}){let config=await client.fetch(`/v1/drains/tracing/config?${new URLSearchParams({projectId})}`,{accountId:teamId}),sampling=config.enabled&&config.sampling.length===0?[{type:"head_sampling",rate:1}]:config.sampling;return{project:{id:projectId,name:projectName},enabled:config.enabled,entries:sampling.map(rule=>({rule,row:toRow(rule)}))}}async function writeSamplingRules({client,teamId,projectId,rules}){await client.fetch(`/v1/drains/tracing/config?${new URLSearchParams({projectId})}`,{accountId:teamId,method:"PUT",body:{enabled:rules.length>0,...rules.length>0?{sampling:rules}:{}}})}export{writeConfigJson,RULE_LIMIT,isRuleEnvironment,ENVIRONMENT_ERROR,RATE_ERROR,EMPTY_PATH_ERROR,parseSampleRate,toApiRate,toRule,formatPath,formatRate,formatRuleTarget,formatRuleLine,subcommandArguments,resolveRuleEnvironment,hasSameKey,readTracingConfig,writeSamplingRules};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{tracesConfigCommand}from"./chunk-M7LUSXMG.js";import{packageName}from"./chunk-JESNVRVR.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-A2UZ2O7H.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{...deploymentOption,description:"Filter by deployment ID"},{name:"deployment-id",shorthand:null,type:String,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace",shorthand:null,type:String,argument:"TRACE",deprecated:!1,description:"Filter by trace ID"},{name:"trace-id",shorthand:null,type:String,deprecated:!0},{name:"span",shorthand:null,type:String,argument:"SPAN",deprecated:!1,description:"Filter by span ID"},{name:"span-id",shorthand:null,type:String,deprecated:!0},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Show a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:"p",type:String,argument:"NAME|ID",deprecated:!1,description:"Project that owns the trace (default: linked project)"},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open (default: timeline). Only valid with --open."}],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Inspect a trace without typing the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],forwardsUnknownOptions:!0,options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl options after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100, max: 1000)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",placeholders:["<CURSOR>"],value:`${packageName} traces search --next <CURSOR> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Inspect project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
7
+ import{tracesConfigCommand}from"./chunk-45UDRX4C.js";import{packageName}from"./chunk-JESNVRVR.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-YPPDRKVC.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{...deploymentOption,description:"Filter by deployment ID"},{name:"deployment-id",shorthand:null,type:String,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace",shorthand:null,type:String,argument:"TRACE",deprecated:!1,description:"Filter by trace ID"},{name:"trace-id",shorthand:null,type:String,deprecated:!0},{name:"span",shorthand:null,type:String,argument:"SPAN",deprecated:!1,description:"Filter by span ID"},{name:"span-id",shorthand:null,type:String,deprecated:!0},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Show a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:"p",type:String,argument:"NAME|ID",deprecated:!1,description:"Project that owns the trace (default: linked project)"},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open (default: timeline). Only valid with --open."}],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Inspect a trace without typing the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],forwardsUnknownOptions:!0,options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl options after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100, max: 1000)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",placeholders:["<CURSOR>"],value:`${packageName} traces search --next <CURSOR> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Inspect project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{STANDARD_ENVIRONMENTS}from"./chunk-7YKFF6CE.js";import{require_lib}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_title=__toESM(require_lib(),1);function formatEnvironment(orgSlug,projectSlug,environment){let projectUrl=`https://vercel.com/${orgSlug}/${projectSlug}`,boldName=import_chalk.default.bold(STANDARD_ENVIRONMENTS.includes(environment.slug)?(0,import_title.default)(environment.slug):environment.slug);return output_manager_default.link(boldName,`${projectUrl}/settings/environments/${environment.slug}`,{fallback:()=>boldName,color:!1})}export{formatEnvironment};
7
+ import{STANDARD_ENVIRONMENTS}from"./chunk-7YKFF6CE.js";import{require_lib}from"./chunk-JESNVRVR.js";import{output_manager_default}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_title=__toESM(require_lib(),1);function formatEnvironment(orgSlug,projectSlug,environment){let projectUrl=`https://vercel.com/${orgSlug}/${projectSlug}`,boldName=import_chalk.default.bold(STANDARD_ENVIRONMENTS.includes(environment.slug)?(0,import_title.default)(environment.slug):environment.slug);return output_manager_default.link(boldName,`${projectUrl}/settings/environments/${environment.slug}`,{fallback:()=>boldName,color:!1})}export{formatEnvironment};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-RHFPMM4R.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,vercelFlags:project.vercelFlags,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{writeProjectSettings,readProjectSettings,pickOverrides};
7
+ import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-QZEZCUUZ.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,vercelFlags:project.vercelFlags,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{writeProjectSettings,readProjectSettings,pickOverrides};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{packageName}from"./chunk-JESNVRVR.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-A2UZ2O7H.js";var PERMISSIONS_ACTIONS={ls:["ls","list"],add:["add"],rm:["rm","remove"],clear:["clear"]},projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},permissionsLsSubcommand={name:"ls",aliases:["list"],description:"List teams with access to a repository",arguments:[],options:[projectScopeOption,{...limitOption,description:"Number of results to return per page (default: 100, max: 100)"},nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"List teams with access as JSON",value:`${packageName} vcr permissions my-app ls --json`}]},permissionsAddSubcommand={name:"add",aliases:[],description:"Give one or more teams access to pull images from a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Share a repository with a team by id",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Share a repository with a team by slug",value:`${packageName} vcr permissions my-app add my-team`},{name:"Share a repository with multiple teams",value:`${packageName} vcr permissions my-app add team_1a2b3c4d,other-team`}]},permissionsRmSubcommand={name:"remove",aliases:["rm"],description:"Remove one or more teams' access to a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Remove a team's access by id",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Remove multiple teams' access",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d,other-team`}]},permissionsClearSubcommand={name:"clear",aliases:[],description:"Remove access to a repository for every team",arguments:[],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`},{name:"Clear all repository permissions without the confirmation prompt",value:`${packageName} vcr permissions my-app clear --yes`}]},permissionsAggregateCommand={name:"permissions",aliases:["permission"],argumentsBeforeSubcommand:!0,description:"Manage which teams can pull images from a container registry repository",arguments:[{name:"repository",required:!0}],subcommands:[permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand],options:[],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"Share a repository with a team",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Remove a team's access to a repository",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`}]};export{PERMISSIONS_ACTIONS,permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand,permissionsAggregateCommand};
7
+ import{packageName}from"./chunk-JESNVRVR.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-YPPDRKVC.js";var PERMISSIONS_ACTIONS={ls:["ls","list"],add:["add"],rm:["rm","remove"],clear:["clear"]},projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},permissionsLsSubcommand={name:"ls",aliases:["list"],description:"List teams with access to a repository",arguments:[],options:[projectScopeOption,{...limitOption,description:"Number of results to return per page (default: 100, max: 100)"},nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"List teams with access as JSON",value:`${packageName} vcr permissions my-app ls --json`}]},permissionsAddSubcommand={name:"add",aliases:[],description:"Give one or more teams access to pull images from a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Share a repository with a team by id",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Share a repository with a team by slug",value:`${packageName} vcr permissions my-app add my-team`},{name:"Share a repository with multiple teams",value:`${packageName} vcr permissions my-app add team_1a2b3c4d,other-team`}]},permissionsRmSubcommand={name:"remove",aliases:["rm"],description:"Remove one or more teams' access to a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Remove a team's access by id",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Remove multiple teams' access",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d,other-team`}]},permissionsClearSubcommand={name:"clear",aliases:[],description:"Remove access to a repository for every team",arguments:[],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`},{name:"Clear all repository permissions without the confirmation prompt",value:`${packageName} vcr permissions my-app clear --yes`}]},permissionsAggregateCommand={name:"permissions",aliases:["permission"],argumentsBeforeSubcommand:!0,description:"Manage which teams can pull images from a container registry repository",arguments:[{name:"repository",required:!0}],subcommands:[permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand],options:[],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"Share a repository with a team",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Remove a team's access to a repository",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`}]};export{PERMISSIONS_ACTIONS,permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand,permissionsAggregateCommand};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{getCommandName}from"./chunk-JESNVRVR.js";import{require_build_utils}from"./chunk-DWOJP4ST.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_bytes=__commonJS({"../../node_modules/.pnpm/bytes@3.0.0/node_modules/bytes/index.js"(exports,module){"use strict";module.exports=bytes2;module.exports.format=format;module.exports.parse=parse;var formatThousandsRegExp=/\B(?=(\d{3})+(?!\d))/g,formatDecimalsRegExp=/(?:\.0*|(\.[^0]+)0+)$/,map={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:(1<<30)*1024},parseRegExp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i;function bytes2(value,options){return typeof value=="string"?parse(value):typeof value=="number"?format(value,options):null}function format(value,options){if(!Number.isFinite(value))return null;var mag=Math.abs(value),thousandsSeparator=options&&options.thousandsSeparator||"",unitSeparator=options&&options.unitSeparator||"",decimalPlaces=options&&options.decimalPlaces!==void 0?options.decimalPlaces:2,fixedDecimals=!!(options&&options.fixedDecimals),unit=options&&options.unit||"";(!unit||!map[unit.toLowerCase()])&&(mag>=map.tb?unit="TB":mag>=map.gb?unit="GB":mag>=map.mb?unit="MB":mag>=map.kb?unit="KB":unit="B");var val=value/map[unit.toLowerCase()],str=val.toFixed(decimalPlaces);return fixedDecimals||(str=str.replace(formatDecimalsRegExp,"$1")),thousandsSeparator&&(str=str.replace(formatThousandsRegExp,thousandsSeparator)),str+unitSeparator+unit}function parse(val){if(typeof val=="number"&&!isNaN(val))return val;if(typeof val!="string")return null;var results=parseRegExp.exec(val),floatValue,unit="b";return results?(floatValue=parseFloat(results[1]),unit=results[4].toLowerCase()):(floatValue=parseInt(val,10),unit="b"),Math.floor(map[unit]*floatValue)}}});var NowError=class extends Error{constructor({code:code2,message,meta}){super(message);this.code=code2,this.meta=meta}};var import_chalk=__toESM(require_source(),1);function code(cmd,{backticks=!0}={}){let tick=backticks?import_chalk.default.gray("`"):"";return`${tick}${import_chalk.default.bold(cmd)}${tick}`}var import_bytes=__toESM(require_bytes(),1),import_build_utils=__toESM(require_build_utils(),1);var import_chalk2=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1),APIError=class extends Error{constructor(message,response,body){super();if(this.message=`${message} (${response.status})`,this.status=response.status,this.serverMessage=message,this.wwwAuthenticate=response.headers.get("WWW-Authenticate")??void 0,body)for(let field of Object.keys(body))field!=="message"&&(this[field]=body[field]);if(response.status===429||response.status===503){let parsed=parseRetryAfterHeaderAsMillis(response.headers.get("Retry-After"));this.retryAfterMs=parsed??(response.status===429?0:void 0)}}};function parseRetryAfterHeaderAsMillis(header){if(!header)return;let retryAfterMs=Number(header)*1e3;if(Number.isNaN(retryAfterMs)){if(retryAfterMs=Date.parse(header),Number.isNaN(retryAfterMs))return;retryAfterMs=retryAfterMs-Date.now()}return Math.max(retryAfterMs,0)}function isAPIError(v){return(0,import_error_utils.isError)(v)&&"status"in v}var TeamDeleted=class extends NowError{constructor(){super({code:"TEAM_DELETED",message:`Your team was deleted or you were removed from the team. You can switch to a different one using ${getCommandName("switch")}.`,meta:{}})}},InvalidToken=class extends NowError{constructor(tokenSource){let message;tokenSource==="flag"?message="The token provided via the `--token` option is not valid. Please provide a valid token.":tokenSource==="env"?message="The token provided via VERCEL_TOKEN environment variable is not valid. Please provide a valid token.":message=`The specified token is not valid. Use ${getCommandName("login")} to generate a new token.`,super({code:"NOT_AUTHORIZED",message,meta:{}})}},MissingUser=class extends NowError{constructor(){super({code:"MISSING_USER",message:"Not able to load user, missing from response",meta:{}})}},DomainAlreadyExists=class extends NowError{constructor(domain){super({code:"DOMAIN_ALREADY_EXISTS",meta:{domain},message:`The domain ${domain} already exists under a different context.`})}},DomainPermissionDenied=class extends NowError{constructor(domain,context){super({code:"DOMAIN_PERMISSION_DENIED",meta:{domain,context},message:`You don't have access to the domain ${domain} under ${context}.`})}},DomainExternal=class extends NowError{constructor(domain){super({code:"DOMAIN_EXTERNAL",meta:{domain},message:`The domain ${domain} must point to zeit.world.`})}},SourceNotFound=class extends NowError{constructor(){super({code:"SOURCE_NOT_FOUND",meta:{},message:"Not able to purchase. Please add a payment method using the dashboard."})}};var DomainNotFound=class extends NowError{constructor(domain,contextName){super({code:"DOMAIN_NOT_FOUND",meta:{domain},message:`Domain not found by "${domain}"${contextName?` under ${import_chalk2.default.bold(contextName)}`:""}.`})}},DomainNotVerified=class extends NowError{constructor(domain){super({code:"DOMAIN_NOT_VERIFIED",meta:{domain},message:`The domain ${domain} is not verified.`})}},DomainVerificationFailed=class extends NowError{constructor({domain,nsVerification,txtVerification,purchased=!1}){super({code:"DOMAIN_VERIFICATION_FAILED",meta:{domain,nsVerification,txtVerification,purchased},message:`We can't verify the domain ${domain}. Both Name Servers and DNS TXT verifications failed.`})}},InvalidDomain=class extends NowError{constructor(domain,message){super({code:"INVALID_DOMAIN",meta:{domain},message:message||`The domain ${domain} is not valid.`})}},NotDomainOwner=class extends NowError{constructor(message){super({code:"NOT_DOMAIN_OWNER",meta:{},message})}},InvalidDeploymentId=class extends NowError{constructor(id,message){super({code:"INVALID_DEPLOYMENT_ID",meta:{id},message:message||`The deployment id "${id}" is not valid.`})}},UnsupportedTLD=class extends NowError{constructor(domain){super({code:"UNSUPPORTED_TLD",meta:{domain},message:`The TLD for domain name ${domain} is not supported.`})}},TLDNotSupportedViaCLI=class extends NowError{constructor(domain){super({code:"UNSUPPORTED_TLD_VIA_CLI",meta:{domain},message:`Purchases for the TLD of ${domain} are not supported via the CLI. Use the REST API or the dashboard to buy it.`})}},DomainNotAvailable=class extends NowError{constructor(domain){super({code:"DOMAIN_NOT_AVAILABLE",meta:{domain},message:`The domain ${domain} is not available to be purchased.`})}};var UnexpectedDomainPurchaseError=class extends NowError{constructor(domain){super({code:"UNEXPECTED_DOMAIN_PURCHASE_ERROR",meta:{domain},message:`The order for ${domain} failed.`})}},UnexpectedDomainTransferError=class extends NowError{constructor(domain){super({code:"UNEXPECTED_DOMAIN_TRANSFER_ERROR",meta:{domain},message:"An unexpected error happened while transferring."})}},DomainPaymentError=class extends NowError{constructor(){super({code:"DOMAIN_PAYMENT_ERROR",meta:{},message:"Your card was declined. Nothing was charged."})}},DomainChargeOutcomeUnknown=class extends NowError{constructor(domain,verb){super({code:"DOMAIN_CHARGE_OUTCOME_UNKNOWN",meta:{domain,verb},message:`Can't confirm whether ${domain} was ${verb==="buy"?"bought":"renewed"}. Run ${getCommandName(`domains inspect ${domain}`)} before trying again, or you may be charged twice.`})}},DomainPurchaseRefunded=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_REFUNDED",meta:{domain},message:`The purchase of ${domain} failed, and the charge was refunded.`})}},DomainPurchaseRefundFailed=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_REFUND_FAILED",meta:{domain},message:`The purchase of ${domain} failed, and refunding the charge also failed. Contact Vercel support about the charge.`})}},DomainPriceChanged=class extends NowError{constructor(domain){super({code:"DOMAIN_PRICE_CHANGED",meta:{domain},message:`The price of ${domain} changed. Nothing was charged.`})}},DomainPurchasePending=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_PENDING",meta:{domain},message:`The domain purchase for ${domain} is pending.`})}},UserAborted=class extends NowError{constructor(){super({code:"USER_ABORTED",meta:{},message:"The user canceled the operation."})}},CertNotFound=class extends NowError{constructor(id){super({code:"CERT_NOT_FOUND",meta:{id},message:`The cert ${id} can't be found.`})}},CertsPermissionDenied=class extends NowError{constructor(context,domain){super({code:"CERTS_PERMISSION_DENIED",meta:{domain},message:`You don't have access to ${domain}'s certs under ${context}.`})}},CertOrderNotFound=class extends NowError{constructor(cns){super({code:"CERT_ORDER_NOT_FOUND",meta:{cns},message:`No cert order could be found for cns ${cns.join(" ,")}`})}},TooManyRequests=class extends NowError{constructor(api,retryAfterMs){super({code:"TOO_MANY_REQUESTS",meta:{api,retryAfterMs},message:"Rate limited. Too many requests to the same endpoint."})}},CertError=class extends NowError{constructor({cns,code:code2,message,helpUrl}){super({code:"CERT_ERROR",meta:{cns,code:code2,helpUrl},message})}},CertConfigurationError=class extends NowError{constructor({cns,message,external,type,helpUrl}){super({code:"CERT_CONFIGURATION_ERROR",meta:{cns,helpUrl,external,type},message})}},DeploymentNotFound=class extends NowError{constructor({context,id=""}){super({code:"DEPLOYMENT_NOT_FOUND",meta:{id,context},message:`Can't find the deployment "${id}" under the context "${context}"`})}},DeploymentNotReady=class extends NowError{constructor({url=""}){super({code:"DEPLOYMENT_NOT_READY",meta:{url},message:`The deployment https://${url} is not ready.`})}},DeploymentFailedAliasImpossible=class extends NowError{constructor(){super({code:"DEPLOYMENT_FAILED_ALIAS_IMPOSSIBLE",meta:{},message:"The deployment build has failed and cannot be aliased"})}},DeploymentPermissionDenied=class extends NowError{constructor(id,context){super({code:"DEPLOYMENT_PERMISSION_DENIED",meta:{id,context},message:`You don't have access to the deployment ${id} under ${context}.`})}},InvalidAlias=class extends NowError{constructor(alias){super({code:"INVALID_ALIAS",meta:{alias},message:`The given alias ${alias} is not valid`})}},AliasInUse=class extends NowError{constructor(alias){super({code:"ALIAS_IN_USE",meta:{alias},message:"The alias is already in use"})}},CertMissing=class extends NowError{constructor(domain){super({code:"CERT_MISSING",meta:{domain},message:`The certificate for domain ${domain} is missing`})}},CantParseJSONFile=class extends NowError{constructor(file,parseErrorLocation){let message=`Can't parse json file ${file}: ${parseErrorLocation}`;super({code:"CANT_PARSE_JSON_FILE",meta:{file,parseErrorLocation},message})}},ConflictingConfigFiles=class extends import_build_utils.NowBuildError{constructor(files,message,link){super({code:"CONFLICTING_CONFIG_FILES",message:message||"Multiple config files found. Please use only one configuration file.",link:link||"https://vercel.link/combining-old-and-new-config"});this.files=files}},DeprecatedNowJson=class extends import_build_utils.NowBuildError{constructor(_file){super({code:"DEPRECATED_NOW_JSON",message:"The `now.json` file is deprecated and no longer supported. Please rename it to `vercel.json`.",link:"https://vercel.com/docs/projects/project-configuration"})}},CantFindConfig=class extends NowError{constructor(paths){super({code:"CANT_FIND_CONFIG",meta:{paths},message:"Can't find a configuration file in the given locations."})}},WorkingDirectoryDoesNotExist=class extends NowError{constructor(){super({code:"CWD_DOES_NOT_EXIST",meta:{},message:"The current working directory does not exist."})}};var NoAliasInConfig=class extends NowError{constructor(){super({code:"NO_ALIAS_IN_CONFIG",meta:{},message:"There is no alias set up in config file."})}},InvalidAliasInConfig=class extends NowError{constructor(value){super({code:"INVALID_ALIAS_IN_CONFIG",meta:{value},message:"Invalid alias option in configuration."})}};var DNSPermissionDenied=class extends NowError{constructor(domain){super({code:"DNS_PERMISSION_DENIED",meta:{domain},message:`You don't have access to the DNS records of ${domain}.`})}},DNSInvalidPort=class extends NowError{constructor(){super({code:"DNS_INVALID_PORT",meta:{},message:"Invalid <port> parameter. A number was expected"})}},DNSInvalidType=class extends NowError{constructor(type){super({code:"DNS_INVALID_TYPE",meta:{type},message:`Invalid <type> parameter "${type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT`})}},DNSConflictingRecord=class extends NowError{constructor(record){super({code:"DNS_CONFLICTING_RECORD",meta:{record},message:` A conflicting record exists "${record}".`})}},DomainRemovalConflict=class extends NowError{constructor({aliases,certs,message,pendingAsyncPurchase,resolvable,suffix,transferring}){super({code:"domain_removal_conflict",meta:{aliases,certs,pendingAsyncPurchase,suffix,transferring,resolvable},message})}},DomainMoveConflict=class extends NowError{constructor({message,pendingAsyncPurchase,resolvable,suffix}){super({code:"domain_move_conflict",meta:{pendingAsyncPurchase,resolvable,suffix},message})}};var InvalidMoveDestination=class extends NowError{constructor(destination){super({code:"INVALID_MOVE_DESTINATION",message:`Invalid move destination "${destination}"`,meta:{destination}})}};var LambdaSizeExceededError=class extends NowError{constructor(size,maxLambdaSize){super({code:"MAX_LAMBDA_SIZE_EXCEEDED",message:`The lambda function size (${(0,import_bytes.default)(size).toLowerCase()}) exceeds the maximum size limit (${(0,import_bytes.default)(maxLambdaSize).toLowerCase()}).`,meta:{size,maxLambdaSize}})}},MissingDotenvVarsError=class extends NowError{constructor(type,missing){let message;missing.length===1?message=`Env var ${JSON.stringify(missing[0])} is not defined in ${code(type)} file`:message=[`The following env vars are not defined in ${code(type)} file:`,...missing.map(name=>` - ${JSON.stringify(name)}`)].join(`
7
+ import{getCommandName}from"./chunk-JESNVRVR.js";import{require_build_utils}from"./chunk-ZRJKGAUT.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_bytes=__commonJS({"../../node_modules/.pnpm/bytes@3.0.0/node_modules/bytes/index.js"(exports,module){"use strict";module.exports=bytes2;module.exports.format=format;module.exports.parse=parse;var formatThousandsRegExp=/\B(?=(\d{3})+(?!\d))/g,formatDecimalsRegExp=/(?:\.0*|(\.[^0]+)0+)$/,map={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:(1<<30)*1024},parseRegExp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i;function bytes2(value,options){return typeof value=="string"?parse(value):typeof value=="number"?format(value,options):null}function format(value,options){if(!Number.isFinite(value))return null;var mag=Math.abs(value),thousandsSeparator=options&&options.thousandsSeparator||"",unitSeparator=options&&options.unitSeparator||"",decimalPlaces=options&&options.decimalPlaces!==void 0?options.decimalPlaces:2,fixedDecimals=!!(options&&options.fixedDecimals),unit=options&&options.unit||"";(!unit||!map[unit.toLowerCase()])&&(mag>=map.tb?unit="TB":mag>=map.gb?unit="GB":mag>=map.mb?unit="MB":mag>=map.kb?unit="KB":unit="B");var val=value/map[unit.toLowerCase()],str=val.toFixed(decimalPlaces);return fixedDecimals||(str=str.replace(formatDecimalsRegExp,"$1")),thousandsSeparator&&(str=str.replace(formatThousandsRegExp,thousandsSeparator)),str+unitSeparator+unit}function parse(val){if(typeof val=="number"&&!isNaN(val))return val;if(typeof val!="string")return null;var results=parseRegExp.exec(val),floatValue,unit="b";return results?(floatValue=parseFloat(results[1]),unit=results[4].toLowerCase()):(floatValue=parseInt(val,10),unit="b"),Math.floor(map[unit]*floatValue)}}});var NowError=class extends Error{constructor({code:code2,message,meta}){super(message);this.code=code2,this.meta=meta}};var import_chalk=__toESM(require_source(),1);function code(cmd,{backticks=!0}={}){let tick=backticks?import_chalk.default.gray("`"):"";return`${tick}${import_chalk.default.bold(cmd)}${tick}`}var import_bytes=__toESM(require_bytes(),1),import_build_utils=__toESM(require_build_utils(),1);var import_chalk2=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1),APIError=class extends Error{constructor(message,response,body){super();if(this.message=`${message} (${response.status})`,this.status=response.status,this.serverMessage=message,this.wwwAuthenticate=response.headers.get("WWW-Authenticate")??void 0,body)for(let field of Object.keys(body))field!=="message"&&(this[field]=body[field]);if(response.status===429||response.status===503){let parsed=parseRetryAfterHeaderAsMillis(response.headers.get("Retry-After"));this.retryAfterMs=parsed??(response.status===429?0:void 0)}}};function parseRetryAfterHeaderAsMillis(header){if(!header)return;let retryAfterMs=Number(header)*1e3;if(Number.isNaN(retryAfterMs)){if(retryAfterMs=Date.parse(header),Number.isNaN(retryAfterMs))return;retryAfterMs=retryAfterMs-Date.now()}return Math.max(retryAfterMs,0)}function isAPIError(v){return(0,import_error_utils.isError)(v)&&"status"in v}var TeamDeleted=class extends NowError{constructor(){super({code:"TEAM_DELETED",message:`Your team was deleted or you were removed from the team. You can switch to a different one using ${getCommandName("switch")}.`,meta:{}})}},InvalidToken=class extends NowError{constructor(tokenSource){let message;tokenSource==="flag"?message="The token provided via the `--token` option is not valid. Please provide a valid token.":tokenSource==="env"?message="The token provided via VERCEL_TOKEN environment variable is not valid. Please provide a valid token.":message=`The specified token is not valid. Use ${getCommandName("login")} to generate a new token.`,super({code:"NOT_AUTHORIZED",message,meta:{}})}},MissingUser=class extends NowError{constructor(){super({code:"MISSING_USER",message:"Not able to load user, missing from response",meta:{}})}},DomainAlreadyExists=class extends NowError{constructor(domain){super({code:"DOMAIN_ALREADY_EXISTS",meta:{domain},message:`The domain ${domain} already exists under a different context.`})}},DomainPermissionDenied=class extends NowError{constructor(domain,context){super({code:"DOMAIN_PERMISSION_DENIED",meta:{domain,context},message:`You don't have access to the domain ${domain} under ${context}.`})}},DomainExternal=class extends NowError{constructor(domain){super({code:"DOMAIN_EXTERNAL",meta:{domain},message:`The domain ${domain} must point to zeit.world.`})}},SourceNotFound=class extends NowError{constructor(){super({code:"SOURCE_NOT_FOUND",meta:{},message:"Not able to purchase. Please add a payment method using the dashboard."})}};var DomainNotFound=class extends NowError{constructor(domain,contextName){super({code:"DOMAIN_NOT_FOUND",meta:{domain},message:`Domain not found by "${domain}"${contextName?` under ${import_chalk2.default.bold(contextName)}`:""}.`})}},DomainNotVerified=class extends NowError{constructor(domain){super({code:"DOMAIN_NOT_VERIFIED",meta:{domain},message:`The domain ${domain} is not verified.`})}},DomainVerificationFailed=class extends NowError{constructor({domain,nsVerification,txtVerification,purchased=!1}){super({code:"DOMAIN_VERIFICATION_FAILED",meta:{domain,nsVerification,txtVerification,purchased},message:`We can't verify the domain ${domain}. Both Name Servers and DNS TXT verifications failed.`})}},InvalidDomain=class extends NowError{constructor(domain,message){super({code:"INVALID_DOMAIN",meta:{domain},message:message||`The domain ${domain} is not valid.`})}},NotDomainOwner=class extends NowError{constructor(message){super({code:"NOT_DOMAIN_OWNER",meta:{},message})}},InvalidDeploymentId=class extends NowError{constructor(id,message){super({code:"INVALID_DEPLOYMENT_ID",meta:{id},message:message||`The deployment id "${id}" is not valid.`})}},UnsupportedTLD=class extends NowError{constructor(domain){super({code:"UNSUPPORTED_TLD",meta:{domain},message:`The TLD for domain name ${domain} is not supported.`})}},TLDNotSupportedViaCLI=class extends NowError{constructor(domain){super({code:"UNSUPPORTED_TLD_VIA_CLI",meta:{domain},message:`Purchases for the TLD of ${domain} are not supported via the CLI. Use the REST API or the dashboard to buy it.`})}},DomainNotAvailable=class extends NowError{constructor(domain){super({code:"DOMAIN_NOT_AVAILABLE",meta:{domain},message:`The domain ${domain} is not available to be purchased.`})}};var UnexpectedDomainPurchaseError=class extends NowError{constructor(domain){super({code:"UNEXPECTED_DOMAIN_PURCHASE_ERROR",meta:{domain},message:`The order for ${domain} failed.`})}},UnexpectedDomainTransferError=class extends NowError{constructor(domain){super({code:"UNEXPECTED_DOMAIN_TRANSFER_ERROR",meta:{domain},message:"An unexpected error happened while transferring."})}},DomainPaymentError=class extends NowError{constructor(){super({code:"DOMAIN_PAYMENT_ERROR",meta:{},message:"Your card was declined. Nothing was charged."})}},DomainChargeOutcomeUnknown=class extends NowError{constructor(domain,verb){super({code:"DOMAIN_CHARGE_OUTCOME_UNKNOWN",meta:{domain,verb},message:`Can't confirm whether ${domain} was ${verb==="buy"?"bought":"renewed"}. Run ${getCommandName(`domains inspect ${domain}`)} before trying again, or you may be charged twice.`})}},DomainPurchaseRefunded=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_REFUNDED",meta:{domain},message:`The purchase of ${domain} failed, and the charge was refunded.`})}},DomainPurchaseRefundFailed=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_REFUND_FAILED",meta:{domain},message:`The purchase of ${domain} failed, and refunding the charge also failed. Contact Vercel support about the charge.`})}},DomainPriceChanged=class extends NowError{constructor(domain){super({code:"DOMAIN_PRICE_CHANGED",meta:{domain},message:`The price of ${domain} changed. Nothing was charged.`})}},DomainPurchasePending=class extends NowError{constructor(domain){super({code:"DOMAIN_PURCHASE_PENDING",meta:{domain},message:`The domain purchase for ${domain} is pending.`})}},UserAborted=class extends NowError{constructor(){super({code:"USER_ABORTED",meta:{},message:"The user canceled the operation."})}},CertNotFound=class extends NowError{constructor(id){super({code:"CERT_NOT_FOUND",meta:{id},message:`The cert ${id} can't be found.`})}},CertsPermissionDenied=class extends NowError{constructor(context,domain){super({code:"CERTS_PERMISSION_DENIED",meta:{domain},message:`You don't have access to ${domain}'s certs under ${context}.`})}},CertOrderNotFound=class extends NowError{constructor(cns){super({code:"CERT_ORDER_NOT_FOUND",meta:{cns},message:`No cert order could be found for cns ${cns.join(" ,")}`})}},TooManyRequests=class extends NowError{constructor(api,retryAfterMs){super({code:"TOO_MANY_REQUESTS",meta:{api,retryAfterMs},message:"Rate limited. Too many requests to the same endpoint."})}},CertError=class extends NowError{constructor({cns,code:code2,message,helpUrl}){super({code:"CERT_ERROR",meta:{cns,code:code2,helpUrl},message})}},CertConfigurationError=class extends NowError{constructor({cns,message,external,type,helpUrl}){super({code:"CERT_CONFIGURATION_ERROR",meta:{cns,helpUrl,external,type},message})}},DeploymentNotFound=class extends NowError{constructor({context,id=""}){super({code:"DEPLOYMENT_NOT_FOUND",meta:{id,context},message:`Can't find the deployment "${id}" under the context "${context}"`})}},DeploymentNotReady=class extends NowError{constructor({url=""}){super({code:"DEPLOYMENT_NOT_READY",meta:{url},message:`The deployment https://${url} is not ready.`})}},DeploymentFailedAliasImpossible=class extends NowError{constructor(){super({code:"DEPLOYMENT_FAILED_ALIAS_IMPOSSIBLE",meta:{},message:"The deployment build has failed and cannot be aliased"})}},DeploymentPermissionDenied=class extends NowError{constructor(id,context){super({code:"DEPLOYMENT_PERMISSION_DENIED",meta:{id,context},message:`You don't have access to the deployment ${id} under ${context}.`})}},InvalidAlias=class extends NowError{constructor(alias){super({code:"INVALID_ALIAS",meta:{alias},message:`The given alias ${alias} is not valid`})}},AliasInUse=class extends NowError{constructor(alias){super({code:"ALIAS_IN_USE",meta:{alias},message:"The alias is already in use"})}},CertMissing=class extends NowError{constructor(domain){super({code:"CERT_MISSING",meta:{domain},message:`The certificate for domain ${domain} is missing`})}},CantParseJSONFile=class extends NowError{constructor(file,parseErrorLocation){let message=`Can't parse json file ${file}: ${parseErrorLocation}`;super({code:"CANT_PARSE_JSON_FILE",meta:{file,parseErrorLocation},message})}},ConflictingConfigFiles=class extends import_build_utils.NowBuildError{constructor(files,message,link){super({code:"CONFLICTING_CONFIG_FILES",message:message||"Multiple config files found. Please use only one configuration file.",link:link||"https://vercel.link/combining-old-and-new-config"});this.files=files}},DeprecatedNowJson=class extends import_build_utils.NowBuildError{constructor(_file){super({code:"DEPRECATED_NOW_JSON",message:"The `now.json` file is deprecated and no longer supported. Please rename it to `vercel.json`.",link:"https://vercel.com/docs/projects/project-configuration"})}},CantFindConfig=class extends NowError{constructor(paths){super({code:"CANT_FIND_CONFIG",meta:{paths},message:"Can't find a configuration file in the given locations."})}},WorkingDirectoryDoesNotExist=class extends NowError{constructor(){super({code:"CWD_DOES_NOT_EXIST",meta:{},message:"The current working directory does not exist."})}};var NoAliasInConfig=class extends NowError{constructor(){super({code:"NO_ALIAS_IN_CONFIG",meta:{},message:"There is no alias set up in config file."})}},InvalidAliasInConfig=class extends NowError{constructor(value){super({code:"INVALID_ALIAS_IN_CONFIG",meta:{value},message:"Invalid alias option in configuration."})}};var DNSPermissionDenied=class extends NowError{constructor(domain){super({code:"DNS_PERMISSION_DENIED",meta:{domain},message:`You don't have access to the DNS records of ${domain}.`})}},DNSInvalidPort=class extends NowError{constructor(){super({code:"DNS_INVALID_PORT",meta:{},message:"Invalid <port> parameter. A number was expected"})}},DNSInvalidType=class extends NowError{constructor(type){super({code:"DNS_INVALID_TYPE",meta:{type},message:`Invalid <type> parameter "${type}". Expected one of A, AAAA, ALIAS, CAA, CNAME, MX, SRV, TXT`})}},DNSConflictingRecord=class extends NowError{constructor(record){super({code:"DNS_CONFLICTING_RECORD",meta:{record},message:` A conflicting record exists "${record}".`})}},DomainRemovalConflict=class extends NowError{constructor({aliases,certs,message,pendingAsyncPurchase,resolvable,suffix,transferring}){super({code:"domain_removal_conflict",meta:{aliases,certs,pendingAsyncPurchase,suffix,transferring,resolvable},message})}},DomainMoveConflict=class extends NowError{constructor({message,pendingAsyncPurchase,resolvable,suffix}){super({code:"domain_move_conflict",meta:{pendingAsyncPurchase,resolvable,suffix},message})}};var InvalidMoveDestination=class extends NowError{constructor(destination){super({code:"INVALID_MOVE_DESTINATION",message:`Invalid move destination "${destination}"`,meta:{destination}})}};var LambdaSizeExceededError=class extends NowError{constructor(size,maxLambdaSize){super({code:"MAX_LAMBDA_SIZE_EXCEEDED",message:`The lambda function size (${(0,import_bytes.default)(size).toLowerCase()}) exceeds the maximum size limit (${(0,import_bytes.default)(maxLambdaSize).toLowerCase()}).`,meta:{size,maxLambdaSize}})}},MissingDotenvVarsError=class extends NowError{constructor(type,missing){let message;missing.length===1?message=`Env var ${JSON.stringify(missing[0])} is not defined in ${code(type)} file`:message=[`The following env vars are not defined in ${code(type)} file:`,...missing.map(name=>` - ${JSON.stringify(name)}`)].join(`
8
8
  `),message+=`
9
9
  Read more: https://err.sh/vercel/missing-env-file`,super({code:"MISSING_DOTENV_VARS",message,meta:{type,missing}})}},DeploymentsRateLimited=class extends NowError{constructor(message){super({code:"DEPLOYMENTS_RATE_LIMITED",meta:{},message})}},BuildsRateLimited=class extends NowError{constructor(message,meta={}){super({code:"BUILDS_RATE_LIMITED",meta,message})}},ProjectNotFound=class extends NowError{constructor(nameOrId){super({code:"PROJECT_NOT_FOUND",meta:{},message:`There is no project for "${nameOrId}"`})}},LinkRequiredError=class extends NowError{constructor(message="No project is linked in this directory. Run `vercel link` or pass a project name."){super({code:"LINK_REQUIRED",meta:{},message})}},AliasDomainConfigured=class extends NowError{constructor({message}){super({code:"DOMAIN_CONFIGURED",meta:{},message})}},MissingBuildScript=class extends NowError{constructor({message}){super({code:"MISSING_BUILD_SCRIPT",meta:{},message})}},ConflictingFilePath=class extends NowError{constructor({message}){super({code:"CONFLICTING_FILE_PATH",meta:{},message})}},ConflictingPathSegment=class extends NowError{constructor({message}){super({code:"CONFLICTING_PATH_SEGMENT",meta:{},message})}},BuildError=class extends NowError{constructor({message,meta}){super({code:"BUILD_ERROR",meta,message})}},SchemaValidationFailed=class extends NowError{constructor(message,keyword,dataPath,params){super({code:"SCHEMA_VALIDATION_FAILED",meta:{message,keyword,dataPath,params},message:"Schema verification failed"})}},InvalidLocalConfig=class extends NowError{constructor(value){super({code:"INVALID_LOCAL_CONFIG",meta:{value},message:`Invalid local config parameter [${value.map(localConfig=>`"${localConfig}"`).join(", ")}]. A string was expected.`})}};export{require_bytes,NowError,code,APIError,parseRetryAfterHeaderAsMillis,isAPIError,TeamDeleted,InvalidToken,MissingUser,DomainAlreadyExists,DomainPermissionDenied,DomainExternal,SourceNotFound,DomainNotFound,DomainNotVerified,DomainVerificationFailed,InvalidDomain,NotDomainOwner,InvalidDeploymentId,UnsupportedTLD,TLDNotSupportedViaCLI,DomainNotAvailable,UnexpectedDomainPurchaseError,UnexpectedDomainTransferError,DomainPaymentError,DomainChargeOutcomeUnknown,DomainPurchaseRefunded,DomainPurchaseRefundFailed,DomainPriceChanged,DomainPurchasePending,UserAborted,CertNotFound,CertsPermissionDenied,CertOrderNotFound,TooManyRequests,CertError,CertConfigurationError,DeploymentNotFound,DeploymentNotReady,DeploymentFailedAliasImpossible,DeploymentPermissionDenied,InvalidAlias,AliasInUse,CertMissing,CantParseJSONFile,ConflictingConfigFiles,DeprecatedNowJson,CantFindConfig,WorkingDirectoryDoesNotExist,NoAliasInConfig,InvalidAliasInConfig,DNSPermissionDenied,DNSInvalidPort,DNSInvalidType,DNSConflictingRecord,DomainRemovalConflict,DomainMoveConflict,InvalidMoveDestination,LambdaSizeExceededError,MissingDotenvVarsError,DeploymentsRateLimited,BuildsRateLimited,ProjectNotFound,LinkRequiredError,AliasDomainConfigured,MissingBuildScript,ConflictingFilePath,ConflictingPathSegment,BuildError,SchemaValidationFailed,InvalidLocalConfig};
10
10
  /*! Bundled license information:
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_minimatch}from"./chunk-3P4Y46MS.js";import{pullEnvRecords}from"./chunk-OER4YAWM.js";import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import{__toESM}from"./chunk-BZENIQ7N.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}import{existsSync,readFileSync}from"node:fs";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir));if(linkLocation==="")return{repoRoot,resolvedRootDirectory:""};let setting=normalizeRelative(rootDirectorySetting??"");return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join(anchorDir,setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot};
7
+ import{require_minimatch}from"./chunk-3P4Y46MS.js";import{pullEnvRecords}from"./chunk-PY5A73YH.js";import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{__toESM}from"./chunk-BZENIQ7N.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}import{existsSync,readFileSync}from"node:fs";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir));if(linkLocation==="")return{repoRoot,resolvedRootDirectory:""};let setting=normalizeRelative(rootDirectorySetting??"");return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join(anchorDir,setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_dist as require_dist2,validateConfig}from"./chunk-APWCVJAG.js";import{require_dist2 as require_dist}from"./chunk-3P4Y46MS.js";import{readJSONFile}from"./chunk-QGGJ5VVZ.js";import{compileVercelConfig}from"./chunk-CS6E5XNQ.js";import{init_dist,parse,stringify}from"./chunk-U4Z2MMOF.js";import{CantParseJSONFile}from"./chunk-YCJHUYBJ.js";import{require_build_utils}from"./chunk-DWOJP4ST.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-IJYZSEBY.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)+`
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
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
9
 
10
10
  `+patchToml+`
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-RHFPMM4R.js";import{packageName}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`)}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};
7
+ import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-QZEZCUUZ.js";import{packageName}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`)}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{resolveProjectContext}from"./chunk-FJ5CNQDD.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-I7U2XP4X.js";import{parseArguments}from"./chunk-F22QLVTX.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-DWOJP4ST.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-A2UZ2O7H.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}export{requireProjectContext,parseSubcommandArguments,validateRequiredArguments};
7
+ import{resolveProjectContext}from"./chunk-JULKMXVP.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-KAUKCHQF.js";import{parseArguments}from"./chunk-KIMIK4SG.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-YPPDRKVC.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}export{requireProjectContext,parseSubcommandArguments,validateRequiredArguments};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{packageName}from"./chunk-JESNVRVR.js";import{formatOption,jsonOption,limitOption,projectOption}from"./chunk-A2UZ2O7H.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},TAGS_SORT_BY_CHOICES=["updatedAt","tag"],TAGS_SORT_ORDER_CHOICES=["asc","desc"],tagsLsSubcommand={name:"ls",aliases:["list"],description:"List a repository's tags",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"sort-by",shorthand:null,type:String,deprecated:!1,description:"Field to sort tags by (default: updatedAt)",argument:"FIELD",choices:TAGS_SORT_BY_CHOICES},{name:"sort-order",shorthand:null,type:String,deprecated:!1,description:"Sort direction (default: desc)",argument:"ORDER",choices:TAGS_SORT_ORDER_CHOICES},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List a repository's tags",value:`${packageName} vcr tag ls my-app`}]},tagsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single tag",arguments:[{name:"repository",required:!0},{name:"tag",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a tag by name",value:`${packageName} vcr tag inspect my-app latest`}]},tagsAggregateCommand={name:"tag",aliases:["tags"],description:"List or inspect a repository's tags",arguments:[],subcommands:[tagsLsSubcommand,tagsInspectSubcommand],options:[],examples:[]};export{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand,tagsInspectSubcommand,tagsAggregateCommand};
7
+ import{packageName}from"./chunk-JESNVRVR.js";import{formatOption,jsonOption,limitOption,projectOption}from"./chunk-YPPDRKVC.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},TAGS_SORT_BY_CHOICES=["updatedAt","tag"],TAGS_SORT_ORDER_CHOICES=["asc","desc"],tagsLsSubcommand={name:"ls",aliases:["list"],description:"List a repository's tags",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"sort-by",shorthand:null,type:String,deprecated:!1,description:"Field to sort tags by (default: updatedAt)",argument:"FIELD",choices:TAGS_SORT_BY_CHOICES},{name:"sort-order",shorthand:null,type:String,deprecated:!1,description:"Sort direction (default: desc)",argument:"ORDER",choices:TAGS_SORT_ORDER_CHOICES},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List a repository's tags",value:`${packageName} vcr tag ls my-app`}]},tagsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single tag",arguments:[{name:"repository",required:!0},{name:"tag",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a tag by name",value:`${packageName} vcr tag inspect my-app latest`}]},tagsAggregateCommand={name:"tag",aliases:["tags"],description:"List or inspect a repository's tags",arguments:[],subcommands:[tagsLsSubcommand,tagsInspectSubcommand],options:[],examples:[]};export{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand,tagsInspectSubcommand,tagsAggregateCommand};