@vercel/cli-support 65.11.0 → 65.12.0-snapshot-801db9d533c3

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 (369) hide show
  1. package/README.md +8 -120
  2. package/dist/chunks/add-BDJYCIBT.js +8 -0
  3. package/dist/chunks/add-LZR4CD7O.js +8 -0
  4. package/dist/chunks/add-MR6YZTRQ.js +8 -0
  5. package/dist/chunks/{alerts-JGRRCQA4.js → alerts-VOYMO6NJ.js} +1 -1
  6. package/dist/chunks/build-H2U56DYB.js +7 -0
  7. package/dist/chunks/{chunk-UF2E5BDE.js → chunk-23PO6JK6.js} +1 -1
  8. package/dist/chunks/{chunk-PUKYAALC.js → chunk-24SIHFEW.js} +1 -1
  9. package/dist/chunks/{chunk-EBIJ26IV.js → chunk-2C6TLXE5.js} +1 -1
  10. package/dist/chunks/{chunk-QROI2U32.js → chunk-2CQJKBKV.js} +2 -4
  11. package/dist/chunks/{chunk-7MZLV3KK.js → chunk-2CZL3GJU.js} +1 -1
  12. package/dist/chunks/{chunk-XH2R2EIK.js → chunk-2EV53VB5.js} +1 -1
  13. package/dist/chunks/{chunk-5B5CLOKM.js → chunk-2FNOYPRB.js} +1 -1
  14. package/dist/chunks/{chunk-4E6BGQWR.js → chunk-2LOA3LC6.js} +1 -1
  15. package/dist/chunks/{chunk-M3Z6NSC2.js → chunk-2V6UURUN.js} +1 -1
  16. package/dist/chunks/{chunk-B6QVH6IG.js → chunk-32EEQITR.js} +1 -1
  17. package/dist/chunks/{chunk-4VP57TOJ.js → chunk-33OMDQTW.js} +1 -1
  18. package/dist/chunks/{chunk-CFYLTZSV.js → chunk-3AGRCSWN.js} +1 -1
  19. package/dist/chunks/{chunk-42J2KCDF.js → chunk-3EFPSM6M.js} +1 -1
  20. package/dist/chunks/{chunk-DQASZDQT.js → chunk-3SNWIYU7.js} +1 -1
  21. package/dist/chunks/{chunk-EVBGFSK5.js → chunk-42Y46TZ3.js} +1 -1
  22. package/dist/chunks/{chunk-KV3QXTRZ.js → chunk-4OO6TXBM.js} +1 -1
  23. package/dist/chunks/{chunk-UUDE44NV.js → chunk-54FY6GJ5.js} +1 -1
  24. package/dist/chunks/{chunk-RIJ45N7C.js → chunk-5HQEYPDO.js} +1 -1
  25. package/dist/chunks/chunk-5KL6UFII.js +7 -0
  26. package/dist/chunks/{chunk-ECFLIVEE.js → chunk-5L566FZB.js} +1 -1
  27. package/dist/chunks/{chunk-NZW3RIQM.js → chunk-5MFGTXWC.js} +1 -1
  28. package/dist/chunks/{chunk-4ELZOAQH.js → chunk-5TMHRECT.js} +1 -1
  29. package/dist/chunks/{chunk-74VQ7PQV.js → chunk-5YLKPSZI.js} +1 -1
  30. package/dist/chunks/chunk-66TKNVRG.js +60 -0
  31. package/dist/chunks/{chunk-RDWLLSPU.js → chunk-6737KAJP.js} +1 -1
  32. package/dist/chunks/{chunk-V5TOMLK4.js → chunk-6Q2XEYCJ.js} +1 -1
  33. package/dist/chunks/{chunk-7VGBGUX7.js → chunk-6S6UZV3V.js} +1 -1
  34. package/dist/chunks/{chunk-EZLPMOHM.js → chunk-6WTGR7UP.js} +1 -1
  35. package/dist/chunks/chunk-7BDQUBSO.js +7 -0
  36. package/dist/chunks/chunk-7M6EHM5B.js +7 -0
  37. package/dist/chunks/{chunk-42FOKWGX.js → chunk-7PGDJTAH.js} +1 -1
  38. package/dist/chunks/{chunk-BZIC36KP.js → chunk-7TVNKTN2.js} +1 -1
  39. package/dist/chunks/{chunk-IIGNDMLO.js → chunk-ABSFPYM4.js} +1 -1
  40. package/dist/chunks/{chunk-MBXLL2HF.js → chunk-AGLOVMPC.js} +3 -3
  41. package/dist/chunks/{chunk-B56SRT5W.js → chunk-AIZIVXNX.js} +1 -1
  42. package/dist/chunks/{chunk-WBSFE6IE.js → chunk-AQBK55BT.js} +1 -1
  43. package/dist/chunks/chunk-AW33SRYY.js +7 -0
  44. package/dist/chunks/{chunk-UNPK7LVC.js → chunk-B3IBBNIR.js} +1 -1
  45. package/dist/chunks/{chunk-VRH7LWOC.js → chunk-B4KA3ZH2.js} +1 -1
  46. package/dist/chunks/{chunk-2J35YKA2.js → chunk-BC74BRVP.js} +12 -12
  47. package/dist/chunks/{chunk-PFZCGMJ7.js → chunk-BH5OASEJ.js} +1 -1
  48. package/dist/chunks/chunk-BIGJEDOA.js +11 -0
  49. package/dist/chunks/chunk-BOJDM3O7.js +7 -0
  50. package/dist/chunks/{chunk-375JVQYK.js → chunk-CJZE7647.js} +1 -1
  51. package/dist/chunks/{chunk-YZKARZ2B.js → chunk-CKJZSRAC.js} +1 -1
  52. package/dist/chunks/{chunk-TUAS3L5I.js → chunk-D5JRYYTT.js} +1 -1
  53. package/dist/chunks/{chunk-SF4E3AQ3.js → chunk-E3WP42P2.js} +1 -1
  54. package/dist/chunks/{chunk-6UMVJ7RL.js → chunk-E7CEQ2PO.js} +1 -1
  55. package/dist/chunks/chunk-E7IFYSQT.js +12 -0
  56. package/dist/chunks/chunk-EDO66J3L.js +7 -0
  57. package/dist/chunks/{chunk-C5QEQSEX.js → chunk-EIFBF3JQ.js} +1 -1
  58. package/dist/chunks/chunk-EM3U6PRB.js +7 -0
  59. package/dist/chunks/{chunk-AMPJ6RWT.js → chunk-EZVNGJN5.js} +1 -1
  60. package/dist/chunks/{chunk-ZPBGAZC2.js → chunk-F6KURUPQ.js} +1 -1
  61. package/dist/chunks/{chunk-5DXC4TE2.js → chunk-F7L5SXJM.js} +1 -1
  62. package/dist/chunks/{chunk-ZTHW5VNH.js → chunk-FFS3QJCU.js} +2 -2
  63. package/dist/chunks/{chunk-FNH3T3CF.js → chunk-FGZXIHGN.js} +1 -1
  64. package/dist/chunks/chunk-FXOKM2RM.js +7 -0
  65. package/dist/chunks/{chunk-NUSKXXZZ.js → chunk-FZLCDLWD.js} +1 -1
  66. package/dist/chunks/{chunk-CD6ZWCKT.js → chunk-G63MSB6N.js} +1 -1
  67. package/dist/chunks/{chunk-HNH3DPIZ.js → chunk-GAILIG45.js} +1 -1
  68. package/dist/chunks/{chunk-FVVOHGQE.js → chunk-GHNHUSVK.js} +1 -1
  69. package/dist/chunks/{chunk-4DMKP6AO.js → chunk-GOI2VVI7.js} +2 -2
  70. package/dist/chunks/chunk-GORL5DZC.js +11 -0
  71. package/dist/chunks/{chunk-WMWB7QKG.js → chunk-GP3KGUCK.js} +1 -1
  72. package/dist/chunks/{chunk-GL66K54F.js → chunk-GPDERS2D.js} +1 -1
  73. package/dist/chunks/{chunk-CU3LNJZV.js → chunk-GUSOYIW6.js} +1 -1
  74. package/dist/chunks/{chunk-AO6AMYBF.js → chunk-GY44CQXK.js} +1 -1
  75. package/dist/chunks/chunk-H64GR57G.js +7 -0
  76. package/dist/chunks/{chunk-VKCBEW6R.js → chunk-HBWRIR42.js} +1 -1
  77. package/dist/chunks/{chunk-4U6ACPA4.js → chunk-HR66URIC.js} +1 -1
  78. package/dist/chunks/chunk-HRGJO4HK.js +7 -0
  79. package/dist/chunks/chunk-HU5NUOWH.js +7 -0
  80. package/dist/chunks/{chunk-4KM733OB.js → chunk-HVJN2SSK.js} +1 -1
  81. package/dist/chunks/chunk-HXLOBW75.js +10 -0
  82. package/dist/chunks/{chunk-4T57TXQ3.js → chunk-IBBLLUXD.js} +1 -1
  83. package/dist/chunks/{chunk-MO2G2ND2.js → chunk-IJBRT2AD.js} +1 -1
  84. package/dist/chunks/{chunk-NT2N5UR4.js → chunk-IRIFXCZW.js} +1 -1
  85. package/dist/chunks/{chunk-ECGY67NB.js → chunk-J7RNU6AO.js} +1 -1
  86. package/dist/chunks/{chunk-SDYCW5JM.js → chunk-JONZUKWX.js} +1 -1
  87. package/dist/chunks/{chunk-P24YBQ6H.js → chunk-JVGENO2R.js} +1 -1
  88. package/dist/chunks/{chunk-PKNEWN4W.js → chunk-K46QQRUN.js} +1 -1
  89. package/dist/chunks/{chunk-BJXLR2RE.js → chunk-KKYNEEM7.js} +1 -1
  90. package/dist/chunks/{chunk-3TDFSO4X.js → chunk-KPSINH7T.js} +1 -1
  91. package/dist/chunks/chunk-KR4DMT3I.js +7 -0
  92. package/dist/chunks/{chunk-RCUDI7OF.js → chunk-M32HBBPK.js} +1 -1
  93. package/dist/chunks/{chunk-ZQXXESKG.js → chunk-MAA5GRIM.js} +1 -1
  94. package/dist/chunks/chunk-MCYG7CCE.js +7 -0
  95. package/dist/chunks/{chunk-VAZ7JG2Z.js → chunk-MNZYFYYH.js} +1 -1
  96. package/dist/chunks/{chunk-HDISAMDF.js → chunk-MQJ4MINN.js} +1 -1
  97. package/dist/chunks/{chunk-ITQPDXXA.js → chunk-MTZYPCZ7.js} +1 -1
  98. package/dist/chunks/{chunk-NE6PKR2J.js → chunk-MWWMY5R6.js} +1 -1
  99. package/dist/chunks/{chunk-UBJVL3NJ.js → chunk-MWXL6HYB.js} +3 -3
  100. package/dist/chunks/{chunk-UFXIPUNI.js → chunk-MXALPSIX.js} +1 -1
  101. package/dist/chunks/{chunk-7JMN657A.js → chunk-NBTFAXL4.js} +1 -1
  102. package/dist/chunks/{chunk-HYOWFNOP.js → chunk-NIZW6D6D.js} +1 -1
  103. package/dist/chunks/{chunk-KBVYN635.js → chunk-NREH4VSU.js} +1 -1
  104. package/dist/chunks/{chunk-TPJV5UNE.js → chunk-NTYBDY24.js} +1 -1
  105. package/dist/chunks/{chunk-NDMQVBTV.js → chunk-NYJTWSSD.js} +1 -1
  106. package/dist/chunks/{chunk-7ZJ7VUIR.js → chunk-O3DAPRJ3.js} +1 -1
  107. package/dist/chunks/chunk-O7TFWXLZ.js +13 -0
  108. package/dist/chunks/{chunk-K7ARJYAG.js → chunk-OFOZ5DBA.js} +1 -1
  109. package/dist/chunks/{chunk-FYE7ILRR.js → chunk-OFZUWHZW.js} +1 -1
  110. package/dist/chunks/{chunk-RI6DJAFI.js → chunk-OHEM2CSW.js} +1 -1
  111. package/dist/chunks/{chunk-6ORJPXDQ.js → chunk-OHK3Y5NS.js} +1 -1
  112. package/dist/chunks/{chunk-IHTWZEQW.js → chunk-OKKG2FUS.js} +1 -1
  113. package/dist/chunks/{chunk-7NMC4E66.js → chunk-OR3ZEVBW.js} +1 -1
  114. package/dist/chunks/{chunk-QDHTI5WK.js → chunk-POR6KNXT.js} +1 -1
  115. package/dist/chunks/{chunk-JUSNW3IF.js → chunk-PSFHYOLD.js} +1 -1
  116. package/dist/chunks/{chunk-TZE4CS4K.js → chunk-QBHTNUM5.js} +1 -1
  117. package/dist/chunks/chunk-QJDWNTYH.js +7 -0
  118. package/dist/chunks/{chunk-YUHKH4TK.js → chunk-QKOLFLLP.js} +1 -1
  119. package/dist/chunks/chunk-REJLEESP.js +10 -0
  120. package/dist/chunks/{chunk-EIMHC5UY.js → chunk-ROKZIMRO.js} +1 -1
  121. package/dist/chunks/{chunk-DR6OJB6P.js → chunk-RPIBJRIT.js} +1 -1
  122. package/dist/chunks/chunk-SEHERY6U.js +7 -0
  123. package/dist/chunks/{chunk-RR5SDYNN.js → chunk-SHMHL6W7.js} +1 -1
  124. package/dist/chunks/{chunk-5FIY443M.js → chunk-SMETSNPH.js} +1 -1
  125. package/dist/chunks/{chunk-NMIZSQDN.js → chunk-SP6E7PHW.js} +1 -1
  126. package/dist/chunks/chunk-SQBDW5FO.js +10 -0
  127. package/dist/chunks/chunk-SWFG73OS.js +8 -0
  128. package/dist/chunks/{chunk-CHIYT3V4.js → chunk-TA7KTIDV.js} +1 -1
  129. package/dist/chunks/{chunk-W24TLPO5.js → chunk-TJBVFVXK.js} +1 -1
  130. package/dist/chunks/{chunk-JTAUWH5V.js → chunk-TJUZVODP.js} +1 -1
  131. package/dist/chunks/{chunk-VWJXV5ZM.js → chunk-TKVUWTBK.js} +1 -1
  132. package/dist/chunks/chunk-U7ZEFVSQ.js +8 -0
  133. package/dist/chunks/{chunk-WTFD4MDT.js → chunk-UZQJQXGJ.js} +1 -1
  134. package/dist/chunks/{chunk-UIMJNASP.js → chunk-V7G4VDZI.js} +1 -1
  135. package/dist/chunks/{chunk-WNDR5HCU.js → chunk-VCJIB3FB.js} +1 -1
  136. package/dist/chunks/{chunk-EGTJTCCW.js → chunk-VFBELAGX.js} +1 -1
  137. package/dist/chunks/{chunk-AYZ52QDF.js → chunk-VM6X5BTK.js} +1 -1
  138. package/dist/chunks/{chunk-HZEKH3RO.js → chunk-VVTMF2AY.js} +1 -1
  139. package/dist/chunks/{chunk-N65H4JMJ.js → chunk-W25UARQV.js} +1 -1
  140. package/dist/chunks/chunk-WLMW7K7F.js +7 -0
  141. package/dist/chunks/{chunk-IHCYNUI2.js → chunk-XJYDISH3.js} +1 -1
  142. package/dist/chunks/chunk-XSQZ35V6.js +7 -0
  143. package/dist/chunks/{chunk-YODQLETL.js → chunk-XVDUP67R.js} +1 -1
  144. package/dist/chunks/{chunk-SLCPSRDR.js → chunk-Y2FVJ7YO.js} +1 -1
  145. package/dist/chunks/chunk-Y2SQC4GV.js +10 -0
  146. package/dist/chunks/{chunk-FVTRIRML.js → chunk-Y5S2OEJH.js} +1 -1
  147. package/dist/chunks/{chunk-EJN55YDV.js → chunk-YANOBY2G.js} +1 -1
  148. package/dist/chunks/{chunk-2RXUQ72I.js → chunk-YIOMTAUF.js} +1 -1
  149. package/dist/chunks/{chunk-BW25OFQG.js → chunk-YLCIOXSX.js} +1 -1
  150. package/dist/chunks/{chunk-GZLYNPNU.js → chunk-YNCWSPPJ.js} +1 -1
  151. package/dist/chunks/chunk-YQQ3A3YC.js +13 -0
  152. package/dist/chunks/{chunk-UI2H2EIM.js → chunk-YTRKHRL3.js} +1 -1
  153. package/dist/chunks/{chunk-MIIHBRKV.js → chunk-Z2K2JR7F.js} +1 -1
  154. package/dist/chunks/{chunk-F7AVGV4Y.js → chunk-Z73UJVGD.js} +1 -1
  155. package/dist/chunks/{chunk-6Y2ZL5XJ.js → chunk-ZKNEIE44.js} +2 -2
  156. package/dist/chunks/chunk-ZXEWWSTH.js +10 -0
  157. package/dist/chunks/chunk-ZZLCRSES.js +11 -0
  158. package/dist/chunks/clear-7QUM5KH7.js +8 -0
  159. package/dist/chunks/{cli-embedded-Y74S252S.js → cli-embedded-ABHGJLYX.js} +1 -1
  160. package/dist/chunks/compile-vercel-config-RDISBTDC.js +7 -0
  161. package/dist/chunks/config-2YNYR6YI.js +7 -0
  162. package/dist/chunks/config-4AOTKKGI.js +8 -0
  163. package/dist/chunks/config-validator.mjs +1 -1
  164. package/dist/chunks/{connect-git-provider-GFAJLQLU.js → connect-git-provider-BMUUC7ND.js} +1 -1
  165. package/dist/chunks/contract-3VSUIBEY.js +10 -0
  166. package/dist/chunks/delete-EJNR4UYC.js +10 -0
  167. package/dist/chunks/delete-OYOBFPEG.js +9 -0
  168. package/dist/chunks/describe-ORIEHT3R.js +25 -0
  169. package/dist/chunks/detect-projects-AKK2XI76.js +7 -0
  170. package/dist/chunks/detect-services-3LYPKUVL.js +7 -0
  171. package/dist/chunks/disable-U6JU546S.js +7 -0
  172. package/dist/chunks/discard-6SHAFQ2H.js +14 -0
  173. package/dist/chunks/edit-YMWKFN3H.js +8 -0
  174. package/dist/chunks/edit-YTTKJFTG.js +9 -0
  175. package/dist/chunks/enable-A6KBPFXJ.js +7 -0
  176. package/dist/chunks/{esm-4ZHGYTUV.js → esm-CF5UHWPM.js} +1 -1
  177. package/dist/chunks/{esm-LNIAU767.js → esm-EYOXGOVF.js} +1 -1
  178. package/dist/chunks/{esm-IBY43SSX.js → esm-FSME24KA.js} +1 -1
  179. package/dist/chunks/{esm-7FVTQHRH.js → esm-IUATPKKB.js} +1 -1
  180. package/dist/chunks/{esm-GTSUYLKG.js → esm-L6OKDFWP.js} +1 -1
  181. package/dist/chunks/{esm-TEM4KPXZ.js → esm-ORQC2ZSA.js} +1 -1
  182. package/dist/chunks/{esm-TLAM7FSK.js → esm-PYIZNQIK.js} +1 -1
  183. package/dist/chunks/{exec-H3X7U4P3.js → exec-RQ257MTR.js} +1 -1
  184. package/dist/chunks/{export-25TQ3YBT.js → export-MMU6VVFK.js} +1 -1
  185. package/dist/chunks/future-ANILGGFQ.js +7 -0
  186. package/dist/chunks/generate-cert-for-deploy-LKKZUKWF.js +7 -0
  187. package/dist/chunks/image-OWWKVBTU.js +7 -0
  188. package/dist/chunks/import-builders-VENL23EH.js +7 -0
  189. package/dist/chunks/{inspect-3W3TUJ6P.js → inspect-BPIJT4OX.js} +1 -1
  190. package/dist/chunks/inspect-GDZJZGHW.js +13 -0
  191. package/dist/chunks/{inspect-TN2QY3BP.js → inspect-H7JGEVL7.js} +1 -1
  192. package/dist/chunks/inspect-I6LQLOBG.js +8 -0
  193. package/dist/chunks/{inspect-BRYVSQBD.js → inspect-IGFAKTAX.js} +1 -1
  194. package/dist/chunks/inspect-U6V4UQXC.js +9 -0
  195. package/dist/chunks/list-763XVNFH.js +8 -0
  196. package/dist/chunks/{list-WA6Q7DUN.js → list-OX2N4JK7.js} +1 -1
  197. package/dist/chunks/list-WHZXMZJ5.js +12 -0
  198. package/dist/chunks/{list-6W4UQBY4.js → list-XLPMNNI7.js} +1 -1
  199. package/dist/chunks/login-2PGWWOKB.js +7 -0
  200. package/dist/chunks/login-T63WJL4S.js +9 -0
  201. package/dist/chunks/logs-S2KJGEIG.js +7 -0
  202. package/dist/chunks/ls-5HXYPIFR.js +11 -0
  203. package/dist/chunks/ls-M4GJOBZP.js +8 -0
  204. package/dist/chunks/ls-N56BWH2L.js +8 -0
  205. package/dist/chunks/{ls-L5LLKZBV.js → ls-O5B3LY4D.js} +1 -1
  206. package/dist/chunks/{ls-MAJ4QZTY.js → ls-PNGTHVUK.js} +1 -1
  207. package/dist/chunks/{ls-UXE5RSZN.js → ls-Q7FAOSVD.js} +1 -1
  208. package/dist/chunks/{ls-4WP6LHLL.js → ls-R4UDBWS3.js} +1 -1
  209. package/dist/chunks/migrate-experimental-services-HWJXO4AJ.js +7 -0
  210. package/dist/chunks/mutate-FM6BLE46.js +9 -0
  211. package/dist/chunks/{native-self-update-DEVBYOH2.js → native-self-update-7LL6RPJW.js} +1 -1
  212. package/dist/chunks/notifications-ZSZN35BQ.js +7 -0
  213. package/dist/chunks/open-4RXUUYQP.js +7 -0
  214. package/dist/chunks/openapi-457MABMI.js +7 -0
  215. package/dist/chunks/permissions-UJRTMOT7.js +7 -0
  216. package/dist/chunks/{plugin-offer-JUYWL4I7.js → plugin-offer-KJCRPUU5.js} +1 -1
  217. package/dist/chunks/prompt-missing-credentials-B5DGQFI7.js +7 -0
  218. package/dist/chunks/publish-I3APOD3N.js +15 -0
  219. package/dist/chunks/pull-2YUNTVPQ.js +7 -0
  220. package/dist/chunks/purchase-domain-if-available-3YOXUXII.js +7 -0
  221. package/dist/chunks/push-4QQJQRGZ.js +7 -0
  222. package/dist/chunks/query-2JO6HH5N.js +12 -0
  223. package/dist/chunks/reauthenticate-COYQMMAG.js +7 -0
  224. package/dist/chunks/remove-PWS5EJ7F.js +9 -0
  225. package/dist/chunks/reorder-COZQX64R.js +10 -0
  226. package/dist/chunks/reply-XDYZNHW2.js +9 -0
  227. package/dist/chunks/resolve-6KUFCZRX.js +12 -0
  228. package/dist/chunks/resolve-agent-team-NOT235ZN.js +7 -0
  229. package/dist/chunks/{resolve-deployment-framework-preset-AXXYBFCL.js → resolve-deployment-framework-preset-4TKUU6AH.js} +1 -1
  230. package/dist/chunks/restore-GSSD4ZWH.js +16 -0
  231. package/dist/chunks/rm-AUNVZPJ5.js +8 -0
  232. package/dist/chunks/rm-EIMUYBJT.js +8 -0
  233. package/dist/chunks/rm-EJH37HYN.js +8 -0
  234. package/dist/chunks/rm-O5NMCBC3.js +8 -0
  235. package/dist/chunks/rm-PHTOXG4E.js +8 -0
  236. package/dist/chunks/{routes-BP54NO3Z.js → routes-NEZJKMR5.js} +1 -1
  237. package/dist/chunks/rule-inspect-7HNYKQ6X.js +8 -0
  238. package/dist/chunks/{schema-753JMRZA.js → schema-5P7HROXE.js} +1 -1
  239. package/dist/chunks/schema-MZM5MN5V.js +14 -0
  240. package/dist/chunks/select-org-3BZWQD6R.js +7 -0
  241. package/dist/chunks/set-2RH74ZC3.js +7 -0
  242. package/dist/chunks/set-Q2EJ3V44.js +9 -0
  243. package/dist/chunks/setup-and-link-BT5TNY4J.js +7 -0
  244. package/dist/chunks/{skills-QZ4AMS2K.js → skills-DUOUHPBY.js} +1 -1
  245. package/dist/chunks/{statuspage-KHTMA4WL.js → statuspage-K5SC7KAQ.js} +1 -1
  246. package/dist/chunks/{detect-projects-K7SVMH5T.js → table-W6LOHWWF.js} +1 -1
  247. package/dist/chunks/tags-QOJEEMKS.js +7 -0
  248. package/dist/chunks/{types-NPUAHKSK.js → types-7L6HBXAU.js} +1 -1
  249. package/dist/chunks/{update-7XH7HM5F.js → update-HS6QFTQK.js} +1 -1
  250. package/dist/chunks/usage-3N6IA5SX.js +13 -0
  251. package/dist/chunks/validate-config-YLL6RPCP.js +7 -0
  252. package/dist/commands/build/index.js +1 -1
  253. package/dist/commands/deploy/index.js +19 -37
  254. package/dist/commands/dev/index.js +4 -4
  255. package/dist/commands/env/index.js +1 -1
  256. package/dist/commands/link/index.js +1 -1
  257. package/dist/commands/list/index.js +1 -1
  258. package/dist/commands/project/index.js +1 -1
  259. package/dist/commands-account.js +3 -3
  260. package/dist/commands-ai.js +6 -6
  261. package/dist/commands-blob.js +1 -1
  262. package/dist/commands-core.js +20 -20
  263. package/dist/commands-deployments.js +5 -5
  264. package/dist/commands-flags.js +1 -1
  265. package/dist/commands-integrations.js +1 -1
  266. package/dist/commands-observability.js +15 -8
  267. package/dist/commands-routing.js +5 -4
  268. package/dist/help.js +1 -1
  269. package/dist/index.js +5 -5
  270. package/dist/internal-build.js +1 -1
  271. package/dist/package.json +45 -245
  272. package/dist/vc.js +47 -695
  273. package/dist/version.mjs +1 -1
  274. package/package.json +51 -196
  275. package/dist/chunks/add-4R6FUHQT.js +0 -8
  276. package/dist/chunks/add-F3H4BFJZ.js +0 -8
  277. package/dist/chunks/add-TCOJ4SIQ.js +0 -8
  278. package/dist/chunks/build-GOLTZF6S.js +0 -7
  279. package/dist/chunks/chunk-3KJ6HWSX.js +0 -7
  280. package/dist/chunks/chunk-5X635INY.js +0 -11
  281. package/dist/chunks/chunk-7LPNDK2O.js +0 -7
  282. package/dist/chunks/chunk-A3M2BHWR.js +0 -13
  283. package/dist/chunks/chunk-BUFEV3T4.js +0 -11
  284. package/dist/chunks/chunk-BVR6OIU5.js +0 -7
  285. package/dist/chunks/chunk-D7BB5BPA.js +0 -10
  286. package/dist/chunks/chunk-DBT6PGEH.js +0 -7
  287. package/dist/chunks/chunk-DRZVM7CB.js +0 -12
  288. package/dist/chunks/chunk-EICEQXVS.js +0 -7
  289. package/dist/chunks/chunk-F2R7L3ZB.js +0 -7
  290. package/dist/chunks/chunk-FHMCTV5E.js +0 -7
  291. package/dist/chunks/chunk-FOE3MWES.js +0 -7
  292. package/dist/chunks/chunk-HKU6D7DU.js +0 -8
  293. package/dist/chunks/chunk-IOTKHTZH.js +0 -7
  294. package/dist/chunks/chunk-K4JTCVNW.js +0 -13
  295. package/dist/chunks/chunk-LALPOYIA.js +0 -8
  296. package/dist/chunks/chunk-M3R7F2N4.js +0 -7
  297. package/dist/chunks/chunk-MUKXOI2K.js +0 -8
  298. package/dist/chunks/chunk-NIS66BFX.js +0 -63
  299. package/dist/chunks/chunk-NSPW47RU.js +0 -7
  300. package/dist/chunks/chunk-NTDP6RTQ.js +0 -11
  301. package/dist/chunks/chunk-Q2QVK3TH.js +0 -7
  302. package/dist/chunks/chunk-RM3ZDRYE.js +0 -7
  303. package/dist/chunks/chunk-UCRMJMH6.js +0 -10
  304. package/dist/chunks/chunk-XQDHMFQY.js +0 -7
  305. package/dist/chunks/chunk-XRIM4BUF.js +0 -7
  306. package/dist/chunks/chunk-Z64MQIOE.js +0 -10
  307. package/dist/chunks/chunk-ZS2WS4AM.js +0 -7
  308. package/dist/chunks/clear-PECHXMV5.js +0 -8
  309. package/dist/chunks/compile-vercel-config-EM3HYOQC.js +0 -7
  310. package/dist/chunks/config-DA2NZUDH.js +0 -8
  311. package/dist/chunks/config-X6O3DT7V.js +0 -7
  312. package/dist/chunks/contract-RHMWRX4W.js +0 -10
  313. package/dist/chunks/delete-5RN5VW5L.js +0 -9
  314. package/dist/chunks/delete-MT6I7R7K.js +0 -10
  315. package/dist/chunks/detect-services-HSA4JHJX.js +0 -7
  316. package/dist/chunks/disable-LXPZDQMC.js +0 -7
  317. package/dist/chunks/discard-PW65T65S.js +0 -14
  318. package/dist/chunks/edit-WFSONASO.js +0 -8
  319. package/dist/chunks/edit-YID3FOJ3.js +0 -9
  320. package/dist/chunks/enable-X2EKQCIY.js +0 -7
  321. package/dist/chunks/future-DQBK457G.js +0 -7
  322. package/dist/chunks/generate-cert-for-deploy-OMEACY5G.js +0 -7
  323. package/dist/chunks/image-AO2OZG4W.js +0 -7
  324. package/dist/chunks/import-builders-GSDV4K4A.js +0 -7
  325. package/dist/chunks/inspect-4244CRHI.js +0 -13
  326. package/dist/chunks/inspect-C43IV7X4.js +0 -9
  327. package/dist/chunks/inspect-RP5KXOYQ.js +0 -8
  328. package/dist/chunks/list-2SY6PZLC.js +0 -12
  329. package/dist/chunks/list-WBKZGIMQ.js +0 -8
  330. package/dist/chunks/login-K6XBWOFD.js +0 -9
  331. package/dist/chunks/login-OGMXEW5N.js +0 -7
  332. package/dist/chunks/logs-R3ZERQ7M.js +0 -7
  333. package/dist/chunks/ls-EVAQD3LI.js +0 -8
  334. package/dist/chunks/ls-O5DKK3TY.js +0 -8
  335. package/dist/chunks/ls-PTHGXQLK.js +0 -11
  336. package/dist/chunks/mutate-EKZWPQQJ.js +0 -9
  337. package/dist/chunks/notifications-F5S3RKZF.js +0 -7
  338. package/dist/chunks/open-KGVG54NN.js +0 -7
  339. package/dist/chunks/openapi-7TPDTMCU.js +0 -7
  340. package/dist/chunks/permissions-5K7JZOMB.js +0 -7
  341. package/dist/chunks/prompt-missing-credentials-DX2KJB5X.js +0 -7
  342. package/dist/chunks/publish-KIRTO2ZO.js +0 -15
  343. package/dist/chunks/pull-3CRJK7BX.js +0 -7
  344. package/dist/chunks/purchase-domain-if-available-55IXEF43.js +0 -7
  345. package/dist/chunks/push-4YG5HKSD.js +0 -7
  346. package/dist/chunks/query-67KQVLTR.js +0 -12
  347. package/dist/chunks/reauthenticate-SWSBFGDU.js +0 -7
  348. package/dist/chunks/remove-SYTIFVWW.js +0 -9
  349. package/dist/chunks/reorder-TX5MXJEB.js +0 -10
  350. package/dist/chunks/reply-XVK33N5T.js +0 -9
  351. package/dist/chunks/resolve-JZ262ZF4.js +0 -12
  352. package/dist/chunks/resolve-agent-team-BG5YW55B.js +0 -7
  353. package/dist/chunks/restore-IPFL7TKT.js +0 -16
  354. package/dist/chunks/rm-2BCAZGQU.js +0 -8
  355. package/dist/chunks/rm-3CCU3CE6.js +0 -8
  356. package/dist/chunks/rm-5CQV5LYG.js +0 -8
  357. package/dist/chunks/rm-OV4OU6H2.js +0 -8
  358. package/dist/chunks/rm-WFGMOZ3G.js +0 -8
  359. package/dist/chunks/rule-inspect-RFJIIXZH.js +0 -8
  360. package/dist/chunks/schema-SUNFQGUL.js +0 -14
  361. package/dist/chunks/select-org-MPHPWWPU.js +0 -7
  362. package/dist/chunks/set-BR6EEOPB.js +0 -7
  363. package/dist/chunks/set-I3NWZRSI.js +0 -9
  364. package/dist/chunks/setup-and-link-MRTKVOWD.js +0 -7
  365. package/dist/chunks/tags-7DIZEAVE.js +0 -7
  366. package/dist/chunks/usage-3BS7JCCU.js +0 -13
  367. package/dist/chunks/validate-config-LAD7BU3B.js +0 -7
  368. package/dist/launcher-errors.js +0 -11
  369. package/dist/native-download.js +0 -8
