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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/dist/chunks/add-EHNDQSPH.js +8 -0
  2. package/dist/chunks/add-QINN2GTA.js +8 -0
  3. package/dist/chunks/add-SEQOVWYP.js +8 -0
  4. package/dist/chunks/build-ATYGR3HB.js +7 -0
  5. package/dist/chunks/{chunk-O7IYJGOR.js → chunk-25B5SV4V.js} +1 -1
  6. package/dist/chunks/chunk-2CSCY66I.js +11 -0
  7. package/dist/chunks/{chunk-FQVSBXRY.js → chunk-2H4DUZJZ.js} +1 -1
  8. package/dist/chunks/{chunk-44XDCARR.js → chunk-2RXUQ72I.js} +1 -1
  9. package/dist/chunks/{chunk-EZL4AJXH.js → chunk-32AS5X7G.js} +1 -1
  10. package/dist/chunks/chunk-32NXYHYC.js +10 -0
  11. package/dist/chunks/{chunk-OTJNOMRV.js → chunk-375JVQYK.js} +1 -1
  12. package/dist/chunks/chunk-3H7HEK63.js +10 -0
  13. package/dist/chunks/{chunk-CJLRNGWY.js → chunk-3QECUY4S.js} +1 -1
  14. package/dist/chunks/{chunk-GKUHMS3A.js → chunk-3Y3FZLFN.js} +1 -1
  15. package/dist/chunks/{chunk-BLFPDEXE.js → chunk-46XT5J5W.js} +1 -1
  16. package/dist/chunks/{chunk-IECNFRTK.js → chunk-4BZ3DNGM.js} +1 -1
  17. package/dist/chunks/chunk-4CQKN5TW.js +10 -0
  18. package/dist/chunks/{chunk-FNOCIKAU.js → chunk-4HIRAB5V.js} +1 -1
  19. package/dist/chunks/{chunk-4UIMSZZB.js → chunk-4KM733OB.js} +1 -1
  20. package/dist/chunks/chunk-4ND2DRU5.js +15 -0
  21. package/dist/chunks/{chunk-6KCYUYUM.js → chunk-4VF5BZJP.js} +1 -1
  22. package/dist/chunks/{chunk-XUJA3RZD.js → chunk-4XFUHNFR.js} +1 -1
  23. package/dist/chunks/chunk-4Z3APEBF.js +7 -0
  24. package/dist/chunks/chunk-5CVEW3HD.js +12 -0
  25. package/dist/chunks/{chunk-LFOWP74R.js → chunk-5DXC4TE2.js} +1 -1
  26. package/dist/chunks/{chunk-KARAZGCO.js → chunk-5KKRDN5F.js} +1 -1
  27. package/dist/chunks/{constants-JAB7MRSK.js → chunk-5MDNVAE6.js} +1 -1
  28. package/dist/chunks/{chunk-HA2ICIB5.js → chunk-5TI3ZXW3.js} +1 -1
  29. package/dist/chunks/{chunk-PY5A73YH.js → chunk-5WFOL3XX.js} +1 -1
  30. package/dist/chunks/{chunk-IHNEF3BG.js → chunk-5XPWRDZN.js} +1 -1
  31. package/dist/chunks/chunk-5ZEROVK5.js +7 -0
  32. package/dist/chunks/{chunk-3LQ2ADXO.js → chunk-64UCX5JM.js} +1 -1
  33. package/dist/chunks/{chunk-A67TLHES.js → chunk-7FAO6DXJ.js} +1 -1
  34. package/dist/chunks/{chunk-AQA4JVKA.js → chunk-7JNBF5SB.js} +1 -1
  35. package/dist/chunks/{chunk-A6F3EE2O.js → chunk-7ULVGK67.js} +1 -1
  36. package/dist/chunks/{chunk-MCP63EVQ.js → chunk-7WY7ASKE.js} +1 -1
  37. package/dist/chunks/{chunk-LD42X7ZH.js → chunk-AX3V7N44.js} +1 -1
  38. package/dist/chunks/{chunk-753RQ6WV.js → chunk-BEAH4TA2.js} +1 -1
  39. package/dist/chunks/chunk-BRETAWE7.js +10 -0
  40. package/dist/chunks/{chunk-T2SRGJPU.js → chunk-BT5C6MCY.js} +1 -1
  41. package/dist/chunks/{chunk-H4DE2OFO.js → chunk-BV2JBHT5.js} +1 -1
  42. package/dist/chunks/{chunk-D3GYYGSS.js → chunk-BWS3ZOHJ.js} +1 -1
  43. package/dist/chunks/{chunk-QZEZCUUZ.js → chunk-CBA2KGXG.js} +13 -13
  44. package/dist/chunks/chunk-CBVVVYUP.js +10 -0
  45. package/dist/chunks/{chunk-KIMIK4SG.js → chunk-CGTD4QFC.js} +1 -1
  46. package/dist/chunks/{chunk-QR7PY5JS.js → chunk-CH5325V5.js} +1 -1
  47. package/dist/chunks/{chunk-5MHRCRIN.js → chunk-CMHL66LK.js} +1 -1
  48. package/dist/chunks/{chunk-WRC5CTUD.js → chunk-D4TD2KWH.js} +1 -1
  49. package/dist/chunks/{chunk-XBOGVOV5.js → chunk-D4ZEJM3T.js} +1 -1
  50. package/dist/chunks/{chunk-5O7CRJE5.js → chunk-D6REP5QQ.js} +1 -1
  51. package/dist/chunks/chunk-DASHFOKO.js +8 -0
  52. package/dist/chunks/{chunk-63DO6KMD.js → chunk-DL5B5I2H.js} +3 -3
  53. package/dist/chunks/{chunk-M4TIOVOP.js → chunk-DUPAU76G.js} +1 -1
  54. package/dist/chunks/{chunk-APNR444T.js → chunk-E7DYXF6G.js} +1 -1
  55. package/dist/chunks/{chunk-GP5MFCGO.js → chunk-ECQKK4JU.js} +1 -1
  56. package/dist/chunks/{chunk-JULKMXVP.js → chunk-EEFLZK52.js} +1 -1
  57. package/dist/chunks/{chunk-GP2FXUFE.js → chunk-EJ2RWXUL.js} +1 -1
  58. package/dist/chunks/{chunk-U3J7VS56.js → chunk-FBYA6LLM.js} +1 -1
  59. package/dist/chunks/{chunk-SOCGBVML.js → chunk-FVVOHGQE.js} +1 -1
  60. package/dist/chunks/{chunk-QLW5DCM4.js → chunk-FWTBSC7Z.js} +1 -1
  61. package/dist/chunks/{chunk-2OET5FWH.js → chunk-G2BNLRPU.js} +1 -1
  62. package/dist/chunks/{chunk-DBV6AB6T.js → chunk-G3LWP5CH.js} +1 -1
  63. package/dist/chunks/{chunk-YIOT5B5Z.js → chunk-G6HUSV7F.js} +1 -1
  64. package/dist/chunks/{chunk-7V2PXIVW.js → chunk-GCPPL24C.js} +1 -1
  65. package/dist/chunks/{chunk-3AXMZRAB.js → chunk-GCXUSXB4.js} +1 -1
  66. package/dist/chunks/{chunk-GZWYJT4C.js → chunk-GHEGWXH2.js} +1 -1
  67. package/dist/chunks/{chunk-YKNHA3RN.js → chunk-GIFIOAOW.js} +1 -1
  68. package/dist/chunks/{chunk-JRBPVMQO.js → chunk-GJCVOEC2.js} +1 -1
  69. package/dist/chunks/{chunk-ELQBQ2O5.js → chunk-GN5IAG3M.js} +1 -1
  70. package/dist/chunks/{chunk-HTFQFHPR.js → chunk-H34SGIVS.js} +1 -1
  71. package/dist/chunks/chunk-IDP63TCP.js +10 -0
  72. package/dist/chunks/{pkg-EDJQLCNP.js → chunk-ITQPDXXA.js} +1 -1
  73. package/dist/chunks/{chunk-XK3W6Q5I.js → chunk-IZ4GFKGR.js} +1 -1
  74. package/dist/chunks/{chunk-62FZFXPJ.js → chunk-JB6T3XEF.js} +1 -1
  75. package/dist/chunks/{chunk-TSKFDJ77.js → chunk-JJ2JHAGW.js} +1 -1
  76. package/dist/chunks/{chunk-V5A4EBV3.js → chunk-JOXGYP5S.js} +1 -1
  77. package/dist/chunks/{chunk-3DDEBTCC.js → chunk-JYWHC7YX.js} +1 -1
  78. package/dist/chunks/{chunk-YTZPQVGF.js → chunk-K3VUXKMV.js} +1 -1
  79. package/dist/chunks/{chunk-2QSNFVB6.js → chunk-K5YO4UD7.js} +1 -1
  80. package/dist/chunks/{chunk-TCEEQLD4.js → chunk-KHG6CZLZ.js} +1 -1
  81. package/dist/chunks/{chunk-KL6HNOFN.js → chunk-KOLCO2RH.js} +1 -1
  82. package/dist/chunks/{chunk-WZ2R4Z7N.js → chunk-KRPY5FHJ.js} +1 -1
  83. package/dist/chunks/{chunk-7E6UJXLR.js → chunk-KV2DYFUG.js} +1 -1
  84. package/dist/chunks/{chunk-3KSTUMR6.js → chunk-M73W4XNR.js} +1 -1
  85. package/dist/chunks/{chunk-EKB2DYCQ.js → chunk-MCJ5OFNP.js} +1 -1
  86. package/dist/chunks/{chunk-LOEU4R4Z.js → chunk-MOW3KNCP.js} +1 -1
  87. package/dist/chunks/chunk-MY4MONOH.js +7 -0
  88. package/dist/chunks/{chunk-SBBD2Q5A.js → chunk-NAU6URTI.js} +1 -1
  89. package/dist/chunks/{chunk-B3ETPBO4.js → chunk-NEUQZYBL.js} +2 -2
  90. package/dist/chunks/chunk-NFASCUXE.js +8 -0
  91. package/dist/chunks/{chunk-3P4Y46MS.js → chunk-NIS66BFX.js} +2 -2
  92. package/dist/chunks/chunk-NTUDWWSL.js +14 -0
  93. package/dist/chunks/{chunk-AEOG4E5G.js → chunk-O4CQRV2G.js} +1 -1
  94. package/dist/chunks/{chunk-4MP4HVBG.js → chunk-O7NJQXN6.js} +1 -1
  95. package/dist/chunks/{chunk-5GOQ3FBV.js → chunk-OVWDOWRV.js} +1 -1
  96. package/dist/chunks/{chunk-7EJ3BZ67.js → chunk-PLJKMCXU.js} +1 -1
  97. package/dist/chunks/{chunk-P2HBUDGR.js → chunk-Q4WEODW3.js} +1 -1
  98. package/dist/chunks/{chunk-KUNFE2M6.js → chunk-QANIGEPP.js} +1 -1
  99. package/dist/chunks/{chunk-T3S63EA3.js → chunk-QBOY2CXL.js} +1 -1
  100. package/dist/chunks/{chunk-37DIJCWK.js → chunk-QQA2OMXJ.js} +1 -1
  101. package/dist/chunks/{chunk-HNOZM6D4.js → chunk-QYNJCJYZ.js} +1 -1
  102. package/dist/chunks/{chunk-K2R3QPOC.js → chunk-R5ZLTWKB.js} +1 -1
  103. package/dist/chunks/chunk-RBIHS5QI.js +7 -0
  104. package/dist/chunks/{chunk-QTCS2HDX.js → chunk-RCFJTXSB.js} +1 -1
  105. package/dist/chunks/{chunk-T34C75TI.js → chunk-RCUDI7OF.js} +1 -1
  106. package/dist/chunks/{chunk-KDRCBWRY.js → chunk-RTJOQK2R.js} +1 -1
  107. package/dist/chunks/{chunk-FXEMEIST.js → chunk-T2FCF46I.js} +1 -1
  108. package/dist/chunks/{chunk-IHRM7L23.js → chunk-T5TOBY4D.js} +1 -1
  109. package/dist/chunks/{chunk-YRK2BCTJ.js → chunk-TD7AL545.js} +1 -1
  110. package/dist/chunks/{chunk-MDWYXLDB.js → chunk-TGQSMRQZ.js} +3 -3
  111. package/dist/chunks/{chunk-6V67VZJD.js → chunk-TMXIVQ45.js} +1 -1
  112. package/dist/chunks/{chunk-J52UJYOK.js → chunk-TRZDIAX3.js} +1 -1
  113. package/dist/chunks/{chunk-7BML2OR6.js → chunk-U6KJOCXX.js} +1 -1
  114. package/dist/chunks/{chunk-Y55DGB3L.js → chunk-UIJYRI3G.js} +1 -1
  115. package/dist/chunks/{chunk-NAXFG37F.js → chunk-UNASHUWQ.js} +1 -1
  116. package/dist/chunks/{chunk-3RXEJWYM.js → chunk-UZTDRGCW.js} +1 -1
  117. package/dist/chunks/{chunk-BHJLCFQ4.js → chunk-VMMSNGPS.js} +1 -1
  118. package/dist/chunks/{chunk-F76MNMH3.js → chunk-VR5ROBAO.js} +1 -1
  119. package/dist/chunks/{chunk-JESNVRVR.js → chunk-VRH7LWOC.js} +1 -1
  120. package/dist/chunks/{chunk-QIPUFI6P.js → chunk-VU3RBRDH.js} +1 -1
  121. package/dist/chunks/{chunk-ZRJKGAUT.js → chunk-W634OFUG.js} +3 -3
  122. package/dist/chunks/{chunk-SKLRHAGH.js → chunk-WFCGAYP5.js} +1 -1
  123. package/dist/chunks/{chunk-C4XT3PG4.js → chunk-WKYFWE37.js} +1 -1
  124. package/dist/chunks/{chunk-G7X2TVUO.js → chunk-WQQTVQZK.js} +1 -1
  125. package/dist/chunks/{chunk-YHFZIUXF.js → chunk-XBWISZCG.js} +1 -1
  126. package/dist/chunks/{chunk-RIAOB3RF.js → chunk-XOBLL6JP.js} +1 -1
  127. package/dist/chunks/chunk-XRIM4BUF.js +7 -0
  128. package/dist/chunks/{chunk-ZBJ44DRL.js → chunk-Y3ZO6WB7.js} +1 -1
  129. package/dist/chunks/chunk-Y5YXAXK3.js +13 -0
  130. package/dist/chunks/{chunk-YEPB52XE.js → chunk-Y6WXTTZS.js} +1 -1
  131. package/dist/chunks/{chunk-OV7G6RIQ.js → chunk-Y7YULJK7.js} +1 -1
  132. package/dist/chunks/{chunk-UAUVCOGS.js → chunk-YJQW3DDY.js} +1 -1
  133. package/dist/chunks/chunk-YYMLVSE2.js +12 -0
  134. package/dist/chunks/{chunk-45UDRX4C.js → chunk-ZBZPCKTW.js} +1 -1
  135. package/dist/chunks/{chunk-2B7U6BB5.js → chunk-ZGKJLJ47.js} +1 -1
  136. package/dist/chunks/chunk-ZS2WS4AM.js +7 -0
  137. package/dist/chunks/clear-BJBNWJJB.js +8 -0
  138. package/dist/chunks/compile-vercel-config-QH77NQ4B.js +7 -0
  139. package/dist/chunks/config-354DFLQE.js +8 -0
  140. package/dist/chunks/config-AXK2BGCA.js +7 -0
  141. package/dist/chunks/connect-git-provider-AWEOEEOO.js +7 -0
  142. package/dist/chunks/delete-GO7DLOJ3.js +9 -0
  143. package/dist/chunks/delete-IYWVEDBG.js +10 -0
  144. package/dist/chunks/{detect-projects-A4H2ZEAP.js → detect-projects-K7SVMH5T.js} +1 -1
  145. package/dist/chunks/detect-services-5P7KCKFK.js +7 -0
  146. package/dist/chunks/disable-LGVOQE3T.js +7 -0
  147. package/dist/chunks/discard-27X77XQE.js +14 -0
  148. package/dist/chunks/edit-2XY4JHTX.js +8 -0
  149. package/dist/chunks/edit-IECKJW64.js +9 -0
  150. package/dist/chunks/enable-AFDKCU3L.js +7 -0
  151. package/dist/chunks/{exec-7LB36K52.js → exec-UV73J2ZB.js} +1 -1
  152. package/dist/chunks/{export-AI2O22W5.js → export-K7JNA5NA.js} +1 -1
  153. package/dist/chunks/future-FFWMSADT.js +7 -0
  154. package/dist/chunks/generate-cert-for-deploy-SY44OYEY.js +7 -0
  155. package/dist/chunks/image-D54UXO4P.js +7 -0
  156. package/dist/chunks/import-builders-4DYFWAOD.js +7 -0
  157. package/dist/chunks/{inspect-OM5S5YQ2.js → inspect-3DLXFK6E.js} +1 -1
  158. package/dist/chunks/{inspect-4A67JORH.js → inspect-A2LKZQMT.js} +1 -1
  159. package/dist/chunks/{inspect-3NMNI7GY.js → inspect-H2EHB6IO.js} +1 -1
  160. package/dist/chunks/inspect-HCBQIEZG.js +13 -0
  161. package/dist/chunks/inspect-XRCF2YRP.js +9 -0
  162. package/dist/chunks/{list-TUJ7HCQK.js → list-AB25WHGO.js} +1 -1
  163. package/dist/chunks/list-CU66L4ZB.js +12 -0
  164. package/dist/chunks/{list-NEV4FBTY.js → list-HUCI73LP.js} +1 -1
  165. package/dist/chunks/login-5GIPMHCM.js +9 -0
  166. package/dist/chunks/login-XD3H356W.js +7 -0
  167. package/dist/chunks/logs-MCYUVB2U.js +7 -0
  168. package/dist/chunks/ls-46HG3NM2.js +8 -0
  169. package/dist/chunks/{ls-COOTTCRW.js → ls-DZTI7O7V.js} +1 -1
  170. package/dist/chunks/ls-FVI4QA2G.js +11 -0
  171. package/dist/chunks/{ls-OVM2DZYL.js → ls-GFWMSKJI.js} +1 -1
  172. package/dist/chunks/{ls-UY3KCDSF.js → ls-GVHHJ6PD.js} +1 -1
  173. package/dist/chunks/{ls-CVO4MCX5.js → ls-IMQKQEA5.js} +1 -1
  174. package/dist/chunks/ls-SNGWJI57.js +8 -0
  175. package/dist/chunks/mutate-AATP3ZZW.js +9 -0
  176. package/dist/chunks/native-self-update-75UJCHGZ.js +7 -0
  177. package/dist/chunks/notifications-X76ITPCJ.js +7 -0
  178. package/dist/chunks/open-FVOQGEWM.js +7 -0
  179. package/dist/chunks/openapi-KYC6JIXI.js +7 -0
  180. package/dist/chunks/permissions-N6JJSYGS.js +7 -0
  181. package/dist/chunks/{plugin-offer-4YTKDZGS.js → plugin-offer-UXUZ3PRE.js} +1 -1
  182. package/dist/chunks/prompt-missing-credentials-7UX2S26W.js +7 -0
  183. package/dist/chunks/publish-BG3UKM2Q.js +15 -0
  184. package/dist/chunks/pull-3NAMWMU6.js +7 -0
  185. package/dist/chunks/purchase-domain-if-available-7UQPSITN.js +7 -0
  186. package/dist/chunks/push-TZAIOAX5.js +7 -0
  187. package/dist/chunks/{query-NIMDIFLO.js → query-R7M64JYQ.js} +1 -1
  188. package/dist/chunks/reauthenticate-TOILE7L6.js +7 -0
  189. package/dist/chunks/reorder-V47PIQFO.js +10 -0
  190. package/dist/chunks/reply-5QZVOLHI.js +9 -0
  191. package/dist/chunks/resolve-7VONHDWK.js +12 -0
  192. package/dist/chunks/resolve-agent-team-DHPOJEQE.js +7 -0
  193. package/dist/chunks/restore-JLME37UW.js +16 -0
  194. package/dist/chunks/rm-2GT4SSDQ.js +8 -0
  195. package/dist/chunks/rm-4EPE3LBT.js +8 -0
  196. package/dist/chunks/rm-5B7XAOK3.js +8 -0
  197. package/dist/chunks/rm-JY3ACRPF.js +8 -0
  198. package/dist/chunks/rm-V2A5HTIT.js +8 -0
  199. package/dist/chunks/routes-S75L7Z7A.js +7 -0
  200. package/dist/chunks/rule-inspect-VPH5ZZ23.js +8 -0
  201. package/dist/chunks/schema-DYNINJQ7.js +14 -0
  202. package/dist/chunks/{schema-44U7GOQE.js → schema-I73FHHZS.js} +1 -1
  203. package/dist/chunks/select-org-DUL7FO5S.js +7 -0
  204. package/dist/chunks/set-YZA622KE.js +7 -0
  205. package/dist/chunks/setup-and-link-ZDP5OPLK.js +7 -0
  206. package/dist/chunks/{skills-XOH4Q7KK.js → skills-DZYJV7BE.js} +3 -3
  207. package/dist/chunks/statuspage-45LJ2XYT.js +7 -0
  208. package/dist/chunks/tags-DYVP7Q2S.js +7 -0
  209. package/dist/chunks/{types-6W3KAE2A.js → types-YA6BOCRV.js} +1 -1
  210. package/dist/chunks/{update-YLFMSPQF.js → update-T3W6JMTU.js} +1 -1
  211. package/dist/chunks/validate-config-XWZ7ZZ3G.js +7 -0
  212. package/dist/commands/build/index.js +1 -6
  213. package/dist/commands/deploy/index.js +14 -14
  214. package/dist/commands/dev/index.js +3 -3
  215. package/dist/commands/env/index.js +1 -1
  216. package/dist/commands/link/index.js +1 -1
  217. package/dist/commands/list/index.js +1 -1
  218. package/dist/commands/project/index.js +1 -1
  219. package/dist/commands-account.js +112 -91
  220. package/dist/commands-ai.js +2 -2
  221. package/dist/commands-blob.js +1 -1
  222. package/dist/commands-core.js +62 -44
  223. package/dist/commands-deployments.js +9 -6
  224. package/dist/commands-flags.js +4 -3
  225. package/dist/commands-integrations.js +98 -74
  226. package/dist/commands-observability.js +5 -5
  227. package/dist/commands-routing.js +154 -162
  228. package/dist/help.js +1 -1
  229. package/dist/index.js +5 -5
  230. package/dist/internal-build.js +1 -1
  231. package/dist/native-download.js +1 -1
  232. package/dist/package.json +57 -58
  233. package/dist/root-help-commands.mjs +1 -1
  234. package/dist/version.mjs +1 -1
  235. package/package.json +50 -51
  236. package/dist/chunks/add-3MWFJH54.js +0 -8
  237. package/dist/chunks/add-CJWCA3MM.js +0 -8
  238. package/dist/chunks/add-GLCVYEEN.js +0 -8
  239. package/dist/chunks/build-6RK6VECG.js +0 -7
  240. package/dist/chunks/chunk-2PYFJXKS.js +0 -14
  241. package/dist/chunks/chunk-5SMV2PPI.js +0 -10
  242. package/dist/chunks/chunk-7A5WO5KA.js +0 -8
  243. package/dist/chunks/chunk-CJHVHB2F.js +0 -8
  244. package/dist/chunks/chunk-EGPVNTKP.js +0 -7
  245. package/dist/chunks/chunk-GJB72ITS.js +0 -12
  246. package/dist/chunks/chunk-H3SJJO6S.js +0 -10
  247. package/dist/chunks/chunk-INH6RXBH.js +0 -9
  248. package/dist/chunks/chunk-IU6PHFPQ.js +0 -7
  249. package/dist/chunks/chunk-KAUKCHQF.js +0 -10
  250. package/dist/chunks/chunk-NDWGYZRT.js +0 -10
  251. package/dist/chunks/chunk-OLAG7Y3P.js +0 -10
  252. package/dist/chunks/chunk-TK2ILW2O.js +0 -21
  253. package/dist/chunks/chunk-WKZ6JSGZ.js +0 -7
  254. package/dist/chunks/chunk-X65XZSWS.js +0 -10
  255. package/dist/chunks/cjs-2SMN43VH.js +0 -54
  256. package/dist/chunks/clear-375VKVXY.js +0 -8
  257. package/dist/chunks/compile-vercel-config-LNRUSKTH.js +0 -7
  258. package/dist/chunks/config-GOYBATSI.js +0 -8
  259. package/dist/chunks/config-VAW454ZH.js +0 -7
  260. package/dist/chunks/connect-git-provider-7KRYVDFS.js +0 -7
  261. package/dist/chunks/delete-3SN6XFOW.js +0 -10
  262. package/dist/chunks/delete-W6BZHLGP.js +0 -9
  263. package/dist/chunks/detect-services-6L57MV5F.js +0 -7
  264. package/dist/chunks/disable-UUV5MYYH.js +0 -7
  265. package/dist/chunks/discard-Y6ZITZ2P.js +0 -14
  266. package/dist/chunks/edit-CVMUITFG.js +0 -9
  267. package/dist/chunks/edit-LLRI57RF.js +0 -8
  268. package/dist/chunks/enable-TFA6XWAA.js +0 -7
  269. package/dist/chunks/future-EZEU2CBY.js +0 -7
  270. package/dist/chunks/generate-cert-for-deploy-QP5BUOJL.js +0 -7
  271. package/dist/chunks/image-YLUF7SHR.js +0 -7
  272. package/dist/chunks/import-builders-ANLKHIYK.js +0 -7
  273. package/dist/chunks/inspect-3TRAN3SP.js +0 -9
  274. package/dist/chunks/inspect-VEUY4QJ2.js +0 -13
  275. package/dist/chunks/list-DJKKVFUL.js +0 -12
  276. package/dist/chunks/login-4HCFKDKL.js +0 -7
  277. package/dist/chunks/login-EPBJQDEK.js +0 -9
  278. package/dist/chunks/logs-Q7XXVFR3.js +0 -7
  279. package/dist/chunks/ls-3TKRCF4T.js +0 -8
  280. package/dist/chunks/ls-LS5J5ERG.js +0 -11
  281. package/dist/chunks/ls-OQQTUQFN.js +0 -8
  282. package/dist/chunks/mutate-I6QWCURL.js +0 -9
  283. package/dist/chunks/notifications-UKC5Z6AH.js +0 -7
  284. package/dist/chunks/open-CYATUDTT.js +0 -7
  285. package/dist/chunks/openapi-B7WSK7AU.js +0 -7
  286. package/dist/chunks/permissions-4ZYPHPOZ.js +0 -7
  287. package/dist/chunks/prompt-missing-credentials-4OKJMYW5.js +0 -7
  288. package/dist/chunks/publish-N6E7VTRK.js +0 -15
  289. package/dist/chunks/pull-LPIT3XUR.js +0 -7
  290. package/dist/chunks/purchase-domain-if-available-IS6UDPJT.js +0 -7
  291. package/dist/chunks/push-ETLU6OCC.js +0 -7
  292. package/dist/chunks/reauthenticate-TESIUM6U.js +0 -7
  293. package/dist/chunks/reorder-PQU2BQEE.js +0 -10
  294. package/dist/chunks/reply-RKDDYV5I.js +0 -9
  295. package/dist/chunks/resolve-ZF7BFXIW.js +0 -12
  296. package/dist/chunks/resolve-agent-team-QSIJ665W.js +0 -7
  297. package/dist/chunks/restore-U5A3BEFQ.js +0 -16
  298. package/dist/chunks/rm-7H5O3T7G.js +0 -8
  299. package/dist/chunks/rm-EPPMQEAV.js +0 -8
  300. package/dist/chunks/rm-FNMW2FPM.js +0 -8
  301. package/dist/chunks/rm-OZIA3DFM.js +0 -8
  302. package/dist/chunks/rm-W3VOR2ED.js +0 -8
  303. package/dist/chunks/routes-BLE5XZJE.js +0 -7
  304. package/dist/chunks/rule-inspect-YAVRRGAP.js +0 -8
  305. package/dist/chunks/schema-6SAZ7T2S.js +0 -14
  306. package/dist/chunks/select-org-L5FJVL5Q.js +0 -7
  307. package/dist/chunks/set-3NQXDGJV.js +0 -7
  308. package/dist/chunks/setup-and-link-H36NRP3A.js +0 -7
  309. package/dist/chunks/tags-CRG27GFL.js +0 -7
  310. /package/dist/chunks/{chunk-OO572JUC.js → chunk-DBT6PGEH.js} +0 -0
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{emitVcrArgParseError,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-RTJOQK2R.js";import{outputError}from"./chunk-AX3V7N44.js";import"./chunk-RCUDI7OF.js";import"./chunk-GD7AV7BO.js";import{addSubcommand}from"./chunk-GCXUSXB4.js";import"./chunk-2H4DUZJZ.js";import"./chunk-ECQKK4JU.js";import"./chunk-JOXGYP5S.js";import{printError}from"./chunk-BWS3ZOHJ.js";import"./chunk-5ZEROVK5.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-32NXYHYC.js";import"./chunk-FWTBSC7Z.js";import"./chunk-CBA2KGXG.js";import"./chunk-64UCX5JM.js";import"./chunk-ITQPDXXA.js";import"./chunk-7WY7ASKE.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-CGTD4QFC.js";import"./chunk-F53OKXYI.js";import"./chunk-GJCVOEC2.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-T2FCF46I.js";import{packageName}from"./chunk-VRH7LWOC.js";import"./chunk-DBT6PGEH.js";import{output_manager_default}from"./chunk-W634OFUG.js";import"./chunk-BLUPZPAS.js";import"./chunk-ZS2WS4AM.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-RM3ZDRYE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-YPPDRKVC.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BULSRTQE.js";import"./chunk-BRQUZ5NC.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-BZENIQ7N.js";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(addSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr create <name> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let name=parsedArgs.args[0],project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),!name)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository name. Example: ${packageName} vcr create <name>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr create <name>"),when:"Replace <name> with the repository name to create"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel vcr create <name>`");let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=`/v1/vcr/repository?teamId=${encodeURIComponent(scope.teamId)}`;output_manager_default.spinner("Creating repository...");try{let created=await client.fetch(path,{method:"POST",body:{projectId:scope.projectId,name}});return fr.jsonOutput?client.stdout.write(`${JSON.stringify(created,null,2)}
8
+ `):output_manager_default.success(`Created repository ${created.repository?.name??name}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List existing repositories (a name conflict means it already exists)"}});throw err}finally{output_manager_default.stopSpinner()}}export{add as default};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{parseTeamRefs,teamRefBody}from"./chunk-LSF7FY6X.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-RTJOQK2R.js";import{outputError}from"./chunk-AX3V7N44.js";import{require_async_sema}from"./chunk-NZ2TFADV.js";import"./chunk-RCUDI7OF.js";import"./chunk-GD7AV7BO.js";import{permissionsAddSubcommand}from"./chunk-2H4DUZJZ.js";import{printError}from"./chunk-BWS3ZOHJ.js";import"./chunk-5ZEROVK5.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-32NXYHYC.js";import"./chunk-FWTBSC7Z.js";import"./chunk-CBA2KGXG.js";import"./chunk-64UCX5JM.js";import"./chunk-ITQPDXXA.js";import"./chunk-7WY7ASKE.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-CGTD4QFC.js";import"./chunk-F53OKXYI.js";import"./chunk-GJCVOEC2.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-T2FCF46I.js";import{packageName}from"./chunk-VRH7LWOC.js";import"./chunk-DBT6PGEH.js";import{output_manager_default}from"./chunk-W634OFUG.js";import"./chunk-BLUPZPAS.js";import"./chunk-ZS2WS4AM.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-RM3ZDRYE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-YPPDRKVC.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BULSRTQE.js";import"./chunk-BRQUZ5NC.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_sema=__toESM(require_async_sema(),1);var USAGE="vcr permissions <repository> add <team>[,<team>...]";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsAddSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],teamRefs=parseTeamRefs(parsedArgs.args.slice(2)),project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),teamRefs.length===0)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing team. Example: ${packageName} vcr permissions ${repository} add team_1a2b3c4d`,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Replace <team> with a team id or slug (comma-separate multiple teams)"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${USAGE}\``);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPermissionsPath(scope,repository),added=[],failed=[];output_manager_default.spinner(`Sharing ${repository} with ${teamRefs.length===1?teamRefs[0]:`${teamRefs.length} teams`}...`);let sema=new import_async_sema.default(10),results;try{results=await Promise.all(teamRefs.map(async team=>{await sema.acquire();try{let result=await client.fetch(path,{method:"POST",body:teamRefBody(team)});return{ok:!0,team,permission:result.permission}}catch(err){if(!isAPIError(err))throw err;let message=err.serverMessage||`API error (${err.status}).`;return{ok:!1,team,failure:{team,code:err.code||"API_ERROR",message}}}finally{sema.release()}}))}finally{output_manager_default.stopSpinner()}for(let result of results)result.ok?(added.push(result.permission),fr.jsonOutput||output_manager_default.success(`Shared ${repository} with ${result.permission?.teamSlug??result.team}`)):(failed.push(result.failure),fr.jsonOutput||output_manager_default.error(`Failed to share ${repository} with ${result.team}: ${result.failure.message}`));return failed.length>0&&outputAgentError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:`Failed to share ${repository} with ${failed.map(f=>`${f.team} (${f.message})`).join(", ")}`},1),fr.jsonOutput&&client.stdout.write(`${JSON.stringify({permissions:added,failed},null,2)}
8
+ `),failed.length>0?1:0}export{add as default};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{printRuleMutationReceipt}from"./chunk-CMHL66LK.js";import"./chunk-FVVOHGQE.js";import{resolveRulesProject,resolveRulesTeam}from"./chunk-PLJKMCXU.js";import"./chunk-XOBLL6JP.js";import"./chunk-GZNDA6SV.js";import{emitRulesArgParseError,getBodyType,handleRulesApiError,outputRulesError,readRuleBody,rulesCollectionPath}from"./chunk-3QECUY4S.js";import"./chunk-GHAY4PSD.js";import"./chunk-AX3V7N44.js";import"./chunk-TOTTVS5P.js";import"./chunk-HRR57QNP.js";import"./chunk-PFD7LETF.js";import"./chunk-375JVQYK.js";import{monitorsAddSubcommand}from"./chunk-T5TOBY4D.js";import{printError}from"./chunk-BWS3ZOHJ.js";import"./chunk-5ZEROVK5.js";import"./chunk-32NXYHYC.js";import"./chunk-FWTBSC7Z.js";import"./chunk-CBA2KGXG.js";import"./chunk-64UCX5JM.js";import"./chunk-ITQPDXXA.js";import"./chunk-7WY7ASKE.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-CGTD4QFC.js";import"./chunk-F53OKXYI.js";import{validateJsonOutput}from"./chunk-GJCVOEC2.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-T2FCF46I.js";import"./chunk-VRH7LWOC.js";import"./chunk-DBT6PGEH.js";import{output_manager_default}from"./chunk-W634OFUG.js";import"./chunk-BLUPZPAS.js";import"./chunk-ZS2WS4AM.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-RM3ZDRYE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-YPPDRKVC.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BULSRTQE.js";import"./chunk-BRQUZ5NC.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-BZENIQ7N.js";function applyScopeFlag(client,body,type,scope,flags,jsonOutput){if(Object.hasOwn(body,"ruleScope"))return flags["--project"]||flags["--all"]?outputRulesError(client,jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both."):void 0;if(flags["--project"]){body.ruleScope=type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]};return}if(flags["--all"]){if(type==="custom")return outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>.");body.ruleScope={type:"all"};return}return outputRulesError(client,jsonOutput,"MISSING_SCOPE","Missing monitor scope. Add ruleScope to the body, or pass --project or --all.")}async function resolveCreateScope(client,flags,jsonOutput){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,"monitors add"):resolveRulesTeam(client,jsonOutput)}async function add(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsAddSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors add --project <name-or-id> --body <path>"),printError(error),2}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);if(!flags["--body"])return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS","Missing required option: --body <PATH>.");let body=readRuleBody(client,flags["--body"],format.jsonOutput);if(typeof body=="number")return body;let type=getBodyType(body);if(!type)return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE","Create body must set a supported monitor type.");if(Object.hasOwn(body,"ruleScope")&&(flags["--project"]||flags["--all"]))return outputRulesError(client,format.jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both.");if(type==="custom"&&flags["--all"])return outputRulesError(client,format.jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>.");let scope=await resolveCreateScope(client,flags,format.jsonOutput);if(typeof scope=="number")return scope;let scopeError=applyScopeFlag(client,body,type,scope,flags,format.jsonOutput);if(scopeError!==void 0)return scopeError;output_manager_default.spinner("Creating monitor\u2026");try{let response=await client.fetch(rulesCollectionPath(api,scope.teamId),{method:"POST",body});return format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
8
+ `):printRuleMutationReceipt("Created",response[api.itemKey],client.argv),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{add as default};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isBuildxAvailable,isEngineInstalled,pushCompressionArgs,reportEngineCommandFailure,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-RTJOQK2R.js";import{outputError}from"./chunk-AX3V7N44.js";import"./chunk-RCUDI7OF.js";import"./chunk-GD7AV7BO.js";import{buildSubcommand}from"./chunk-GCXUSXB4.js";import"./chunk-2H4DUZJZ.js";import"./chunk-ECQKK4JU.js";import"./chunk-JOXGYP5S.js";import{printError}from"./chunk-BWS3ZOHJ.js";import"./chunk-5ZEROVK5.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-32NXYHYC.js";import"./chunk-FWTBSC7Z.js";import"./chunk-CBA2KGXG.js";import"./chunk-64UCX5JM.js";import"./chunk-ITQPDXXA.js";import"./chunk-7WY7ASKE.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-CGTD4QFC.js";import"./chunk-F53OKXYI.js";import"./chunk-GJCVOEC2.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4SAVH3H7.js";import"./chunk-T2FCF46I.js";import"./chunk-VRH7LWOC.js";import"./chunk-DBT6PGEH.js";import{output_manager_default}from"./chunk-W634OFUG.js";import"./chunk-BLUPZPAS.js";import"./chunk-ZS2WS4AM.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-RM3ZDRYE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-YPPDRKVC.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BULSRTQE.js";import"./chunk-BRQUZ5NC.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-BZENIQ7N.js";var DEFAULT_PLATFORM="linux/amd64";async function build(client,telemetry){let{own,passthrough}=splitPassthrough(client.argv),parsedArgs;try{parsedArgs=parseArguments(own,getFlagsSpecification(buildSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr build <engine> [path] [name[:tag]]"),printError(err),2}let[engineArg,pathArg,nameArg]=parsedArgs.args.slice(2),project=parsedArgs.flags["--project"],platform=parsedArgs.flags["--platform"],push=!!parsedArgs.flags["--push"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliArgumentPath(pathArg),telemetry.trackCliArgumentName(nameArg),telemetry.trackCliOptionProject(project),telemetry.trackCliOptionPlatform(platform),telemetry.trackCliFlagPush(push),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr build docker"),when:"Replace docker with the container tool you use"}]},2),outputError(client,!1,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,!1);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,!1,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:!1});if(typeof scope=="number")return scope;let parsed=parseNameArg(nameArg,scope.projectName);if("error"in parsed)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:parsed.error},2),outputError(client,!1,"INVALID_ARGUMENTS",parsed.error);let validationError=validateImageParts(parsed);if(validationError)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:validationError},2),outputError(client,!1,"INVALID_ARGUMENTS",validationError);let ref=`${buildRepositoryReference({registry:resolveRegistry(),teamSlug:scope.teamSlug,projectName:scope.projectName,repository:parsed.repository})}:${parsed.tag??DEFAULT_TAG}`,contextPath=pathArg??".",buildPlatform=platform??DEFAULT_PLATFORM;if(push&&engine==="docker"&&await isBuildxAvailable()){let outputSpec=`type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`,engineArgs2=["buildx","build","--platform",buildPlatform,"--output",outputSpec,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);let result2=await runEngine(engine,engineArgs2,{cwd:client.cwd,captureStderr:!0});return result2.exitCode!==0?reportEnginePushFailure(client,engine,"buildx build",result2):(output_manager_default.success(`Built and pushed ${ref} (zstd compression)`),0)}push&&engine==="docker"&&output_manager_default.warn("Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes.");let engineArgs=["build","--platform",buildPlatform,"--tag",ref,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);let result=await runEngine(engine,engineArgs,{cwd:client.cwd});if(result.exitCode!==0)return reportEngineCommandFailure(client,engine,"build",result);if(!push)return output_manager_default.success(`Built ${ref}`),output_manager_default.log(`Push it with \`${buildCommandWithGlobalFlags(client.argv,`vcr push ${engine}${nameArg?` ${nameArg}`:""}`)}\`.`),0;let pushArgs=["push",...pushCompressionArgs(engine),ref];output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);let pushResult=await runEngine(engine,pushArgs,{cwd:client.cwd,captureStderr:!0});if(pushResult.exitCode!==0)return reportEnginePushFailure(client,engine,"push",pushResult);let compressed=engine!=="docker";return output_manager_default.success(`Built and pushed ${ref}${compressed?" (zstd compression)":""}`),0}export{build as default};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{collectContactInformation,getDomainPrice,getDomainStatus,purchaseDomain}from"./chunk-62FZFXPJ.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{param}from"./chunk-3G3FQYMW.js";import{require_pluralize}from"./chunk-QZEZCUUZ.js";import{DomainNotAvailable,DomainNotFound,UnsupportedTLD,UserAborted}from"./chunk-FXEMEIST.js";import{eraseLines,output_manager_default}from"./chunk-ZRJKGAUT.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_pluralize=__toESM(require_pluralize(),1);var isTTY=process.stdout.isTTY;async function purchaseDomainIfAvailable(client,domain,contextName){output_manager_default.spinner(`Checking status of ${import_chalk.default.bold(domain)}`);let buyDomainStamp=stamp_default(),{available}=await getDomainStatus(client,domain);if(available){if(!isTTY)return new DomainNotFound(domain);output_manager_default.debug(`Domain ${domain} is available to be purchased`);let domainPrice=await getDomainPrice(client,domain).finally(()=>{output_manager_default.stopSpinner()});if(domainPrice instanceof UnsupportedTLD)return domainPrice;if(domainPrice instanceof Error)throw domainPrice;let{purchasePrice,years}=domainPrice;if(purchasePrice===null)return output_manager_default.error(`The domain ${param(domain)} is ${import_chalk.default.underline("unavailable")}! ${buyDomainStamp()}`),new DomainNotAvailable(domain);if(output_manager_default.log(`Domain not found, but you can buy it under ${import_chalk.default.bold(contextName)}! ${buyDomainStamp()}`),!await client.input.confirm(`Buy ${import_chalk.default.underline(domain)} for ${import_chalk.default.bold(`$${purchasePrice}`)} (${(0,import_pluralize.default)("yr",years,!0)})?`,!1))return output_manager_default.print(eraseLines(1)),new UserAborted;output_manager_default.print(eraseLines(1));let contactInformation=await collectContactInformation(client),result=await purchaseDomain(client,domain,purchasePrice,years,!0,contactInformation);return result instanceof Error?result:!0}return output_manager_default.debug(`Domain ${domain} is not available to be purchased`),!1}export{purchaseDomainIfAvailable};
7
+ import{collectContactInformation,getDomainPrice,getDomainStatus,purchaseDomain}from"./chunk-JB6T3XEF.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{param}from"./chunk-3G3FQYMW.js";import{require_pluralize}from"./chunk-CBA2KGXG.js";import{DomainNotAvailable,DomainNotFound,UnsupportedTLD,UserAborted}from"./chunk-T2FCF46I.js";import{eraseLines,output_manager_default}from"./chunk-W634OFUG.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_pluralize=__toESM(require_pluralize(),1);var isTTY=process.stdout.isTTY;async function purchaseDomainIfAvailable(client,domain,contextName){output_manager_default.spinner(`Checking status of ${import_chalk.default.bold(domain)}`);let buyDomainStamp=stamp_default(),{available}=await getDomainStatus(client,domain);if(available){if(!isTTY)return new DomainNotFound(domain);output_manager_default.debug(`Domain ${domain} is available to be purchased`);let domainPrice=await getDomainPrice(client,domain).finally(()=>{output_manager_default.stopSpinner()});if(domainPrice instanceof UnsupportedTLD)return domainPrice;if(domainPrice instanceof Error)throw domainPrice;let{purchasePrice,years}=domainPrice;if(purchasePrice===null)return output_manager_default.error(`The domain ${param(domain)} is ${import_chalk.default.underline("unavailable")}! ${buyDomainStamp()}`),new DomainNotAvailable(domain);if(output_manager_default.log(`Domain not found, but you can buy it under ${import_chalk.default.bold(contextName)}! ${buyDomainStamp()}`),!await client.input.confirm(`Buy ${import_chalk.default.underline(domain)} for ${import_chalk.default.bold(`$${purchasePrice}`)} (${(0,import_pluralize.default)("yr",years,!0)})?`,!1))return output_manager_default.print(eraseLines(1)),new UserAborted;output_manager_default.print(eraseLines(1));let contactInformation=await collectContactInformation(client),result=await purchaseDomain(client,domain,purchasePrice,years,!0,contactInformation);return result instanceof Error?result:!0}return output_manager_default.debug(`Domain ${domain} is not available to be purchased`),!1}export{purchaseDomainIfAvailable};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{AGENT_REASON,writeActionRequired}from"./chunk-32NXYHYC.js";import{output_manager_default}from"./chunk-W634OFUG.js";function isNonProductionTarget(target){return!!target&&target!=="production"}async function hasDeployment(client,org,projectId){let{deployments}=await client.fetch(`/v6/deployments?projectId=${encodeURIComponent(projectId)}&limit=1`,{accountId:org.id});return deployments.length>0}async function hasEarlierDeployment(client,org,projectId,listedDeployments){if(listedDeployments?.length)return!0;try{return await hasDeployment(client,org,projectId)}catch(err){return output_manager_default.debug(`Couldn't check the project for earlier deployments: ${err}`),!0}}function refuseFirstDeployment(client,{target,newProject,prodCommand,prepareCommands=[]}){let environment=target==="preview"?"Preview":target,cause=newProject?"This deploy would create a new project":"This project has no deployments yet",recovery=prepareCommands.length?"pull its Production settings, build again with --prod, then retry with --prod":"retry with --prod",message=`Can't create a ${environment} deployment. ${cause}, and a project's first deployment is assigned to Production. To deploy to Production, ${recovery}. Later deployments can use --environment ${target}.`,note=prodCommand.note?`; ${prodCommand.note}`:"",steps=prepareCommands.length?[...prepareCommands,{command:prodCommand.command,action:`deploy the build to Production${note}`}]:[{command:prodCommand.command,action:`deploy to Production instead${note}`}];return client.nonInteractive&&writeActionRequired(client,{status:"action_required",reason:AGENT_REASON.FIRST_DEPLOYMENT_PRODUCTION,message,userActionRequired:!0,hint:"Ask the user before deploying to Production.",next:steps.map((step,i)=>({command:step.command,when:i===0?`Only after the user approves: ${step.action}`:`Then ${step.action}`}))}),output_manager_default.error(`${message}
8
+
9
+ ${steps.map((step,i)=>`${i===0?"To":"Then"} ${step.action}:
10
+ ${step.command}`).join(`
11
+ `)}`),1}export{isNonProductionTarget,hasDeployment,hasEarlierDeployment,refuseFirstDeployment};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{packageName}from"./chunk-JESNVRVR.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-YPPDRKVC.js";var PERMISSIONS_ACTIONS={ls:["ls","list"],add:["add"],rm:["rm","remove"],clear:["clear"]},projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},permissionsLsSubcommand={name:"ls",aliases:["list"],description:"List teams with access to a repository",arguments:[],options:[projectScopeOption,{...limitOption,description:"Number of results to return per page (default: 100, max: 100)"},nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"List teams with access as JSON",value:`${packageName} vcr permissions my-app ls --json`}]},permissionsAddSubcommand={name:"add",aliases:[],description:"Give one or more teams access to pull images from a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Share a repository with a team by id",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Share a repository with a team by slug",value:`${packageName} vcr permissions my-app add my-team`},{name:"Share a repository with multiple teams",value:`${packageName} vcr permissions my-app add team_1a2b3c4d,other-team`}]},permissionsRmSubcommand={name:"remove",aliases:["rm"],description:"Remove one or more teams' access to a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Remove a team's access by id",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Remove multiple teams' access",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d,other-team`}]},permissionsClearSubcommand={name:"clear",aliases:[],description:"Remove access to a repository for every team",arguments:[],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`},{name:"Clear all repository permissions without the confirmation prompt",value:`${packageName} vcr permissions my-app clear --yes`}]},permissionsAggregateCommand={name:"permissions",aliases:["permission"],argumentsBeforeSubcommand:!0,description:"Manage which teams can pull images from a container registry repository",arguments:[{name:"repository",required:!0}],subcommands:[permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand],options:[],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"Share a repository with a team",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Remove a team's access to a repository",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`}]};export{PERMISSIONS_ACTIONS,permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand,permissionsAggregateCommand};
7
+ import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-YPPDRKVC.js";var PERMISSIONS_ACTIONS={ls:["ls","list"],add:["add"],rm:["rm","remove"],clear:["clear"]},projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},permissionsLsSubcommand={name:"ls",aliases:["list"],description:"List teams with access to a repository",arguments:[],options:[projectScopeOption,{...limitOption,description:"Number of results to return per page (default: 100, max: 100)"},nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"List teams with access as JSON",value:`${packageName} vcr permissions my-app ls --json`}]},permissionsAddSubcommand={name:"add",aliases:[],description:"Give one or more teams access to pull images from a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Share a repository with a team by id",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Share a repository with a team by slug",value:`${packageName} vcr permissions my-app add my-team`},{name:"Share a repository with multiple teams",value:`${packageName} vcr permissions my-app add team_1a2b3c4d,other-team`}]},permissionsRmSubcommand={name:"remove",aliases:["rm"],description:"Remove one or more teams' access to a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Remove a team's access by id",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Remove multiple teams' access",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d,other-team`}]},permissionsClearSubcommand={name:"clear",aliases:[],description:"Remove access to a repository for every team",arguments:[],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`},{name:"Clear all repository permissions without the confirmation prompt",value:`${packageName} vcr permissions my-app clear --yes`}]},permissionsAggregateCommand={name:"permissions",aliases:["permission"],argumentsBeforeSubcommand:!0,description:"Manage which teams can pull images from a container registry repository",arguments:[{name:"repository",required:!0}],subcommands:[permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand],options:[],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"Share a repository with a team",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Remove a team's access to a repository",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`}]};export{PERMISSIONS_ACTIONS,permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand,permissionsAggregateCommand};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{table}from"./chunk-OTJNOMRV.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function strlen(str){return(0,import_strip_ansi.default)(str).length}function formatTable(header,align,blocks){let nrCols=header.length,padding=[],out=`
7
+ import{table}from"./chunk-375JVQYK.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var import_strip_ansi=__toESM(require_strip_ansi(),1);function strlen(str){return(0,import_strip_ansi.default)(str).length}function formatTable(header,align,blocks){let nrCols=header.length,padding=[],out=`
8
8
  `;for(let i=0;i<nrCols;i++)padding[i]=blocks.reduce((acc,block)=>{let maxLen=Math.max(...block.rows.map(row=>strlen(`${row[i]}`)));return Math.max(acc,Math.ceil(maxLen/8))},1);for(let block of blocks){block.name&&(out+=`${block.name}
9
9
  `);let rows=[header.map(s=>import_chalk.default.dim(s))].concat(block.rows);if(rows.length>0){rows[0][0]=` ${rows[0][0]}`;for(let i=1;i<rows.length;i++){let row=rows[i].slice(0);row[0]=` ${row[0]}`;for(let j=0;j<nrCols;j++){let col=`${row[j]}`,al=align[j]||"l",repeat=padding[j]>1?padding[j]*8-strlen(col):0,pad=repeat>0?" ".repeat(repeat):"";rows[i][j]=al==="l"?col+pad:pad+col}}out+=table(rows,{align,hsep:4})}out+=`
10
10
 
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{tracesConfigCommand}from"./chunk-45UDRX4C.js";import{packageName}from"./chunk-JESNVRVR.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-YPPDRKVC.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{...deploymentOption,description:"Filter by deployment ID"},{name:"deployment-id",shorthand:null,type:String,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace",shorthand:null,type:String,argument:"TRACE",deprecated:!1,description:"Filter by trace ID"},{name:"trace-id",shorthand:null,type:String,deprecated:!0},{name:"span",shorthand:null,type:String,argument:"SPAN",deprecated:!1,description:"Filter by span ID"},{name:"span-id",shorthand:null,type:String,deprecated:!0},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Show a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:"p",type:String,argument:"NAME|ID",deprecated:!1,description:"Project that owns the trace (default: linked project)"},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open (default: timeline). Only valid with --open."}],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Inspect a trace without typing the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],forwardsUnknownOptions:!0,options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl options after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100, max: 1000)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",placeholders:["<CURSOR>"],value:`${packageName} traces search --next <CURSOR> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Inspect project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
7
+ import{tracesConfigCommand}from"./chunk-ZBZPCKTW.js";import{packageName}from"./chunk-VRH7LWOC.js";import{deploymentOption,nextCursorOption,projectOption,protectionBypassOption,sinceOption,untilOption,yesOption}from"./chunk-YPPDRKVC.js";var spanQueryOptions=[{...projectOption,shorthand:"p",description:"Filter spans to one project (default: all team projects)"},{name:"environment",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1,description:"Environment: production or preview (case-insensitive)"},{name:"service",shorthand:null,type:String,deprecated:!1,description:"Filter by service name"},{name:"name",shorthand:null,type:String,deprecated:!1,description:"Filter by span name"},{name:"kind",shorthand:null,type:String,deprecated:!1,description:"Filter by span kind: unspecified (0), internal (1), server (2), client (3), producer (4), consumer (5)"},{name:"status",shorthand:null,type:String,deprecated:!1,description:"Status: error, ok, or unset (case-insensitive)"},{...deploymentOption,description:"Filter by deployment ID"},{name:"deployment-id",shorthand:null,type:String,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!1,description:"Filter by request ID. Some IDs return 404 in traces inspect. Reuse --scope and --project. See traces inspect --help."},{name:"trace",shorthand:null,type:String,argument:"TRACE",deprecated:!1,description:"Filter by trace ID"},{name:"trace-id",shorthand:null,type:String,deprecated:!0},{name:"span",shorthand:null,type:String,argument:"SPAN",deprecated:!1,description:"Filter by span ID"},{name:"span-id",shorthand:null,type:String,deprecated:!0},{name:"root",shorthand:null,type:Boolean,deprecated:!1,description:"Show root spans only"},{...sinceOption,description:`${sinceOption.description} (default: 1h ago)`},untilOption];var requestIdLookupHelp={title:"Request-ID lookup",body:["A request ID in search results does not guarantee traces inspect can retrieve the trace. Lookup requires a matching root span in the same project within 30 minutes after the request-ID timestamp.","","If no matching root is found, lookup returns 404. Use the same --scope and --project for search and inspect."]},getSubcommand={name:"inspect",aliases:["get"],default:!0,description:"Show a captured trace by trace ID or request ID",helpSections:[{title:"Trace-ID lookup",body:["A 32-character hexadecimal ID selects trace-ID lookup. Other IDs select request-ID lookup.","Trace-ID lookup retrieves the trace directly within the trace retention window. Use the same --scope and --project as search."]},requestIdLookupHelp],arguments:[{name:"id",required:!0}],options:[{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Print the raw trace JSON to stdout"},{name:"project",shorthand:"p",type:String,argument:"NAME|ID",deprecated:!1,description:"Project that owns the trace (default: linked project)"},{name:"open",shorthand:null,type:Boolean,deprecated:!1,description:"Open the trace in the Vercel Dashboard instead of printing it."},{name:"view",shorthand:null,type:String,argument:"timeline|tree|waterfall",deprecated:!1,description:"Dashboard view to open (default: timeline). Only valid with --open."}],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Inspect a trace without typing the default inspect subcommand",value:`${packageName} traces e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace from a specific team and project",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --scope my-team --project my-app`},{name:"Open the trace in the Vercel Dashboard",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open`},{name:"Open the trace in the Vercel Dashboard with the waterfall view",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --open --view waterfall`}]},createSubcommand={name:"create",aliases:[],description:"Capture a session trace for a request (alias for `vercel curl --trace`).",arguments:[{name:"path",required:!0}],forwardsUnknownOptions:!0,options:[deploymentOption,protectionBypassOption,{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Emit { response, requestId } as JSON on stdout"},{...yesOption,description:"Skip the production confirmation prompt (e.g. in non-interactive mode)"}],examples:[{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Target a specific deployment",value:`${packageName} traces create /api/status --deployment https://your-project-abc123.vercel.app`},{name:"Pass curl options after the separator",value:`${packageName} traces create /api/test -- --request POST --data '{"name": "John"}'`}]},searchSubcommand={name:"search",aliases:[],description:"Search team spans. Use --project to filter one project. Results are newest first. Duration filters do not sort results.",helpSections:[{title:"Table columns",body:["Available: span.startTime, span.duration, span.name, span.status.code, service.name, environment, request.id, trace.id, span.id, parent.id, span.kind","Default: all except environment, request.id, and span.kind."]},{title:"KQL filters",body:["Fields: project.id, environment, service.name, deployment.id, request.id, user.id, session.id","Span fields: span.name, span.kind, span.id, parent.id, span.isRoot, span.status.code, span.duration","Trace fields: trace.id, trace.state","","Other fields search span attributes first, then resource attributes.","","span.duration uses milliseconds.","span.kind uses the numeric values shown under --kind.","span.status.code uses Error, Ok, or Unset.","Use field:value filters. Plain text search is not supported.","Use NOT to exclude values. End a value with * to match a prefix.","Wrap values with spaces in double quotes. Keep the full query in single quotes."]},{title:"Paging",body:["When more spans match, a Next page command is printed on stderr.","--json prints one span line per record and ends with a summary line; --non-interactive implies --json.","--next continues from the summary's pagination.next value. It keeps the original team, project, filters, and time window, so it can't be combined with them. --limit can change."]}],arguments:[],options:[...spanQueryOptions,{name:"limit",shorthand:"n",type:Number,deprecated:!1,description:"Maximum number of spans (default: 100, max: 1000)"},{name:"query",shorthand:"q",type:String,deprecated:!1,description:"Filter spans using KQL"},{name:"columns",shorthand:null,argument:"LIST",type:String,deprecated:!1,description:"Columns to show, in order. Separate names with commas. Cannot be used with --json or --non-interactive."},{...nextCursorOption,description:"Continue a previous search from its summary's next value"},{name:"json",shorthand:null,type:Boolean,deprecated:!1,description:"Output JSON Lines ending with a summary line"}],examples:[{name:"Find production errors for one service",value:`${packageName} traces search --environment production --service checkout-api --status error --since 1h`},{name:"Use KQL and output JSON Lines",value:`${packageName} traces search --query 'http.route:"/api/checkout"' --kind server --json`},{name:"Exclude span names starting with app/lib/fetch-api",value:`${packageName} traces search --query 'NOT span.name:app/lib/fetch-api*'`},{name:"Exclude exact span names",value:`${packageName} traces search --query 'NOT span.name:("GET /screenshot/v2" OR "middleware GET")'`},{name:"Find spans longer than 2 seconds",value:`${packageName} traces search --query 'span.duration > 2000' --columns span.startTime,span.duration,span.name,span.kind,span.status.code`},{name:"Continue from the summary's next value",placeholders:["<CURSOR>"],value:`${packageName} traces search --next <CURSOR> --json`}]},tracesCommand={name:"traces",aliases:[],description:"Inspect project traces and search spans across a Vercel team.",arguments:[{name:"id",required:!1}],subcommands:[getSubcommand,searchSubcommand,createSubcommand,tracesConfigCommand],options:[],examples:[{name:"Inspect a trace by trace ID",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00`},{name:"Inspect a trace by request ID",value:`${packageName} traces inspect qb46r-1790847620933-1145d2891a3e`},{name:"Print the raw trace JSON",value:`${packageName} traces inspect e5c0d1efb3904155472b01692c7f2d00 --json`},{name:"Capture a session trace for a request",value:`${packageName} traces create /api/hello`},{name:"Search recent spans",value:`${packageName} traces search --status error`},{name:"List the trace sampling rules for a project",value:`${packageName} traces config ls`}]};export{getSubcommand,createSubcommand,searchSubcommand,tracesCommand};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{linkCommand}from"./chunk-FWTBSC7Z.js";import{quoteArg,teamCache}from"./chunk-F53OKXYI.js";import{InvalidToken,LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-T2FCF46I.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-VRH7LWOC.js";import{pkg_default}from"./chunk-DBT6PGEH.js";import{recordCliError}from"./chunk-W634OFUG.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{arg_common_default,getFlagsSpecification,getGlobalFlagsFromArgs,normalizeFlagName,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-YPPDRKVC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",AGENT_CANNOT_SWITCH:"agent_cannot_switch",API_ERROR:"api_error",STDIN_ERROR:"stdin_error",RATE_LIMITED:"rate_limited",NETWORK_ERROR:"network_error",UNKNOWN_COMMAND:"unknown_command",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",PRICE_CHANGED:"price_changed",CONFLICT:"conflict",DOMAIN_NOT_AVAILABLE:"domain_not_available",TLD_NOT_SUPPORTED:"tld_not_supported",PAYMENT_FAILED:"payment_failed",UNKNOWN_OUTCOME:"unknown_outcome",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",PAGE_INTEGRITY_NOT_AVAILABLE:"page_integrity_not_available",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_SINGLE_AT_PASSED:"schedule_single_at_passed",SCHEDULE_ALREADY_ACTIVE:"schedule_already_active",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",PLAN_LIMIT:"plan_limit",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination",TARGET_CONFLICT:"target_conflict",FIRST_DEPLOYMENT_PRODUCTION:"first_deployment_production",DEPRECATED:"deprecated",LIMIT_CLAMPED:"limit_clamped",METRICS_UNAVAILABLE:"metrics_unavailable",STREAM_GAP:"stream_gap",INCOMPLETE_RESULTS:"incomplete_results"},USAGE_ERROR_REASONS=new Set(["invalid_arguments","missing_arguments","unknown_command","missing_command","invalid_environment","invalid_type","missing_id","missing_value","missing_name","missing_flags","missing_clients","invalid_clients","conflicting_type_flags","missing_environment","invalid_slug","invalid_name","invalid_alert_thresholds","invalid_budget","invalid_dns_type","invalid_event","invalid_expiration","invalid_port","invalid_refresh_period","invalid_role_combination","invalid_url","missing_events","missing_issuer_id","missing_key_id","missing_key","missing_url"]);function getExitCodeForReason(reason){return reason!==void 0&&USAGE_ERROR_REASONS.has(reason)?2:1}var AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus",PRIORITY_PROJECT_ENABLE_COMMAND="project priority enable",BUY_PRO_COMMAND="buy pro",PROJECT_ENABLE_COMMAND="project observability enable";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function mentionsPriorityProject(message){return/priority\s+project/i.test(message)||/priority\s+tier/i.test(message)}function observabilityPlusDenialReason(error){if(!error||typeof error!="object"||!("meta"in error))return;let meta=error.meta;if(meta&&typeof meta=="object"&&"reason"in meta&&typeof meta.reason=="string")return meta.reason}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function isHobbyLikePlan(plan){return plan==="hobby"||plan==="oss"}function isProOrEnterprisePlan(plan){return plan==="pro"||plan==="enterprise"}function currentTeamPlan(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.billing?.plan}function planForTeam(idOrSlug){return teamCache.get(idOrSlug)?.billing?.plan}function buyProFix(hint){return{command:BUY_PRO_COMMAND,hint:hint??`Upgrade with ${getCommandName(BUY_PRO_COMMAND)}.`,when:"a person has approved upgrading the plan"}}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function inferDenialReason(message){if(/(?:disabled|switched off|re-enable)/i.test(message))return"subscription_disabled";if(/excluded from it|include the project/i.test(message))return"project_excluded";if(/upgrade your plan/i.test(message)&&/pro and enterprise/i.test(message))return"plan_upgrade_required";if(/(?:quota|usage limit|query limit)/i.test(message))return"quota"}function plusNeedsPlanUpgradeHint(){return`Observability Plus is available on Pro and Enterprise. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}. The add-on cannot be purchased on Hobby.`}function observabilityPlusRecovery(message,denialReason,plan){if(mentionsObservabilityPlus(message))switch(denialReason??inferDenialReason(message)){case"subscription_disabled":return{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."};case"project_excluded":return{command:PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:`Observability Plus is on for the team, but this project is excluded. Enable it with ${getCommandName(PROJECT_ENABLE_COMMAND)}. A new subscription is not needed.`,preserveProject:!1,when:"a person has approved enabling Observability Plus for this project"};case"plan_upgrade_required":return buyProFix(plusNeedsPlanUpgradeHint());case"quota":return{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."};default:return isHobbyLikePlan(plan)?buyProFix(plusNeedsPlanUpgradeHint()):{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}}function priorityProjectRecovery(message,plan){if(mentionsPriorityProject(message))return isHobbyLikePlan(plan)?buyProFix(`Priority Projects are only available on Pro or Enterprise team plans. Upgrade with ${getCommandName(BUY_PRO_COMMAND)}, then run ${getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND)}.`):{command:PRIORITY_PROJECT_ENABLE_COMMAND,excludeFlags:["--non-interactive","--project","--yes"],hint:getCommandName(PRIORITY_PROJECT_ENABLE_COMMAND),preserveProject:!1,when:"user runs this command in an interactive terminal"}}function observabilityPlanRecovery(message,denialReason,plan){return priorityProjectRecovery(message,plan)??observabilityPlusRecovery(message,denialReason,plan)}var PROJECT_POSITIONAL_COMMANDS=new Set([PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND]);function currentTeamScope(client){let id=client?.config?.currentTeam;if(id)return teamCache.get(id)?.slug??id}function targetRecovery(fix,target){if(!fix)return;let targeted=command=>{let out=command;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(command)&&(out+=` ${quoteArg(target.projectName)}`),target.scope&&(out+=` --scope ${quoteArg(target.scope)}`),out},hint=fix.hint;for(let command of[BUY_PRO_COMMAND,OBSERVABILITY_PLUS_PURCHASE_COMMAND,PRIORITY_PROJECT_ENABLE_COMMAND,PROJECT_ENABLE_COMMAND])hint=hint.split(getCommandName(command)).join(getCommandName(targeted(command)));if(!fix.command)return{...fix,hint};let excludeFlags=new Set(fix.excludeFlags??[]),preserveProject=fix.preserveProject;return target.projectName&&PROJECT_POSITIONAL_COMMANDS.has(fix.command)&&(excludeFlags.add("--project"),preserveProject=!1),fix.command===BUY_PRO_COMMAND&&excludeFlags.add("--project"),target.scope&&(excludeFlags.add("--scope"),excludeFlags.add("--team")),{...fix,command:targeted(fix.command),hint,...excludeFlags.size?{excludeFlags:Array.from(excludeFlags)}:{},...preserveProject!==void 0?{preserveProject}:{}}}function clientObservabilityPlanRecovery(client,error,message,projectName,scope){return targetRecovery(observabilityPlanRecovery(message,observabilityPlusDenialReason(error),scope?planForTeam(scope):currentTeamPlan(client)),{projectName,scope:scope??currentTeamScope(client)})}function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}var TOKENS_URL="https://vercel.com/account/tokens";function isInvalidTokenApiError(error){if(typeof error!="object"||error===null)return!1;let{status,invalidToken,missingToken}=error;return(status===401||status===403)&&(invalidToken===!0||missingToken===!0)}function isInvalidTokenError(error){return error instanceof InvalidToken||isInvalidTokenApiError(error)}function getInvalidTokenRecovery(client){let source=client?.authConfig?.tokenSource,create=`Create a token at ${TOKENS_URL}.`;return{hint:source==="env"?`Replace the token in VERCEL_TOKEN with a valid one, or unset it to use the saved login, then retry. ${create}`:source==="flag"?`Pass a valid token with --token, or set VERCEL_TOKEN, then retry. ${create}`:`Set VERCEL_TOKEN or pass --token with a valid token, then retry. A person can also run \`${getCommandNamePlain("login")}\` in an interactive terminal to sign in again. ${create}`,retryable:!1,userActionRequired:!0}}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(isInvalidTokenApiError(error))return getInvalidTokenRecovery(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||reason==="not_authorized")return{hint:"Provide valid credentials for the intended account and team, then retry.",retryable:!1,userActionRequired:!0};if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlanRecovery(message,observabilityPlusDenialReason(error),currentTeamPlan(client))?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}var import_error_utils=__toESM(require_dist(),1);import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function isHelpInvocation(argv){let args=argv.slice(2),separator=args.indexOf("--");return args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h")}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let help=isHelpInvocation(client.argv);client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){let flag=arg==="-e"?"--environment":arg;preserved.push(flag),!flag.includes("=")&&suggestionFlagTakesSeparateValue(flag)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}var LINK_FLAGS={...arg_common_default(),...getFlagsSpecification(linkCommand.options)};function getLinkSuggestionArgs(args){let out=[];for(let i=0;i<args.length;i++){let arg=args[i];if(!arg.startsWith("-"))continue;let spec=LINK_FLAGS[normalizeFlagName(arg)],handler=typeof spec=="string"?LINK_FLAGS[spec]:spec,hasSeparateValue=!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-");if(handler===void 0){hasSeparateValue&&suggestionFlagTakesSeparateValue(arg)&&i++;continue}out.push(arg),hasSeparateValue&&handler!==Boolean&&out.push(args[++i])}return out}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkCommand2=buildCommandWithGlobalFlags(argv,"link",packageName,{preserveProject:!0,excludeFlags:["--scope","--team"]});for(let choice of payload.choices){let slug=choice.name;next.push({command:`${linkCommand2} --scope ${slug}`,when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeActionRequired(client,payload),process.exit(exitCode))}function writeActionRequired(client,payload){let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),recordCliError({code:payload.reason}),client.stdout.write(`${JSON.stringify(enriched,null,2)}
8
+ `)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function buildInvalidTokenAgentError(client){let source=client.authConfig?.tokenSource;return{status:"error",reason:AGENT_REASON.LOGIN_REQUIRED,message:source==="flag"?"The token passed with --token is not valid.":source==="env"?"The token in VERCEL_TOKEN is not valid.":"The saved login is not valid or has expired.",...getInvalidTokenRecovery(client)}}function outputAgentError(client,payload,exitCode=getExitCodeForReason(payload.reason)){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client),...client.isAgent&&{feedback:{message:"Please send one brief feedback report about this error while helping the user resolve it. Don't delay the user's request for feedback.",command:"Run the 'vercel feedback --help' command to see how to report feedback. Make sure all feedback, including text copied from errors or logs, excludes personal data, account identifiers (e.g., usernames, team IDs, project names), and secrets (e.g., API keys, tokens, env values, credentials)."}}};recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,enriched),client.stdout.write(`${JSON.stringify(enriched,null,2)}
9
+ `)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
10
+ `),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --query ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --query <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isInvalidTokenError(err)){writeAgentErrorPayloadAndExit(client,buildInvalidTokenAgentError(client),exitCode,variant);return}if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{AGENT_STATUS,AGENT_REASON,getExitCodeForReason,AGENT_ACTION,PRIORITY_PROJECT_ENABLE_COMMAND,BUY_PRO_COMMAND,isProOrEnterprisePlan,buyProFix,targetRecovery,clientObservabilityPlanRecovery,isInvalidTokenApiError,isInvalidTokenError,getErrorRecovery,agentErrorMetadata,trackAgentError,isHelpInvocation,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getLinkSuggestionArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,writeActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,buildInvalidTokenAgentError,outputAgentError,writeAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
@@ -10,4 +10,4 @@ import{require_string_width}from"./chunk-BULSRTQE.js";import{__commonJS,__requir
10
10
  `)!=-1,nestedStyles=this._styles,i=nestedStyles.length;i--;){var code=ansiStyles[nestedStyles[i]];str=code.open+str.replace(code.closeRe,code.open)+code.close,newLinesPresent&&(str=str.replace(newLineRegex,function(match){return code.close+match+code.open}))}return str}colors.setTheme=function(theme){if(typeof theme=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var style in theme)(function(style2){colors[style2]=function(str){if(typeof theme[style2]=="object"){var out=str;for(var i in theme[style2])out=colors[theme[style2][i]](out);return out}return colors[theme[style2]](str)}})(style)};function init(){var ret={};return Object.keys(styles).forEach(function(name){ret[name]={get:function(){return build([name])}}}),ret}var sequencer=function(map2,str){var exploded=str.split("");return exploded=exploded.map(map2),exploded.join("")};colors.trap=require_trap();colors.zalgo=require_zalgo();colors.maps={};colors.maps.america=require_america()(colors);colors.maps.zebra=require_zebra()(colors);colors.maps.rainbow=require_rainbow()(colors);colors.maps.random=require_random()(colors);for(map in colors.maps)(function(map2){colors[map2]=function(str){return sequencer(colors.maps[map2],str)}})(map);var map;defineProps(colors,init())}});var require_safe=__commonJS({"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/safe.js"(exports,module){var colors=require_colors();module.exports=colors}});var require_cell=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/cell.js"(exports,module){var{info,debug}=require_debug(),utils=require_utils(),Cell=class _Cell{constructor(options){this.setOptions(options),this.x=null,this.y=null}setOptions(options){["boolean","number","string"].indexOf(typeof options)!==-1&&(options={content:""+options}),options=options||{},this.options=options;let content=options.content;if(["boolean","number","string"].indexOf(typeof content)!==-1)this.content=String(content);else if(!content)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof content);this.colSpan=options.colSpan||1,this.rowSpan=options.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(tableOptions,cells){this.cells=cells;let optionsChars=this.options.chars||{},tableChars=tableOptions.chars,chars=this.chars={};CHAR_NAMES.forEach(function(name){setOption(optionsChars,tableChars,name,chars)}),this.truncate=this.options.truncate||tableOptions.truncate;let style=this.options.style=this.options.style||{},tableStyle=tableOptions.style;setOption(style,tableStyle,"padding-left",this),setOption(style,tableStyle,"padding-right",this),this.head=style.head||tableStyle.head,this.border=style.border||tableStyle.border,this.fixedWidth=tableOptions.colWidths[this.x],this.lines=this.computeLines(tableOptions),this.desiredWidth=utils.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(tableOptions){let tableWordWrap=tableOptions.wordWrap||tableOptions.textWrap,{wordWrap=tableWordWrap}=this.options;if(this.fixedWidth&&wordWrap){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let i=1;for(;i<this.colSpan;)this.fixedWidth+=tableOptions.colWidths[this.x+i],i++}let{wrapOnWordBoundary:tableWrapOnWordBoundary=!0}=tableOptions,{wrapOnWordBoundary=tableWrapOnWordBoundary}=this.options;return this.wrapLines(utils.wordWrap(this.fixedWidth,this.content,wrapOnWordBoundary))}return this.wrapLines(this.content.split(`
11
11
  `))}wrapLines(computedLines){let lines=utils.colorizeLines(computedLines);return this.href?lines.map(line=>utils.hyperlink(this.href,line)):lines}init(tableOptions){let x=this.x,y=this.y;this.widths=tableOptions.colWidths.slice(x,x+this.colSpan),this.heights=tableOptions.rowHeights.slice(y,y+this.rowSpan),this.width=this.widths.reduce(sumPlusOne,-1),this.height=this.heights.reduce(sumPlusOne,-1),this.hAlign=this.options.hAlign||tableOptions.colAligns[x],this.vAlign=this.options.vAlign||tableOptions.rowAligns[y],this.drawRight=x+this.colSpan==tableOptions.colWidths.length}draw(lineNum,spanningCell){if(lineNum=="top")return this.drawTop(this.drawRight);if(lineNum=="bottom")return this.drawBottom(this.drawRight);let content=utils.truncate(this.content,10,this.truncate);lineNum||info(`${this.y}-${this.x}: ${this.rowSpan-lineNum}x${this.colSpan} Cell ${content}`);let padLen=Math.max(this.height-this.lines.length,0),padTop;switch(this.vAlign){case"center":padTop=Math.ceil(padLen/2);break;case"bottom":padTop=padLen;break;default:padTop=0}if(lineNum<padTop||lineNum>=padTop+this.lines.length)return this.drawEmpty(this.drawRight,spanningCell);let forceTruncation=this.lines.length>this.height&&lineNum+1>=this.height;return this.drawLine(lineNum-padTop,this.drawRight,forceTruncation,spanningCell)}drawTop(drawRight){let content=[];return this.cells?this.widths.forEach(function(width,index){content.push(this._topLeftChar(index)),content.push(utils.repeat(this.chars[this.y==0?"top":"mid"],width))},this):(content.push(this._topLeftChar(0)),content.push(utils.repeat(this.chars[this.y==0?"top":"mid"],this.width))),drawRight&&content.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",content.join(""))}_topLeftChar(offset){let x=this.x+offset,leftChar;if(this.y==0)leftChar=x==0?"topLeft":offset==0?"topMid":"top";else if(x==0)leftChar="leftMid";else if(leftChar=offset==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][x]instanceof _Cell.ColSpanCell&&(leftChar=offset==0?"topMid":"mid"),offset==0)){let i=1;for(;this.cells[this.y][x-i]instanceof _Cell.ColSpanCell;)i++;this.cells[this.y][x-i]instanceof _Cell.RowSpanCell&&(leftChar="leftMid")}return this.chars[leftChar]}wrapWithStyleColors(styleProperty,content){if(this[styleProperty]&&this[styleProperty].length)try{let colors=require_safe();for(let i=this[styleProperty].length-1;i>=0;i--)colors=colors[this[styleProperty][i]];return colors(content)}catch{return content}else return content}drawLine(lineNum,drawRight,forceTruncationSymbol,spanningCell){let left=this.chars[this.x==0?"left":"middle"];if(this.x&&spanningCell&&this.cells){let cellLeft=this.cells[this.y+spanningCell][this.x-1];for(;cellLeft instanceof ColSpanCell;)cellLeft=this.cells[cellLeft.y][cellLeft.x-1];cellLeft instanceof RowSpanCell||(left=this.chars.rightMid)}let leftPadding=utils.repeat(" ",this.paddingLeft),right=drawRight?this.chars.right:"",rightPadding=utils.repeat(" ",this.paddingRight),line=this.lines[lineNum],len=this.width-(this.paddingLeft+this.paddingRight);forceTruncationSymbol&&(line+=this.truncate||"\u2026");let content=utils.truncate(line,len,this.truncate);return content=utils.pad(content,len," ",this.hAlign),content=leftPadding+content+rightPadding,this.stylizeLine(left,content,right)}stylizeLine(left,content,right){return left=this.wrapWithStyleColors("border",left),right=this.wrapWithStyleColors("border",right),this.y===0&&(content=this.wrapWithStyleColors("head",content)),left+content+right}drawBottom(drawRight){let left=this.chars[this.x==0?"bottomLeft":"bottomMid"],content=utils.repeat(this.chars.bottom,this.width),right=drawRight?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",left+content+right)}drawEmpty(drawRight,spanningCell){let left=this.chars[this.x==0?"left":"middle"];if(this.x&&spanningCell&&this.cells){let cellLeft=this.cells[this.y+spanningCell][this.x-1];for(;cellLeft instanceof ColSpanCell;)cellLeft=this.cells[cellLeft.y][cellLeft.x-1];cellLeft instanceof RowSpanCell||(left=this.chars.rightMid)}let right=drawRight?this.chars.right:"",content=utils.repeat(" ",this.width);return this.stylizeLine(left,content,right)}},ColSpanCell=class{constructor(){}draw(lineNum){return typeof lineNum=="number"&&debug(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},RowSpanCell=class{constructor(originalCell){this.originalCell=originalCell}init(tableOptions){let y=this.y,originalY=this.originalCell.y;this.cellOffset=y-originalY,this.offset=findDimension(tableOptions.rowHeights,originalY,this.cellOffset)}draw(lineNum){return lineNum=="top"?this.originalCell.draw(this.offset,this.cellOffset):lineNum=="bottom"?this.originalCell.draw("bottom"):(debug(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+lineNum))}mergeTableOptions(){}};function firstDefined(...args){return args.filter(v=>v!=null).shift()}function setOption(objA,objB,nameB,targetObj){let nameA=nameB.split("-");nameA.length>1?(nameA[1]=nameA[1].charAt(0).toUpperCase()+nameA[1].substr(1),nameA=nameA.join(""),targetObj[nameA]=firstDefined(objA[nameA],objA[nameB],objB[nameA],objB[nameB])):targetObj[nameB]=firstDefined(objA[nameB],objB[nameB])}function findDimension(dimensionTable,startingIndex,span){let ret=dimensionTable[startingIndex];for(let i=1;i<span;i++)ret+=1+dimensionTable[startingIndex+i];return ret}function sumPlusOne(a,b){return a+b+1}var CHAR_NAMES=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];module.exports=Cell;module.exports.ColSpanCell=ColSpanCell;module.exports.RowSpanCell=RowSpanCell}});var require_layout_manager=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/layout-manager.js"(exports,module){var{warn,debug}=require_debug(),Cell=require_cell(),{ColSpanCell,RowSpanCell}=Cell;(function(){function next(alloc,col){return alloc[col]>0?next(alloc,col+1):col}function layoutTable(table2){let alloc={};table2.forEach(function(row,rowIndex){let col=0;row.forEach(function(cell){cell.y=rowIndex,cell.x=rowIndex?next(alloc,col):col;let rowSpan=cell.rowSpan||1,colSpan=cell.colSpan||1;if(rowSpan>1)for(let cs=0;cs<colSpan;cs++)alloc[cell.x+cs]=rowSpan;col=cell.x+colSpan}),Object.keys(alloc).forEach(idx=>{alloc[idx]--,alloc[idx]<1&&delete alloc[idx]})})}function maxWidth(table2){let mw=0;return table2.forEach(function(row){row.forEach(function(cell){mw=Math.max(mw,cell.x+(cell.colSpan||1))})}),mw}function maxHeight(table2){return table2.length}function cellsConflict(cell1,cell2){let yMin1=cell1.y,yMax1=cell1.y-1+(cell1.rowSpan||1),yMin2=cell2.y,yMax2=cell2.y-1+(cell2.rowSpan||1),yConflict=!(yMin1>yMax2||yMin2>yMax1),xMin1=cell1.x,xMax1=cell1.x-1+(cell1.colSpan||1),xMin2=cell2.x,xMax2=cell2.x-1+(cell2.colSpan||1),xConflict=!(xMin1>xMax2||xMin2>xMax1);return yConflict&&xConflict}function conflictExists(rows,x,y){let i_max=Math.min(rows.length-1,y),cell={x,y};for(let i=0;i<=i_max;i++){let row=rows[i];for(let j=0;j<row.length;j++)if(cellsConflict(cell,row[j]))return!0}return!1}function allBlank(rows,y,xMin,xMax){for(let x=xMin;x<xMax;x++)if(conflictExists(rows,x,y))return!1;return!0}function addRowSpanCells(table2){table2.forEach(function(row,rowIndex){row.forEach(function(cell){for(let i=1;i<cell.rowSpan;i++){let rowSpanCell=new RowSpanCell(cell);rowSpanCell.x=cell.x,rowSpanCell.y=cell.y+i,rowSpanCell.colSpan=cell.colSpan,insertCell(rowSpanCell,table2[rowIndex+i])}})})}function addColSpanCells(cellRows){for(let rowIndex=cellRows.length-1;rowIndex>=0;rowIndex--){let cellColumns=cellRows[rowIndex];for(let columnIndex=0;columnIndex<cellColumns.length;columnIndex++){let cell=cellColumns[columnIndex];for(let k=1;k<cell.colSpan;k++){let colSpanCell=new ColSpanCell;colSpanCell.x=cell.x+k,colSpanCell.y=cell.y,cellColumns.splice(columnIndex+1,0,colSpanCell)}}}}function insertCell(cell,row){let x=0;for(;x<row.length&&row[x].x<cell.x;)x++;row.splice(x,0,cell)}function fillInTable(table2){let h_max=maxHeight(table2),w_max=maxWidth(table2);debug(`Max rows: ${h_max}; Max cols: ${w_max}`);for(let y=0;y<h_max;y++)for(let x=0;x<w_max;x++)if(!conflictExists(table2,x,y)){let opts={x,y,colSpan:1,rowSpan:1};for(x++;x<w_max&&!conflictExists(table2,x,y);)opts.colSpan++,x++;let y2=y+1;for(;y2<h_max&&allBlank(table2,y2,opts.x,opts.x+opts.colSpan);)opts.rowSpan++,y2++;let cell=new Cell(opts);cell.x=opts.x,cell.y=opts.y,warn(`Missing cell at ${cell.y}-${cell.x}.`),insertCell(cell,table2[y])}}function generateCells(rows){return rows.map(function(row){if(!Array.isArray(row)){let key=Object.keys(row)[0];row=row[key],Array.isArray(row)?(row=row.slice(),row.unshift(key)):row=[key,row]}return row.map(function(cell){return new Cell(cell)})})}function makeTableLayout(rows){let cellRows=generateCells(rows);return layoutTable(cellRows),fillInTable(cellRows),addRowSpanCells(cellRows),addColSpanCells(cellRows),cellRows}module.exports={makeTableLayout,layoutTable,addRowSpanCells,maxWidth,fillInTable,computeWidths:makeComputeWidths("colSpan","desiredWidth","x",1),computeHeights:makeComputeWidths("rowSpan","desiredHeight","y",1)}})();function makeComputeWidths(colSpan,desiredWidth,x,forcedMin){return function(vals,table2){let result=[],spanners=[],auto={};table2.forEach(function(row){row.forEach(function(cell){(cell[colSpan]||1)>1?spanners.push(cell):result[cell[x]]=Math.max(result[cell[x]]||0,cell[desiredWidth]||0,forcedMin)})}),vals.forEach(function(val,index){typeof val=="number"&&(result[index]=val)});for(let k=spanners.length-1;k>=0;k--){let cell=spanners[k],span=cell[colSpan],col=cell[x],existingWidth=result[col],editableCols=typeof vals[col]=="number"?0:1;if(typeof existingWidth=="number")for(let i=1;i<span;i++)existingWidth+=1+result[col+i],typeof vals[col+i]!="number"&&editableCols++;else existingWidth=desiredWidth==="desiredWidth"?cell.desiredWidth-1:1,(!auto[col]||auto[col]<existingWidth)&&(auto[col]=existingWidth);if(cell[desiredWidth]>existingWidth){let i=0;for(;editableCols>0&&cell[desiredWidth]>existingWidth;){if(typeof vals[col+i]!="number"){let dif=Math.round((cell[desiredWidth]-existingWidth)/editableCols);existingWidth+=dif,result[col+i]+=dif,editableCols--}i++}}}Object.assign(vals,result,auto);for(let j=0;j<vals.length;j++)vals[j]=Math.max(forcedMin,vals[j]||0)}}}});var require_table=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/src/table.js"(exports,module){var debug=require_debug(),utils=require_utils(),tableLayout=require_layout_manager(),Table2=class extends Array{constructor(opts){super();let options=utils.mergeOptions(opts);if(Object.defineProperty(this,"options",{value:options,enumerable:options.debug}),options.debug){switch(typeof options.debug){case"boolean":debug.setDebugLevel(debug.WARN);break;case"number":debug.setDebugLevel(options.debug);break;case"string":debug.setDebugLevel(parseInt(options.debug,10));break;default:debug.setDebugLevel(debug.WARN),debug.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof options.debug}`)}Object.defineProperty(this,"messages",{get(){return debug.debugMessages()}})}}toString(){let array=this,headersPresent=this.options.head&&this.options.head.length;headersPresent?(array=[this.options.head],this.length&&array.push.apply(array,this)):this.options.style.head=[];let cells=tableLayout.makeTableLayout(array);cells.forEach(function(row){row.forEach(function(cell){cell.mergeTableOptions(this.options,cells)},this)},this),tableLayout.computeWidths(this.options.colWidths,cells),tableLayout.computeHeights(this.options.rowHeights,cells),cells.forEach(function(row){row.forEach(function(cell){cell.init(this.options)},this)},this);let result=[];for(let rowIndex=0;rowIndex<cells.length;rowIndex++){let row=cells[rowIndex],heightOfRow=this.options.rowHeights[rowIndex];(rowIndex===0||!this.options.style.compact||rowIndex==1&&headersPresent)&&doDraw(row,"top",result);for(let lineNum=0;lineNum<heightOfRow;lineNum++)doDraw(row,lineNum,result);rowIndex+1==cells.length&&doDraw(row,"bottom",result)}return result.join(`
12
12
  `)}get width(){return this.toString().split(`
13
- `)[0].length}};Table2.reset=()=>debug.reset();function doDraw(row,lineNum,result){let line=[];row.forEach(function(cell){line.push(cell.draw(lineNum))});let str=line.join("");str.length&&result.push(str)}module.exports=Table2}});var require_cli_table3=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/index.js"(exports,module){module.exports=require_table()}});var import_cli_table3=__toESM(require_cli_table3(),1),defaultStyle={"padding-left":0,"padding-right":2},noBorderChars={top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:""},alignMap={l:"left",c:"center",r:"right"};function table(rows,opts){let table2=new import_cli_table3.default({style:{...defaultStyle,"padding-right":opts?.hsep??defaultStyle["padding-right"]},chars:noBorderChars});return table2.push(...rows.map(row=>row.map((cell,i)=>({content:cell,hAlign:alignMap[opts?.align?.[i]??"l"]})))),table2.toString()}export{require_cli_table3,noBorderChars,table};
13
+ `)[0].length}};Table2.reset=()=>debug.reset();function doDraw(row,lineNum,result){let line=[];row.forEach(function(cell){line.push(cell.draw(lineNum))});let str=line.join("");str.length&&result.push(str)}module.exports=Table2}});var require_cli_table3=__commonJS({"../../node_modules/.pnpm/cli-table3@0.6.3/node_modules/cli-table3/index.js"(exports,module){module.exports=require_table()}});var import_cli_table3=__toESM(require_cli_table3(),1),defaultStyle={"padding-left":0,"padding-right":2},noBorderChars={top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:""},alignMap={l:"left",c:"center",r:"right"};function table(rows,opts){let table2=new import_cli_table3.default({style:{...defaultStyle,"padding-right":opts?.hsep??defaultStyle["padding-right"]},chars:noBorderChars});return table2.push(...rows.map(row=>row.map((cell,i)=>({content:cell,hAlign:alignMap[opts?.align?.[i]??"l"]})))),table2.toString()}export{table};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{readJSONFile}from"./chunk-5KKRDN5F.js";import{getScope}from"./chunk-5ZEROVK5.js";import{humanizePath,readConfigFile}from"./chunk-CBA2KGXG.js";import{getArgs}from"./chunk-CGTD4QFC.js";import{CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist}from"./chunk-T2FCF46I.js";import{pkg_default}from"./chunk-DBT6PGEH.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-W634OFUG.js";import{require_types}from"./chunk-ZS2WS4AM.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{fetch}from"./chunk-MY4MONOH.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_epipebomb=__commonJS({"../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports,module){module.exports=epipeBomb;function epipeBomb(stream,callback){stream==null&&(stream=process.stdout),callback==null&&(callback=process.exit);function epipeFilter(err){if(err.code==="EPIPE")return callback();stream.listeners("error").length<=1&&(stream.removeAllListeners(),stream.emit("error",err),stream.on("error",epipeFilter))}stream.on("error",epipeFilter)}}});function isOutputDebugEnabled(debugFlag){return debugFlag===!0||process.env.VERCEL_CLI_DEBUG==="1"}var import_epipebomb=__toESM(require_epipebomb(),1),SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],installed=!1;function installProcessGuards(){if(installed)return;installed=!0;let originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)},(0,import_epipebomb.default)()}var import_error_utils=__toESM(require_dist(),1),CRASH_REPORT_TIMEOUT_MS=2e3;async function reportError(client,error){if(ignoreError(error)||!telemetryEnabled(client))return;let user,team,scopeError;if(client)try{({user,team}=await getScope(client))}catch(err){(0,import_error_utils.isError)(err)&&(scopeError=err)}let crashReport={cli_version:pkg_default.version,invocation_id:client?.telemetryEventStore?.currentInvocationId,error:(0,import_error_utils.isError)(error)?{kind:error.name,message:error.message,stack:stackOf(error)}:{kind:"NonError",message:String(error)},user:user?{id:user.id,email:user.email,username:user.username,name:user.name}:void 0,team_id:team?.id,scope_error:scopeError?{name:scopeError.name,message:scopeError.message,stack:scopeError.stack}:void 0,args:redactedArgs(),node:{execPath:process.execPath,version:process.version,platform:process.platform}};try{(await fetch(process.env.VERCEL_TELEMETRY_BRIDGE_URL||"https://telemetry.vercel.com/api/vercel-cli/v1/events",{method:"POST",headers:{"Content-Type":"application/json","x-vercel-cli-crash-report":"1"},body:JSON.stringify({version:1,crashReport}),signal:AbortSignal.timeout(CRASH_REPORT_TIMEOUT_MS)})).body?.cancel().catch(()=>{})}catch{}}function telemetryEnabled(client){if(process.env.VERCEL_TELEMETRY_DISABLED)return!1;if(client?.telemetryEventStore)return client.telemetryEventStore.enabled;try{return readConfigFile().telemetry?.enabled!==!1}catch(err){return(0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"}}function stackOf(error){let stacks=[],current=error;for(;(0,import_error_utils.isError)(current)&&stacks.length<5;)stacks.push(current.stack??`${current.name}: ${current.message}`),current=current.cause;return stacks.join(`
8
+ Caused by: `)}function redactedArgs(){try{let args=getArgs(process.argv.slice(2),{});for(let flag of["--env","--build-env","--token"])args[flag]&&(args[flag]="REDACTED");return args._.length>=4&&args._[0].startsWith("secret")&&args._[1]==="add"&&(args._[3]="REDACTED"),args}catch(err){return`Unable to parse args${(0,import_error_utils.isError)(err)?`: ${err}`:""}`}}function ignoreError(error){return(0,import_error_utils.isError)(error)&&error.message.includes("uv_cwd")}var fatalErrorHandlerSymbol=Symbol.for("vercel.cli.fatal-error-handler");async function exitWithUnexpectedError(error){let handler=globalThis[fatalErrorHandlerSymbol];if(typeof handler=="function")try{await handler(error)}catch{}process.exit(1)}async function handleUnexpectedError(client,err){output_manager_default.error(`An unexpected error occurred!
9
+ ${err.stack}`),await reportError(client,err)}function registerUnexpectedErrorHandlers(getClient){process.on("unhandledRejection",async err=>{recordCliError(cliErrorFromUnknown(err)),err?err instanceof Error?await handleUnexpectedError(getClient(),err):(output_manager_default.error(`An unexpected rejection occurred
10
+ ${err}`),await reportError(getClient(),err)):output_manager_default.error("An unexpected empty rejection occurred"),await exitWithUnexpectedError(err)}),process.on("uncaughtException",async error=>{await handleUnexpectedError(getClient(),error),await exitWithUnexpectedError(error)})}var import_types=__toESM(require_types(),1);import path from"path";var import_error_utils2=__toESM(require_dist(),1);var config;async function earlyGetConfig(configFile){if(config)return config;let localPath;try{localPath=process.cwd()}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")return new WorkingDirectoryDoesNotExist;throw err}if(configFile){let localFilePath=path.resolve(localPath,configFile);output_manager_default.debug(`Found config in provided --local-config path ${localFilePath}`);let localConfig=await readJSONFile(localFilePath);return localConfig instanceof CantParseJSONFile?localConfig:localConfig===null?new CantFindConfig([humanizePath(localFilePath)]):(config=localConfig,config[import_types.fileNameSymbol]=configFile,config)}let vercelFilePath=path.resolve(localPath,"vercel.json"),nowFilePath=path.resolve(localPath,"now.json"),[vercelConfig,nowConfig]=await Promise.all([readJSONFile(vercelFilePath),readJSONFile(nowFilePath)]);return vercelConfig instanceof CantParseJSONFile?vercelConfig:nowConfig instanceof CantParseJSONFile?nowConfig:vercelConfig!==null?(output_manager_default.debug(`Found config in file "${vercelFilePath}"`),config=vercelConfig,config[import_types.fileNameSymbol]="vercel.json",config):nowConfig!==null?new DeprecatedNowJson(nowFilePath):new CantFindConfig([vercelFilePath].map(humanizePath))}var fallbackReason;function recordDirectBuildFallback(reason){fallbackReason=reason}function getDirectBuildFallbackAttributes(){return fallbackReason===void 0?void 0:{directBuild:"false",fallbackReason}}export{isOutputDebugEnabled,installProcessGuards,reportError,exitWithUnexpectedError,handleUnexpectedError,registerUnexpectedErrorHandlers,earlyGetConfig,recordDirectBuildFallback,getDirectBuildFallbackAttributes};
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{getExitCodeForErrorCode}from"./chunk-LD42X7ZH.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-KAUKCHQF.js";import{isJSONObject}from"./chunk-QZEZCUUZ.js";import{output_manager_default}from"./chunk-ZRJKGAUT.js";import{readFileSync}from"fs";import{resolve}from"path";var MONITORS_API={basePath:"/alerts/v3/monitors",itemKey:"monitor",listKey:"monitors",typesKey:"monitorTypes",idKey:"monitorId"},ALERT_RULES_API={basePath:"/alerts/v3/alert-rules",itemKey:"rule",listKey:"rules",typesKey:"ruleTypes",idKey:"ruleId"};function rulesCollectionPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`${api.basePath}?${query.toString()}`}function rulesItemPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`${api.basePath}/notifications?${query.toString()}`}function rulesNotificationLinksPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(api,teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`${api.basePath}/schema?${query.toString()}`}async function fetchRule(client,api,scope,ruleId){return(await client.fetch(rulesItemPath(api,scope.teamId,ruleId)))[api.itemKey]}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
7
+ import{getExitCodeForErrorCode}from"./chunk-AX3V7N44.js";import{AGENT_REASON,buildCommandWithGlobalFlags,getExitCodeForReason,outputAgentError}from"./chunk-32NXYHYC.js";import{isJSONObject}from"./chunk-CBA2KGXG.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{readFileSync}from"fs";import{resolve}from"path";var MONITORS_API={basePath:"/alerts/v3/monitors",itemKey:"monitor",listKey:"monitors",typesKey:"monitorTypes",idKey:"monitorId"},ALERT_RULES_API={basePath:"/alerts/v3/alert-rules",itemKey:"rule",listKey:"rules",typesKey:"ruleTypes",idKey:"ruleId"};function rulesCollectionPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),options.projectId&&query.set("projectId",options.projectId),options.type&&query.set("type",options.type),`${api.basePath}?${query.toString()}`}function rulesItemPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}?${query.toString()}`}function ruleNotificationsPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications?${query.toString()}`}function rulesNotificationsPath(api,teamId,options={}){let query=new URLSearchParams({teamId});return options.limit!==void 0&&query.set("limit",String(options.limit)),options.cursor&&query.set("cursor",options.cursor),`${api.basePath}/notifications?${query.toString()}`}function rulesNotificationLinksPath(api,teamId,ruleId){let query=new URLSearchParams({teamId});return`${api.basePath}/${encodeURIComponent(ruleId)}/notifications/links?${query.toString()}`}function rulesSchemaPath(api,teamId,type){let query=new URLSearchParams({teamId});return type&&query.set("type",type),`${api.basePath}/schema?${query.toString()}`}async function fetchRule(client,api,scope,ruleId){return(await client.fetch(rulesItemPath(api,scope.teamId,ruleId)))[api.itemKey]}function getIssues(error){return Array.isArray(error.issues)?error.issues.filter(issue=>isJSONObject(issue)&&typeof issue.path=="string"&&typeof issue.message=="string"):[]}function outputRulesError(client,jsonOutput,code,message,options={}){let issues=options.issues??[],issueSummary=issues.slice(0,5).map(issue=>`${issue.path||"body"}: ${issue.message}`).join("; "),exitCode=options.reason!==void 0?getExitCodeForReason(options.reason):getExitCodeForErrorCode(code);return outputAgentError(client,{status:"error",reason:options.reason??AGENT_REASON.INVALID_ARGUMENTS,message,hint:options.hint??(issueSummary||void 0)},exitCode),jsonOutput?client.stdout.write(`${JSON.stringify({error:{code,message,...issues.length?{issues}:{}}},null,2)}
8
8
  `):output_manager_default.fatal([message,...issues.map(issue=>` ${issue.path}: ${issue.message}`)].join(`
9
9
  `)),exitCode}function handleRulesApiError(client,err,jsonOutput){let message=err.status===401?"You do not have access to monitors in this team. Ensure your role can manage Alert Rules, or pass --token and --scope.":err.status===403?err.serverMessage||"You do not have permission to manage monitors in this team.":err.status>=500?`The monitors endpoint failed (${err.status}). Re-run with --debug and share the x-vercel-id from the failed request.`:err.serverMessage||`API error (${err.status}).`;return outputRulesError(client,jsonOutput,err.code||"API_ERROR",message,{reason:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,issues:getIssues(err),hint:err.status===401||err.status===403?"Confirm the team with `vercel whoami`; use --scope <team-slug> if the monitor belongs to another team.":void 0})}var LEGACY_BODY_FIELDS=["alertTypes","customAlert","queryJsonString"];function readRuleBody(client,bodyPath,jsonOutput){let raw;try{raw=readFileSync(resolve(client.cwd,bodyPath),"utf8")}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS",`Could not read --body file: ${bodyPath}`)}let parsed;try{parsed=JSON.parse(raw)}catch{return outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","Invalid JSON in --body file.")}return isJSONObject(parsed)?LEGACY_BODY_FIELDS.some(field=>Object.hasOwn(parsed,field))?outputRulesError(client,jsonOutput,"LEGACY_ALERT_RULE_BODY","This body uses the previous alert-rules shape. Rewrite it using the current schema.",{hint:"Run `vercel monitors schema --type built-in` for examples."}):parsed:outputRulesError(client,jsonOutput,"INVALID_ARGUMENTS","The --body file must contain a JSON object.")}function getBodyType(body){return body.type==="built-in"||body.type==="custom"?body.type:void 0}function emitRulesArgParseError(client,err,recoverWithProjectFlag){let message=err instanceof Error?err.message:String(err),projectFlagMissingArg=message.includes("--project")&&message.includes("requires argument");outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":message,next:[{command:buildCommandWithGlobalFlags(client.argv,projectFlagMissingArg?recoverWithProjectFlag:"monitors --help"),when:projectFlagMissingArg?"Retry with a project name or id":"See valid `monitors` subcommands"}]},2)}export{MONITORS_API,ALERT_RULES_API,rulesCollectionPath,rulesItemPath,ruleNotificationsPath,rulesNotificationsPath,rulesNotificationLinksPath,rulesSchemaPath,fetchRule,outputRulesError,handleRulesApiError,readRuleBody,getBodyType,emitRulesArgParseError};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-QZEZCUUZ.js";import{packageName}from"./chunk-JESNVRVR.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`)}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};