@@ -4,14 +4,23 @@ 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{handleTracingApiError,invalidArguments,resolveConfigScope,resolveScope,tracingErrorMessage,tracingErrorReason}from"./chunks/chunk-F2R7L3ZB.js";import{RECENT_DAYS,STATUS_PAGE_HOST,STATUS_PAGE_URL,StatusPageError,getStatusReport}from"./chunks/chunk-BJXLR2RE.js";import{main}from"./chunks/chunk-W24TLPO5.js";import{InvalidEventsResponseError,RecordTooLargeError,decodeContinuation,encodeContinuation,fetchEventPages,sortIntervals,warningLine}from"./chunks/chunk-3TDFSO4X.js";import{readStdinText}from"./chunks/chunk-PSOVLGHP.js";import"./chunks/chunk-XOETL6DB.js";import"./chunks/chunk-MO2G2ND2.js";import"./chunks/chunk-VWJXV5ZM.js";import"./chunks/chunk-TPJV5UNE.js";import"./chunks/chunk-6Y2ZL5XJ.js";import"./chunks/chunk-YZKARZ2B.js";import{runCurl}from"./chunks/chunk-K4JTCVNW.js";import{applyDeprecatedGitBranchFlag}from"./chunks/chunk-KBVYN635.js";import"./chunks/chunk-7YKFF6CE.js";import"./chunks/chunk-EVBGFSK5.js";import"./chunks/chunk-UNPK7LVC.js";import"./chunks/chunk-NE6PKR2J.js";import{validateIntegerRangeWithDefault}from"./chunks/chunk-42FOKWGX.js";import"./chunks/chunk-4T57TXQ3.js";import"./chunks/chunk-LALPOYIA.js";import"./chunks/chunk-25565AGS.js";import{decodeListCursor,sliceList}from"./chunks/chunk-ECGY67NB.js";import{ellipsis}from"./chunks/chunk-AKOYIH3A.js";import{external_exports}from"./chunks/chunk-2AMO2VMV.js";import{parseRepoUrl}from"./chunks/chunk-WNDR5HCU.js";import"./chunks/chunk-4ELZOAQH.js";import"./chunks/chunk-JUAHDOL6.js";import"./chunks/chunk-UI2H2EIM.js";import"./chunks/chunk-UUDE44NV.js";import{recordLine,summaryLine,writeJsonError}from"./chunks/chunk-UFXIPUNI.js";import"./chunks/chunk-TOTTVS5P.js";import{formatTable}from"./chunks/chunk-2RXUQ72I.js";import"./chunks/chunk-D3M2JG5C.js";import{parseListLimit,printNextPageCommand,printNextPageHint}from"./chunks/chunk-TZE4CS4K.js";import"./chunks/chunk-UIMJNASP.js";import{canPrompt,canPromptOnTerminal}from"./chunks/chunk-IQ7FPAI4.js";import"./chunks/chunk-VT6RIZJH.js";import{stamp_default}from"./chunks/chunk-A2RZZQEP.js";import"./chunks/chunk-Q7D7RGXM.js";import"./chunks/chunk-UCRMJMH6.js";import"./chunks/chunk-7JMN657A.js";import"./chunks/chunk-JTAUWH5V.js";import{require_open}from"./chunks/chunk-PVASGBEF.js";import"./chunks/chunk-JUSNW3IF.js";import{table}from"./chunks/chunk-375JVQYK.js";import{getRenamedOption}from"./chunks/chunk-3KJ6HWSX.js";import{getSubcommand as getSubcommand2}from"./chunks/chunk-ETV3C2CV.js";import{printUnknownCommand}from"./chunks/chunk-D7BB5BPA.js";import"./chunks/chunk-SLCPSRDR.js";import{CI_LOG_LEVELS,ciCommand,createSubcommand4 as createSubcommand,deleteSubcommand,disableSubcommand,drainsCommand,enableSubcommand,getCommandAliases,grepSubcommand,healthCommand,inspectSubcommand4 as inspectSubcommand,inspectSubcommand7 as inspectSubcommand2,listSubcommand12 as listSubcommand2,listSubcommand6 as listSubcommand,logsSubcommand,pauseSubcommand,rerunSubcommand,resumeSubcommand,updateSubcommand3 as updateSubcommand}from"./chunks/chunk-QROI2U32.js";import{createSubcommand as createSubcommand2,getSubcommand,searchSubcommand,tracesCommand}from"./chunks/chunk-M3Z6NSC2.js";import"./chunks/chunk-ECFLIVEE.js";import"./chunks/chunk-RDWLLSPU.js";import"./chunks/chunk-7ZJ7VUIR.js";import"./chunks/chunk-WTFD4MDT.js";import{tracesConfigCommand}from"./chunks/chunk-IHTWZEQW.js";import"./chunks/chunk-74VQ7PQV.js";import"./chunks/chunk-SNGM6NSO.js";import"./chunks/chunk-P24YBQ6H.js";import"./chunks/chunk-NMIZSQDN.js";import"./chunks/chunk-K7ARJYAG.js";import"./chunks/chunk-V5TOMLK4.js";import"./chunks/chunk-M3R7F2N4.js";import"./chunks/chunk-4E6BGQWR.js";import"./chunks/chunk-6UMVJ7RL.js";import"./chunks/chunk-IIGNDMLO.js";import"./chunks/chunk-N65H4JMJ.js";import"./chunks/chunk-EJN55YDV.js";import"./chunks/chunk-5DXC4TE2.js";import"./chunks/chunk-4U6ACPA4.js";import"./chunks/chunk-7VGBGUX7.js";import"./chunks/chunk-CU3LNJZV.js";import"./chunks/chunk-JALVF3C2.js";import"./chunks/chunk-BZIC36KP.js";import{printError}from"./chunks/chunk-NDMQVBTV.js";import{help,remoteText}from"./chunks/chunk-HZEKH3RO.js";import"./chunks/chunk-3G3FQYMW.js";import{getContextName,getScope,scopeFlagPassed}from"./chunks/chunk-NSPW47RU.js";import{TelemetryClient}from"./chunks/chunk-MBXLL2HF.js";import"./chunks/chunk-2EYYB6YN.js";import"./chunks/chunk-NWGBDBZI.js";import{buildCommandWithYes,getErrorRecovery,getGlobalFlagsFromArgv,outputAgentError,shouldEmitNonInteractiveCommandError,withGlobalFlags,writeAgentError}from"./chunks/chunk-5X635INY.js";import"./chunks/chunk-FYE7ILRR.js";import{execFileAsync,getGitExecutable,getLinkedProject,getProjectByNameOrId,selectGitRemote,sleep}from"./chunks/chunk-2J35YKA2.js";import{require_pluralize}from"./chunks/chunk-4HR3I3ML.js";import{ALIGNED_LABEL_WIDTH,formatAlignedLabel,printAlignedLabel}from"./chunks/chunk-PKNEWN4W.js";import"./chunks/chunk-ITQPDXXA.js";import"./chunks/chunk-GL66K54F.js";import"./chunks/chunk-4NTBYNFR.js";import{isArgumentError,parseArguments,takeCommand}from"./chunks/chunk-AYZ52QDF.js";import{getTeamByIdOrSlug}from"./chunks/chunk-2VBFQZ72.js";import{validateJsonOutput,warnDeprecatedSubcommand}from"./chunks/chunk-SDYCW5JM.js";import"./chunks/chunk-LUX4PBJL.js";import"./chunks/chunk-OPORM35X.js";import{require_ms}from"./chunks/chunk-MXTC4ZAQ.js";import"./chunks/chunk-ZS2WS4AM.js";import"./chunks/chunk-4SAVH3H7.js";import{ProjectNotFound,isAPIError}from"./chunks/chunk-4DMKP6AO.js";import{cmd,getCommandName,getCommandNamePlain}from"./chunks/chunk-VRH7LWOC.js";import"./chunks/chunk-DBT6PGEH.js";import{output_manager_default,recordCliError}from"./chunks/chunk-GZLYNPNU.js";import"./chunks/chunk-BLUPZPAS.js";import"./chunks/chunk-5MDNVAE6.js";import"./chunks/chunk-OCR5CRTH.js";import"./chunks/chunk-RM3ZDRYE.js";import"./chunks/chunk-YHPPP3SF.js";import"./chunks/chunk-PUKYAALC.js";import{GLOBAL_CLI_FLAG_NAMES,getFlagsSpecification,quoteArg}from"./chunks/chunk-AMPJ6RWT.js";import"./chunks/chunk-2BKALEOP.js";import{require_source}from"./chunks/chunk-NB2WLB3J.js";import"./chunks/chunk-ISWW3DKF.js";import{require_strip_ansi}from"./chunks/chunk-BULSRTQE.js";import"./chunks/chunk-BRQUZ5NC.js";import"./chunks/chunk-D6REP5QQ.js";import"./chunks/chunk-FBYA6LLM.js";import{toNodeReadable}from"./chunks/chunk-MY4MONOH.js";import"./chunks/chunk-7EJQLVWX.js";import"./chunks/chunk-SCV7XEEO.js";import{AGENT_REASON,AGENT_STATUS,getExitCodeForReason}from"./chunks/chunk-Q2QVK3TH.js";import{__commonJS,__require,__toESM}from"./chunks/chunk-BZENIQ7N.js";var require_split2=__commonJS({"../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js"(exports,module){"use strict";var{Transform:Transform2}=__require("stream"),{StringDecoder}=__require("string_decoder"),kLast=Symbol("last"),kDecoder=Symbol("decoder");function transform(chunk,enc,cb){let list2;if(this.overflow){if(list2=this[kDecoder].write(chunk).split(this.matcher),list2.length===1)return cb();list2.shift(),this.overflow=!1}else this[kLast]+=this[kDecoder].write(chunk),list2=this[kLast].split(this.matcher);this[kLast]=list2.pop();for(let i=0;i<list2.length;i++)try{push(this,this.mapper(list2[i]))}catch(error){return cb(error)}if(this.overflow=this[kLast].length>this.maxLength,this.overflow&&!this.skipOverflow){cb(new Error("maximum buffer reached"));return}cb()}function flush(cb){if(this[kLast]+=this[kDecoder].end(),this[kLast])try{push(this,this.mapper(this[kLast]))}catch(error){return cb(error)}cb()}function push(self,val){val!==void 0&&self.push(val)}function noop(incoming){return incoming}function split2(matcher,mapper,options){switch(matcher=matcher||/\r?\n/,mapper=mapper||noop,options=options||{},arguments.length){case 1:typeof matcher=="function"?(mapper=matcher,matcher=/\r?\n/):typeof matcher=="object"&&!(matcher instanceof RegExp)&&!matcher[Symbol.split]&&(options=matcher,matcher=/\r?\n/);break;case 2:typeof matcher=="function"?(options=mapper,mapper=matcher,matcher=/\r?\n/):typeof mapper=="object"&&(options=mapper,mapper=noop)}options=Object.assign({},options),options.autoDestroy=!0,options.transform=transform,options.flush=flush,options.readableObjectMode=!0;let stream=new Transform2(options);return stream[kLast]="",stream[kDecoder]=new StringDecoder("utf8"),stream.matcher=matcher,stream.mapper=mapper,stream.maxLength=options.maxLength,stream.skipOverflow=options.skipOverflow||!1,stream.overflow=!1,stream._destroy=function(err,cb){this._writableState.errorEmitted=!1,cb(err)},stream}module.exports=split2}});var CiTelemetryClient=class extends TelemetryClient{trackCliSubcommandDisable(actual){this.trackCliSubcommand({subcommand:"disable",value:actual})}trackCliSubcommandEnable(actual){this.trackCliSubcommand({subcommand:"enable",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandLogs(actual){this.trackCliSubcommand({subcommand:"logs",value:actual})}trackCliSubcommandGrep(actual){this.trackCliSubcommand({subcommand:"grep",value:actual})}trackCliSubcommandRerun(actual){this.trackCliSubcommand({subcommand:"rerun",value:actual})}trackCliSubcommandList(actual){this.trackCliSubcommand({subcommand:"list",value:actual})}};var import_strip_ansi=__toESM(require_strip_ansi(),1);function ciDisplayText(value){return Array.from((0,import_strip_ansi.default)(value),char=>{let code=char.codePointAt(0);return code>=127&&code<=159?`\\u${code.toString(16).padStart(4,"0")}`:code<32?JSON.stringify(char).slice(1,-1):char}).join("")}function quoteCiCommandArg(value){return/^[a-zA-Z0-9_./:@%+,=-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}function buildCiCommand(argv,args){return getCommandNamePlain([...args,...getGlobalFlagsFromArgv(argv)].map(quoteCiCommandArg).join(" "))}var import_split2=__toESM(require_split2(),1);import{Transform}from"node:stream";import{pipeline}from"node:stream/promises";async function*readNdjson(client,url,options={}){let response=await client.fetch(url,{json:!1,accountId:options.accountId,signal:options.signal}),source=toNodeReadable(response.body),maxFrameBytes=8*1024*1024,frameBytes=0,bounded=new Transform({transform(chunk,_encoding,callback){let start=0;for(;start<chunk.length;){let newline=chunk.indexOf(10,start),end=newline===-1?chunk.length:newline;if(frameBytes+=end-start,frameBytes>maxFrameBytes){callback(new Error("Vercel CI response frame exceeds 8 MiB."));return}if(newline===-1)break;frameBytes=0,start=newline+1}callback(null,chunk)}}),lines=(0,import_split2.default)(),completion=pipeline(source,bounded,lines,{signal:options.signal}).then(()=>{},error=>error);try{let snapshot=response.headers.get("content-type")?.split(";")[0]==="application/json",json="",bytes=0;for await(let line of lines)if(snapshot){if(bytes+=Buffer.byteLength(line)+1,bytes>8*1024*1024)throw new Error("Vercel CI JSON snapshot exceeds 8 MiB.");json+=`${line}
7
+ import{handleTracingApiError,invalidArguments,resolveConfigScope,resolveScope,tracingErrorMessage,tracingErrorReason}from"./chunks/chunk-QJDWNTYH.js";import{RECENT_DAYS,STATUS_PAGE_HOST,STATUS_PAGE_URL,StatusPageError,getStatusReport}from"./chunks/chunk-KKYNEEM7.js";import{main}from"./chunks/chunk-TJBVFVXK.js";import{InvalidEventsResponseError,RecordTooLargeError,decodeContinuation,encodeContinuation,fetchEventPages,sortIntervals,warningLine}from"./chunks/chunk-KPSINH7T.js";import"./chunks/chunk-TKVUWTBK.js";import{readStdinText}from"./chunks/chunk-PSOVLGHP.js";import"./chunks/chunk-XOETL6DB.js";import{runCurl}from"./chunks/chunk-YQQ3A3YC.js";import{applyDeprecatedGitBranchFlag}from"./chunks/chunk-NREH4VSU.js";import{validateIntegerRangeWithDefault}from"./chunks/chunk-7PGDJTAH.js";import"./chunks/chunk-Y2SQC4GV.js";import{decodeListCursor,sliceList}from"./chunks/chunk-J7RNU6AO.js";import{parseRepoUrl}from"./chunks/chunk-VCJIB3FB.js";import"./chunks/chunk-5TMHRECT.js";import"./chunks/chunk-JUAHDOL6.js";import"./chunks/chunk-YTRKHRL3.js";import"./chunks/chunk-54FY6GJ5.js";import{ellipsis}from"./chunks/chunk-AKOYIH3A.js";import"./chunks/chunk-D3M2JG5C.js";import"./chunks/chunk-V7G4VDZI.js";import"./chunks/chunk-VT6RIZJH.js";import"./chunks/chunk-TOTTVS5P.js";import"./chunks/chunk-42Y46TZ3.js";import{external_exports}from"./chunks/chunk-2AMO2VMV.js";import{recordLine,summaryLine,writeJsonError}from"./chunks/chunk-MXALPSIX.js";import{formatTable}from"./chunks/chunk-YIOMTAUF.js";import{stamp_default}from"./chunks/chunk-A2RZZQEP.js";import"./chunks/chunk-Q7D7RGXM.js";import{printUnknownCommand}from"./chunks/chunk-SQBDW5FO.js";import"./chunks/chunk-IJBRT2AD.js";import"./chunks/chunk-NTYBDY24.js";import"./chunks/chunk-ZKNEIE44.js";import"./chunks/chunk-KR4DMT3I.js";import"./chunks/chunk-CKJZSRAC.js";import"./chunks/chunk-IBBLLUXD.js";import"./chunks/chunk-B3IBBNIR.js";import"./chunks/chunk-7YKFF6CE.js";import"./chunks/chunk-MWWMY5R6.js";import"./chunks/chunk-25565AGS.js";import{require_open}from"./chunks/chunk-PVASGBEF.js";import"./chunks/chunk-ZXEWWSTH.js";import"./chunks/chunk-PSFHYOLD.js";import"./chunks/chunk-NBTFAXL4.js";import"./chunks/chunk-TJUZVODP.js";import{canPrompt,canPromptOnTerminal}from"./chunks/chunk-IQ7FPAI4.js";import{getRenamedOption}from"./chunks/chunk-WLMW7K7F.js";import{getSubcommand as getSubcommand2}from"./chunks/chunk-ETV3C2CV.js";import{parseListLimit,printNextPageCommand,printNextPageHint}from"./chunks/chunk-QBHTNUM5.js";import{table}from"./chunks/chunk-CJZE7647.js";import"./chunks/chunk-Y2FVJ7YO.js";import{CI_LOG_LEVELS,ciCommand,createSubcommand4 as createSubcommand,deleteSubcommand,disableSubcommand,drainsCommand,enableSubcommand,getCommandAliases,grepSubcommand,healthCommand,inspectSubcommand4 as inspectSubcommand,inspectSubcommand7 as inspectSubcommand2,listSubcommand12 as listSubcommand2,listSubcommand6 as listSubcommand,logsSubcommand,pauseSubcommand,rerunSubcommand,resumeSubcommand,updateSubcommand3 as updateSubcommand}from"./chunks/chunk-2CQJKBKV.js";import{createSubcommand as createSubcommand2,getSubcommand,searchSubcommand,tracesCommand}from"./chunks/chunk-2V6UURUN.js";import{tracesConfigCommand}from"./chunks/chunk-OKKG2FUS.js";import"./chunks/chunk-5L566FZB.js";import"./chunks/chunk-6737KAJP.js";import"./chunks/chunk-O3DAPRJ3.js";import"./chunks/chunk-UZQJQXGJ.js";import"./chunks/chunk-5YLKPSZI.js";import"./chunks/chunk-SNGM6NSO.js";import"./chunks/chunk-JVGENO2R.js";import"./chunks/chunk-SP6E7PHW.js";import"./chunks/chunk-OFOZ5DBA.js";import"./chunks/chunk-6Q2XEYCJ.js";import"./chunks/chunk-SEHERY6U.js";import"./chunks/chunk-2LOA3LC6.js";import"./chunks/chunk-E7CEQ2PO.js";import"./chunks/chunk-W25UARQV.js";import"./chunks/chunk-7BDQUBSO.js";import"./chunks/chunk-ABSFPYM4.js";import"./chunks/chunk-YANOBY2G.js";import"./chunks/chunk-F7L5SXJM.js";import"./chunks/chunk-6S6UZV3V.js";import"./chunks/chunk-GUSOYIW6.js";import"./chunks/chunk-JALVF3C2.js";import"./chunks/chunk-7TVNKTN2.js";import"./chunks/chunk-HR66URIC.js";import{printError}from"./chunks/chunk-NYJTWSSD.js";import{help,remoteText}from"./chunks/chunk-VVTMF2AY.js";import"./chunks/chunk-3G3FQYMW.js";import{getContextName,getScope,scopeFlagPassed}from"./chunks/chunk-XSQZ35V6.js";import{TelemetryClient}from"./chunks/chunk-AGLOVMPC.js";import"./chunks/chunk-2EYYB6YN.js";import"./chunks/chunk-NWGBDBZI.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,getErrorRecovery,getExitCodeForReason,getGlobalFlagsFromArgv,outputAgentError,shouldEmitNonInteractiveCommandError,withGlobalFlags,writeAgentError}from"./chunks/chunk-GORL5DZC.js";import"./chunks/chunk-OFZUWHZW.js";import{execFileAsync,getGitExecutable,getLinkedProject,getProjectByNameOrId,selectGitRemote,sleep}from"./chunks/chunk-BC74BRVP.js";import{require_pluralize}from"./chunks/chunk-4HR3I3ML.js";import{ALIGNED_LABEL_WIDTH,formatAlignedLabel,printAlignedLabel}from"./chunks/chunk-K46QQRUN.js";import"./chunks/chunk-MTZYPCZ7.js";import"./chunks/chunk-GPDERS2D.js";import"./chunks/chunk-4NTBYNFR.js";import{isArgumentError,parseArguments,takeCommand}from"./chunks/chunk-VM6X5BTK.js";import{getTeamByIdOrSlug}from"./chunks/chunk-2VBFQZ72.js";import{validateJsonOutput,warnDeprecatedSubcommand}from"./chunks/chunk-JONZUKWX.js";import"./chunks/chunk-LUX4PBJL.js";import"./chunks/chunk-OPORM35X.js";import{require_ms}from"./chunks/chunk-MXTC4ZAQ.js";import"./chunks/chunk-D6REP5QQ.js";import"./chunks/chunk-FBYA6LLM.js";import{toNodeReadable}from"./chunks/chunk-MY4MONOH.js";import"./chunks/chunk-4SAVH3H7.js";import{ProjectNotFound,isAPIError}from"./chunks/chunk-GOI2VVI7.js";import{cmd,getCommandName,getCommandNamePlain}from"./chunks/chunk-B4KA3ZH2.js";import"./chunks/chunk-BOJDM3O7.js";import{output_manager_default,recordCliError}from"./chunks/chunk-YNCWSPPJ.js";import"./chunks/chunk-BLUPZPAS.js";import"./chunks/chunk-AW33SRYY.js";import"./chunks/chunk-5MDNVAE6.js";import"./chunks/chunk-OCR5CRTH.js";import"./chunks/chunk-7EJQLVWX.js";import"./chunks/chunk-SCV7XEEO.js";import"./chunks/chunk-MCYG7CCE.js";import"./chunks/chunk-YHPPP3SF.js";import"./chunks/chunk-24SIHFEW.js";import{GLOBAL_CLI_FLAG_NAMES,getFlagsSpecification,quoteArg}from"./chunks/chunk-EZVNGJN5.js";import"./chunks/chunk-2BKALEOP.js";import{require_source}from"./chunks/chunk-NB2WLB3J.js";import"./chunks/chunk-ISWW3DKF.js";import"./chunks/chunk-BRQUZ5NC.js";import{require_strip_ansi}from"./chunks/chunk-BULSRTQE.js";import{__commonJS,__require,__toESM}from"./chunks/chunk-BZENIQ7N.js";var require_split2=__commonJS({"../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js"(exports,module){"use strict";var{Transform:Transform2}=__require("stream"),{StringDecoder}=__require("string_decoder"),kLast=Symbol("last"),kDecoder=Symbol("decoder");function transform(chunk,enc,cb){let list2;if(this.overflow){if(list2=this[kDecoder].write(chunk).split(this.matcher),list2.length===1)return cb();list2.shift(),this.overflow=!1}else this[kLast]+=this[kDecoder].write(chunk),list2=this[kLast].split(this.matcher);this[kLast]=list2.pop();for(let i=0;i<list2.length;i++)try{push(this,this.mapper(list2[i]))}catch(error){return cb(error)}if(this.overflow=this[kLast].length>this.maxLength,this.overflow&&!this.skipOverflow){cb(new Error("maximum buffer reached"));return}cb()}function flush(cb){if(this[kLast]+=this[kDecoder].end(),this[kLast])try{push(this,this.mapper(this[kLast]))}catch(error){return cb(error)}cb()}function push(self,val){val!==void 0&&self.push(val)}function noop(incoming){return incoming}function split2(matcher,mapper,options){switch(matcher=matcher||/\r?\n/,mapper=mapper||noop,options=options||{},arguments.length){case 1:typeof matcher=="function"?(mapper=matcher,matcher=/\r?\n/):typeof matcher=="object"&&!(matcher instanceof RegExp)&&!matcher[Symbol.split]&&(options=matcher,matcher=/\r?\n/);break;case 2:typeof matcher=="function"?(options=mapper,mapper=matcher,matcher=/\r?\n/):typeof mapper=="object"&&(options=mapper,mapper=noop)}options=Object.assign({},options),options.autoDestroy=!0,options.transform=transform,options.flush=flush,options.readableObjectMode=!0;let stream=new Transform2(options);return stream[kLast]="",stream[kDecoder]=new StringDecoder("utf8"),stream.matcher=matcher,stream.mapper=mapper,stream.maxLength=options.maxLength,stream.skipOverflow=options.skipOverflow||!1,stream.overflow=!1,stream._destroy=function(err,cb){this._writableState.errorEmitted=!1,cb(err)},stream}module.exports=split2}});var CiTelemetryClient=class extends TelemetryClient{trackCliSubcommandDisable(actual){this.trackCliSubcommand({subcommand:"disable",value:actual})}trackCliSubcommandEnable(actual){this.trackCliSubcommand({subcommand:"enable",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandLogs(actual){this.trackCliSubcommand({subcommand:"logs",value:actual})}trackCliSubcommandGrep(actual){this.trackCliSubcommand({subcommand:"grep",value:actual})}trackCliSubcommandRerun(actual){this.trackCliSubcommand({subcommand:"rerun",value:actual})}trackCliSubcommandList(actual){this.trackCliSubcommand({subcommand:"list",value:actual})}};var import_strip_ansi=__toESM(require_strip_ansi(),1);function ciDisplayText(value){return Array.from((0,import_strip_ansi.default)(value),char=>{let code=char.codePointAt(0);return code>=127&&code<=159?`\\u${code.toString(16).padStart(4,"0")}`:code<32?JSON.stringify(char).slice(1,-1):char}).join("")}function quoteCiCommandArg(value){return/^[a-zA-Z0-9_./:@%+,=-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}function buildCiCommand(argv,args){return getCommandNamePlain([...args,...getGlobalFlagsFromArgv(argv)].map(quoteCiCommandArg).join(" "))}var import_split2=__toESM(require_split2(),1);import{Transform}from"node:stream";import{pipeline}from"node:stream/promises";async function*readNdjson(client,url,options={}){let response=await client.fetch(url,{json:!1,accountId:options.accountId,signal:options.signal}),source=toNodeReadable(response.body),maxFrameBytes=8*1024*1024,frameBytes=0,bounded=new Transform({transform(chunk,_encoding,callback){let start=0;for(;start<chunk.length;){let newline=chunk.indexOf(10,start),end=newline===-1?chunk.length:newline;if(frameBytes+=end-start,frameBytes>maxFrameBytes){callback(new Error("Vercel CI response frame exceeds 8 MiB."));return}if(newline===-1)break;frameBytes=0,start=newline+1}callback(null,chunk)}}),lines=(0,import_split2.default)(),completion=pipeline(source,bounded,lines,{signal:options.signal}).then(()=>{},error=>error);try{let snapshot=response.headers.get("content-type")?.split(";")[0]==="application/json",json="",bytes=0;for await(let line of lines)if(snapshot){if(bytes+=Buffer.byteLength(line)+1,bytes>8*1024*1024)throw new Error("Vercel CI JSON snapshot exceeds 8 MiB.");json+=`${line}
8
8
  `}else line.trim()&&(yield JSON.parse(line));let error=await completion;if(error)throw error;snapshot&&(yield JSON.parse(json))}finally{source.destroy(),bounded.destroy(),lines.destroy(),await completion}}async function resolveCiTeam(_client){return{ok:!0}}function listCiInvocations(client,params,accountId){let query=new URLSearchParams({provider:params.provider,repository:params.repository});params.branch&&query.set("branchName",params.branch),params.commitSha&&query.set("snapshot",params.commitSha);for(let status of params.statuses??[])query.append("status",status);for(let conclusion2 of params.conclusions??[])query.append("conclusion",conclusion2);return params.limit&&query.set("limit",String(params.limit)),params.cursor&&query.set("cursor",params.cursor),client.fetch(`/v2/vercel-ci/invocations?${query}`,{accountId})}function getCiInvocationTree(client,invocationId,options={}){let query=new URLSearchParams;options.attempt&&query.set("attempt",String(options.attempt));let suffix=query.size?`?${query}`:"";return client.fetch(`/v1/vercel-ci/invocations/${encodeURIComponent(invocationId)}/tree${suffix}`,{accountId:options.accountId})}function streamCiInvocationTree(client,invocationId,options){let query=new URLSearchParams({attempt:String(options.attempt),follow:"1"});return readNdjson(client,`/v1/vercel-ci/invocations/${encodeURIComponent(invocationId)}/tree?${query}`,{accountId:options.accountId,signal:options.signal})}async function getLatestCiAttempt(client,invocationId,accountId){let{attempts}=await client.fetch(`/v1/vercel-ci/invocations/${encodeURIComponent(invocationId)}/attempts`,{accountId});return Math.max(1,...attempts.map(attempt=>attempt.attempt))}function searchCiLogs(client,runs,filters,accountId){let query=new URLSearchParams;for(let run of runs)query.append("invocation",`${run.invocationId}:${run.attempt}`);query.set("search",filters.search);for(let level of filters.levels??[])query.append("level",level);return client.fetch(`/v1/vercel-ci/log-search?${query}`,{accountId})}function getCiTaskLogs(client,invocationId,attempt,filters,accountId){let query=new URLSearchParams;for(let task of filters.tasks??[])query.append("task",task);for(let conclusion2 of filters.conclusions??[])query.append("conclusion",conclusion2);for(let level of filters.levels??[])query.append("level",level);filters.search&&query.set("search",filters.search),filters.limit&&query.set("limit",String(filters.limit));let suffix=query.size?`?${query}`:"";return client.fetch(`/v1/vercel-ci/invocations/${encodeURIComponent(invocationId)}/attempts/${attempt}/task-logs${suffix}`,{accountId})}function streamCiTaskRunLogs(client,locator,options){let query=new URLSearchParams({follow:"1"});options.since!==void 0&&query.set("since",String(options.since));for(let level of options.levels??[])query.append("level",level);return readNdjson(client,`${ciTaskRunLogsPath(locator)}?${query}`,{accountId:options.accountId,signal:options.signal})}async function getCiTaskRunLogs(client,locator,options={}){let query=new URLSearchParams;for(let level of options.levels??[])query.append("level",level);let suffix=query.size?`?${query}`:"",snapshot;for await(let value of readNdjson(client,`${ciTaskRunLogsPath(locator)}${suffix}`,{accountId:options.accountId})){if(snapshot||typeof value!="object"||value===null||!("lines"in value)||!Array.isArray(value.lines))throw new Error("Invalid Vercel CI log snapshot.");snapshot=value}if(!snapshot)throw new Error("Missing Vercel CI log snapshot.");return snapshot}function ciTaskRunLogsPath(locator){return`/v1/vercel-ci/${["invocations",locator.invocationId,"attempts",locator.attempt,"job-definitions",locator.jobDefinitionId,"runs",locator.jobRunAttempt,"task-definitions",locator.taskDefinitionId,"runs",locator.taskRunAttempt,"logs"].map(segment=>encodeURIComponent(String(segment))).join("/")}`}async function getCiSetupLogs(client,invocationId,attempt,options={}){let base=`/v1/vercel-ci/invocations/${encodeURIComponent(invocationId)}/attempts/${attempt}`,{invocation}=await client.fetch(base,{accountId:options.accountId});if(invocation.setupConclusion?.result!=="failed")return{failed:!1,lines:[]};let query=new URLSearchParams;for(let level of options.levels??[])query.append("level",level);let suffix=query.size?`?${query}`:"",{lines}=await client.fetch(`${base}/logs${suffix}`,{accountId:options.accountId});return{failed:!0,lines}}function repositorySettingsPath(repo){return`/v1/vercel-ci/repository-settings?${new URLSearchParams({provider:repo.provider,organizationId:repo.organizationId,repository:repo.repository})}`}function getCiRepositorySettings(client,repo,accountId){return client.fetch(repositorySettingsPath(repo),{accountId})}function updateCiRepositorySettings(client,repo,settings,accountId){return client.fetch(repositorySettingsPath(repo),{method:"PATCH",body:settings,accountId})}var CiEnableTelemetryClient=class extends TelemetryClient{trackCliOptionRemote(remote){remote!==void 0&&this.trackCliOption({option:"remote",value:this.redactedValue})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var CiDisableTelemetryClient=class extends TelemetryClient{trackCliOptionRemote(remote){remote!==void 0&&this.trackCliOption({option:"remote",value:this.redactedValue})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var SUPPORTED_PROVIDERS=["github"];async function getCiGitRemoteNames(cwd){let git=await getGitExecutable(cwd),names=await readGit(git,cwd,["remote"]);return names?names.split(`
9
- `):[]}async function getCiGitContext(cwd,remoteName="origin"){let git=await getGitExecutable(cwd),[remote,branch,commitSha]=await Promise.all([readGit(git,cwd,["remote","get-url",remoteName]),readGit(git,cwd,["rev-parse","--abbrev-ref","HEAD"]),readGit(git,cwd,["rev-parse","HEAD"])]);if(!remote)return null;let repo=parseRepoUrl(remote),provider=SUPPORTED_PROVIDERS.find(p=>p===repo?.provider);return!repo||!provider?(output_manager_default.debug("Unsupported Git remote for Vercel CI."),null):{provider,repository:`${repo.org}/${repo.repo}`,...branch&&branch!=="HEAD"?{branch}:{},...commitSha?{commitSha}:{}}}var COMMIT_SHA_PATTERN=/^[0-9a-f]{4,40}$/i;async function resolveCommitSha(cwd,value){let sha=value.trim().toLowerCase();if(!COMMIT_SHA_PATTERN.test(sha))return null;if(sha.length===40)return sha;let git=await getGitExecutable(cwd);return await readGit(git,cwd,["rev-parse","--verify","--quiet",`${sha}^{commit}`])??null}async function readGit(git,cwd,args){try{let{stdout}=await execFileAsync(git,args,{cwd});return stdout.trim()||void 0}catch(error){output_manager_default.debug(`git ${args.join(" ")} failed: ${error}`);return}}function failCi(client,failure){return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,{status:AGENT_STATUS.ERROR,...failure}):output_manager_default.fatal(failure.message),getExitCodeForReason(failure.reason)}function invalidCiArguments(client,message){return failCi(client,{reason:AGENT_REASON.INVALID_ARGUMENTS,message})}function handleCiApiError(client,action,err){if(isAPIError(err)){let detail=err.serverMessage?` ${err.serverMessage}`:"";switch(err.status){case 403:return failCi(client,{reason:AGENT_REASON.PERMISSION_DENIED,message:`Can't ${action}. You don't have access to Vercel CI runs for this team.`});case 404:return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:"Couldn't find that Vercel CI run for this team."});case 429:return failCi(client,{reason:AGENT_REASON.RATE_LIMITED,message:`Failed to ${action}. Too many requests. Wait a moment, then try again.`});default:return failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${action}.${detail}`})}}throw err}async function resolveCiContext(client,remoteOptions){let action=remoteOptions?.action??"enable",remoteName="origin";if(remoteOptions){let remoteNames=await getCiGitRemoteNames(client.cwd);if(remoteOptions.remote!==void 0){if(!remoteNames.includes(remoteOptions.remote))return invalidCiArguments(client,`Can't ${action} Vercel CI. --remote must name an existing Git remote. Run \`git remote\` to list remotes, then pass --remote <NAME>.`);remoteName=remoteOptions.remote}else{if(remoteNames.length>1&&(remoteOptions.nonInteractive||!canPromptOnTerminal(client)))return invalidCiArguments(client,`Can't ${action} Vercel CI. Found multiple Git remotes. Pass --remote <NAME> to select one; run \`git remote\` to list remotes.`);remoteNames.length>0&&(remoteName=await selectGitRemote(client,remoteNames))}}let git=await getCiGitContext(client.cwd,remoteName);if(!git)return failCi(client,{reason:AGENT_REASON.GIT_REPOSITORY_REQUIRED,message:remoteOptions?"Couldn't find a supported Git repository for the selected remote. Vercel CI currently supports GitHub repositories. Run `git remote -v` to check remotes, then pass --remote <NAME>.":"Couldn't find a supported Git repository here. Vercel CI currently supports GitHub repositories with an origin remote."});let team=await resolveCiTeam(client);return team.ok?{git,remoteName,accountId:team.accountId}:team.exitCode}async function updateSettings(client,argv,action){let enabled=action==="enable",command=enabled?enableSubcommand:disableSubcommand,Telemetry=enabled?CiEnableTelemetryClient:CiDisableTelemetryClient,telemetry=new Telemetry({opts:{store:client.telemetryEventStore}}),parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(command.options))}catch(error){return printError(error,client),2}let{args,flags}=parsedArgs;if(telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliOptionRemote(flags["--remote"]),args.length>0)return invalidCiArguments(client,`\`${getCommandNamePlain(`ci ${action}`)}\` doesn't take arguments. Run it inside the repository to ${action}.`);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return invalidCiArguments(client,formatResult.error);let asJson=formatResult.jsonOutput||client.nonInteractive,context=await resolveCiContext(client,{remote:flags["--remote"],nonInteractive:asJson,action});if(typeof context=="number")return context;let{git,accountId}=context,[organizationId,repository]=git.repository.split("/"),repo={provider:git.provider,organizationId,repository},repoName=ciDisplayText(git.repository);asJson||output_manager_default.spinner(enabled?"Enabling Vercel CI\u2026":"Disabling Vercel CI\u2026");let settings,outcome;try{let current=await getCiRepositorySettings(client,repo,accountId);current.ciEnabled===enabled?(settings=current,outcome="unchanged"):(settings=await updateCiRepositorySettings(client,repo,{ciEnabled:enabled},accountId),outcome=enabled?"enabled":"disabled")}catch(err){return output_manager_default.stopSpinner(),handleSettingsError(client,repoName,action,err)}output_manager_default.stopSpinner();let listCommand=buildCiCommand(client.argv,["ci","list"]),next=enabled&&context.remoteName==="origin"?[{command:listCommand,when:"List Vercel CI runs after you push a commit"}]:[],state=enabled?"enabled":"disabled",verb=enabled?"Enabled":"Disabled",message=outcome==="unchanged"?`Vercel CI is already ${state} for ${repoName}.`:`${verb} Vercel CI for ${repoName}.`;if(asJson){let payload={repository:settings,outcome,next},agentPayload=client.nonInteractive?{status:AGENT_STATUS.OK,...payload,message}:payload;return client.stdout.write(`${JSON.stringify(agentPayload,null,2)}
9
+ `):[]}async function getCiGitContext(cwd,remoteName="origin"){let git=await getGitExecutable(cwd),[remote,branch,commitSha]=await Promise.all([readGit(git,cwd,["remote","get-url",remoteName]),readGit(git,cwd,["rev-parse","--abbrev-ref","HEAD"]),readGit(git,cwd,["rev-parse","HEAD"])]);if(!remote)return null;let repo=parseRepoUrl(remote),provider=SUPPORTED_PROVIDERS.find(p=>p===repo?.provider);return!repo||!provider?(output_manager_default.debug("Unsupported Git remote for Vercel CI."),null):{provider,repository:`${repo.org}/${repo.repo}`,...branch&&branch!=="HEAD"?{branch}:{},...commitSha?{commitSha}:{}}}var COMMIT_SHA_PATTERN=/^[0-9a-f]{4,40}$/i;async function resolveCommitSha(cwd,value){let sha=value.trim().toLowerCase();if(!COMMIT_SHA_PATTERN.test(sha))return null;if(sha.length===40)return sha;let git=await getGitExecutable(cwd);return await readGit(git,cwd,["rev-parse","--verify","--quiet",`${sha}^{commit}`])??null}async function readGit(git,cwd,args){try{let{stdout}=await execFileAsync(git,args,{cwd});return stdout.trim()||void 0}catch(error){output_manager_default.debug(`git ${args.join(" ")} failed: ${error}`);return}}function failCi(client,failure){if(shouldEmitNonInteractiveCommandError(client))writeAgentError(client,{status:AGENT_STATUS.ERROR,...failure});else{output_manager_default.fatal(failure.message),typeof failure.data?.httpStatus=="number"&&output_manager_default.print(` HTTP status: ${failure.data.httpStatus}
10
+ `);let apiAction=failure.data?.action;typeof apiAction=="string"&&output_manager_default.print(` API action: ${apiAction}
11
+ `);let remoteMessage=failure.data?.remoteMessage;typeof remoteMessage=="string"&&output_manager_default.print(` API: ${remoteMessage}
12
+ `),failure.hint&&output_manager_default.print(`
13
+ ${failure.hint}
14
+ `),failure.verification_uri&&output_manager_default.print(` ${failure.verification_uri}
15
+ `);for(let step of failure.next??[])output_manager_default.print(`
16
+ ${step.when??"Next"}:
17
+ ${step.command}
18
+ `)}return getExitCodeForReason(failure.reason)}function invalidCiArguments(client,message){return failCi(client,{reason:AGENT_REASON.INVALID_ARGUMENTS,message})}function handleCiApiError(client,action,err){if(isAPIError(err)){let detail=err.serverMessage?` ${err.serverMessage}`:"";switch(err.status){case 403:return failCi(client,{reason:AGENT_REASON.PERMISSION_DENIED,message:`Can't ${action}. You don't have access to Vercel CI runs for this team.`});case 404:return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:"Couldn't find that Vercel CI run for this team."});case 429:return failCi(client,{reason:AGENT_REASON.RATE_LIMITED,message:`Failed to ${action}. Too many requests. Wait a moment, then try again.`});default:return failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${action}.${detail}`})}}throw err}async function resolveCiContext(client,remoteOptions){let action=remoteOptions?.action??"enable",remoteName="origin";if(remoteOptions){let remoteNames=await getCiGitRemoteNames(client.cwd);if(remoteOptions.remote!==void 0){if(!remoteNames.includes(remoteOptions.remote))return invalidCiArguments(client,`Can't ${action} Vercel CI. --remote must name an existing Git remote. Run \`git remote\` to list remotes, then pass --remote <NAME>.`);remoteName=remoteOptions.remote}else{if(remoteNames.length>1&&(remoteOptions.nonInteractive||!canPromptOnTerminal(client)))return invalidCiArguments(client,`Can't ${action} Vercel CI. Found multiple Git remotes. Pass --remote <NAME> to select one; run \`git remote\` to list remotes.`);remoteNames.length>0&&(remoteName=await selectGitRemote(client,remoteNames))}}let git=await getCiGitContext(client.cwd,remoteName);if(!git)return failCi(client,{reason:AGENT_REASON.GIT_REPOSITORY_REQUIRED,message:remoteOptions?"Couldn't find a supported Git repository for the selected remote. Vercel CI currently supports GitHub repositories. Run `git remote -v` to check remotes, then pass --remote <NAME>.":"Couldn't find a supported Git repository here. Vercel CI currently supports GitHub repositories with an origin remote."});let team=await resolveCiTeam(client);return team.ok?{git,remoteName,accountId:team.accountId}:team.exitCode}async function updateSettings(client,argv,action){let enabled=action==="enable",command=enabled?enableSubcommand:disableSubcommand,Telemetry=enabled?CiEnableTelemetryClient:CiDisableTelemetryClient,telemetry=new Telemetry({opts:{store:client.telemetryEventStore}}),parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(command.options))}catch(error){return printError(error,client),2}let{args,flags}=parsedArgs;if(telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliOptionRemote(flags["--remote"]),args.length>0)return invalidCiArguments(client,`\`${getCommandNamePlain(`ci ${action}`)}\` doesn't take arguments. Run it inside the repository to ${action}.`);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return invalidCiArguments(client,formatResult.error);let asJson=formatResult.jsonOutput||client.nonInteractive,context=await resolveCiContext(client,{remote:flags["--remote"],nonInteractive:asJson,action});if(typeof context=="number")return context;let{git,accountId}=context,[organizationId,repository]=git.repository.split("/"),repo={provider:git.provider,organizationId,repository},repoName=ciDisplayText(git.repository);asJson||output_manager_default.spinner(enabled?"Enabling Vercel CI\u2026":"Disabling Vercel CI\u2026");let settings,outcome;try{let current=await getCiRepositorySettings(client,repo,accountId);current.ciEnabled===enabled?(settings=current,outcome="unchanged"):(settings=await updateCiRepositorySettings(client,repo,{ciEnabled:enabled},accountId),outcome=enabled?"enabled":"disabled")}catch(err){return output_manager_default.stopSpinner(),handleSettingsError(client,repoName,action,context.remoteName,err)}output_manager_default.stopSpinner();let listCommand=buildCiCommand(client.argv,["ci","list"]),next=enabled&&context.remoteName==="origin"?[{command:listCommand,when:"List Vercel CI runs after you push a commit"}]:[],state=enabled?"enabled":"disabled",verb=enabled?"Enabled":"Disabled",message=outcome==="unchanged"?`Vercel CI is already ${state} for ${repoName}.`:`${verb} Vercel CI for ${repoName}.`;if(asJson){let payload={repository:settings,outcome,next},agentPayload=client.nonInteractive?{status:AGENT_STATUS.OK,...payload,message}:payload;return client.stdout.write(`${JSON.stringify(agentPayload,null,2)}
10
19
  `),0}return outcome!=="unchanged"?(printAlignedLabel(verb,"Vercel CI",{gutter:"\u2713"}),printAlignedLabel("Repository",repoName)):output_manager_default.print(` ${message}
11
20
  `),next.length>0&&output_manager_default.print(`
12
21
  ${next[0].when}:
13
22
  ${listCommand}
14
- `),0}function handleSettingsError(client,repoName,action,err){if(!isAPIError(err))throw err;switch(err.status){case 403:return failCi(client,{reason:AGENT_REASON.PERMISSION_DENIED,message:`Can't ${action} Vercel CI for ${repoName}. You don't have permission to change Vercel CI settings for this team.`});case 404:return failCi(client,{reason:AGENT_REASON.NOT_FOUND,message:`Couldn't find ${repoName} connected to a project on this team. Connect the repository to a project, or pass the team that owns it with --scope.`,next:[{command:buildCiCommand(client.argv,["git","connect"]),when:"Connect the linked project to this repository"}]});case 409:return failCi(client,{reason:AGENT_REASON.CONFLICT,message:err.code==="repository_linked_to_multiple_teams"?`Can't ${action} Vercel CI for ${repoName}. It's connected to projects on more than one team; Vercel CI needs it connected to one team only.`:`Can't ${action} Vercel CI for ${repoName}. More than one connected repository matches it on this team.`});case 429:return failCi(client,{reason:AGENT_REASON.RATE_LIMITED,message:`Failed to ${action} Vercel CI for ${repoName}. Too many requests. Wait a moment, then try again.`});default:return failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${action} Vercel CI for ${repoName} (HTTP ${err.status}). ${action==="enable"?"Enabling":"Disabling"} is safe to repeat, so run the command again.`})}}function disable(client,argv){return updateSettings(client,argv,"disable")}function enable(client,argv){return updateSettings(client,argv,"enable")}var import_chalk2=__toESM(require_source(),1),import_ms2=__toESM(require_ms(),1),import_pluralize=__toESM(require_pluralize(),1);var FAILED_SETUP_STATUSES=new Set(["bootstrapping_failed","jobs_on_hive_failed"]);function getRunStatus(invocation){return invocation.runConclusion?invocation.runConclusion.result:invocation.completed?.conclusion?invocation.completed.conclusion:invocation.status==="skipped"?"skipped":FAILED_SETUP_STATUSES.has(invocation.status)?"failed":invocation.status==="completed"?"completed":invocation.status==="new"?"queued":"running"}var CI_RUN_STATUSES=["queued","running","succeeded","failed","skipped"],RUNNING_API_STATUSES=["bootstrapping","snapshotted","sandbox_named","jobs_on_hive_clone_dispatched","jobs_on_hive_dispatched","jobs_on_hive_completed","awaiting_jobs"];function toRunStatusFilter(status){switch(status){case"queued":return{statuses:["new"]};case"running":return{statuses:RUNNING_API_STATUSES};case"completed":return{statuses:["completed"]};default:return{conclusions:[status]}}}function isTerminalRunStatus(status){return status!=="queued"&&status!=="running"}function toBranchName(ref){return ref.startsWith("refs/heads/")?ref.slice(11):ref}function toShortSha(sha){return sha.slice(0,7)}var RUN_ID_PREFIX="invo1_",RUN_ID_PATTERN=/^[A-Za-z0-9]+$/;function toDisplayRunId(id2){return id2.startsWith(RUN_ID_PREFIX)?id2.slice(RUN_ID_PREFIX.length):id2}function toApiRunId(input){let id2=toDisplayRunId(input.trim());return RUN_ID_PATTERN.test(id2)?`${RUN_ID_PREFIX}${id2}`:null}function toRunSummary(invocation,repositories){let repository=repositories[invocation.repositoryKey];return{id:toDisplayRunId(invocation.invocationId),attempt:invocation.attempt,status:getRunStatus(invocation),...getRunReason(invocation),repository:repository?`${repository.owner}/${repository.name}`:"",branch:toBranchName(invocation.ref),commitSha:invocation.commitSha,createdAt:toIso(invocation.createdAt)}}function getRunReason(invocation){return invocation.skipped?{reason:invocation.skipped.reason}:invocation.setupConclusion?.result==="failed"?{reason:"setup_failed"}:{}}function toRunView(tree){return{run:toRunSummary(tree.invocation,tree.repositories),jobs:tree.jobs.map(job=>({name:job.definition.name,kind:job.definition.kind,...toStepTiming(job.run),tasks:job.tasks.map(task=>({name:task.definition.name,...toStepTiming(task.run)}))}))}}function toStepTiming(run){let startedAt=run?.started?.startedAt,completedAt=run?.completed?.completedAt,conclusion2=run?.completed?.conclusion,status="queued";return conclusion2?status=conclusion2.result:startedAt!==void 0&&(status="running"),{status,...conclusion2&&"reason"in conclusion2?{reason:conclusion2.reason}:{},...startedAt!==void 0?{startedAt:toIso(startedAt)}:{},...completedAt!==void 0?{completedAt:toIso(completedAt)}:{},...startedAt!==void 0&&completedAt!==void 0?{durationMs:Math.max(completedAt-startedAt,0)}:{}}}function toIso(timestamp2){return new Date(timestamp2).toISOString()}function countTasks(view){let total=0,finished=0;for(let job of view.jobs)for(let task of job.tasks)total++,task.status!=="queued"&&task.status!=="running"&&finished++;return{total,finished}}var CiGrepTelemetryClient=class extends TelemetryClient{trackCliArgumentText(text){text&&this.trackCliArgument({arg:"text",value:this.redactedValue})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliOptionBranch(branch){branch&&this.trackCliOption({option:"branch",value:this.redactedValue})}trackCliFlagAllBranches(allBranches){allBranches&&this.trackCliFlag("all-branches")}trackCliOptionStatus(status){status&&this.trackCliOption({option:"status",value:status})}trackCliOptionRuns(runs){runs!==void 0&&this.trackCliOption({option:"runs",value:String(runs)})}trackCliOptionLevel(levels){levels?.length&&this.trackCliOption({option:"level",value:levels.join(",")})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var import_chalk=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1);function formatStatus(status){switch(status){case"succeeded":return import_chalk.default.green(status);case"failed":return import_chalk.default.red(status);case"skipped":case"cached":return import_chalk.default.gray(status);default:return ciDisplayText(status)}}function formatCiTable(headers,rows){return formatTable(headers,headers.map(()=>"l"),[{rows}]).split(`
23
+ `),0}function handleSettingsError(client,repoName,action,remoteName,err){if(!isAPIError(err))throw err;switch(err.status){case 400:return handleConfigurationError(client,repoName,action,remoteName,err);case 403:return failCi(client,{reason:AGENT_REASON.PERMISSION_DENIED,message:`Can't ${action} Vercel CI for ${repoName}. You don't have permission to change Vercel CI settings for this team.`});case 404:return failCi(client,{reason:AGENT_REASON.NOT_FOUND,message:`Couldn't find ${repoName} connected to a project on this team. Connect the repository to a project, or pass the team that owns it with --scope.`,next:[{command:buildCiCommand(client.argv,["git","connect"]),when:"Connect the linked project to this repository"}]});case 409:return failCi(client,{reason:AGENT_REASON.CONFLICT,message:err.code==="repository_linked_to_multiple_teams"?`Can't ${action} Vercel CI for ${repoName}. It's connected to projects on more than one team; Vercel CI needs it connected to one team only.`:`Can't ${action} Vercel CI for ${repoName}. More than one connected repository matches it on this team.`});case 429:return failCi(client,{reason:AGENT_REASON.RATE_LIMITED,message:`Failed to ${action} Vercel CI for ${repoName}. Too many requests. Wait a moment, then try again.`});default:return failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${action} Vercel CI for ${repoName}.${err.status>=500&&err.status<600?` ${action==="enable"?"Enabling":"Disabling"} is safe to repeat, so run the command again.`:""}`,data:{httpStatus:err.status}})}}function handleConfigurationError(client,repoName,action,remoteName,err){let hint,userActionRequired=!1;err.code==="repo_no_access"?(hint="Ask a repository admin to grant your GitHub user write or admin access.",userActionRequired=!0):err.action==="Install GitHub App"?(hint="Install or configure the Vercel GitHub App with access to this repository.",userActionRequired=!0):err.action==="Open GitHub App Settings"?(hint="Configure the Vercel GitHub App to allow access to this repository.",userActionRequired=!0):err.action==="Add a Login Connection"?(hint="Connect your GitHub account to your Vercel account.",userActionRequired=!0):err.code==="repo_not_found"?hint="Check the repository name and your GitHub access to it.":hint="Review the API detail and resolve the repository configuration before trying again.";let link=configurationRecoveryLink(err.link),retryCommand=buildCiCommand(client.argv,["ci",action,"--remote",remoteName]);return failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Can't ${action} Vercel CI for ${repoName}.`,hint,retryable:!1,...userActionRequired&&{userActionRequired},...link&&{verification_uri:link},data:{httpStatus:err.status,...typeof err.code=="string"&&{code:remoteText(err.code)},...typeof err.serverMessage=="string"&&err.serverMessage&&{remoteMessage:remoteText(err.serverMessage)},...typeof err.action=="string"&&{action:remoteText(err.action)}},next:[{command:retryCommand,when:"After resolving the repository configuration, run"}]})}function configurationRecoveryLink(value){if(!(typeof value!="string"||remoteText(value)!==value))try{let url=new URL(value);if(url.protocol==="https:"&&["github.com","vercel.com"].includes(url.hostname)&&!url.username&&!url.password&&!url.port&&!url.search)return url.href}catch{}}function disable(client,argv){return updateSettings(client,argv,"disable")}function enable(client,argv){return updateSettings(client,argv,"enable")}var import_chalk2=__toESM(require_source(),1),import_ms2=__toESM(require_ms(),1),import_pluralize=__toESM(require_pluralize(),1);var FAILED_SETUP_STATUSES=new Set(["bootstrapping_failed","jobs_on_hive_failed"]);function getRunStatus(invocation){return invocation.runConclusion?invocation.runConclusion.result:invocation.completed?.conclusion?invocation.completed.conclusion:invocation.status==="skipped"?"skipped":FAILED_SETUP_STATUSES.has(invocation.status)?"failed":invocation.status==="completed"?"completed":invocation.status==="new"?"queued":"running"}var CI_RUN_STATUSES=["queued","running","succeeded","failed","skipped"],RUNNING_API_STATUSES=["bootstrapping","snapshotted","sandbox_named","jobs_on_hive_clone_dispatched","jobs_on_hive_dispatched","jobs_on_hive_completed","awaiting_jobs"];function toRunStatusFilter(status){switch(status){case"queued":return{statuses:["new"]};case"running":return{statuses:RUNNING_API_STATUSES};case"completed":return{statuses:["completed"]};default:return{conclusions:[status]}}}function isTerminalRunStatus(status){return status!=="queued"&&status!=="running"}function toBranchName(ref){return ref.startsWith("refs/heads/")?ref.slice(11):ref}function toShortSha(sha){return sha.slice(0,7)}var RUN_ID_PREFIX="invo1_",RUN_ID_PATTERN=/^[A-Za-z0-9]+$/;function toDisplayRunId(id2){return id2.startsWith(RUN_ID_PREFIX)?id2.slice(RUN_ID_PREFIX.length):id2}function toApiRunId(input){let id2=toDisplayRunId(input.trim());return RUN_ID_PATTERN.test(id2)?`${RUN_ID_PREFIX}${id2}`:null}function toRunSummary(invocation,repositories){let repository=repositories[invocation.repositoryKey];return{id:toDisplayRunId(invocation.invocationId),attempt:invocation.attempt,status:getRunStatus(invocation),...getRunReason(invocation),repository:repository?`${repository.owner}/${repository.name}`:"",branch:toBranchName(invocation.ref),commitSha:invocation.commitSha,createdAt:toIso(invocation.createdAt)}}function getRunReason(invocation){return invocation.skipped?{reason:invocation.skipped.reason}:invocation.setupConclusion?.result==="failed"?{reason:"setup_failed"}:{}}function toRunView(tree){return{run:toRunSummary(tree.invocation,tree.repositories),jobs:tree.jobs.map(job=>({name:job.definition.name,kind:job.definition.kind,...toStepTiming(job.run),tasks:job.tasks.map(task=>({name:task.definition.name,...toStepTiming(task.run)}))}))}}function toStepTiming(run){let startedAt=run?.started?.startedAt,completedAt=run?.completed?.completedAt,conclusion2=run?.completed?.conclusion,status="queued";return conclusion2?status=conclusion2.result:startedAt!==void 0&&(status="running"),{status,...conclusion2&&"reason"in conclusion2?{reason:conclusion2.reason}:{},...startedAt!==void 0?{startedAt:toIso(startedAt)}:{},...completedAt!==void 0?{completedAt:toIso(completedAt)}:{},...startedAt!==void 0&&completedAt!==void 0?{durationMs:Math.max(completedAt-startedAt,0)}:{}}}function toIso(timestamp2){return new Date(timestamp2).toISOString()}function countTasks(view){let total=0,finished=0;for(let job of view.jobs)for(let task of job.tasks)total++,task.status!=="queued"&&task.status!=="running"&&finished++;return{total,finished}}var CiGrepTelemetryClient=class extends TelemetryClient{trackCliArgumentText(text){text&&this.trackCliArgument({arg:"text",value:this.redactedValue})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliOptionBranch(branch){branch&&this.trackCliOption({option:"branch",value:this.redactedValue})}trackCliFlagAllBranches(allBranches){allBranches&&this.trackCliFlag("all-branches")}trackCliOptionStatus(status){status&&this.trackCliOption({option:"status",value:status})}trackCliOptionRuns(runs){runs!==void 0&&this.trackCliOption({option:"runs",value:String(runs)})}trackCliOptionLevel(levels){levels?.length&&this.trackCliOption({option:"level",value:levels.join(",")})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var import_chalk=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1);function formatStatus(status){switch(status){case"succeeded":return import_chalk.default.green(status);case"failed":return import_chalk.default.red(status);case"skipped":case"cached":return import_chalk.default.gray(status);default:return ciDisplayText(status)}}function formatCiTable(headers,rows){return formatTable(headers,headers.map(()=>"l"),[{rows}]).split(`
15
24
  `).map(line=>line.trimEnd()).filter(line=>line.length>0).join(`
16
25
  `)}function printRunView(view,elapsed){let{run}=view;output_manager_default.log(`Vercel CI run ${import_chalk.default.bold(ciDisplayText(run.id))} ${import_chalk.default.gray(elapsed)}`),output_manager_default.print(`
17
26
  `),printAlignedLabel("Status",formatStatus(run.status)),run.reason&&printAlignedLabel("Reason",ciDisplayText(run.reason)),run.repository&&printAlignedLabel("Repository",ciDisplayText(run.repository)),printAlignedLabel("Branch",ciDisplayText(run.branch)),printAlignedLabel("Commit",ciDisplayText(toShortSha(run.commitSha))),printAlignedLabel("Attempt",String(run.attempt)),printAlignedLabel("Created",`${(0,import_ms.default)(Math.max(Date.now()-Date.parse(run.createdAt),0))} ago`),view.jobs.length===0&&run.reason==="setup_failed"&&output_manager_default.print(`
@@ -29,10 +38,8 @@ import{handleTracingApiError,invalidArguments,resolveConfigScope,resolveScope,tr
29
38
  `)}}return output_manager_default.print(`
30
39
  `),output_manager_default.log(`${(0,import_pluralize.default)("matching line",lineCount,!0)} in ${(0,import_pluralize.default)("run",matches.length,!0)} of ${runs.length} searched`),result.hasMore&&output_manager_default.log(`Showing the newest ${lineCount} matching lines. Narrow with --status, --level, or fewer --runs.`),0}function isAddressableTask(tree,task){let named=tree.jobs.flatMap(job2=>job2.tasks.filter(current2=>current2.definition.name===task.taskName).map(current2=>({job:job2,current:current2})));if(named.length!==1||task.taskRunAttempt===void 0)return!1;let{job,current}=named[0];return job.definition.jobDefinitionId===task.jobDefinitionId&&job.run?.attempt===task.jobRunAttempt&&current.definition.jobDefinitionId===task.jobDefinitionId&&current.definition.jobRunAttempt===task.jobRunAttempt&&current.definition.taskDefinitionId===task.taskDefinitionId&&current.run?.taskDefinitionId===task.taskDefinitionId&&current.run.attempt===task.taskRunAttempt}function latestAttempts(invocations){let latest=new Map;for(let invocation of invocations){let current=latest.get(invocation.invocationId);(!current||invocation.attempt>current.attempt)&&latest.set(invocation.invocationId,invocation)}return[...latest.values()]}function printNoRuns(client,asJson,text,scope,selection,scanNotice){return asJson?(client.stdout.write(`${JSON.stringify({...client.nonInteractive?{status:AGENT_STATUS.OK,message:selection.limited?`No Vercel CI runs match the current filters among the runs checked. ${scanNotice}`:"No Vercel CI runs match the current filters.",next:[]}:{},search:text,searchedRuns:0,selection,matches:{lines:0,runs:0},runs:[],hasMore:!1},null,2)}
31
40
  `),0):(scanNotice&&output_manager_default.print(`! ${scanNotice}
32
- `),output_manager_default.log(selection.limited?`No Vercel CI runs match the current filters among the runs checked for ${scope}.`:selection.scannedRuns>0?`No Vercel CI runs match the current filters for ${scope}.`:`No Vercel CI runs found for ${scope}.`),0)}function describeScope(git,branch){let repo=import_chalk2.default.bold(ciDisplayText(git.repository));return branch?`${repo} on ${import_chalk2.default.bold(ciDisplayText(branch))}`:`${repo} on all branches`}function plainScope(git,branch){return branch?`${ciDisplayText(git.repository)} on ${ciDisplayText(branch)}`:`${ciDisplayText(git.repository)} on all branches`}function describeRun(run,now,showBranch){return[`Run ${import_chalk2.default.bold(ciDisplayText(run.id))}`,formatStatus(run.status),...run.attempt>1?[`attempt ${run.attempt}`]:[],...showBranch?[ciDisplayText(run.branch)]:[],ciDisplayText(toShortSha(run.commitSha)),`${(0,import_ms2.default)(Math.max(now-Date.parse(run.createdAt),0))} ago`].join(import_chalk2.default.gray(" \xB7 "))}function formatTime(timestamp2){return new Date(timestamp2).toLocaleTimeString("en-US",{hour12:!1})}function highlight(message,text){let literal=text.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return message.replace(new RegExp(literal,"giu"),match=>import_chalk2.default.red.bold(match))}function handleGrepApiError(client,action,err){return isAPIError(err)&&err.status===404?failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${action}. The Vercel CI endpoint wasn't found.`}):handleCiApiError(client,action,err)}var import_chalk3=__toESM(require_source(),1);var CiInspectTelemetryClient=class extends TelemetryClient{trackCliArgumentRun(run){run&&this.trackCliArgument({arg:"run",value:this.redactedValue})}trackCliOptionAttempt(attempt){attempt!==void 0&&this.trackCliOption({option:"attempt",value:String(attempt)})}trackCliFlagWait(wait){wait&&this.trackCliFlag("wait")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var MAX_STREAM_FAILURES=3,STREAM_RETRY_DELAY_MS=2e3,WAIT_TIMEOUT_MS=10*60*1e3,id=external_exports.string().min(1),attemptNumber=external_exports.number().int().positive(),timestamp=external_exports.number().refine(value=>Number.isFinite(new Date(value).getTime())),conclusionResult=external_exports.enum(["succeeded","failed","skipped"]),conclusion=external_exports.object({result:conclusionResult}),stepConclusion=external_exports.object({result:conclusionResult,reason:external_exports.string().optional()}),stepRun=external_exports.object({attempt:attemptNumber,createdAt:timestamp,started:external_exports.object({startedAt:timestamp}).optional()}),treeSchema=external_exports.object({invocation:external_exports.object({invocationId:id,attempt:attemptNumber,teamId:id,createdAt:timestamp,repositoryKey:id,ref:external_exports.string(),commitSha:external_exports.string(),status:external_exports.enum(["new","running","bootstrapping","bootstrapping_failed","snapshotted","sandbox_named","jobs_on_hive_clone_dispatched","jobs_on_hive_dispatched","jobs_on_hive_completed","jobs_on_hive_failed","awaiting_jobs","completed","skipped"]),skipped:external_exports.object({reason:external_exports.string()}).optional(),completed:external_exports.object({completedAt:timestamp,conclusion:conclusionResult.optional()}).optional(),runConclusion:conclusion.optional(),setupConclusion:conclusion.optional()}),repositories:external_exports.record(external_exports.string(),external_exports.object({owner:external_exports.string(),name:external_exports.string()})),jobs:external_exports.array(external_exports.object({definition:external_exports.object({jobDefinitionId:id,kind:external_exports.enum(["command","turbo"]),name:external_exports.string(),command:external_exports.string(),createdAt:timestamp}),run:stepRun.extend({jobDefinitionId:id,completed:external_exports.object({completedAt:timestamp,conclusion:stepConclusion}).optional()}).optional(),tasks:external_exports.array(external_exports.object({definition:external_exports.object({jobDefinitionId:id,jobRunAttempt:attemptNumber,taskDefinitionId:id,name:external_exports.string(),dependencyTaskDefinitionIds:external_exports.array(id),createdAt:timestamp}),run:stepRun.extend({taskDefinitionId:id,completed:external_exports.object({completedAt:timestamp,conclusion:stepConclusion.extend({result:external_exports.enum(["succeeded","cached","failed","skipped"])})}).optional()}).optional()}))}))});function validateTree(tree,expected){let parsed=treeSchema.safeParse(tree);if(!parsed.success||parsed.data.invocation.invocationId!==expected.invocationId||parsed.data.invocation.attempt!==expected.attempt||parsed.data.invocation.teamId!==expected.teamId)throw new Error("Invalid Vercel CI run tree.")}var CiWaitError=class extends Error{constructor(reason){super(reason==="ci_wait_timeout"?"Stopped waiting after 10 minutes. The run may still be running.":"Failed to wait for the Vercel CI run after 3 interrupted streams. The run may still be running.");this.reason=reason}};async function waitForRun(client,target,initial,asJson){let expected={invocationId:target.invocationId,attempt:target.attempt??initial.invocation?.attempt,teamId:target.accountId??initial.invocation?.teamId};if(validateTree(initial,expected),isTerminalRunStatus(getRunStatus(initial.invocation)))return initial;let tree=initial,attempt=initial.invocation.attempt,controller=new AbortController,timeoutError=new CiWaitError("ci_wait_timeout"),timer,deadline=new Promise((_resolve,reject)=>{timer=setTimeout(()=>{reject(timeoutError),controller.abort()},WAIT_TIMEOUT_MS)}),updateSpinner=()=>{if(asJson)return;let{total,finished}=countTasks(toRunView(tree)),progress2=total>0?` ${finished} of ${total} tasks finished`:"";output_manager_default.spinner(`Waiting for the run to finish\u2026${progress2}`)};asJson||(output_manager_default.stopSpinner(),output_manager_default.log("Waiting for the run to finish (up to 10 minutes). Press Ctrl+C to stop waiting; the run keeps going."));let follow=async()=>{let failures=0,incompleteStreams=0;for(;!controller.signal.aborted;){updateSpinner();let timedOut=!1,validTree=!1;try{for await(let event of streamCiInvocationTree(client,target.invocationId,{attempt,accountId:target.accountId,signal:controller.signal})){if(controller.signal.aborted)throw timeoutError;if(!event||typeof event!="object")throw new Error("Invalid Vercel CI run stream event.");if(event.type==="tree"){let{type:_type,...next}=event;if(validateTree(next,expected),countTasks(toRunView(next)),tree=next,validTree=!0,isTerminalRunStatus(getRunStatus(tree.invocation)))return tree;updateSpinner()}else if(event.type==="end"&&event.reason==="timeout"){timedOut=!0;break}else throw new Error("Vercel CI run stream ended without completion.")}}catch(err){if(controller.signal.aborted)throw timeoutError;if(isAPIError(err))throw err;output_manager_default.debug(`Vercel CI run stream interrupted: ${err}`)}if(timedOut)validTree&&(failures=0);else if(++failures>=MAX_STREAM_FAILURES||++incompleteStreams>=MAX_STREAM_FAILURES)throw new CiWaitError("ci_wait_interrupted");await new Promise((resolve,reject)=>{let onAbort=()=>{clearTimeout(retryTimer),reject(timeoutError)},retryTimer=setTimeout(()=>{controller.signal.removeEventListener("abort",onAbort),resolve()},STREAM_RETRY_DELAY_MS);controller.signal.addEventListener("abort",onAbort,{once:!0}),controller.signal.aborted&&onAbort()})}throw timeoutError};try{return await Promise.race([follow(),deadline])}finally{clearTimeout(timer),controller.abort(),asJson||output_manager_default.stopSpinner()}}async function resolveRunTarget(client,runArg,attempt){if(runArg!==void 0){let invocationId2=toApiRunId(runArg);if(!invocationId2)return invalidCiArguments(client,`Run IDs contain only letters and numbers. Find one with ${getCommandName("ci ls")}.`);let team=await resolveCiTeam(client);return team.ok?{invocationId:invocationId2,attempt,accountId:team.accountId}:team.exitCode}let context=await resolveCiContext(client);if(typeof context=="number")return context;let{git,accountId}=context;if(!git.commitSha)return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:"This repository doesn't have any commits yet. Commit and push, then try again."});if(!git.branch){let command=buildCiCommand(client.argv,["ci","ls","--all-branches"]),exitCode=failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:"Can't find the run for HEAD while HEAD is detached. Check out its branch and try again, or list runs across all branches and pass a run ID.",next:[{command,when:"Find a run ID across all branches, then pass it explicitly"}]});return shouldEmitNonInteractiveCommandError(client)||output_manager_default.print(` ${command}
33
- `),exitCode}let invocationId;try{let{invocations}=await listCiInvocations(client,{provider:git.provider,repository:git.repository,branch:git.branch,commitSha:git.commitSha,limit:1},accountId);invocationId=invocations.find(invocation=>invocation.commitSha===git.commitSha)?.invocationId}catch(err){return handleCiApiError(client,"find the Vercel CI run for HEAD",err)}if(!invocationId){let where=` on ${ciDisplayText(git.branch)}`;return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:`No Vercel CI run found for ${toShortSha(git.commitSha)}${where}. Push the commit, or pass a run ID from ${getCommandName("ci ls")}.`,next:[{command:buildCiCommand(client.argv,["ci","ls"]),when:"List recent runs for this branch"}]})}return{invocationId,attempt,accountId}}async function resolveAttemptNumber(client,target){return target.attempt??await getLatestCiAttempt(client,target.invocationId,target.accountId)}async function inspect(client,argv){let telemetry=new CiInspectTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(inspectSubcommand.options))}catch(error){return printError(error,client),2}let{args,flags}=parsedArgs;if(telemetry.trackCliArgumentRun(args[0]),telemetry.trackCliOptionAttempt(flags["--attempt"]),telemetry.trackCliFlagWait(flags["--wait"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),args.length>1)return invalidCiArguments(client,`Pass at most 1 run ID. Usage: ${getCommandName("ci inspect [run]")}`);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return invalidCiArguments(client,formatResult.error);let asJson=formatResult.jsonOutput||client.nonInteractive,attempt=flags["--attempt"];if(attempt!==void 0&&(!Number.isInteger(attempt)||attempt<1))return invalidCiArguments(client,"--attempt must be a whole number of 1 or more.");let target=await resolveRunTarget(client,args[0],attempt);if(typeof target=="number")return target;let inspectStamp=stamp_default(),tree;try{if(asJson||output_manager_default.spinner("Fetching Vercel CI run\u2026"),tree=await getCiInvocationTree(client,target.invocationId,{attempt:target.attempt,accountId:target.accountId}),flags["--wait"])try{tree=await waitForRun(client,target,tree,asJson)}catch(err){if(!(err instanceof CiWaitError))throw err;output_manager_default.stopSpinner();let command=buildCiCommand(client.argv,["ci","inspect",toRunView(tree).run.id,"--attempt",String(tree.invocation.attempt)]),failure={reason:err.reason,message:err.message,next:[{command,when:"Check the status of this attempt"}]};if(asJson)return client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.ERROR,...failure},null,2)}
34
- `),1;let exitCode=failCi(client,failure);return output_manager_default.print(` ${command}
35
- `),exitCode}}catch(err){return output_manager_default.stopSpinner(),handleCiApiError(client,"fetch the Vercel CI run",err)}output_manager_default.stopSpinner();let view=toRunView(tree),next=getNextSteps(client,view,tree.invocation.source),failedWait=flags["--wait"]&&view.run.status==="failed";if(asJson){let payload=client.nonInteractive?{status:failedWait?AGENT_STATUS.ERROR:AGENT_STATUS.OK,message:`The Vercel CI run ${view.run.status}.`,...failedWait?{reason:"ci_run_failed"}:{},...view,next}:view;client.stdout.write(`${JSON.stringify(payload,null,2)}
41
+ `),output_manager_default.log(selection.limited?`No Vercel CI runs match the current filters among the runs checked for ${scope}.`:selection.scannedRuns>0?`No Vercel CI runs match the current filters for ${scope}.`:`No Vercel CI runs found for ${scope}.`),0)}function describeScope(git,branch){let repo=import_chalk2.default.bold(ciDisplayText(git.repository));return branch?`${repo} on ${import_chalk2.default.bold(ciDisplayText(branch))}`:`${repo} on all branches`}function plainScope(git,branch){return branch?`${ciDisplayText(git.repository)} on ${ciDisplayText(branch)}`:`${ciDisplayText(git.repository)} on all branches`}function describeRun(run,now,showBranch){return[`Run ${import_chalk2.default.bold(ciDisplayText(run.id))}`,formatStatus(run.status),...run.attempt>1?[`attempt ${run.attempt}`]:[],...showBranch?[ciDisplayText(run.branch)]:[],ciDisplayText(toShortSha(run.commitSha)),`${(0,import_ms2.default)(Math.max(now-Date.parse(run.createdAt),0))} ago`].join(import_chalk2.default.gray(" \xB7 "))}function formatTime(timestamp2){return new Date(timestamp2).toLocaleTimeString("en-US",{hour12:!1})}function highlight(message,text){let literal=text.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return message.replace(new RegExp(literal,"giu"),match=>import_chalk2.default.red.bold(match))}function handleGrepApiError(client,action,err){return isAPIError(err)&&err.status===404?failCi(client,{reason:AGENT_REASON.API_ERROR,message:`Failed to ${action}. The Vercel CI endpoint wasn't found.`}):handleCiApiError(client,action,err)}var import_chalk3=__toESM(require_source(),1);var CiInspectTelemetryClient=class extends TelemetryClient{trackCliArgumentRun(run){run&&this.trackCliArgument({arg:"run",value:this.redactedValue})}trackCliOptionAttempt(attempt){attempt!==void 0&&this.trackCliOption({option:"attempt",value:String(attempt)})}trackCliFlagWait(wait){wait&&this.trackCliFlag("wait")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var MAX_STREAM_FAILURES=3,STREAM_RETRY_DELAY_MS=2e3,WAIT_TIMEOUT_MS=10*60*1e3,id=external_exports.string().min(1),attemptNumber=external_exports.number().int().positive(),timestamp=external_exports.number().refine(value=>Number.isFinite(new Date(value).getTime())),conclusionResult=external_exports.enum(["succeeded","failed","skipped"]),conclusion=external_exports.object({result:conclusionResult}),stepConclusion=external_exports.object({result:conclusionResult,reason:external_exports.string().optional()}),stepRun=external_exports.object({attempt:attemptNumber,createdAt:timestamp,started:external_exports.object({startedAt:timestamp}).optional()}),treeSchema=external_exports.object({invocation:external_exports.object({invocationId:id,attempt:attemptNumber,teamId:id,createdAt:timestamp,repositoryKey:id,ref:external_exports.string(),commitSha:external_exports.string(),status:external_exports.enum(["new","running","bootstrapping","bootstrapping_failed","snapshotted","sandbox_named","jobs_on_hive_clone_dispatched","jobs_on_hive_dispatched","jobs_on_hive_completed","jobs_on_hive_failed","awaiting_jobs","completed","skipped"]),skipped:external_exports.object({reason:external_exports.string()}).optional(),completed:external_exports.object({completedAt:timestamp,conclusion:conclusionResult.optional()}).optional(),runConclusion:conclusion.optional(),setupConclusion:conclusion.optional()}),repositories:external_exports.record(external_exports.string(),external_exports.object({owner:external_exports.string(),name:external_exports.string()})),jobs:external_exports.array(external_exports.object({definition:external_exports.object({jobDefinitionId:id,kind:external_exports.enum(["command","turbo"]),name:external_exports.string(),command:external_exports.string(),createdAt:timestamp}),run:stepRun.extend({jobDefinitionId:id,completed:external_exports.object({completedAt:timestamp,conclusion:stepConclusion}).optional()}).optional(),tasks:external_exports.array(external_exports.object({definition:external_exports.object({jobDefinitionId:id,jobRunAttempt:attemptNumber,taskDefinitionId:id,name:external_exports.string(),dependencyTaskDefinitionIds:external_exports.array(id),createdAt:timestamp}),run:stepRun.extend({taskDefinitionId:id,completed:external_exports.object({completedAt:timestamp,conclusion:stepConclusion.extend({result:external_exports.enum(["succeeded","cached","failed","skipped"])})}).optional()}).optional()}))}))});function validateTree(tree,expected){let parsed=treeSchema.safeParse(tree);if(!parsed.success||parsed.data.invocation.invocationId!==expected.invocationId||parsed.data.invocation.attempt!==expected.attempt||parsed.data.invocation.teamId!==expected.teamId)throw new Error("Invalid Vercel CI run tree.")}var CiWaitError=class extends Error{constructor(reason){super(reason==="ci_wait_timeout"?"Stopped waiting after 10 minutes. The run may still be running.":"Failed to wait for the Vercel CI run after 3 interrupted streams. The run may still be running.");this.reason=reason}};async function waitForRun(client,target,initial,asJson){let expected={invocationId:target.invocationId,attempt:target.attempt??initial.invocation?.attempt,teamId:target.accountId??initial.invocation?.teamId};if(validateTree(initial,expected),isTerminalRunStatus(getRunStatus(initial.invocation)))return initial;let tree=initial,attempt=initial.invocation.attempt,controller=new AbortController,timeoutError=new CiWaitError("ci_wait_timeout"),timer,deadline=new Promise((_resolve,reject)=>{timer=setTimeout(()=>{reject(timeoutError),controller.abort()},WAIT_TIMEOUT_MS)}),updateSpinner=()=>{if(asJson)return;let{total,finished}=countTasks(toRunView(tree)),progress2=total>0?` ${finished} of ${total} tasks finished`:"";output_manager_default.spinner(`Waiting for the run to finish\u2026${progress2}`)};asJson||(output_manager_default.stopSpinner(),output_manager_default.log("Waiting for the run to finish (up to 10 minutes). Press Ctrl+C to stop waiting; the run keeps going."));let follow=async()=>{let failures=0,incompleteStreams=0;for(;!controller.signal.aborted;){updateSpinner();let timedOut=!1,validTree=!1;try{for await(let event of streamCiInvocationTree(client,target.invocationId,{attempt,accountId:target.accountId,signal:controller.signal})){if(controller.signal.aborted)throw timeoutError;if(!event||typeof event!="object")throw new Error("Invalid Vercel CI run stream event.");if(event.type==="tree"){let{type:_type,...next}=event;if(validateTree(next,expected),countTasks(toRunView(next)),tree=next,validTree=!0,isTerminalRunStatus(getRunStatus(tree.invocation)))return tree;updateSpinner()}else if(event.type==="end"&&event.reason==="timeout"){timedOut=!0;break}else throw new Error("Vercel CI run stream ended without completion.")}}catch(err){if(controller.signal.aborted)throw timeoutError;if(isAPIError(err))throw err;output_manager_default.debug(`Vercel CI run stream interrupted: ${err}`)}if(timedOut)validTree&&(failures=0);else if(++failures>=MAX_STREAM_FAILURES||++incompleteStreams>=MAX_STREAM_FAILURES)throw new CiWaitError("ci_wait_interrupted");await new Promise((resolve,reject)=>{let onAbort=()=>{clearTimeout(retryTimer),reject(timeoutError)},retryTimer=setTimeout(()=>{controller.signal.removeEventListener("abort",onAbort),resolve()},STREAM_RETRY_DELAY_MS);controller.signal.addEventListener("abort",onAbort,{once:!0}),controller.signal.aborted&&onAbort()})}throw timeoutError};try{return await Promise.race([follow(),deadline])}finally{clearTimeout(timer),controller.abort(),asJson||output_manager_default.stopSpinner()}}async function resolveRunTarget(client,runArg,attempt){if(runArg!==void 0){let invocationId2=toApiRunId(runArg);if(!invocationId2)return invalidCiArguments(client,`Run IDs contain only letters and numbers. Find one with ${getCommandName("ci ls")}.`);let team=await resolveCiTeam(client);return team.ok?{invocationId:invocationId2,attempt,accountId:team.accountId}:team.exitCode}let context=await resolveCiContext(client);if(typeof context=="number")return context;let{git,accountId}=context;if(!git.commitSha)return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:"This repository doesn't have any commits yet. Commit and push, then try again."});if(!git.branch){let command=buildCiCommand(client.argv,["ci","ls","--all-branches"]);return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:"Can't find the run for HEAD while HEAD is detached. Check out its branch and try again, or list runs across all branches and pass a run ID.",next:[{command,when:"Find a run ID across all branches, then pass it explicitly"}]})}let invocationId;try{let{invocations}=await listCiInvocations(client,{provider:git.provider,repository:git.repository,branch:git.branch,commitSha:git.commitSha,limit:1},accountId);invocationId=invocations.find(invocation=>invocation.commitSha===git.commitSha)?.invocationId}catch(err){return handleCiApiError(client,"find the Vercel CI run for HEAD",err)}if(!invocationId){let where=` on ${ciDisplayText(git.branch)}`;return failCi(client,{reason:AGENT_REASON.CI_RUN_NOT_FOUND,message:`No Vercel CI run found for ${toShortSha(git.commitSha)}${where}. Push the commit, or pass a run ID from ${getCommandName("ci ls")}.`,next:[{command:buildCiCommand(client.argv,["ci","ls"]),when:"List recent runs for this branch"}]})}return{invocationId,attempt,accountId}}async function resolveAttemptNumber(client,target){return target.attempt??await getLatestCiAttempt(client,target.invocationId,target.accountId)}async function inspect(client,argv){let telemetry=new CiInspectTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(inspectSubcommand.options))}catch(error){return printError(error,client),2}let{args,flags}=parsedArgs;if(telemetry.trackCliArgumentRun(args[0]),telemetry.trackCliOptionAttempt(flags["--attempt"]),telemetry.trackCliFlagWait(flags["--wait"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),args.length>1)return invalidCiArguments(client,`Pass at most 1 run ID. Usage: ${getCommandName("ci inspect [run]")}`);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return invalidCiArguments(client,formatResult.error);let asJson=formatResult.jsonOutput||client.nonInteractive,attempt=flags["--attempt"];if(attempt!==void 0&&(!Number.isInteger(attempt)||attempt<1))return invalidCiArguments(client,"--attempt must be a whole number of 1 or more.");let target=await resolveRunTarget(client,args[0],attempt);if(typeof target=="number")return target;let inspectStamp=stamp_default(),tree;try{if(asJson||output_manager_default.spinner("Fetching Vercel CI run\u2026"),tree=await getCiInvocationTree(client,target.invocationId,{attempt:target.attempt,accountId:target.accountId}),flags["--wait"])try{tree=await waitForRun(client,target,tree,asJson)}catch(err){if(!(err instanceof CiWaitError))throw err;output_manager_default.stopSpinner();let command=buildCiCommand(client.argv,["ci","inspect",toRunView(tree).run.id,"--attempt",String(tree.invocation.attempt)]),failure={reason:err.reason,message:err.message,next:[{command,when:"Check the status of this attempt"}]};return asJson?(client.stdout.write(`${JSON.stringify({status:AGENT_STATUS.ERROR,...failure},null,2)}
42
+ `),1):failCi(client,failure)}}catch(err){return output_manager_default.stopSpinner(),handleCiApiError(client,"fetch the Vercel CI run",err)}output_manager_default.stopSpinner();let view=toRunView(tree),next=getNextSteps(client,view,tree.invocation.source),failedWait=flags["--wait"]&&view.run.status==="failed";if(asJson){let payload=client.nonInteractive?{status:failedWait?AGENT_STATUS.ERROR:AGENT_STATUS.OK,message:`The Vercel CI run ${view.run.status}.`,...failedWait?{reason:"ci_run_failed"}:{},...view,next}:view;client.stdout.write(`${JSON.stringify(payload,null,2)}
36
43
  `)}else{printRunView(view,inspectStamp());for(let step of next)output_manager_default.log(`${step.when}: ${import_chalk3.default.cyan(step.command)}`)}return failedWait?1:0}function getNextSteps(client,view,source){if(!toApiRunId(view.run.id))return[];let attemptArgs=["--attempt",String(view.run.attempt)];return isTerminalRunStatus(view.run.status)?view.run.status==="failed"?[{command:buildCiCommand(client.argv,["ci","logs",view.run.id,"--failed",...attemptArgs]),when:"Show logs for the failed tasks"},...source?.type==="vercel-ci"?[{command:buildCiCommand(client.argv,["ci","rerun",view.run.id]),when:"Start a new attempt of this run"}]:[]]:[]:[{command:buildCiCommand(client.argv,["ci","inspect",view.run.id,"--wait",...attemptArgs]),when:"Wait for this run to finish"}]}var import_chalk4=__toESM(require_source(),1),import_pluralize2=__toESM(require_pluralize(),1);var CiStreamOutputError=class extends Error{},CiReplayLimitError=class extends Error{};async function writeCiOutput(stream,text){await new Promise((resolve,reject)=>{let cleanup=()=>{stream.removeListener("drain",onDrain),stream.removeListener("error",onError),stream.removeListener("close",onClose)},onDrain=()=>{cleanup(),resolve()},onError=()=>{cleanup(),reject(new CiStreamOutputError("Failed to write task logs."))},onClose=()=>{cleanup(),reject(new CiStreamOutputError("Task log output closed."))};if(stream.once("drain",onDrain),stream.once("error",onError),stream.once("close",onClose),stream.destroyed)return onClose();try{stream.write(text)&&onDrain()}catch{onError()}})}var CiLogReplay=class{constructor(maxBytes=8*1024*1024,maxKeys=5e4){this.maxBytes=maxBytes;this.maxKeys=maxKeys;this.counts=new Map;this.bytes=0}begin(){let remaining=new Map(this.counts);return line=>{let key=JSON.stringify([line.timestamp,line.level,line.message]),count=remaining.get(key)??0;if(count>0)return remaining.set(key,count-1),!1;if(!this.counts.has(key)){let bytes=Buffer.byteLength(key)+128;if(this.bytes+bytes>this.maxBytes||this.counts.size>=this.maxKeys)throw new CiReplayLimitError("Stopped following task logs because full replay reached its memory limit. Fetch task logs without --follow.");this.bytes+=bytes}return this.counts.set(key,(this.counts.get(key)??0)+1),!0}}};async function reportCiStreamError(client,asJson,report){if(!asJson)return report(client);let payload="",reportingClient=new Proxy(client,{get(target,property){return property==="nonInteractive"?!0:property==="stdout"?{write:text=>(payload+=text,!0)}:Reflect.get(target,property,target)}}),code=report(reportingClient);return payload&&await writeCiOutput(client.stdout,`${JSON.stringify(JSON.parse(payload))}