7
+ import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_lib}from"./chunk-CBA2KGXG.js";import{packageName}from"./chunk-VRH7LWOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join as join2,sep}from"path";import{execFile}from"child_process";import{tmpdir}from"node:os";import{resolve}from"node:path";var trustedUpgradeEnvironment=Object.freeze({...process.env}),trustedUpgradeDirectory=resolve(tmpdir());import{join}from"path";var packageManagers={npm:{metadataArgs:specifier=>["view",specifier,"version","--json","--global"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--min-release-age=0"],globalDetection:{args:["root","-g"],packageDir:(root,pkg)=>join(root,pkg)}},pnpm:{metadataArgs:specifier=>["view",specifier,"version","--json"],installArgs:specifier=>["i","-g",specifier],releaseAgeBypassArgs:["--config.minimumReleaseAge=0"],globalDetection:{args:pkg=>["list","-g",pkg,"--depth=0","--json"],packageDir:(output,pkg)=>{try{let projects=JSON.parse(output),path=(Array.isArray(projects)?projects[0]:projects)?.dependencies?.[pkg]?.path;return typeof path=="string"?path:void 0}catch{return}}}},yarn:{metadataArgs:specifier=>["info",specifier.endsWith("@latest")?specifier.slice(0,-7):specifier,"version","--json"],installArgs:specifier=>["global","add",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["--silent","global","dir"],packageDir:(root,pkg)=>join(root,"node_modules",pkg)}},bun:{metadataArgs:specifier=>["info",specifier,"version","--json","--global"],installArgs:specifier=>["add","-g",specifier],releaseAgeBypassArgs:[],globalDetection:{args:["pm","bin","-g"],binaryNames:["vercel","vc"]}}};function getUpgradePackageManager(name){return packageManagers[name]}var UnsupportedUpgradeInstallError=class extends Error{},HOMEBREW_UPGRADE_COMMAND="brew upgrade vercel",HomebrewInstallError=class extends UnsupportedUpgradeInstallError{constructor(){super(`This Vercel CLI was installed with Homebrew. Update it with \`${HOMEBREW_UPGRADE_COMMAND}\`.`)}};async function isHomebrewInstall(){return isNativeBinaryInstall()?(await(0,import_fs_extra.realpath)(process.execPath).catch(()=>process.execPath)).includes(`${sep}Caskroom${sep}vercel${sep}`):!1}var globalCliTypes=["npm","pnpm","yarn","bun"];function throwIfAborted(signal){if(signal?.aborted)throw signal.reason instanceof Error?signal.reason:new Error("Package manager detection was aborted")}async function getPackageManagerGlobalRoot(cliType,pkg,env=trustedUpgradeEnvironment,signal){try{let detectionArgs=getUpgradePackageManager(cliType).globalDetection.args;return(await new Promise((resolve2,reject)=>{execFile(cliType,typeof detectionArgs=="function"?detectionArgs(pkg):detectionArgs,{encoding:"utf8",windowsHide:!0,cwd:trustedUpgradeDirectory,timeout:15e3,env:{...env},signal},(error,stdout2)=>{error?reject(error):resolve2(stdout2)})})).trim()||null}catch{return throwIfAborted(signal),null}}async function detectGlobalPackageManager(installPath,pkg,cliTypes=globalCliTypes,env=trustedUpgradeEnvironment,signal){for(let cliType of cliTypes){throwIfAborted(signal);let root=await getPackageManagerGlobalRoot(cliType,pkg,env,signal);if(!root)continue;let detection=getUpgradePackageManager(cliType).globalDetection;if(detection.packageDir)try{let packageDir=detection.packageDir(root,pkg);if(!packageDir)continue;let resolvedPackageDir=await(0,import_fs_extra.realpath)(packageDir);if(installPath===resolvedPackageDir||installPath.startsWith(resolvedPackageDir+sep))return cliType}catch{}for(let binary of detection.binaryNames||[])try{let target=await(0,import_fs_extra.realpath)(join2(root,binary));if(target===installPath||target.startsWith(installPath+sep)||installPath.startsWith(target+sep))return cliType;let entrypoint=await(0,import_fs_extra.realpath)(process.argv[1]);if(!isNativeBinaryInstall()&&target===entrypoint)return cliType}catch{}}return null}async function resolveInstall(env=trustedUpgradeEnvironment,signal){if(throwIfAborted(signal),await isHomebrewInstall())throw new HomebrewInstallError;let nativeExecutable=isNativeBinaryInstall()&&env.VERCEL_CLI_PACKAGE_EXECUTABLE,resolvedNativeExecutable=nativeExecutable&&await(0,import_fs_extra.realpath)(nativeExecutable).catch(()=>null),entrypoint=resolvedNativeExecutable&&resolvedNativeExecutable===await(0,import_fs_extra.realpath)(process.execPath).catch(()=>null)?env.VERCEL_CLI_PACKAGE_ENTRYPOINT:process.argv[1],installPath=entrypoint&&await(0,import_fs_extra.realpath)(entrypoint).catch(()=>null);if(!installPath)throw new UnsupportedUpgradeInstallError("Could not resolve this Vercel CLI installation. Update it with the package manager that installed it.");let packageManager=await detectGlobalPackageManager(installPath,packageName,globalCliTypes,env,signal);if(!packageManager)throw new UnsupportedUpgradeInstallError("Could not detect a supported global npm, pnpm, Yarn, or Bun installation of Vercel CLI. Update it with the package manager that installed it.");return{packageManager,global:!0,assumed:!1}}async function isGlobal(){if(await isHomebrewInstall())return!0;try{return await resolveInstall(),!0}catch{return!1}}async function getUpdateCommandInfo(env=trustedUpgradeEnvironment,signal){let{packageManager}=await resolveInstall(env,signal),args=getUpgradePackageManager(packageManager).installArgs(`${packageName}@latest`),allowBuild=pnpmAllowBuildFlag(packageManager,"esbuild");return{command:`${packageManager} ${args.join(" ")}${allowBuild}`,global:!0,packageManager,assumed:!1}}function pnpmAllowBuildFlag(cliType,pkg){return cliType==="pnpm"?` --allow-build=${pkg}`:""}async function getUpdateCommand(){return await isHomebrewInstall()?HOMEBREW_UPGRADE_COMMAND:(await getUpdateCommandInfo()).command}export{trustedUpgradeEnvironment,trustedUpgradeDirectory,getUpgradePackageManager,HOMEBREW_UPGRADE_COMMAND,isHomebrewInstall,isGlobal,getUpdateCommandInfo,getUpdateCommand};