37
44
  `),code}var CiLogsTelemetryClient=class extends TelemetryClient{trackCliArgumentRun(run){run&&this.trackCliArgument({arg:"run",value:this.redactedValue})}trackCliFlagFailed(failed){failed&&this.trackCliFlag("failed")}trackCliOptionTask(tasks){tasks?.length&&this.trackCliOption({option:"task",value:this.redactedValue})}trackCliOptionLevel(levels){levels?.length&&this.trackCliOption({option:"level",value:levels.join(",")})}trackCliOptionGrep(grep2){grep2!==void 0&&this.trackCliOption({option:"grep",value:this.redactedValue})}trackCliOptionAttempt(attempt){attempt!==void 0&&this.trackCliOption({option:"attempt",value:String(attempt)})}trackCliOptionLimit(limit){limit!==void 0&&this.trackCliOption({option:"limit",value:String(limit)})}trackCliFlagFollow(follow){follow&&this.trackCliFlag("follow")}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var MAX_TASK_LIMIT=25,MAX_GREP_LENGTH=256,EOF_LEVEL2="eof",MAX_STREAM_FAILURES2=3,STREAM_RETRY_DELAY_MS2=2e3;async function logs(client,argv){let telemetry=new CiLogsTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(logsSubcommand.options))}catch(error){return printError(error,client),2}let{args,flags}=parsedArgs;if(telemetry.trackCliArgumentRun(args[0]),telemetry.trackCliFlagFailed(flags["--failed"]),telemetry.trackCliOptionTask(flags["--task"]),telemetry.trackCliOptionLevel(flags["--level"]),telemetry.trackCliOptionGrep(flags["--grep"]),telemetry.trackCliOptionAttempt(flags["--attempt"]),telemetry.trackCliOptionLimit(flags["--limit"]),telemetry.trackCliFlagFollow(flags["--follow"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),args.length>1)return invalidCiArguments(client,`Pass at most 1 run ID. Usage: ${getCommandName("ci logs [run]")}`);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return invalidCiArguments(client,formatResult.error);let asJson=formatResult.jsonOutput||client.nonInteractive,levels=flags["--level"]??[];if(levels.find(level=>!CI_LOG_LEVELS.includes(level))!==void 0)return invalidCiArguments(client,`Level must be one of: ${CI_LOG_LEVELS.join(", ")}.`);let attempt=flags["--attempt"];if(attempt!==void 0&&(!Number.isInteger(attempt)||attempt<1))return invalidCiArguments(client,"--attempt must be a whole number of 1 or more.");let limit=flags["--limit"];if(limit!==void 0&&(!Number.isInteger(limit)||limit<1||limit>MAX_TASK_LIMIT))return invalidCiArguments(client,`--limit must be a whole number from 1 to ${MAX_TASK_LIMIT}.`);let grep2=flags["--grep"];if(grep2!==void 0){if(grep2.trim()===""||grep2.length>MAX_GREP_LENGTH)return invalidCiArguments(client,`--grep takes 1 to ${MAX_GREP_LENGTH} characters of text.`);if(flags["--follow"])return invalidCiArguments(client,"--grep can't be combined with --follow. Use --level to filter a stream.");if(limit!==void 0)return invalidCiArguments(client,"--grep searches every task, so --limit does not apply. Narrow with --task or --failed.")}if(flags["--failed"]&&flags["--follow"])return invalidCiArguments(client,"--failed can't be combined with --follow. Fetch failed task logs without --follow.");let tasks=flags["--task"]??[];if(flags["--follow"]&&tasks.length!==1)return invalidCiArguments(client,"--follow streams 1 task at a time. Pass --task <name>.");let target=await resolveRunTarget(client,args[0],attempt);if(typeof target=="number")return target;let attemptNumber2;try{attemptNumber2=await resolveAttemptNumber(client,target)}catch(err){return handleCiApiError(client,"fetch the Vercel CI run",err)}if(flags["--follow"])return followTask(client,{invocationId:target.invocationId,attempt:attemptNumber2,accountId:target.accountId,taskName:tasks[0],levels,asJson});let result,setup,runFinished;try{if(asJson||output_manager_default.spinner("Fetching task logs\u2026"),result=await getCiTaskLogs(client,target.invocationId,attemptNumber2,{tasks,conclusions:flags["--failed"]?["failed"]:void 0,levels,search:grep2,limit},target.accountId),flags["--failed"]&&result.tasks.length===0&&(tasks.length===0&&(setup=await getCiSetupLogs(client,target.invocationId,attemptNumber2,{levels,accountId:target.accountId})),!setup?.failed)){let tree=await getCiInvocationTree(client,target.invocationId,{attempt:attemptNumber2,accountId:target.accountId});runFinished=!!(tree.invocation.completed||tree.invocation.skipped)}}catch(err){return output_manager_default.stopSpinner(),handleCiApiError(client,"fetch task logs",err)}output_manager_default.stopSpinner();let view={run:{id:toDisplayRunId(target.invocationId),attempt:attemptNumber2,...runFinished!==void 0?{finished:runFinished}:{}},tasks:result.tasks.map(task=>({job:task.jobName,name:task.taskName,status:task.conclusion?.result??"running",...task.conclusion&&"reason"in task.conclusion?{reason:task.conclusion.reason}:{},lines:task.lines.filter(isContentLine).map(toJsonLine)})),hasMore:result.hasMore,...setup?.failed?{setup:{status:"failed",lines:setup.lines.filter(isContentLine).filter(line=>grep2===void 0||matchesGrep(line,grep2)).map(toJsonLine)}}:{}};if(asJson)return await writeCiOutput(client.stdout,`${JSON.stringify(view,null,2)}
38
45
  `),0;if(view.setup){output_manager_default.log(`${import_chalk4.default.bold("Setup")} ${import_chalk4.default.gray("\xB7")} failed`),view.setup.lines.length===0&&output_manager_default.print(import_chalk4.default.gray(grep2===void 0?` No log lines.
@@ -119,4 +126,4 @@ ${formatStatusReport(report,Date.now())}`),0}var TracesTelemetryClient=class ext
119
126
  `),printNextPageCommand(getCommandNamePlain(nextPageArgs(nextToken)))):output_manager_default.print(`Narrow the query or increase --limit to see the rest.
120
127
  `)),0;function reportFailure2(err){json||output_manager_default.stopSpinner(),err instanceof InvalidEventsResponseError&&(err=new Error(INVALID_RESPONSE_MESSAGE)),addSpanQueryIssueDetails(err),query.startCursor&&received===0&&isAPIError(err)&&err.status===400&&(err.serverMessage=`${err.serverMessage}. The cursor may have expired. Run the search again without --next.`,err.message=`${err.serverMessage} (${err.status})`);let retryToken=received>0&&resumeCursor&&!(err instanceof RecordTooLargeError)?spanContinuationToken(query,resumeCursor):null;if(json&&received>0)return writeJsonError(client,{status:"error",reason:tracingErrorReason(err),message:tracingErrorMessage(err),...isAPIError(err)&&err.status===429?getErrorRecovery(err,client):{},data:progressFor(query,received,retryToken,excludedIntervals),...retryToken?{next:[{command:getCommandNamePlain(nextPageArgs(retryToken)),when:"Retry the failed page"}]}:{}},1);!json&&spans.length>0&&printSpans(client,spans,columns);let exitCode=handleTracingApiError(client,err);return received>0&&(output_manager_default.error(`Output is incomplete: ${received} spans were printed before the failure.`),retryToken&&output_manager_default.print(`Retry the failed page:
121
128
  ${getCommandName(nextPageArgs(retryToken))}
122
- `)),exitCode}}function explicitInteractionOverride(argv){let args=argv.slice(2),end=args.indexOf("--");for(let arg of end===-1?args:args.slice(0,end)){if(arg==="--non-interactive=false")return"--non-interactive=false";if(arg==="--non-interactive"||arg.startsWith("--non-interactive="))return"--non-interactive"}}function progressFor(query,received,retryToken,excludedIntervals){return{recordsReturned:received,outputIncomplete:!0,timeRange:query.timeRange,pagination:{hasMore:!0,next:retryToken},excludedIntervals:sortIntervals(excludedIntervals.values())}}var COMMAND_CONFIG3={inspect:getCommandAliases(getSubcommand),create:getCommandAliases(createSubcommand2),search:getCommandAliases(searchSubcommand),config:getCommandAliases(tracesConfigCommand)},SUBCOMMAND_METADATA={[getSubcommand.name]:getSubcommand,[createSubcommand2.name]:createSubcommand2,[searchSubcommand.name]:searchSubcommand};async function traces(client){let telemetry=new TracesTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(tracesCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification,{permissive:!0})}catch(err){return invalidArguments(client,err instanceof Error?err.message:String(err))}let{subcommand,subcommandOriginal,args}=getSubcommand2(parsedArgs.args.slice(1),COMMAND_CONFIG3),needHelp=!!parsedArgs.flags["--help"];if(subcommand===tracesConfigCommand.name)return(await import("./chunks/config-X6O3DT7V.js")).default(client,{args,needHelp,subcommandOriginal,telemetry});if(needHelp){telemetry.trackCliFlagHelp("traces",subcommandOriginal);let subMetadata=typeof subcommand=="string"?SUBCOMMAND_METADATA[subcommand]:void 0;return output_manager_default.print(help(subMetadata??tracesCommand,{stream:client.stderr,parent:subMetadata?tracesCommand:void 0,columns:client.stderr.columns})),0}if(subcommand===createSubcommand2.name){let args2=client.argv.slice(4);return runCurl(client,{forceTrace:!0,args:args2})}return subcommand===searchSubcommand.name?(telemetry.trackCliSubcommandSearch(subcommandOriginal||subcommand),search(client,telemetry)):(subcommandOriginal==="get"&&warnDeprecatedSubcommand(client,"traces get","traces inspect"),get(client,telemetry))}export{main2 as ci,drains,health,main as pull,traces};
129
+ `)),exitCode}}function explicitInteractionOverride(argv){let args=argv.slice(2),end=args.indexOf("--");for(let arg of end===-1?args:args.slice(0,end)){if(arg==="--non-interactive=false")return"--non-interactive=false";if(arg==="--non-interactive"||arg.startsWith("--non-interactive="))return"--non-interactive"}}function progressFor(query,received,retryToken,excludedIntervals){return{recordsReturned:received,outputIncomplete:!0,timeRange:query.timeRange,pagination:{hasMore:!0,next:retryToken},excludedIntervals:sortIntervals(excludedIntervals.values())}}var COMMAND_CONFIG3={inspect:getCommandAliases(getSubcommand),create:getCommandAliases(createSubcommand2),search:getCommandAliases(searchSubcommand),config:getCommandAliases(tracesConfigCommand)},SUBCOMMAND_METADATA={[getSubcommand.name]:getSubcommand,[createSubcommand2.name]:createSubcommand2,[searchSubcommand.name]:searchSubcommand};async function traces(client){let telemetry=new TracesTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(tracesCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification,{permissive:!0})}catch(err){return invalidArguments(client,err instanceof Error?err.message:String(err))}let{subcommand,subcommandOriginal,args}=getSubcommand2(parsedArgs.args.slice(1),COMMAND_CONFIG3),needHelp=!!parsedArgs.flags["--help"];if(subcommand===tracesConfigCommand.name)return(await import("./chunks/config-2YNYR6YI.js")).default(client,{args,needHelp,subcommandOriginal,telemetry});if(needHelp){telemetry.trackCliFlagHelp("traces",subcommandOriginal);let subMetadata=typeof subcommand=="string"?SUBCOMMAND_METADATA[subcommand]:void 0;return output_manager_default.print(help(subMetadata??tracesCommand,{stream:client.stderr,parent:subMetadata?tracesCommand:void 0,columns:client.stderr.columns})),0}if(subcommand===createSubcommand2.name){let args2=client.argv.slice(4);return runCurl(client,{forceTrace:!0,args:args2})}return subcommand===searchSubcommand.name?(telemetry.trackCliSubcommandSearch(subcommandOriginal||subcommand),search(client,telemetry)):(subcommandOriginal==="get"&&warnDeprecatedSubcommand(client,"traces get","traces inspect"),get(client,telemetry))}export{main2 as ci,drains,health,main as pull,traces};