vercel 64.5.0 → 65.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/dist/chunks/add-2HOGPYWC.js +8 -0
  2. package/dist/chunks/add-2RYLJ442.js +8 -0
  3. package/dist/chunks/add-PAQE7CT2.js +8 -0
  4. package/dist/chunks/build-77Q2YPHO.js +7 -0
  5. package/dist/chunks/{chunk-OJKZ7EV3.js → chunk-27QCVNMI.js} +1 -1
  6. package/dist/chunks/chunk-2BAAJZBZ.js +12 -0
  7. package/dist/chunks/{chunk-CITTRAYH.js → chunk-2UBZCG4F.js} +1 -1
  8. package/dist/chunks/chunk-36N6VMW4.js +7 -0
  9. package/dist/chunks/chunk-3GXZPT7T.js +7 -0
  10. package/dist/chunks/{chunk-ZZ3LJ22B.js → chunk-3L4MAGRI.js} +3 -3
  11. package/dist/chunks/chunk-3XDTQFBL.js +57 -0
  12. package/dist/chunks/{chunk-3DP66SQ4.js → chunk-43T3YKNH.js} +1 -1
  13. package/dist/chunks/{chunk-VKXEOL4K.js → chunk-4NTBYNFR.js} +3 -2
  14. package/dist/chunks/chunk-4T22AQTB.js +7 -0
  15. package/dist/chunks/{chunk-TPVAPVQC.js → chunk-52JGR5SZ.js} +1 -1
  16. package/dist/chunks/{chunk-7QQIWMAT.js → chunk-66262IYI.js} +5 -5
  17. package/dist/chunks/{chunk-JH257EDL.js → chunk-66ODHUGV.js} +1 -1
  18. package/dist/chunks/chunk-732WJANV.js +15 -0
  19. package/dist/chunks/chunk-7C5JHTHO.js +7 -0
  20. package/dist/chunks/chunk-7G72V52B.js +7 -0
  21. package/dist/chunks/chunk-7OMWRRY4.js +9 -0
  22. package/dist/chunks/chunk-AGDMSAYW.js +9 -0
  23. package/dist/chunks/chunk-AW7DEWIM.js +7 -0
  24. package/dist/chunks/{chunk-XSDAUM4F.js → chunk-AZ5OUZPP.js} +1 -1
  25. package/dist/chunks/{chunk-7GFRZWLE.js → chunk-B6U5434D.js} +1 -1
  26. package/dist/chunks/{chunk-3NNH2U5M.js → chunk-BFJC3UDU.js} +1 -1
  27. package/dist/chunks/{chunk-KKCBFBJK.js → chunk-BHWEIKSP.js} +1 -1
  28. package/dist/chunks/chunk-BJ5APZ6X.js +7 -0
  29. package/dist/chunks/chunk-BZQ7YWSB.js +10 -0
  30. package/dist/chunks/chunk-CLKHGKJA.js +7 -0
  31. package/dist/chunks/{chunk-CYV3X62I.js → chunk-CTKJQTC5.js} +1 -1
  32. package/dist/chunks/{chunk-IVIZLWZQ.js → chunk-CZ2KEML2.js} +1 -1
  33. package/dist/chunks/{chunk-WYI4VNXT.js → chunk-DBNQ45J5.js} +1 -1
  34. package/dist/chunks/chunk-DGDNI76L.js +10 -0
  35. package/dist/chunks/{chunk-HVUJNVPS.js → chunk-EJINOHL3.js} +1 -1
  36. package/dist/chunks/chunk-EKMQNUO4.js +9 -0
  37. package/dist/chunks/chunk-ENWROHWX.js +7 -0
  38. package/dist/chunks/{chunk-OYMFOCD5.js → chunk-F4ZFLPMT.js} +1 -1
  39. package/dist/chunks/chunk-F53OKXYI.js +7 -0
  40. package/dist/chunks/{chunk-6UCSM3CZ.js → chunk-FN7TTXXY.js} +1 -1
  41. package/dist/chunks/{chunk-EVQJ7SCV.js → chunk-FPC5LINQ.js} +1 -1
  42. package/dist/chunks/chunk-FRSHC2HN.js +7 -0
  43. package/dist/chunks/chunk-GRVLQZFQ.js +7 -0
  44. package/dist/chunks/chunk-HBPSZHXX.js +7 -0
  45. package/dist/chunks/{chunk-PAOR4MQZ.js → chunk-HNF2BEOE.js} +1 -1
  46. package/dist/chunks/{chunk-VRAMXFRB.js → chunk-IKSZMJKB.js} +4 -3
  47. package/dist/chunks/chunk-IMMMID5G.js +7 -0
  48. package/dist/chunks/{chunk-LYU4MVL5.js → chunk-INDGZ3JK.js} +5 -5
  49. package/dist/chunks/chunk-IYM5GO57.js +9 -0
  50. package/dist/chunks/{chunk-XEBMH33W.js → chunk-JDVUKDX3.js} +1 -1
  51. package/dist/chunks/{chunk-2UPVIVAA.js → chunk-JETQEZ24.js} +1 -1
  52. package/dist/chunks/{chunk-CMEEAXVV.js → chunk-JT273F22.js} +1 -1
  53. package/dist/chunks/{chunk-TE2EE7DR.js → chunk-JWX2YZVC.js} +1 -1
  54. package/dist/chunks/{chunk-ACVDKHVS.js → chunk-KCVCGYAR.js} +2 -2
  55. package/dist/chunks/chunk-KDABXEHF.js +7 -0
  56. package/dist/chunks/chunk-KNTBWMVA.js +7 -0
  57. package/dist/chunks/chunk-KUGFILF5.js +7 -0
  58. package/dist/chunks/{chunk-PTI3TP7P.js → chunk-KXHUMVXD.js} +1 -1
  59. package/dist/chunks/{chunk-GNV6PG6W.js → chunk-L5ANBZTX.js} +1 -1
  60. package/dist/chunks/chunk-LJIQZ3LU.js +7 -0
  61. package/dist/chunks/chunk-MIKNK3B6.js +7 -0
  62. package/dist/chunks/{chunk-VS7O22ED.js → chunk-MTETAZA4.js} +1 -1
  63. package/dist/chunks/{chunk-ZQKDO5PL.js → chunk-NYKEU7DQ.js} +2 -2
  64. package/dist/chunks/chunk-O3AL3QFA.js +7 -0
  65. package/dist/chunks/chunk-ODB7LEAO.js +7 -0
  66. package/dist/chunks/{chunk-HARXQZV3.js → chunk-OVV5MV5M.js} +1 -1
  67. package/dist/chunks/{chunk-T3GQAMBJ.js → chunk-PADL3C6Z.js} +1 -1
  68. package/dist/chunks/{chunk-H3KYG32S.js → chunk-PNUH3XXW.js} +1 -1
  69. package/dist/chunks/{chunk-LUJL3KFT.js → chunk-PS3KKHSI.js} +1 -1
  70. package/dist/chunks/chunk-PUKYAALC.js +7 -0
  71. package/dist/chunks/chunk-PXU645V7.js +8 -0
  72. package/dist/chunks/chunk-R3MRIQMO.js +7 -0
  73. package/dist/chunks/chunk-RAN5LUZY.js +7 -0
  74. package/dist/chunks/chunk-RH2SQQWH.js +10 -0
  75. package/dist/chunks/{chunk-SI7FQJIE.js → chunk-RTWGDRYT.js} +3 -3
  76. package/dist/chunks/{chunk-XXCWQPAH.js → chunk-RUOOZ574.js} +1 -1
  77. package/dist/chunks/{chunk-GWB27IAS.js → chunk-SLI2O5X7.js} +4 -4
  78. package/dist/chunks/chunk-SSKMT5SL.js +7 -0
  79. package/dist/chunks/chunk-T5LBVZWY.js +7 -0
  80. package/dist/chunks/chunk-UDMEPP3K.js +39 -0
  81. package/dist/chunks/{chunk-M774HRX5.js → chunk-UGZ3HFHI.js} +2 -2
  82. package/dist/chunks/chunk-UMUPJDWU.js +7 -0
  83. package/dist/chunks/chunk-VAZQS475.js +7 -0
  84. package/dist/chunks/chunk-VCV3H73W.js +7 -0
  85. package/dist/chunks/{chunk-JZ7FDBS4.js → chunk-VF2WX27D.js} +1 -1
  86. package/dist/chunks/chunk-VO2XAQFF.js +22 -0
  87. package/dist/chunks/{chunk-TLEBLYBS.js → chunk-VO36D4U4.js} +1 -1
  88. package/dist/chunks/chunk-VWK26HHN.js +7 -0
  89. package/dist/chunks/{chunk-TCQZFIBR.js → chunk-VY63XWWU.js} +1 -1
  90. package/dist/chunks/{chunk-BJXMXDBM.js → chunk-W7J5HTTY.js} +1 -1
  91. package/dist/chunks/{chunk-IJCCFLCQ.js → chunk-WDWYKX2I.js} +1 -1
  92. package/dist/chunks/{chunk-GVUB6QGX.js → chunk-WFEEUZ6B.js} +1 -1
  93. package/dist/chunks/{chunk-5S2NK6K6.js → chunk-WFSQ3OSN.js} +1 -1
  94. package/dist/chunks/{chunk-YROIQRYI.js → chunk-WKC7S5IW.js} +1 -1
  95. package/dist/chunks/{chunk-MZ3QGJH3.js → chunk-WTBGMDQ7.js} +1 -1
  96. package/dist/chunks/chunk-WYJGP5QW.js +7 -0
  97. package/dist/chunks/{chunk-MPZFMEVK.js → chunk-X3VSVBXT.js} +1 -1
  98. package/dist/chunks/{chunk-DRXOTZSJ.js → chunk-X5J7LOJK.js} +1 -1
  99. package/dist/chunks/{chunk-ROPQIBWJ.js → chunk-X7CLBXWL.js} +1 -1
  100. package/dist/chunks/chunk-XBTLXKOI.js +7 -0
  101. package/dist/chunks/{chunk-YQKURZ5W.js → chunk-XD2FF2PZ.js} +1 -1
  102. package/dist/chunks/chunk-XDKCDGJF.js +25 -0
  103. package/dist/chunks/chunk-YNOLLMOG.js +9 -0
  104. package/dist/chunks/{chunk-WN7EJWN4.js → chunk-YPX7BXJ6.js} +2 -2
  105. package/dist/chunks/{chunk-DNDBPLLI.js → chunk-YXZGKFF3.js} +1 -1
  106. package/dist/chunks/{chunk-6QRT6USI.js → chunk-Z6JDXW4A.js} +1 -1
  107. package/dist/chunks/{chunk-3GUO6F6P.js → chunk-ZIWS57E4.js} +1 -1
  108. package/dist/chunks/{chunk-5NXYYFRL.js → chunk-ZVRKM3UD.js} +1 -1
  109. package/dist/chunks/clear-HPHGW2CD.js +8 -0
  110. package/dist/chunks/compile-vercel-config-YG2E5LXN.js +7 -0
  111. package/dist/chunks/config-PZ7HFZQZ.js +8 -0
  112. package/dist/chunks/config-XH532PP3.js +7 -0
  113. package/dist/chunks/config-validator.mjs +1 -1
  114. package/dist/chunks/{connect-git-provider-2JIBL3ST.js → connect-git-provider-WEFO2ESM.js} +1 -1
  115. package/dist/chunks/delete-UPHMMYEJ.js +10 -0
  116. package/dist/chunks/delete-Z7PXYHTL.js +9 -0
  117. package/dist/chunks/{detect-projects-THLTMO7V.js → detect-projects-CHMBPFSE.js} +1 -1
  118. package/dist/chunks/detect-services-ZYHOOBMO.js +7 -0
  119. package/dist/chunks/disable-34LCZPFL.js +7 -0
  120. package/dist/chunks/discard-HDUCYAHG.js +14 -0
  121. package/dist/chunks/edit-4F7DADVN.js +9 -0
  122. package/dist/chunks/edit-5WKAHKCW.js +8 -0
  123. package/dist/chunks/enable-YV6I32W6.js +7 -0
  124. package/dist/chunks/{exec-NMRO6DIZ.js → exec-5ZWP5NC6.js} +1 -1
  125. package/dist/chunks/{export-KTLACTAJ.js → export-3OE2RWU7.js} +1 -1
  126. package/dist/chunks/future-N2ZTDYVW.js +7 -0
  127. package/dist/chunks/generate-cert-for-deploy-ORS7XL64.js +7 -0
  128. package/dist/chunks/image-WTWQT7A4.js +7 -0
  129. package/dist/chunks/import-builders-XBGAW4MC.js +7 -0
  130. package/dist/chunks/{inspect-7IZ7M2TX.js → inspect-GD6JJPWG.js} +1 -1
  131. package/dist/chunks/{inspect-JDSFHP6X.js → inspect-HYJULYCV.js} +1 -1
  132. package/dist/chunks/inspect-ISRYYL7L.js +13 -0
  133. package/dist/chunks/{inspect-PQNECP2Z.js → inspect-JWDH7C6F.js} +1 -1
  134. package/dist/chunks/inspect-MEYRAEVT.js +9 -0
  135. package/dist/chunks/{list-3N2CBVOG.js → list-4SZS2TB7.js} +1 -1
  136. package/dist/chunks/{list-2G2BWD4T.js → list-AGS47O5P.js} +2 -2
  137. package/dist/chunks/list-O7FAMXMT.js +12 -0
  138. package/dist/chunks/login-KNE2BGUB.js +9 -0
  139. package/dist/chunks/login-NCAGHBZD.js +7 -0
  140. package/dist/chunks/logs-7H5XDI44.js +7 -0
  141. package/dist/chunks/ls-KNRG7G5K.js +12 -0
  142. package/dist/chunks/ls-LGL5ZKEJ.js +12 -0
  143. package/dist/chunks/ls-RI6BNJO7.js +8 -0
  144. package/dist/chunks/ls-UJHETSDA.js +11 -0
  145. package/dist/chunks/ls-WQX2DS4X.js +12 -0
  146. package/dist/chunks/ls-Y2JQYSVO.js +12 -0
  147. package/dist/chunks/{ls-5YLXAARZ.js → ls-ZPUNJ7ND.js} +1 -1
  148. package/dist/chunks/mutate-QHSLJCQU.js +9 -0
  149. package/dist/chunks/notifications-557GW5KI.js +7 -0
  150. package/dist/chunks/open-IYLA5OZF.js +7 -0
  151. package/dist/chunks/openapi-IVXUCJPM.js +7 -0
  152. package/dist/chunks/permissions-2XHSDRNE.js +7 -0
  153. package/dist/chunks/prompt-missing-credentials-BLT57RIR.js +7 -0
  154. package/dist/chunks/publish-MQ56IB4K.js +15 -0
  155. package/dist/chunks/pull-K3JVXGZM.js +7 -0
  156. package/dist/chunks/purchase-domain-if-available-VDMLT3J2.js +7 -0
  157. package/dist/chunks/push-YXUJGMP4.js +7 -0
  158. package/dist/chunks/query-JA5OWDSP.js +12 -0
  159. package/dist/chunks/reauthenticate-YZXHWSEC.js +7 -0
  160. package/dist/chunks/reorder-UNU63VF3.js +10 -0
  161. package/dist/chunks/reply-CTLC5KAK.js +9 -0
  162. package/dist/chunks/resolve-HTKF4MMV.js +12 -0
  163. package/dist/chunks/resolve-agent-team-DLIROIXX.js +7 -0
  164. package/dist/chunks/restore-CSZYM5WU.js +16 -0
  165. package/dist/chunks/rm-BGLDOP4N.js +8 -0
  166. package/dist/chunks/rm-O2XVUZOW.js +8 -0
  167. package/dist/chunks/rm-OSMI52XV.js +8 -0
  168. package/dist/chunks/rm-SZIT75ZY.js +8 -0
  169. package/dist/chunks/rm-WJERY4WM.js +8 -0
  170. package/dist/chunks/{routes-LK2HUGAK.js → routes-ZNPZJERJ.js} +1 -1
  171. package/dist/chunks/rule-inspect-NGI6XURL.js +8 -0
  172. package/dist/chunks/schema-JLQ7SNYR.js +14 -0
  173. package/dist/chunks/{schema-QHZO72DB.js → schema-OV4SUO52.js} +7 -7
  174. package/dist/chunks/select-org-URO7GRAY.js +7 -0
  175. package/dist/chunks/set-RU227EQQ.js +7 -0
  176. package/dist/chunks/setup-and-link-WX6IEZZO.js +7 -0
  177. package/dist/chunks/skills-6EFE7KH7.js +590 -0
  178. package/dist/chunks/tags-KJINDQSV.js +7 -0
  179. package/dist/chunks/{types-77UW6BI4.js → types-2DDQTYAO.js} +1 -1
  180. package/dist/chunks/update-XUMH6CAJ.js +8 -0
  181. package/dist/commands/build/index.js +4 -4
  182. package/dist/commands/deploy/index.js +17 -13
  183. package/dist/commands/dev/index.js +26 -16
  184. package/dist/commands/env/index.js +13 -13
  185. package/dist/commands/link/index.js +1 -1
  186. package/dist/commands/list/index.js +2 -2
  187. package/dist/commands-bulk.js +725 -683
  188. package/dist/help.js +1 -1
  189. package/dist/index.js +2 -2
  190. package/dist/internal-build.js +1 -1
  191. package/dist/root-help-commands.mjs +1 -1
  192. package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
  193. package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
  194. package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
  195. package/dist/version.mjs +1 -1
  196. package/package.json +65 -59
  197. package/dist/chunks/add-CG73LA5A.js +0 -8
  198. package/dist/chunks/add-KBBLLPHW.js +0 -8
  199. package/dist/chunks/add-U5U56FJR.js +0 -8
  200. package/dist/chunks/build-7EWHBKAN.js +0 -7
  201. package/dist/chunks/chunk-2B3A3MOX.js +0 -7
  202. package/dist/chunks/chunk-2UMWTCY7.js +0 -7
  203. package/dist/chunks/chunk-2VBFQZ72.js +0 -7
  204. package/dist/chunks/chunk-5AYB3JRL.js +0 -9
  205. package/dist/chunks/chunk-74QCXPNW.js +0 -7
  206. package/dist/chunks/chunk-7NNENHGN.js +0 -7
  207. package/dist/chunks/chunk-AOWWC6WZ.js +0 -7
  208. package/dist/chunks/chunk-BFRDBBSO.js +0 -7
  209. package/dist/chunks/chunk-CMKLX4DC.js +0 -7
  210. package/dist/chunks/chunk-D4MW3RDW.js +0 -7
  211. package/dist/chunks/chunk-DDLM6CIQ.js +0 -10
  212. package/dist/chunks/chunk-DXLLC7ZM.js +0 -7
  213. package/dist/chunks/chunk-GLH4PVMY.js +0 -7
  214. package/dist/chunks/chunk-GVVIFYQE.js +0 -7
  215. package/dist/chunks/chunk-HJRAWEA2.js +0 -7
  216. package/dist/chunks/chunk-ILFUNCJZ.js +0 -7
  217. package/dist/chunks/chunk-ITKS32PG.js +0 -7
  218. package/dist/chunks/chunk-J6O6JW2K.js +0 -7
  219. package/dist/chunks/chunk-JIGCN5QS.js +0 -44
  220. package/dist/chunks/chunk-KUGXOLL7.js +0 -25
  221. package/dist/chunks/chunk-LD5U73LA.js +0 -7
  222. package/dist/chunks/chunk-MI7W4QMV.js +0 -7
  223. package/dist/chunks/chunk-MY4MONOH.js +0 -7
  224. package/dist/chunks/chunk-MYHJNSCW.js +0 -15
  225. package/dist/chunks/chunk-N2TNA2FE.js +0 -9
  226. package/dist/chunks/chunk-O4FDRZ22.js +0 -7
  227. package/dist/chunks/chunk-OHVPJNGY.js +0 -8
  228. package/dist/chunks/chunk-OUHPDA7Q.js +0 -7
  229. package/dist/chunks/chunk-P2O5DOYE.js +0 -7
  230. package/dist/chunks/chunk-P5BNAP5T.js +0 -39
  231. package/dist/chunks/chunk-PPCFQQSU.js +0 -7
  232. package/dist/chunks/chunk-Q5ZGA2RO.js +0 -7
  233. package/dist/chunks/chunk-QEXSF4NA.js +0 -7
  234. package/dist/chunks/chunk-QOFK5PKB.js +0 -20
  235. package/dist/chunks/chunk-U73RXMGU.js +0 -7
  236. package/dist/chunks/chunk-UCAE5Z5L.js +0 -7
  237. package/dist/chunks/chunk-UGMTKOTN.js +0 -7
  238. package/dist/chunks/chunk-UQIVF4Q2.js +0 -7
  239. package/dist/chunks/chunk-V3RDOM3U.js +0 -20
  240. package/dist/chunks/chunk-VEMJINMZ.js +0 -13
  241. package/dist/chunks/chunk-VKPZP4LC.js +0 -8
  242. package/dist/chunks/chunk-VLDU2MDL.js +0 -7
  243. package/dist/chunks/chunk-VRWLNWNE.js +0 -7
  244. package/dist/chunks/chunk-W3TGCMRW.js +0 -9
  245. package/dist/chunks/chunk-WCBNKVVG.js +0 -9
  246. package/dist/chunks/chunk-Y24OSBXP.js +0 -7
  247. package/dist/chunks/chunk-ZBDLYNUF.js +0 -7
  248. package/dist/chunks/chunk-ZDKSDWSO.js +0 -9
  249. package/dist/chunks/chunk-ZMY3GQBK.js +0 -7
  250. package/dist/chunks/chunk-ZQME5XUJ.js +0 -7
  251. package/dist/chunks/chunk-ZS2WS4AM.js +0 -7
  252. package/dist/chunks/clear-35NUHHDI.js +0 -8
  253. package/dist/chunks/compile-vercel-config-UQIYIVA6.js +0 -7
  254. package/dist/chunks/config-FZD3R5VT.js +0 -8
  255. package/dist/chunks/config-IQE5C7PZ.js +0 -7
  256. package/dist/chunks/delete-6LSSOF4X.js +0 -9
  257. package/dist/chunks/delete-IBRCB3S3.js +0 -10
  258. package/dist/chunks/detect-services-GFVD2C3W.js +0 -7
  259. package/dist/chunks/disable-4TODXYTB.js +0 -7
  260. package/dist/chunks/discard-WHC5FKWF.js +0 -14
  261. package/dist/chunks/edit-3DXOWQMF.js +0 -8
  262. package/dist/chunks/edit-R2RUDKC4.js +0 -9
  263. package/dist/chunks/enable-2OAHPKCN.js +0 -7
  264. package/dist/chunks/future-JZ3RVO4B.js +0 -7
  265. package/dist/chunks/generate-cert-for-deploy-D4IHTKQS.js +0 -7
  266. package/dist/chunks/image-UW5U6CRJ.js +0 -7
  267. package/dist/chunks/import-builders-JONKAYLL.js +0 -7
  268. package/dist/chunks/inspect-2FS4PYBH.js +0 -13
  269. package/dist/chunks/inspect-PWLUWUGV.js +0 -9
  270. package/dist/chunks/list-Y3OA4KFK.js +0 -11
  271. package/dist/chunks/login-LLM3Q6GJ.js +0 -9
  272. package/dist/chunks/login-VQN3F7JU.js +0 -7
  273. package/dist/chunks/logs-XEJPLFXM.js +0 -7
  274. package/dist/chunks/ls-2DACOWSU.js +0 -12
  275. package/dist/chunks/ls-2M7QSW2F.js +0 -12
  276. package/dist/chunks/ls-7DJWHOK4.js +0 -12
  277. package/dist/chunks/ls-GY2YLYMD.js +0 -12
  278. package/dist/chunks/ls-NJEJSYSO.js +0 -11
  279. package/dist/chunks/ls-OAJKYQEL.js +0 -8
  280. package/dist/chunks/mutate-G2I4ISF4.js +0 -9
  281. package/dist/chunks/notifications-6MXYY2V6.js +0 -7
  282. package/dist/chunks/open-YKOYB7PH.js +0 -7
  283. package/dist/chunks/openapi-36GMGEXR.js +0 -7
  284. package/dist/chunks/permissions-RRP6IEHS.js +0 -7
  285. package/dist/chunks/prompt-missing-credentials-WQUF6X6K.js +0 -7
  286. package/dist/chunks/publish-AQ3FYC3J.js +0 -15
  287. package/dist/chunks/pull-HT2MQ3ML.js +0 -7
  288. package/dist/chunks/purchase-domain-if-available-NDEUZYHK.js +0 -7
  289. package/dist/chunks/push-6LE54BCC.js +0 -7
  290. package/dist/chunks/query-SNY42BTX.js +0 -12
  291. package/dist/chunks/reauthenticate-4SGT475I.js +0 -7
  292. package/dist/chunks/reorder-SRF3NE5U.js +0 -10
  293. package/dist/chunks/reply-6HUIX4AX.js +0 -9
  294. package/dist/chunks/resolve-TNBNGA3G.js +0 -12
  295. package/dist/chunks/resolve-agent-team-XSXRT42F.js +0 -7
  296. package/dist/chunks/restore-HK4SWMZP.js +0 -16
  297. package/dist/chunks/rm-4VXZ3AIX.js +0 -8
  298. package/dist/chunks/rm-ESSU4MS4.js +0 -8
  299. package/dist/chunks/rm-EWPYZXTX.js +0 -8
  300. package/dist/chunks/rm-GNDGYUKQ.js +0 -8
  301. package/dist/chunks/rm-SKCAZTYN.js +0 -8
  302. package/dist/chunks/rule-inspect-RHHD5UIR.js +0 -8
  303. package/dist/chunks/rules-FF5FU7BV.js +0 -7
  304. package/dist/chunks/schema-HIKNWMV2.js +0 -14
  305. package/dist/chunks/select-org-CK5CWC3A.js +0 -7
  306. package/dist/chunks/set-5P44OPZP.js +0 -7
  307. package/dist/chunks/setup-and-link-OLSKD2HE.js +0 -7
  308. package/dist/chunks/tags-35DFWGDC.js +0 -7
  309. package/dist/chunks/update-WHBFIV22.js +0 -8
@@ -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{__commonJS}from"./chunk-BZENIQ7N.js";var require_dist=__commonJS({"../../internals/constants/dist/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.TITLE=exports.NAME=exports.LOGO=exports.PROJECT_ENV_TARGET=void 0;exports.PROJECT_ENV_TARGET=["production","preview","development"];exports.LOGO="\u25B2";exports.NAME="vercel";exports.TITLE="Vercel"}});export{require_dist};
@@ -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{canPrompt}from"./chunk-IQ7FPAI4.js";import{require_dist}from"./chunk-YPX7BXJ6.js";import{AGENT_REASON,AGENT_STATUS,outputActionRequired}from"./chunk-RH2SQQWH.js";import{humanizePath,require_lib}from"./chunk-3XDTQFBL.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_client=__toESM(require_dist(),1);import{dirname,isAbsolute,relative,sep}from"path";var singleFileConfig={framework:null,buildCommand:"",installCommand:"",outputDirectory:"."},singleFileProjectSettings={...singleFileConfig,rootDirectory:null};async function isIgnoredFile(file,cwd){let roots=new Set([dirname(file)]),fromCwd=relative(cwd,file);fromCwd&&!fromCwd.startsWith(`..${sep}`)&&!isAbsolute(fromCwd)&&roots.add(cwd);for(let root of roots){let{ig}=await(0,import_client.getVercelIgnore)(root);if(ig.ignores(relative(root,file).split(sep).join("/")))return!0}return!1}var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep as sep2}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep2)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths,{allowFiles=!1}={}){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);if(!pathStat)return output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1};let isFile=pathStat.isFile();if(!pathStat.isDirectory()&&!(allowFiles&&isFile))return output_manager_default.fatal(allowFiles?"Deploy a regular file or directory. Symbolic links and special files are not supported as deployment paths.":"This command requires a directory. Use `vercel <file>` to deploy a single file."),{valid:!1,exitCode:1};if(path===homedir()){if(!canPrompt(client)){let message="Can't deploy your home directory without interactive confirmation. Run from your project directory, or run in a terminal to confirm deploying your home directory.";return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.INTERACTIVE_CONFIRMATION_REQUIRED,message,userActionRequired:!0},2),output_manager_default.error(message),{valid:!1,exitCode:2}}if(!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1))return output_manager_default.print(`Canceled
8
+ `),{valid:!1,exitCode:0}}return{valid:!0,path,isFile}}export{singleFileConfig,singleFileProjectSettings,isIgnoredFile,validateRootDirectory,validatePaths};
@@ -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{stamp_default}from"./chunk-A2RZZQEP.js";import{param}from"./chunk-3G3FQYMW.js";import{getScope}from"./chunk-T5LBVZWY.js";import{require_pluralize,sleep}from"./chunk-3XDTQFBL.js";import{DomainChargeOutcomeUnknown,DomainNotAvailable,DomainNotFound,DomainPaymentError,DomainPriceChanged,DomainPurchaseRefundFailed,DomainPurchaseRefunded,InvalidDomain,TLDNotSupportedViaCLI,UnexpectedDomainPurchaseError,UnsupportedTLD,UserAborted,isAPIError}from"./chunk-AZ5OUZPP.js";import{eraseLines,output_manager_default}from"./chunk-UGZ3HFHI.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);async function getDomainPrice(client,name){try{return await client.fetch(`/v1/registrar/domains/${name}/price`)}catch(err){if(isAPIError(err)){if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.status<500)return err}throw err}}async function getDomainStatus(client,domain){return client.fetch(`/v1/registrar/domains/${encodeURIComponent(domain)}/availability`)}function getOrderOutcome(order,domain){let item=order.domains.find(d=>d.domainName===domain);return order.status==="completed"&&item?.status==="completed"?"completed":order.error?.code==="payment-failed"?"payment_failed":item?.status==="refund-failed"?"refund_failed":item?.status==="refunded"?"refunded":item?.status==="failed"?"failed":"unknown"}async function getOrder(client,orderId){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"";try{return await client.fetch(`/v1/registrar/orders/${orderId}${teamParam}`)}catch(err){if(isAPIError(err)){if(err.code==="not_found")return null;if(err.status<500)return err}throw err}}var pollForOrder=async(client,orderId,timeoutMs=1e4)=>{let startTime=Date.now();for(;Date.now()-startTime<timeoutMs;){let order=await getOrder(client,orderId);if(order!==null&&(order.status==="completed"||order.status==="failed"))return order;await sleep(500)}return null};async function purchaseDomain(client,name,expectedPrice,years,autoRenew=!0,contactInformation){let{team}=await getScope(client),teamParam=team?`?teamId=${team.slug}`:"",orderId;try{({orderId}=await client.fetch(`/v1/registrar/domains/${name}/buy${teamParam}`,{body:{expectedPrice,autoRenew,years,contactInformation},method:"POST",retry:{retries:0},bailOn429:!0}))}catch(err){if(isAPIError(err)&&err.status<500){if(err.code==="invalid_domain")return new InvalidDomain(name);if(err.code==="domain_not_available")return new DomainNotAvailable(name);if(err.code==="tld_not_supported")return new UnsupportedTLD(name);if(err.code==="additional_contact_info_required")return new TLDNotSupportedViaCLI(name);if(err.code==="expected_price_mismatch")return new DomainPriceChanged(name);throw err}return new DomainChargeOutcomeUnknown(name,"buy")}let order;try{order=await pollForOrder(client,orderId)}catch{order=null}if(order===null)return new DomainChargeOutcomeUnknown(name,"buy");switch(getOrderOutcome(order,name)){case"completed":return{orderId};case"payment_failed":return new DomainPaymentError;case"refund_failed":return new DomainPurchaseRefundFailed(name);case"refunded":return new DomainPurchaseRefunded(name);case"failed":return new UnexpectedDomainPurchaseError(name);case"unknown":return new DomainChargeOutcomeUnknown(name,"buy")}}var CONTACT_FIELDS=[{field:"firstName",flag:"--first-name",label:"First name",prompt:"First name:",validate:val=>val.length>0||"First name is required"},{field:"lastName",flag:"--last-name",label:"Last name",prompt:"Last name:",validate:val=>val.length>0||"Last name is required"},{field:"email",flag:"--email",label:"Email",prompt:"Email:",validate:val=>val.length===0?"Email is required":/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val)?!0:"Invalid email format"},{field:"phone",flag:"--phone",label:"Phone",prompt:"Phone (include country code, e.g., +15551234567):",validate:val=>val.length===0?"Phone is required":/^\+\d{10,15}$/.test(val)?!0:"Phone must start with + and contain 10-15 digits"},{field:"address1",flag:"--address",label:"Address",prompt:"Address:",validate:val=>val.length>0||"Address is required"},{field:"city",flag:"--city",label:"City",prompt:"City:",validate:val=>val.length>0||"City is required"},{field:"state",flag:"--state",label:"State",prompt:"State/Province:",validate:val=>val.length>0||"State/Province is required"},{field:"zip",flag:"--zip",label:"ZIP",prompt:"Postal/ZIP code:",validate:val=>val.length>0||"Postal/ZIP code is required"},{field:"country",flag:"--country",label:"Country",prompt:"Country code (2 letters, e.g., US):",validate:val=>val.length===0?"Country code is required":/^[A-Z]{2}$/i.test(val)?!0:"Country code must be 2 letters"},{field:"companyName",flag:"--company",label:"Company",prompt:"Company name (optional):"}],ADDRESS_FIELDS=new Set(["address1","city","state","zip","country"]);function readContactFlags(flags){let contact={};for(let{field,flag,validate}of CONTACT_FIELDS){let raw=flags[flag];if(typeof raw!="string")continue;let value=raw.trim(),result=validate?validate(value):!0;if(result!==!0)return`Invalid ${flag}. ${result}.`;contact[field]=field==="country"?value.toUpperCase():value}return contact}function getBillingContact(team){let billing=team?.billing;if(!billing)return{};let address=billing.address,line1=address?.line1?.trim(),line2=address?.line2?.trim(),country=address?.country?.trim().toUpperCase(),rawState=address?.state?.trim(),state=country&&rawState?.toUpperCase().startsWith(`${country}-`)?rawState.slice(country.length+1):rawState,candidates={email:billing.email,address1:line1&&line2?`${line1}, ${line2}`:line1,city:address?.city,state:country==="US"&&!/^[A-Z]{2}$/i.test(state??"")?"":state,zip:address?.postalCode,country},contact={};for(let{field,validate}of CONTACT_FIELDS){let value=candidates[field]?.trim();value&&(!validate||validate(value)===!0)&&(contact[field]=value)}return contact}function mergeContact(fromFlags,billing){let ownAddress=[...ADDRESS_FIELDS].some(field=>fromFlags[field]!==void 0&&billing[field]!==void 0),merged={};for(let{field}of CONTACT_FIELDS){let fallback=ownAddress&&ADDRESS_FIELDS.has(field)?void 0:billing[field],value=fromFlags[field]??fallback;value!==void 0&&(merged[field]=value)}return merged}function billingFieldsUsed(fromFlags,billing){let merged=mergeContact(fromFlags,billing),used={};for(let{field}of CONTACT_FIELDS)fromFlags[field]===void 0&&merged[field]!==void 0&&(used[field]=merged[field]);return used}function missingContactFields(contact){return CONTACT_FIELDS.filter(({field,validate})=>validate&&!contact[field]).map(({field})=>field)}async function collectContactInformation(client,{provided={},defaults={}}={}){let contact={...provided},pending=CONTACT_FIELDS.filter(({field})=>!(field in provided));pending.length>0&&(output_manager_default.log(""),output_manager_default.log("Please provide contact information for domain registration:"));for(let{field,prompt,validate}of pending){let value=await client.input.text({message:prompt,default:defaults[field],validate});value&&(contact[field]=value)}return{...contact,country:contact.country.toUpperCase(),companyName:contact.companyName||void 0}}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{getDomainPrice,getDomainStatus,getOrderOutcome,pollForOrder,purchaseDomain,CONTACT_FIELDS,readContactFlags,getBillingContact,mergeContact,billingFieldsUsed,missingContactFields,collectContactInformation,purchaseDomainIfAvailable};
@@ -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{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";var OUTPUT_FORMATS=["json"];function parseOutputFormat(value){let normalized=value.toLowerCase();if(OUTPUT_FORMATS.includes(normalized))return normalized;throw new Error(`Invalid output format: "${value}". Valid formats: ${OUTPUT_FORMATS.join(", ")}`)}function getOutputFormat(flags){let formatFlag=flags["--format"],jsonFlag=flags["--json"];if(formatFlag)return parseOutputFormat(formatFlag);if(jsonFlag)return"json"}function isJsonOutput(flags){return getOutputFormat(flags)==="json"}function validateJsonOutput(flags){try{return{valid:!0,jsonOutput:isJsonOutput(flags)}}catch(err){return{valid:!1,error:err.message}}}function wantsMachineReadableOutput(subcommand,argv){if(argv.includes("--help")||argv.includes("-h"))return!1;if(subcommand==="api"||argv.includes("--json"))return!0;for(let arg of argv)if(arg.toLowerCase()==="--format=json")return!0;let formatIdx=argv.indexOf("--format");return formatIdx!==-1&&argv[formatIdx+1]?.toLowerCase()==="json"}function shouldPrintVersionBanner(subcommand,argv){return!wantsMachineReadableOutput(subcommand,argv)}function warnDeprecatedSubcommand(client,deprecated,replacement){wantsMachineReadableOutput(void 0,client.argv)||output_manager_default.warning(`${getCommandName(deprecated)} is deprecated. Use ${getCommandName(replacement)}.`)}function warnDeprecatedOption(argv,deprecated,replacement){wantsMachineReadableOutput(void 0,argv)||output_manager_default.warning(`${deprecated} is deprecated. Use ${replacement}.`)}function warnDeprecatedInput(client,deprecated,replacement){wantsMachineReadableOutput(void 0,client.argv)||output_manager_default.warning(`${deprecated} is deprecated. Use ${replacement}.`)}export{validateJsonOutput,wantsMachineReadableOutput,shouldPrintVersionBanner,warnDeprecatedSubcommand,warnDeprecatedOption,warnDeprecatedInput};
@@ -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-FRSHC2HN.js";import{quoteArg,teamCache}from"./chunk-F53OKXYI.js";import{arg_common_default,getFlagsSpecification,getGlobalFlagsFromArgs,normalizeFlagName,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-ODB7LEAO.js";import{LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-AZ5OUZPP.js";import{getCommandName,packageName}from"./chunk-JESNVRVR.js";import{recordCliError}from"./chunk-UGZ3HFHI.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.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",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_COMPLETED:"schedule_completed",SCHEDULE_ALREADY_ACTIVE:"schedule_already_active",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",PLAN_LIMIT:"plan_limit",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination",TARGET_CONFLICT:"target_conflict",DEPRECATED:"deprecated",LIMIT_CLAMPED:"limit_clamped",METRICS_UNAVAILABLE:"metrics_unavailable",STREAM_GAP:"stream_gap",INCOMPLETE_RESULTS:"incomplete_results"},USAGE_ERROR_REASONS=new Set(["invalid_arguments","missing_arguments","unknown_command","missing_command","invalid_environment","invalid_type","missing_id","missing_value","missing_name","missing_flags","missing_clients","invalid_clients","conflicting_type_flags","missing_environment","invalid_slug","invalid_name","invalid_alert_thresholds","invalid_budget","invalid_dns_type","invalid_event","invalid_expiration","invalid_port","invalid_refresh_period","invalid_role_combination","invalid_url","missing_events","missing_issuer_id","missing_key_id","missing_key","missing_url"]);function getExitCodeForReason(reason){return reason!==void 0&&USAGE_ERROR_REASONS.has(reason)?2:1}var AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};var import_error_utils=__toESM(require_dist(),1);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}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(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{}}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)){if(!shouldEmitNonInteractiveCommandError(client))return;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
+ `),process.exit(exitCode)}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 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)};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 --filter ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --filter <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(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,getErrorRecovery,agentErrorMetadata,trackAgentError,isHelpInvocation,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getLinkSuggestionArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,outputAgentError,writeAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
@@ -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{resolveProjectContext}from"./chunk-DRXOTZSJ.js";import{require_json_parse_better_errors}from"./chunk-25565AGS.js";import{ensureLink,getEnvRecords,parseEnv,pullEnvRecords}from"./chunk-ZMY3GQBK.js";import{require_frameworks}from"./chunk-MVCAUS4F.js";import{pullSubcommand}from"./chunk-CMKLX4DC.js";import{param}from"./chunk-3G3FQYMW.js";import{STANDARD_ENVIRONMENTS,formatProject}from"./chunk-WYI4VNXT.js";import{parseTarget}from"./chunk-2B3A3MOX.js";import{getDeployment}from"./chunk-IVIZLWZQ.js";import{printError}from"./chunk-HARXQZV3.js";import{TelemetryClient}from"./chunk-KUGXOLL7.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{buildCommandWithYes,getPreservedArgsForEnvPull,outputActionRequired,outputAgentError}from"./chunk-DDLM6CIQ.js";import{getFlagsSpecification}from"./chunk-MI7W4QMV.js";import{addToGitIgnore,require_lib}from"./chunk-JIGCN5QS.js";import{printAlignedLabel}from"./chunk-IJCCFLCQ.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk2=__toESM(require_source(),1),import_fs_extra2=__toESM(require_lib(),1);import{closeSync,openSync,readSync}from"fs";import{resolve}from"path";var import_fs_extra=__toESM(require_lib(),1);var import_chalk=__toESM(require_source(),1);async function createEnvObject(envPath){let envArr=(await(0,import_fs_extra.readFile)(envPath,"utf-8")).replace(/"/g,"").split(/\r?\n|\r/).filter(line=>/^[^#]/.test(line)).filter(line=>/=/i.test(line)),parsedEnv=parseEnv(envArr);if(Object.keys(parsedEnv).length===0){output_manager_default.debug("Failed to parse env file.");return}return parsedEnv}function findChanges(oldEnv,newEnv){let added=[],changed=[];for(let key of Object.keys(newEnv))oldEnv[key]===void 0?added.push(key):oldEnv[key]!==newEnv[key]&&changed.push(key),delete oldEnv[key];let removed=Object.keys(oldEnv);return{added,changed,removed}}function buildDeltaString(oldEnv,newEnv){let{added,changed,removed}=findChanges(oldEnv,newEnv),deltaString="";return deltaString+=import_chalk.default.green(addDeltaSection("+",changed,!0)),deltaString+=import_chalk.default.green(addDeltaSection("+",added)),deltaString+=import_chalk.default.red(addDeltaSection("-",removed)),deltaString&&import_chalk.default.gray(` Changes:
7
+ import{resolveProjectContext}from"./chunk-X5J7LOJK.js";import{require_json_parse_better_errors}from"./chunk-25565AGS.js";import{ensureLink,getEnvRecords,getRenamedOption,parseEnv,pullEnvRecords,renameOptionInArgs,reportRenamedOptionError}from"./chunk-BZQ7YWSB.js";import{require_frameworks}from"./chunk-MVCAUS4F.js";import{pullSubcommand}from"./chunk-AW7DEWIM.js";import{param}from"./chunk-3G3FQYMW.js";import{STANDARD_ENVIRONMENTS,formatProject}from"./chunk-DBNQ45J5.js";import{parseTarget}from"./chunk-7C5JHTHO.js";import{getDeployment}from"./chunk-CZ2KEML2.js";import{printError}from"./chunk-OVV5MV5M.js";import{TelemetryClient}from"./chunk-XDKCDGJF.js";import{buildCommandWithYes,getPreservedArgsForEnvPull,outputActionRequired,outputAgentError}from"./chunk-RH2SQQWH.js";import{addToGitIgnore,require_lib}from"./chunk-3XDTQFBL.js";import{printAlignedLabel}from"./chunk-WDWYKX2I.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk2=__toESM(require_source(),1),import_fs_extra2=__toESM(require_lib(),1);import{closeSync,openSync,readSync}from"fs";import{resolve}from"path";var import_fs_extra=__toESM(require_lib(),1);var import_chalk=__toESM(require_source(),1);async function createEnvObject(envPath){let envArr=(await(0,import_fs_extra.readFile)(envPath,"utf-8")).replace(/"/g,"").split(/\r?\n|\r/).filter(line=>/^[^#]/.test(line)).filter(line=>/=/i.test(line)),parsedEnv=parseEnv(envArr);if(Object.keys(parsedEnv).length===0){output_manager_default.debug("Failed to parse env file.");return}return parsedEnv}function findChanges(oldEnv,newEnv){let added=[],changed=[];for(let key of Object.keys(newEnv))oldEnv[key]===void 0?added.push(key):oldEnv[key]!==newEnv[key]&&changed.push(key),delete oldEnv[key];let removed=Object.keys(oldEnv);return{added,changed,removed}}function buildDeltaString(oldEnv,newEnv){let{added,changed,removed}=findChanges(oldEnv,newEnv),deltaString="";return deltaString+=import_chalk.default.green(addDeltaSection("+",changed,!0)),deltaString+=import_chalk.default.green(addDeltaSection("+",added)),deltaString+=import_chalk.default.red(addDeltaSection("-",removed)),deltaString&&import_chalk.default.gray(` Changes:
8
8
  `)+deltaString+`
9
9
  `}function addDeltaSection(prefix,arr,changed=!1){return arr.length===0?"":arr.sort().map(item=>` ${prefix} ${item}${changed?" (Updated)":""}`).join(`
10
10
  `)+`
@@ -13,9 +13,9 @@ import{resolveProjectContext}from"./chunk-DRXOTZSJ.js";import{require_json_parse
13
13
  `))valueWithoutTrailingNewline=value.slice(0,-2);else if(value.endsWith(`
14
14
  `))valueWithoutTrailingNewline=value.slice(0,-1);else return{value,strippedTrailingNewline:!1};return valueWithoutTrailingNewline.includes(`
15
15
  `)||valueWithoutTrailingNewline.includes("\r")?{value,strippedTrailingNewline:!1}:{value:valueWithoutTrailingNewline,strippedTrailingNewline:!0}}function getPublicPrefix(key){let upperKey=key.toUpperCase();return PUBLIC_PREFIXES.find(p=>upperKey.startsWith(p))||null}function getFrameworkPublicPrefix(frameworkSlug,key){let prefix=import_frameworks.frameworkList.find(framework=>framework.slug===frameworkSlug)?.envPrefix;return prefix&&key.toUpperCase().startsWith(prefix.toUpperCase())?prefix:null}function getApiPublicPrefix(key){let upperKey=key.toUpperCase();return API_PUBLIC_PREFIXES.find(prefix=>upperKey.startsWith(prefix))??null}function parseSvelteKitPublicEnvVarPrefix(config){if(!config.includes("publicPrefix"))return{status:"ready",prefix:null};let match=/publicPrefix:\s*(?:'(?<single>[^']*)'|"(?<double>[^"]*)"|`(?<template>[^`$]*)`)/.exec(config),prefix=match?.groups?.single??match?.groups?.double??match?.groups?.template;return prefix===void 0?{status:"unavailable"}:{status:"ready",prefix}}async function getLocalSvelteKitPublicPrefixes(cwd,rootDirectory){let projectRoot=rootDirectory?join(cwd,rootDirectory):cwd,config;try{config=await readFile2(join(projectRoot,"svelte.config.js"),"utf8")}catch{return}let parsed=parseSvelteKitPublicEnvVarPrefix(config);if(parsed.status!=="unavailable")return[parsed.prefix??"PUBLIC_","VITE_"]}function removePublicPrefix(key){let prefix=getPublicPrefix(key);return prefix?key.slice(prefix.length):key}async function validateEnvValue(opts){let finalValue=opts.initialValue,alreadyConfirmed=!1;if(opts.skipConfirm){let valueWarnings=getEnvValueWarnings(finalValue),warningMessage=formatWarnings(valueWarnings);warningMessage&&opts.showWarning(warningMessage)}else{let valueAccepted=!1;for(;!valueAccepted;){let valueWarnings=getEnvValueWarnings(finalValue),warningMessage=formatWarnings(valueWarnings);if(!warningMessage){valueAccepted=!0;break}opts.showWarning(warningMessage);let choices=hasOnlyWhitespaceWarnings(valueWarnings)?[{name:"Leave as is",value:"c"},{name:"Re-enter",value:"r"},{name:"Trim whitespace",value:"t"}]:[{name:"Leave as is",value:"c"},{name:"Re-enter",value:"r"}],action=await opts.selectAction(choices);action==="c"?(valueAccepted=!0,valueWarnings.some(w=>w.requiresConfirmation)&&(alreadyConfirmed=!0)):action==="t"?(finalValue=trimValue(finalValue),opts.showLog("Trimmed whitespace")):finalValue=await opts.promptForValue()}}return{finalValue,alreadyConfirmed}}function getEnvKeyWarnings(key){let warnings=[],matchingPrefix=getPublicPrefix(key);if(matchingPrefix){let nameWithoutPrefix=key.slice(matchingPrefix.length);looksLikeSecret(nameWithoutPrefix)&&getMatchingServerOnlyKey(nameWithoutPrefix)?warnings.push({message:`\`${matchingPrefix}\` exposes \`${key}\` to anyone visiting your site`,requiresConfirmation:!0}):warnings.push({message:`\`${matchingPrefix}\` exposes this value to anyone visiting your site`,requiresConfirmation:!1})}return warnings}var ENV_VISIBILITY_DEPRECATION_MESSAGE="`--visibility` is deprecated. Use `--type` instead.";function invalidTypeOptionError(optionName,value){if(!(value==="config"||value==="secret"))return value==="sensitive"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type secret\` or the legacy \`--sensitive\` flag.`:value==="plain"||value==="encrypted"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type config\` for readable values.`:`The \`${optionName}\` flag must be either \`config\` or \`secret\`.`}function resolveEnvVarTypeOption(options){let usedDeprecatedVisibility=options.visibility!==void 0;if(options.type!==void 0){let error=invalidTypeOptionError("--type",options.type);if(error)return{usedDeprecatedVisibility,error,errorReason:"invalid_type"}}if(options.visibility!==void 0){let error=invalidTypeOptionError("--visibility",options.visibility);if(error)return{usedDeprecatedVisibility,error,errorReason:"invalid_visibility"}}return options.type!==void 0&&options.visibility!==void 0&&options.type!==options.visibility?{usedDeprecatedVisibility,error:`\`--type ${options.type}\` conflicts with \`--visibility ${options.visibility}\`. \`--visibility\` is a deprecated alias of \`--type\`; remove it.`,errorReason:"conflicting_type_visibility"}:options.type!==void 0?{explicitVisibility:options.type,source:"type",usedDeprecatedVisibility}:options.visibility!==void 0?{explicitVisibility:options.visibility,source:"visibility",usedDeprecatedVisibility}:{usedDeprecatedVisibility}}function isSecretEnvVar(env){return env.type==="sensitive"||env.visibility==="secret"}function formatVisibilityLabel(visibility,type){let resolved=visibility??visibilityFromEnvType(type);if(resolved==="config")return"Config";if(resolved==="secret")return"Secret"}function visibilityFromEnvType(type){if(type==="sensitive")return"secret";if(type==="plain"||type==="encrypted")return"config"}function hasNonDevelopmentTarget(envTargets){return envTargets.some(target=>target!=="development")}function getPublicPrefixSecretVisibilityError(key,options){let publicPrefix=getApiPublicPrefix(key);if(!publicPrefix||!(options.visibility==="secret"||options.type==="sensitive"))return null;let privateKey=key.slice(publicPrefix.length);return options.context==="update"?`\`${publicPrefix}\` exposes this value to anyone visiting your site, so \`${key}\` cannot be a Secret. To keep it private, add \`${privateKey}\` as a Secret, then remove \`${key}\`. If the value is safe to expose, keep it as Config.`:`\`${publicPrefix}\` exposes this value to anyone visiting your site, so \`${key}\` cannot be a Secret. To keep it private, rename the variable to \`${privateKey}\` and keep the Secret type. If the value is safe to expose, use \`--type config\`.`}function shouldOmitInferredVisibility(key,envTargets,teamSensitivePolicyOn){return!getApiPublicPrefix(key)||!hasNonDevelopmentTarget(envTargets)?!1:teamSensitivePolicyOn}function resolveEnvVarVisibility(options){if(options.explicitVisibility!==void 0){if(options.explicitVisibility!=="config"&&options.explicitVisibility!=="secret"){let optionName=options.explicitOptionSource==="visibility"?"--visibility":"--type";return{error:options.explicitVisibility==="sensitive"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type secret\` or the legacy \`--sensitive\` flag.`:options.explicitVisibility==="plain"||options.explicitVisibility==="encrypted"?`The \`${optionName}\` flag accepts \`config\` or \`secret\`. Use \`--type config\` for readable values.`:`The \`${optionName}\` flag must be either \`config\` or \`secret\`.`}}let publicPrefixError2=getPublicPrefixSecretVisibilityError(options.key,{visibility:options.explicitVisibility,type:options.type,context:options.context});return publicPrefixError2?{error:publicPrefixError2}:{visibility:options.explicitVisibility}}let inferred=visibilityFromEnvType(options.type);if(inferred===void 0)return{};if(shouldOmitInferredVisibility(options.key,options.envTargets,options.teamSensitivePolicyOn))return{};let publicPrefixError=getPublicPrefixSecretVisibilityError(options.key,{visibility:inferred,type:options.type,context:options.context});return publicPrefixError?{error:publicPrefixError}:{visibility:inferred}}function getUnavailableSecretValuesMessage(environment,count){let values=count===1?"value":"values";return environment==="development"?`${count} Development Secret ${values} ${count===1?"was":"were"} not returned by Vercel.`:`${count} Secret ${values} cannot be pulled from the \`${environment}\` Environment.`}function getLocalSecretFallbackMessage(count){return` Define ${count===1?"it":"them"} in a local .env file.`}var CONTENTS_HEADER="# Created by Vercel CLI";function updateOidcTokenContents(existing,token){let assignment=`${VERCEL_OIDC_TOKEN}="${escapeValue(token)}"`,oidcAssignment=new RegExp(`^(\\uFEFF?)[\\t ]*(?:export[\\t ]+)?${VERCEL_OIDC_TOKEN}[\\t ]*=[^\\r\\n]*(\\r\\n|\\n|\\r|$)`,"gm"),tokenWritten=!1,withoutDuplicates=existing.replace(oidcAssignment,(_match,byteOrderMark,lineEnding2)=>token!==void 0&&!tokenWritten?(tokenWritten=!0,`${byteOrderMark}${assignment}${lineEnding2}`):byteOrderMark);if(token===void 0||tokenWritten)return withoutDuplicates;let lineEnding=withoutDuplicates.match(/\r\n|\n|\r/)?.[0]??`
16
- `,hasTrailingLineEnding=/(?:\r\n|\n|\r)$/.test(withoutDuplicates),hasTrailingBlankLine=/(?:\r\n|\n|\r){2}$/.test(withoutDuplicates),separator=withoutDuplicates.length===0||hasTrailingBlankLine?"":hasTrailingLineEnding?lineEnding:`${lineEnding}${lineEnding}`;return`${withoutDuplicates}${separator}${CONTENTS_HEADER}${lineEnding}${assignment}${lineEnding}`}function escapeValue(value){return value?value.replace(/\n/g,"\\n").replace(/\r/g,"\\r"):""}var import_error_utils=__toESM(require_dist(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1);var EnvPullTelemetryClient=class extends TelemetryClient{trackCliArgumentFilename(filename){filename&&this.trackCliArgument({arg:"filename",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:STANDARD_ENVIRONMENTS.includes(environment)?environment:this.redactedValue})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliOptionId(id){id&&this.trackCliOption({option:"id",value:this.redactedValue})}};var CONTENTS_PREFIX=`# Created by Vercel CLI
16
+ `,hasTrailingLineEnding=/(?:\r\n|\n|\r)$/.test(withoutDuplicates),hasTrailingBlankLine=/(?:\r\n|\n|\r){2}$/.test(withoutDuplicates),separator=withoutDuplicates.length===0||hasTrailingBlankLine?"":hasTrailingLineEnding?lineEnding:`${lineEnding}${lineEnding}`;return`${withoutDuplicates}${separator}${CONTENTS_HEADER}${lineEnding}${assignment}${lineEnding}`}function escapeValue(value){return value?value.replace(/\n/g,"\\n").replace(/\r/g,"\\r"):""}var import_error_utils=__toESM(require_dist(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1);var EnvPullTelemetryClient=class extends TelemetryClient{trackCliArgumentFilename(filename){filename&&this.trackCliArgument({arg:"filename",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:STANDARD_ENVIRONMENTS.includes(environment)?environment:this.redactedValue})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}trackCliOptionDeployment(deployment){deployment&&this.trackCliOption({option:"deployment",value:this.redactedValue})}trackCliOptionId(id){id&&this.trackCliOption({option:"id",value:this.redactedValue})}};var CONTENTS_PREFIX=`# Created by Vercel CLI
17
17
  `;function printEnvPullWarning(message){output_manager_default.print(`${import_chalk2.default.yellow("!")} ${message}
18
- `)}function readHeadSync(path,length){let buffer=Buffer.alloc(length),fd=openSync(path,"r");try{readSync(fd,buffer,0,buffer.length,null)}finally{closeSync(fd)}return buffer.toString()}function tryReadHeadSync(path,length){try{return readHeadSync(path,length)}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ENOENT")throw err}}var VARIABLES_TO_IGNORE=["VERCEL_ANALYTICS_ID","VERCEL_SPEED_INSIGHTS_ID","VERCEL_WEB_ANALYTICS_ID"],SENSITIVE_PLACEHOLDER=SENSITIVE_ENV_VALUE_PLACEHOLDER;async function getRedactedSensitiveKeys(client,projectId,source,target,gitBranch,records){let emptyKeys=Object.keys(records).filter(key=>!records[key]);if(!projectId||emptyKeys.length===0)return new Set;try{let{envs}=await getEnvRecords(client,projectId,source,{target,gitBranch}),sensitiveKeys=new Set(envs.filter(isSecretEnvVar).map(env=>env.key));return new Set(emptyKeys.filter(key=>sensitiveKeys.has(key)))}catch{return new Set}}async function pull(client,argv,source="vercel-cli:env:pull",options={}){let telemetryClient=new EnvPullTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(pullSubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(err){return printError(err),2}let{args,flags:opts}=parsedArgs;if(args.length>1)return output_manager_default.error(`Invalid number of arguments. Usage: ${getCommandName("env pull <file>")}`),2;let[rawFilename]=args,filename=rawFilename||".env.local",skipConfirmation=opts["--yes"],gitBranch=opts["--git-branch"];telemetryClient.trackCliArgumentFilename(args[0]),telemetryClient.trackCliFlagYes(skipConfirmation),telemetryClient.trackCliOptionGitBranch(gitBranch),telemetryClient.trackCliOptionEnvironment(opts["--environment"]),telemetryClient.trackCliOptionId(opts["--id"]),telemetryClient.trackCliOptionProject(opts["--project"]);let link=await resolveProjectContext({client,projectNameOrId:opts["--project"],skipOwnerLookup:!0});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive){let preserved=getPreservedArgsForEnvPull(client.argv),linkArgv=[...client.argv.slice(0,2),"link","--scope","<scope>",...preserved];outputAgentError(client,{status:"error",reason:"not_linked",message:`Your codebase isn't linked to a project on Vercel. Run \`${getCommandNamePlain("link")}\` to begin. Use \`--yes\` for non-interactive; use \`--scope\` or \`--project\` to specify team or project.`,next:[{command:buildCommandWithYes(linkArgv)},{command:buildCommandWithYes(client.argv)}]},1)}if(!client.nonInteractive&&client.stdin.isTTY&&!skipConfirmation){let ensuredLink=await ensureLink("env pull",client,client.cwd,{link,pullEnv:!1});if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink}else return output_manager_default.error(`Your codebase isn\u2019t linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}client.config.currentTeam=link.org.type==="team"?link.org.id:void 0;let deploymentId=opts["--id"];if(deploymentId&&opts["--project"]){let deployment=await getDeployment(client,link.org.slug||link.org.id,deploymentId);if(deployment.projectId&&deployment.projectId!==link.project.id)return output_manager_default.error(`Deployment ${import_chalk2.default.bold(deploymentId)} does not belong to project ${import_chalk2.default.bold(link.project.name)}.`),1}let environment=parseTarget({flagName:"environment",flags:opts})||"development";return await envPullCommandLogic(client,filename,!!skipConfirmation,environment,link,gitBranch,client.cwd,source,deploymentId,options),0}async function envPullCommandLogic(client,filename,skipConfirmation,environment,link,gitBranch,cwd,source,deploymentId,{oidcTokenOnly=!1}={}){let fullPath=resolve(cwd,filename),head=tryReadHeadSync(fullPath,Buffer.byteLength(CONTENTS_PREFIX)),exists=typeof head<"u";if(head===CONTENTS_PREFIX&&!oidcTokenOnly)output_manager_default.log(`Overwriting existing ${import_chalk2.default.bold(filename)} file`);else if(exists&&!skipConfirmation&&!oidcTokenOnly){if(client.nonInteractive){let preserved=getPreservedArgsForEnvPull(client.argv).filter(arg=>arg!=="--yes"&&arg!=="-y"),suffix=preserved.length>0?` ${preserved.join(" ")}`:"";outputActionRequired(client,{status:"action_required",reason:"env_file_exists",message:`File ${param(filename)} already exists and was not created by Vercel CLI. Use --yes to overwrite or specify a different filename.`,next:[{command:getCommandNamePlain(`env pull ${filename} --yes${suffix}`),when:"Overwrite this file"},{command:getCommandNamePlain(`env pull <filename>${suffix}`),when:"Use a different filename"}]})}if(!await client.input.confirm(`Found existing file ${param(filename)}. Do you want to overwrite?`,!1)){output_manager_default.log("Canceled");return}}let projectSlugLink=link.org.slug?formatProject(link.org.slug,link.project.name):import_chalk2.default.bold(link.project.name),downloadMessage=oidcTokenOnly?`Downloading a fresh \`${import_chalk2.default.cyan(VERCEL_OIDC_TOKEN)}\` for ${projectSlugLink}`:gitBranch?`Downloading \`${import_chalk2.default.cyan(environment)}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk2.default.cyan(gitBranch)}`:`Downloading \`${import_chalk2.default.cyan(environment)}\` environment variables for ${projectSlugLink}`;output_manager_default.log(downloadMessage),output_manager_default.spinner("Downloading");let pullId=deploymentId||link.project.id,pullResult=await pullEnvRecords(client,pullId,source,{target:environment||"development",gitBranch}),records=deploymentId?pullResult.buildEnv:pullResult.env,deltaString="",oldEnv;exists&&!oidcTokenOnly&&(oldEnv=await createEnvObject(fullPath));let contents,fileChanged=!0,keptLocalKeys=[],preservedLocalSecretKeys=[],redactedSecretCount=0,placeholderSecretCount=0;if(oidcTokenOnly){let existingContents=exists?await(0,import_fs_extra2.readFile)(fullPath,"utf8"):"";contents=updateOidcTokenContents(existingContents,records[VERCEL_OIDC_TOKEN]||void 0),fileChanged=contents!==existingContents}else{let sensitiveKeys=await getRedactedSensitiveKeys(client,deploymentId?void 0:link.project.id,source,environment,gitBranch,records);redactedSecretCount=sensitiveKeys.size;let mergedRecords={...records};for(let key of sensitiveKeys){let localValue=oldEnv?.[key];localValue&&localValue!==SENSITIVE_PLACEHOLDER?(mergedRecords[key]=localValue,preservedLocalSecretKeys.push(key)):(mergedRecords[key]=SENSITIVE_PLACEHOLDER,placeholderSecretCount++)}if(oldEnv)for(let[key,value]of Object.entries(oldEnv))!(key in mergedRecords)&&key!==VERCEL_OIDC_TOKEN&&!VARIABLES_TO_IGNORE.includes(key)&&(mergedRecords[key]=value,keptLocalKeys.push(key));if(contents=CONTENTS_PREFIX+Object.keys(mergedRecords).sort().filter(key=>!VARIABLES_TO_IGNORE.includes(key)).map(key=>`${key}="${escapeValue2(mergedRecords[key])}"`).join(`
18
+ `)}function readHeadSync(path,length){let buffer=Buffer.alloc(length),fd=openSync(path,"r");try{readSync(fd,buffer,0,buffer.length,null)}finally{closeSync(fd)}return buffer.toString()}function tryReadHeadSync(path,length){try{return readHeadSync(path,length)}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="ENOENT")throw err}}var VARIABLES_TO_IGNORE=["VERCEL_ANALYTICS_ID","VERCEL_SPEED_INSIGHTS_ID","VERCEL_WEB_ANALYTICS_ID"],SENSITIVE_PLACEHOLDER=SENSITIVE_ENV_VALUE_PLACEHOLDER;async function getRedactedSensitiveKeys(client,projectId,source,target,gitBranch,records){let emptyKeys=Object.keys(records).filter(key=>!records[key]);if(!projectId||emptyKeys.length===0)return new Set;try{let{envs}=await getEnvRecords(client,projectId,source,{target,gitBranch}),sensitiveKeys=new Set(envs.filter(isSecretEnvVar).map(env=>env.key));return new Set(emptyKeys.filter(key=>sensitiveKeys.has(key)))}catch{return new Set}}async function pull(client,argv,source="vercel-cli:env:pull",options={}){let telemetryClient=new EnvPullTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(pullSubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(err){return printError(err),2}let{args,flags:opts}=parsedArgs;if(args.length>1)return output_manager_default.error(`Invalid number of arguments. Usage: ${getCommandName("env pull <file>")}`),2;let[rawFilename]=args,filename=rawFilename||".env.local",skipConfirmation=opts["--yes"],gitBranch=opts["--git-branch"];telemetryClient.trackCliArgumentFilename(args[0]),telemetryClient.trackCliFlagYes(skipConfirmation),telemetryClient.trackCliOptionGitBranch(gitBranch),telemetryClient.trackCliOptionEnvironment(opts["--environment"]),telemetryClient.trackCliOptionDeployment(opts["--deployment"]),telemetryClient.trackCliOptionId(opts["--id"]),telemetryClient.trackCliOptionProject(opts["--project"]);let deploymentFlag=getRenamedOption(opts,"--deployment","--id");if("error"in deploymentFlag)return reportRenamedOptionError(client,deploymentFlag.error);let link=await resolveProjectContext({client,projectNameOrId:opts["--project"],skipOwnerLookup:!0});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive){let argv2=renameOptionInArgs(client.argv,"--id","--deployment"),preserved=getPreservedArgsForEnvPull(argv2),linkArgv=[...argv2.slice(0,2),"link","--scope","<scope>",...preserved];outputAgentError(client,{status:"error",reason:"not_linked",message:`Your codebase isn't linked to a project on Vercel. Run \`${getCommandNamePlain("link")}\` to begin. Use \`--yes\` for non-interactive; use \`--scope\` or \`--project\` to specify team or project.`,next:[{command:buildCommandWithYes(linkArgv)},{command:buildCommandWithYes(argv2)}]},1)}if(!client.nonInteractive&&client.stdin.isTTY&&!skipConfirmation){let ensuredLink=await ensureLink("env pull",client,client.cwd,{link,pullEnv:!1});if(typeof ensuredLink=="number")return ensuredLink;link=ensuredLink}else return output_manager_default.error(`Your codebase isn\u2019t linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}client.config.currentTeam=link.org.type==="team"?link.org.id:void 0;let deploymentId=deploymentFlag.value;if(deploymentId&&opts["--project"]){let deployment=await getDeployment(client,link.org.slug||link.org.id,deploymentId);if(deployment.projectId&&deployment.projectId!==link.project.id)return output_manager_default.error(`Deployment ${import_chalk2.default.bold(deploymentId)} does not belong to project ${import_chalk2.default.bold(link.project.name)}.`),1}let environment=parseTarget({flagName:"environment",flags:opts})||"development";return await envPullCommandLogic(client,filename,!!skipConfirmation,environment,link,gitBranch,client.cwd,source,deploymentId,options),0}async function envPullCommandLogic(client,filename,skipConfirmation,environment,link,gitBranch,cwd,source,deploymentId,{oidcTokenOnly=!1}={}){let fullPath=resolve(cwd,filename),head=tryReadHeadSync(fullPath,Buffer.byteLength(CONTENTS_PREFIX)),exists=typeof head<"u";if(head===CONTENTS_PREFIX&&!oidcTokenOnly)output_manager_default.log(`Overwriting existing ${import_chalk2.default.bold(filename)} file`);else if(exists&&!skipConfirmation&&!oidcTokenOnly){if(client.nonInteractive){let preserved=getPreservedArgsForEnvPull(renameOptionInArgs(client.argv,"--id","--deployment")).filter(arg=>arg!=="--yes"&&arg!=="-y"),suffix=preserved.length>0?` ${preserved.join(" ")}`:"";outputActionRequired(client,{status:"action_required",reason:"env_file_exists",message:`File ${param(filename)} already exists and was not created by Vercel CLI. Use --yes to overwrite or specify a different filename.`,next:[{command:getCommandNamePlain(`env pull ${filename} --yes${suffix}`),when:"Overwrite this file"},{command:getCommandNamePlain(`env pull <filename>${suffix}`),when:"Use a different filename"}]})}if(!await client.input.confirm(`Found existing file ${param(filename)}. Do you want to overwrite?`,!1)){output_manager_default.log("Canceled");return}}let projectSlugLink=link.org.slug?formatProject(link.org.slug,link.project.name):import_chalk2.default.bold(link.project.name),downloadMessage=oidcTokenOnly?`Downloading a fresh \`${import_chalk2.default.cyan(VERCEL_OIDC_TOKEN)}\` for ${projectSlugLink}`:gitBranch?`Downloading \`${import_chalk2.default.cyan(environment)}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk2.default.cyan(gitBranch)}`:`Downloading \`${import_chalk2.default.cyan(environment)}\` environment variables for ${projectSlugLink}`;output_manager_default.log(downloadMessage),output_manager_default.spinner("Downloading");let pullId=deploymentId||link.project.id,pullResult=await pullEnvRecords(client,pullId,source,{target:environment||"development",gitBranch}),records=deploymentId?pullResult.buildEnv:pullResult.env,deltaString="",oldEnv;exists&&!oidcTokenOnly&&(oldEnv=await createEnvObject(fullPath));let contents,fileChanged=!0,keptLocalKeys=[],preservedLocalSecretKeys=[],redactedSecretCount=0,placeholderSecretCount=0;if(oidcTokenOnly){let existingContents=exists?await(0,import_fs_extra2.readFile)(fullPath,"utf8"):"";contents=updateOidcTokenContents(existingContents,records[VERCEL_OIDC_TOKEN]||void 0),fileChanged=contents!==existingContents}else{let sensitiveKeys=await getRedactedSensitiveKeys(client,deploymentId?void 0:link.project.id,source,environment,gitBranch,records);redactedSecretCount=sensitiveKeys.size;let mergedRecords={...records};for(let key of sensitiveKeys){let localValue=oldEnv?.[key];localValue&&localValue!==SENSITIVE_PLACEHOLDER?(mergedRecords[key]=localValue,preservedLocalSecretKeys.push(key)):(mergedRecords[key]=SENSITIVE_PLACEHOLDER,placeholderSecretCount++)}if(oldEnv)for(let[key,value]of Object.entries(oldEnv))!(key in mergedRecords)&&key!==VERCEL_OIDC_TOKEN&&!VARIABLES_TO_IGNORE.includes(key)&&(mergedRecords[key]=value,keptLocalKeys.push(key));if(contents=CONTENTS_PREFIX+Object.keys(mergedRecords).sort().filter(key=>!VARIABLES_TO_IGNORE.includes(key)).map(key=>`${key}="${escapeValue2(mergedRecords[key])}"`).join(`
19
19
  `)+`
20
20
  `,oldEnv){let newEnv=(0,import_json_parse_better_errors.default)(JSON.stringify(mergedRecords).replace(/\\"/g,""));deltaString=buildDeltaString(oldEnv,newEnv)}}if(fileChanged&&await(0,import_fs_extra2.outputFile)(fullPath,contents,"utf8"),deltaString?output_manager_default.print(`
21
21
  `+deltaString):oldEnv&&exists&&output_manager_default.log("No changes found."),keptLocalKeys.length>0&&output_manager_default.log(`Kept ${keptLocalKeys.sort().map(key=>import_chalk2.default.bold(key)).join(", ")} (defined locally, not found in the ${import_chalk2.default.cyan(environment)} Environment)`),redactedSecretCount>0){let preservedMessage=preservedLocalSecretKeys.length>0?` Kept ${preservedLocalSecretKeys.length} existing local ${preservedLocalSecretKeys.length===1?"value":"values"}.`:"",placeholderMessage=placeholderSecretCount>0?` Wrote "${SENSITIVE_PLACEHOLDER}" ${placeholderSecretCount===1?"as a placeholder":"as placeholders"} for the remaining ${placeholderSecretCount===1?"value":"values"}; replace ${placeholderSecretCount===1?"it":"them"} with local-only values.`:"";printEnvPullWarning(`${getUnavailableSecretValuesMessage(environment,redactedSecretCount)}${preservedMessage}${placeholderMessage}`)}let isGitIgnoreUpdated=!1,fileExistsAfterPull=exists||contents.length>0;if(filename===".env.local"&&fileExistsAfterPull){let rootPath=link.repoRoot??cwd;isGitIgnoreUpdated=await addToGitIgnore(rootPath,".env*")}if(!fileChanged&&!isGitIgnoreUpdated){output_manager_default.stopSpinner();return}if(output_manager_default.print(`
@@ -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{TelemetryClient}from"./chunk-KUGXOLL7.js";var RoutesTelemetryClient=class extends TelemetryClient{trackCliSubcommandList(actual){this.trackCliSubcommand({subcommand:"list",value:actual})}trackCliSubcommandListVersions(actual){this.trackCliSubcommand({subcommand:"list-versions",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandAdd(actual){this.trackCliSubcommand({subcommand:"add",value:actual})}trackCliSubcommandPublish(actual){this.trackCliSubcommand({subcommand:"publish",value:actual})}trackCliSubcommandRestore(actual){this.trackCliSubcommand({subcommand:"restore",value:actual})}trackCliSubcommandDiscardStaging(actual){this.trackCliSubcommand({subcommand:"discard-staging",value:actual})}trackCliSubcommandDelete(actual){this.trackCliSubcommand({subcommand:"delete",value:actual})}trackCliSubcommandExport(actual){this.trackCliSubcommand({subcommand:"export",value:actual})}trackCliSubcommandEnable(actual){this.trackCliSubcommand({subcommand:"enable",value:actual})}trackCliSubcommandDisable(actual){this.trackCliSubcommand({subcommand:"disable",value:actual})}trackCliSubcommandReorder(actual){this.trackCliSubcommand({subcommand:"reorder",value:actual})}trackCliSubcommandUpdate(actual){this.trackCliSubcommand({subcommand:"update",value:actual})}},RoutesAddTelemetryClient=class extends TelemetryClient{trackCliArgumentName(name){name&&this.trackCliArgument({arg:"name",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagDisabled(flag){flag&&this.trackCliFlag("disabled")}trackCliOptionSrc(src){src&&this.trackCliOption({option:"src",value:this.redactedValue})}trackCliOptionSrcSyntax(syntax){syntax&&this.trackCliOption({option:"src-syntax",value:syntax})}trackCliOptionAction(action){action&&this.trackCliOption({option:"action",value:action})}trackCliOptionDest(dest){dest&&this.trackCliOption({option:"dest",value:this.redactedValue})}trackCliOptionStatus(status){status!==void 0&&this.trackCliOption({option:"status",value:String(status)})}trackCliOptionPosition(position){if(position){let placement=position.split(":")[0];this.trackCliOption({option:"position",value:placement})}}trackCliOptionDescription(description){description&&this.trackCliOption({option:"description",value:this.redactedValue})}trackCliOptionSetResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"set-response-header",value:this.redactedValue})}trackCliOptionAppendResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"append-response-header",value:this.redactedValue})}trackCliOptionDeleteResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"delete-response-header",value:this.redactedValue})}trackCliOptionSetRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"set-request-header",value:this.redactedValue})}trackCliOptionAppendRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"append-request-header",value:this.redactedValue})}trackCliOptionDeleteRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"delete-request-header",value:this.redactedValue})}trackCliOptionSetRequestQuery(params){params&&params.length>0&&this.trackCliOption({option:"set-request-query",value:this.redactedValue})}trackCliOptionAppendRequestQuery(params){params&&params.length>0&&this.trackCliOption({option:"append-request-query",value:this.redactedValue})}trackCliOptionDeleteRequestQuery(params){params&&params.length>0&&this.trackCliOption({option:"delete-request-query",value:this.redactedValue})}trackCliOptionHas(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"has",value:this.redactedValue})}trackCliOptionMissing(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"missing",value:this.redactedValue})}trackCliOptionAi(prompt){prompt&&this.trackCliOption({option:"ai",value:this.redactedValue})}trackCliActionType(actionType){this.trackCliOption({option:"action-type",value:actionType})}trackCliFlagHasConditions(hasConditions){hasConditions&&this.trackCliFlag("has-conditions")}trackCliFlagMissingConditions(hasMissingConditions){hasMissingConditions&&this.trackCliFlag("missing-conditions")}trackCliFlagResponseHeaders(hasResponseHeaders){hasResponseHeaders&&this.trackCliFlag("response-headers")}trackCliFlagRequestTransforms(hasRequestTransforms){hasRequestTransforms&&this.trackCliFlag("request-transforms")}},RoutesEditTelemetryClient=class extends TelemetryClient{trackCliArgumentNameOrId(id){id&&this.trackCliArgument({arg:"name-or-id",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagNoDest(flag){flag&&this.trackCliFlag("no-dest")}trackCliFlagNoStatus(flag){flag&&this.trackCliFlag("no-status")}trackCliFlagClearConditions(flag){flag&&this.trackCliFlag("clear-conditions")}trackCliFlagClearHeaders(flag){flag&&this.trackCliFlag("clear-headers")}trackCliFlagClearTransforms(flag){flag&&this.trackCliFlag("clear-transforms")}trackCliOptionName(name){name&&this.trackCliOption({option:"name",value:this.redactedValue})}trackCliOptionDescription(desc){desc&&this.trackCliOption({option:"description",value:this.redactedValue})}trackCliOptionSrc(src){src&&this.trackCliOption({option:"src",value:this.redactedValue})}trackCliOptionSrcSyntax(syntax){syntax&&this.trackCliOption({option:"src-syntax",value:syntax})}trackCliOptionAction(action){action&&this.trackCliOption({option:"action",value:action})}trackCliOptionDest(dest){dest&&this.trackCliOption({option:"dest",value:this.redactedValue})}trackCliOptionStatus(status){status!==void 0&&this.trackCliOption({option:"status",value:String(status)})}trackCliOptionSetResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"set-response-header",value:this.redactedValue})}trackCliOptionAppendResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"append-response-header",value:this.redactedValue})}trackCliOptionDeleteResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"delete-response-header",value:this.redactedValue})}trackCliOptionSetRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"set-request-header",value:this.redactedValue})}trackCliOptionAppendRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"append-request-header",value:this.redactedValue})}trackCliOptionDeleteRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"delete-request-header",value:this.redactedValue})}trackCliOptionSetRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"set-request-query",value:this.redactedValue})}trackCliOptionAppendRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"append-request-query",value:this.redactedValue})}trackCliOptionDeleteRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"delete-request-query",value:this.redactedValue})}trackCliOptionHas(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"has",value:this.redactedValue})}trackCliOptionMissing(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"missing",value:this.redactedValue})}trackCliOptionAi(prompt){prompt&&this.trackCliOption({option:"ai",value:this.redactedValue})}};export{RoutesTelemetryClient,RoutesAddTelemetryClient,RoutesEditTelemetryClient};
7
+ import{TelemetryClient}from"./chunk-XDKCDGJF.js";var RoutesTelemetryClient=class extends TelemetryClient{trackCliSubcommandList(actual){this.trackCliSubcommand({subcommand:"list",value:actual})}trackCliSubcommandListVersions(actual){this.trackCliSubcommand({subcommand:"list-versions",value:actual})}trackCliSubcommandInspect(actual){this.trackCliSubcommand({subcommand:"inspect",value:actual})}trackCliSubcommandAdd(actual){this.trackCliSubcommand({subcommand:"add",value:actual})}trackCliSubcommandPublish(actual){this.trackCliSubcommand({subcommand:"publish",value:actual})}trackCliSubcommandRestore(actual){this.trackCliSubcommand({subcommand:"restore",value:actual})}trackCliSubcommandDiscardStaging(actual){this.trackCliSubcommand({subcommand:"discard-staging",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}trackCliSubcommandExport(actual){this.trackCliSubcommand({subcommand:"export",value:actual})}trackCliSubcommandEnable(actual){this.trackCliSubcommand({subcommand:"enable",value:actual})}trackCliSubcommandDisable(actual){this.trackCliSubcommand({subcommand:"disable",value:actual})}trackCliSubcommandReorder(actual){this.trackCliSubcommand({subcommand:"reorder",value:actual})}trackCliSubcommandUpdate(actual){this.trackCliSubcommand({subcommand:"update",value:actual})}},RoutesAddTelemetryClient=class extends TelemetryClient{trackCliArgumentName(name){name&&this.trackCliArgument({arg:"name",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagDisabled(flag){flag&&this.trackCliFlag("disabled")}trackCliOptionSrc(src){src&&this.trackCliOption({option:"src",value:this.redactedValue})}trackCliOptionSrcSyntax(syntax){syntax&&this.trackCliOption({option:"src-syntax",value:syntax})}trackCliOptionAction(action){action&&this.trackCliOption({option:"action",value:action})}trackCliOptionDest(dest){dest&&this.trackCliOption({option:"dest",value:this.redactedValue})}trackCliOptionStatus(status){status!==void 0&&this.trackCliOption({option:"status",value:String(status)})}trackCliOptionPosition(position){if(position){let placement=position.split(":")[0];this.trackCliOption({option:"position",value:placement})}}trackCliOptionDescription(description){description&&this.trackCliOption({option:"description",value:this.redactedValue})}trackCliOptionSetResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"set-response-header",value:this.redactedValue})}trackCliOptionAppendResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"append-response-header",value:this.redactedValue})}trackCliOptionDeleteResponseHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"delete-response-header",value:this.redactedValue})}trackCliOptionSetRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"set-request-header",value:this.redactedValue})}trackCliOptionAppendRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"append-request-header",value:this.redactedValue})}trackCliOptionDeleteRequestHeader(headers){headers&&headers.length>0&&this.trackCliOption({option:"delete-request-header",value:this.redactedValue})}trackCliOptionSetRequestQuery(params){params&&params.length>0&&this.trackCliOption({option:"set-request-query",value:this.redactedValue})}trackCliOptionAppendRequestQuery(params){params&&params.length>0&&this.trackCliOption({option:"append-request-query",value:this.redactedValue})}trackCliOptionDeleteRequestQuery(params){params&&params.length>0&&this.trackCliOption({option:"delete-request-query",value:this.redactedValue})}trackCliOptionHas(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"has",value:this.redactedValue})}trackCliOptionMissing(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"missing",value:this.redactedValue})}trackCliOptionAi(prompt){prompt&&this.trackCliOption({option:"ai",value:this.redactedValue})}trackCliActionType(actionType){this.trackCliOption({option:"action-type",value:actionType})}trackCliFlagHasConditions(hasConditions){hasConditions&&this.trackCliFlag("has-conditions")}trackCliFlagMissingConditions(hasMissingConditions){hasMissingConditions&&this.trackCliFlag("missing-conditions")}trackCliFlagResponseHeaders(hasResponseHeaders){hasResponseHeaders&&this.trackCliFlag("response-headers")}trackCliFlagRequestTransforms(hasRequestTransforms){hasRequestTransforms&&this.trackCliFlag("request-transforms")}},RoutesEditTelemetryClient=class extends TelemetryClient{trackCliArgumentNameOrId(id){id&&this.trackCliArgument({arg:"name-or-id",value:this.redactedValue})}trackCliFlagYes(flag){flag&&this.trackCliFlag("yes")}trackCliFlagNoDest(flag){flag&&this.trackCliFlag("no-dest")}trackCliFlagNoStatus(flag){flag&&this.trackCliFlag("no-status")}trackCliFlagClearConditions(flag){flag&&this.trackCliFlag("clear-conditions")}trackCliFlagClearHeaders(flag){flag&&this.trackCliFlag("clear-headers")}trackCliFlagClearTransforms(flag){flag&&this.trackCliFlag("clear-transforms")}trackCliOptionName(name){name&&this.trackCliOption({option:"name",value:this.redactedValue})}trackCliOptionDescription(desc){desc&&this.trackCliOption({option:"description",value:this.redactedValue})}trackCliOptionSrc(src){src&&this.trackCliOption({option:"src",value:this.redactedValue})}trackCliOptionSrcSyntax(syntax){syntax&&this.trackCliOption({option:"src-syntax",value:syntax})}trackCliOptionAction(action){action&&this.trackCliOption({option:"action",value:action})}trackCliOptionDest(dest){dest&&this.trackCliOption({option:"dest",value:this.redactedValue})}trackCliOptionStatus(status){status!==void 0&&this.trackCliOption({option:"status",value:String(status)})}trackCliOptionSetResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"set-response-header",value:this.redactedValue})}trackCliOptionAppendResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"append-response-header",value:this.redactedValue})}trackCliOptionDeleteResponseHeader(h){h&&h.length>0&&this.trackCliOption({option:"delete-response-header",value:this.redactedValue})}trackCliOptionSetRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"set-request-header",value:this.redactedValue})}trackCliOptionAppendRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"append-request-header",value:this.redactedValue})}trackCliOptionDeleteRequestHeader(h){h&&h.length>0&&this.trackCliOption({option:"delete-request-header",value:this.redactedValue})}trackCliOptionSetRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"set-request-query",value:this.redactedValue})}trackCliOptionAppendRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"append-request-query",value:this.redactedValue})}trackCliOptionDeleteRequestQuery(p){p&&p.length>0&&this.trackCliOption({option:"delete-request-query",value:this.redactedValue})}trackCliOptionHas(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"has",value:this.redactedValue})}trackCliOptionMissing(conditions){conditions&&conditions.length>0&&this.trackCliOption({option:"missing",value:this.redactedValue})}trackCliOptionAi(prompt){prompt&&this.trackCliOption({option:"ai",value:this.redactedValue})}};export{RoutesTelemetryClient,RoutesAddTelemetryClient,RoutesEditTelemetryClient};
@@ -29,9 +29,9 @@ ${commandRows(commands.filter(command=>!command.basic),commands,columns)}
29
29
  --cwd Current working directory
30
30
  -A ${import_chalk.default.bold.underline("FILE")}, --local-config=${import_chalk.default.bold.underline("FILE")} Path to the local \`vercel.json\` file
31
31
  -Q ${import_chalk.default.bold.underline("DIR")}, --global-config=${import_chalk.default.bold.underline("DIR")} Path to the global \`.vercel\` directory
32
- -d, --debug Debug mode [off]
33
- --no-color No color mode [off]
34
- --non-interactive Run without interactive prompts (default when agent detected)
32
+ -d, --debug Debug mode (default: off)
33
+ --no-color No color mode (default: off)
34
+ --non-interactive Run without interactive prompts (default: on when an agent is detected)
35
35
  -S, --scope Set a custom scope
36
36
  -t ${import_chalk.default.underline("TOKEN")}, --token=${import_chalk.default.underline("TOKEN")} Login token
37
37
 
@@ -47,7 +47,7 @@ ${commandRows(commands.filter(command=>!command.basic),commands,columns)}
47
47
 
48
48
  ${import_chalk.default.gray("\u2013")} Deploy with Environment Variables
49
49
 
50
- ${import_chalk.default.cyan(`$ ${packageName} -e NODE_ENV=production`)}
50
+ ${import_chalk.default.cyan(`$ ${packageName} --env NODE_ENV=production`)}
51
51
 
52
52
  ${import_chalk.default.gray("\u2013")} Show the usage information for the sub command ${import_chalk.default.dim("`list`")}
53
53
 
@@ -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{emitAlertsScopeError,resolveAlertsScope}from"./chunk-KXHUMVXD.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-NYKEU7DQ.js";import{getScope}from"./chunk-T5LBVZWY.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-RH2SQQWH.js";import{getProjectByNameOrId}from"./chunk-3XDTQFBL.js";import{ProjectNotFound,isAPIError}from"./chunk-AZ5OUZPP.js";async function resolveRulesTeam(client,jsonOutput){let scope;try{scope=await getScope(client,{resolveLocalScope:!0})}catch(err){if(isAPIError(err)&&(err.status===403||err.status===404))return emitAlertsScopeError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`,{reason:AGENT_REASON.MISSING_SCOPE,hint:"The selected team could not be loaded. Select a team you can access, or pass --scope <team-slug>.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]});throw err}let{team}=scope;return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Monitors belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="monitors ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope};
@@ -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{require_ms}from"./chunk-MXTC4ZAQ.js";import{getTeams}from"./chunk-FPC5LINQ.js";import{AGENT_REASON,outputAgentError}from"./chunk-RH2SQQWH.js";import{findProjectsFromPath,getConfigFilePath,getLinkFromDir,getRepoLink,getUser,getVercelDirectory,inspectTokenRequest,processInspectTokenResponse}from"./chunk-3XDTQFBL.js";import{getTeamByIdOrSlug}from"./chunk-F53OKXYI.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-AZ5OUZPP.js";import{output_manager_default,require_build_utils}from"./chunk-UGZ3HFHI.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function getAppTokenTeamId(client){try{await getUser(client);return}catch{let token=await introspectToken(client).catch(()=>null);return token&&resolveAppFromToken(token)?token.team?.id:void 0}}function assertOrgIdMatchesAppTeam(client,appTeamId){let envOrgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");if(!envOrgId||envOrgId===appTeamId)return;let message=`This token only works with team ${appTeamId}, but VERCEL_ORG_ID is set to ${envOrgId}.`;throw outputAgentError(client,{status:"error",reason:AGENT_REASON.SCOPE_NOT_ACCESSIBLE,message}),new Error(message)}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}var VERCEL_TEAM_SLUG="vercel";function isVercelianFromLoadedTeams(client){return client.teams?.some(team=>team.slug===VERCEL_TEAM_SLUG)===!0}async function isVercelian(client){if(isVercelianFromLoadedTeams(client))return!0;try{return(await getTeams(client)).some(team=>team.slug===VERCEL_TEAM_SLUG)}catch{return!1}}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils2=__toESM(require_build_utils(),1);import{relative}from"path";var import_cli_config2=__toESM(require_cli_config(),1);function isEligibleForNativeBinaryAutoOptIn(client){return isVercelianFromLoadedTeams(client)}function autoOptInNativeBinary(client){let envOverride=process.env.VERCEL_CLI_USE_NATIVE_BINARY;if(!(envOverride==="false"||envOverride==="0"||typeof client.config.useNativeBinary=="boolean"||client.config.nativeBinaryAutoOptIn===!0||!isEligibleForNativeBinaryAutoOptIn(client)))try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config2.readGlobalConfigFile)(configPath);if(typeof savedConfig.useNativeBinary=="boolean"||savedConfig.nativeBinaryAutoOptIn===!0)return;let config={...savedConfig,nativeBinaryAutoOptIn:!0};(0,import_cli_config2.writeGlobalConfigFile)(configPath,config),client.config={...client.config,nativeBinaryAutoOptIn:!0}}catch{output_manager_default.debug("Failed to persist automatic native binary enrollment.")}}async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client);user&&autoOptInNativeBinary(client);let defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils2.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!1}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{introspectToken,isAppPrincipalEnabled,resolveAppFromToken,getAppTokenTeamId,assertOrgIdMatchesAppTeam,resolveAppTokenScope,isVercelian,autoOptInNativeBinary,forgetCachedTeamSlug,getScope,getContextName,getLocalOrgId,scopeFlagPassed,detectExplicitScope};
@@ -0,0 +1,39 @@
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{humanizeReference,renderAlertTable}from"./chunk-RRWEIG6B.js";import{formatDate}from"./chunk-YTDK6AHS.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{buildCommandWithGlobalFlags}from"./chunk-RH2SQQWH.js";import{printAlignedLabel}from"./chunk-WDWYKX2I.js";import{quoteArg}from"./chunk-F53OKXYI.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatBoolean(value){return value?"yes":"no"}function formatOperator(operator){return{gt:">",gte:">=",lt:"<",lte:"<="}[operator]??operator}function formatPublicRuleScope(rule){let scope=rule.ruleScope;return scope.type==="all"?"all projects":scope.type==="project"?`project: ${scope.projectId}`:`${scope.type}: ${scope.projectIds.join(", ")}`}function formatMetricSelection(metric){let modifiers=[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.length?`dimensions ${metric.dimensions.join(", ")}`:void 0].filter(Boolean);return`${metric.aggregation} ${metric.metric}${modifiers.length?` (${modifiers.join("; ")})`:""}`}function formatCustomTrigger(trigger){let minimum=trigger.minimum?`; minimum ${trigger.minimum.output} >= ${trigger.minimum.threshold}`:"";return trigger.type==="anomaly"?`${trigger.output} anomaly at ${trigger.standardDeviations} standard deviations${minimum}`:`${trigger.output} ${formatOperator(trigger.operator)} ${trigger.threshold}${minimum}`}function formatCustomCondition(rule){if(!rule.querySupported)return"Query unavailable via API";let query=rule.evaluation.query,output=query.outputs[0];return`${query.formulas?.[output]?`${output} = ${query.formulas[output]}`:query.metrics[output]?formatMetricSelection(query.metrics[output]):output}; ${formatCustomTrigger(rule.trigger)}; ${rule.evaluation.window}`}function formatBuiltInCondition(rule){return`${rule.triggers.mode==="all"?"all triggers":rule.triggers.items.map(trigger=>humanizeReference(trigger.type)).join(", ")}; minimum ${rule.matchMinimumSeverityLevel}`}function formatRuleCondition(rule){return rule.type==="built-in"?formatBuiltInCondition(rule):formatCustomCondition(rule)}function printRules(rules){let rows=[["Name","Monitor ID","Type","Scope","Condition"].map(header=>import_chalk.default.cyan(header)),...rules.map(rule=>[import_chalk.default.bold(truncateEnd(rule.name,36)),import_chalk.default.dim(rule.id),rule.isDefault?`${rule.type} (default)`:rule.type,truncateMiddle(formatPublicRuleScope(rule),38),truncateEnd(formatRuleCondition(rule),72)])];output_manager_default.print(`
8
+ ${renderAlertTable(rows,2)}
9
+ `)}function commonRows(rule){return[["Name",rule.name],["Monitor ID",rule.id],["Type",rule.type],["Scope",formatPublicRuleScope(rule)],["Default",formatBoolean(rule.isDefault)],...rule.createdAt?[["Created",formatDate(rule.createdAt)]]:[],...rule.updatedAt?[["Updated",formatDate(rule.updatedAt)]]:[]]}function notificationRows(rule){return[["Team owner notifications",formatBoolean(rule.notificationSettings.enableTeamOwnerNotifications)],...rule.notificationSettings.incidentIoRoutingKey?[["Incident.io routing key",rule.notificationSettings.incidentIoRoutingKey]]:[]]}function printBuiltInRule(rule){output_manager_default.print(`${import_chalk.default.cyan("Built-in conditions")}
10
+
11
+ `),rule.triggers.mode==="all"?output_manager_default.print(`${renderAlertTable([["Minimum severity",rule.matchMinimumSeverityLevel],["Triggers","all built-in triggers"]],3)}
12
+ `):output_manager_default.print(`${renderAlertTable([["Minimum severity",rule.matchMinimumSeverityLevel]],3)}
13
+
14
+ ${renderAlertTable([["Trigger","Filter"].map(header=>import_chalk.default.cyan(header)),...rule.triggers.items.map(trigger=>[trigger.type,trigger.filter||"-"])],3)}
15
+ `)}function metricRows(rule){return Object.entries(rule.evaluation.query.metrics).map(([alias,metric])=>[alias,metric.metric,metric.aggregation,[metric.per?`per ${metric.per}`:void 0,metric.normalize?`normalize ${metric.normalize}`:void 0,metric.dimensions?.join(", ")].filter(Boolean).join("; ")||"-",metric.filter||"-"])}function printCustomRule(rule){if(output_manager_default.print(`${import_chalk.default.cyan("Custom alert")}
16
+
17
+ `),!rule.querySupported){output_manager_default.print(` Query unavailable via API. You can update metadata, delete the monitor, or recreate it with a supported query.
18
+ `),output_manager_default.print(`
19
+ ${renderAlertTable([["Severity",rule.severity]],3)}
20
+ `);return}let query=rule.evaluation.query;output_manager_default.print(`${renderAlertTable([["Severity",rule.severity],["Window",rule.evaluation.window],["Output",query.outputs[0]],...query.formulas?Object.entries(query.formulas).map(([alias,formula])=>[`Formula ${alias}`,formula]):[],...query.groupBy?.length?[["Group By",query.groupBy.join(", ")]]:[],...query.filter?[["Query Filter",query.filter]]:[]],3)}
21
+ `),output_manager_default.print(`
22
+ ${import_chalk.default.cyan("Metrics")}
23
+
24
+ `),output_manager_default.print(`${renderAlertTable([["Alias","Metric","Aggregation","Modifiers","Filter"].map(header=>import_chalk.default.cyan(header)),...metricRows(rule)],3)}
25
+ `),output_manager_default.print(`
26
+ ${import_chalk.default.cyan("Trigger")}
27
+
28
+ `),output_manager_default.print(`${renderAlertTable([["Type",rule.trigger.type],["Output",rule.trigger.output],...rule.trigger.type==="threshold"?[["Operator",rule.trigger.operator],["Threshold",String(rule.trigger.threshold)]]:[["Standard Deviations",String(rule.trigger.standardDeviations)]],...rule.trigger.minimum?[["Minimum Output",rule.trigger.minimum.output],["Minimum Threshold",String(rule.trigger.minimum.threshold)]]:[]],3)}
29
+ `)}function printRule(rule){output_manager_default.print(`
30
+ ${import_chalk.default.bold("Monitor")} ${import_chalk.default.cyan(rule.id)}
31
+ ${renderAlertTable(commonRows(rule),3)}
32
+
33
+ ${import_chalk.default.cyan("Notifications")}
34
+
35
+ ${renderAlertTable(notificationRows(rule),3)}
36
+
37
+ `),rule.type==="built-in"?printBuiltInRule(rule):printCustomRule(rule)}function printRulePreview(rule){printAlignedLabel("Name",rule.name),printAlignedLabel("Monitor ID",rule.id),printAlignedLabel("Type",rule.type),printAlignedLabel("Scope",formatPublicRuleScope(rule))}function printRuleDeletionReceipt(ruleId){output_manager_default.print(`
38
+ `),printAlignedLabel("Removed",ruleId,{gutter:"\u2713"})}function printRuleMutationReceipt(action,rule,argv){output_manager_default.print(`
39
+ `),printAlignedLabel(action,rule.name,{gutter:"\u2713"}),printAlignedLabel("Monitor ID",rule.id),printAlignedLabel("Type",rule.type),printAlignedLabel("Scope",formatPublicRuleScope(rule)),action!=="Removed"&&printAlignedLabel("Inspect",buildCommandWithGlobalFlags(argv,`monitors inspect ${quoteArg(rule.id)}`))}export{printRules,printRule,printRulePreview,printRuleDeletionReceipt,printRuleMutationReceipt};
@@ -23,5 +23,5 @@ ${action}: ${link_default(details)}`:""))),this.print(`
23
23
  `)};this.formatStatus=(label,tone)=>{let colors={success:import_chalk3.default.green,pending:import_chalk3.default.yellow,error:import_chalk3.default.red,muted:import_chalk3.default.gray};return`${this.colorDisabled?chars_default.dot:colors[tone](chars_default.dot)} ${label}`};this.prettyError=err=>{if(recordCliError(cliErrorFromUnknown(err)),err instanceof Diagnostic){let code=err.name&&err.name!=="Diagnostic"?err.name:void 0,str=code?`${import_chalk3.default.dim(`[${code}]`)} ${(0,import_error_utils.errorToString)(err)}`:(0,import_error_utils.errorToString)(err);err.fix&&(str+=`
24
24
  ${import_chalk3.default.bold("Fix:")} ${err.fix}`);let action=err.action;return this.error(str,void 0,err.docs,action??"Learn More")}return this.error((0,import_error_utils.errorToString)(err),void 0,err.link,err.action)};this.ready=str=>{this.print(`${import_chalk3.default.cyan("> Ready!")} ${str}
25
25
  `)};this.success=str=>{this.print(`${import_chalk3.default.cyan("> Success!")} ${str}
26
- `)};this.debug=debug=>{this.debugEnabled&&this.log(`${import_chalk3.default.bold("[debug]")} ${import_chalk3.default.gray(`[${new Date().toISOString()}]`)} ${debugToString(debug)}`)};this.spinner=(message,delay=300)=>{if(this.debugEnabled){this.debug(`Spinner invoked (${message}) with a ${delay}ms delay`);return}IS_TEST||!this.stream.isTTY?this.print(`${message}
27
- `):(this.spinnerMessage=message,this._spinner?this._spinner.text=message:this._spinner=wait({text:message,stream:this.stream},delay))};this.stopSpinner=()=>{if(this.debugEnabled&&this.spinnerMessage){let msg=`Spinner stopped (${this.spinnerMessage})`;this.spinnerMessage="",this.debug(msg)}this._spinner&&(this._spinner(),this._spinner=null,this.spinnerMessage="")};this.time=async(label,fn)=>{let promise=typeof fn=="function"?fn():fn;if(this.debugEnabled){let startLabel=typeof label=="function"?label():label;this.debug(startLabel);let start=Date.now(),r=await promise,endLabel=typeof label=="function"?label(r):label,duration=Date.now()-start,durationPretty=duration<1e3?`${duration}ms`:`${(duration/1e3).toFixed(2)}s`;return this.debug(`${endLabel} ${import_chalk3.default.gray(`[${durationPretty}]`)}`),r}return promise};this.link=(text,url,{fallback,color=import_chalk3.default.cyan}={})=>this.supportsHyperlink?ansiEscapes2.link(color?color(text):text,url):fallback===!1?link_default(text):typeof fallback=="function"?fallback():`${text} (${link_default(url)})`;this.spinnerMessage="",this._spinner=null,this.initialize({...options,stream})}initialize({stream,debug:debugEnabled,supportsHyperlink,noColor}={}){stream!==void 0&&(this.stream=stream),debugEnabled!==void 0&&(this.debugEnabled=debugEnabled),supportsHyperlink===void 0?this.supportsHyperlink=(0,import_supports_hyperlinks.supportsHyperlink)(this.stream):this.supportsHyperlink=supportsHyperlink,noColor!==void 0&&(this.colorDisabled=getNoColor(noColor),this.colorDisabled?(defaultChalkColorLevel=import_chalk3.default.level,import_chalk3.default.level=0):import_chalk3.default.level=defaultChalkColorLevel)}};function getNoColor(noColorArg){return!!(process.env.FORCE_COLOR==="0"||process.env.NO_COLOR==="1"||noColorArg)}function debugToString(debug){return typeof debug=="string"?debug:inspect(debug)}var output=new Output(process.stderr,{debug:!1}),output_manager_default=output;export{link_default,require_signal_exit,eraseLines,Diagnostic,defineDiagnostics,dist_exports,init_dist,emoji,prependEmoji,chars_default,UNCLASSIFIED_ERROR_CODE,cliErrorFromUnknown,recordCliError,recordCliErrorFromOutput,takeCliError,output_manager_default,require_build_utils};
26
+ `)};this.debug=debug=>{this.debugEnabled&&this.log(`${import_chalk3.default.bold("[debug]")} ${import_chalk3.default.gray(`[${new Date().toISOString()}]`)} ${debugToString(debug)}`)};this.spinner=(message,delay=300)=>{if(this.debugEnabled){this.debug(`Spinner invoked (${message}) with a ${delay}ms delay`);return}this.spinnersHidden||(IS_TEST||!this.stream.isTTY?this.print(`${message}
27
+ `):(this.spinnerMessage=message,this._spinner?this._spinner.text=message:this._spinner=wait({text:message,stream:this.stream},delay)))};this.stopSpinner=()=>{if(this.debugEnabled&&this.spinnerMessage){let msg=`Spinner stopped (${this.spinnerMessage})`;this.spinnerMessage="",this.debug(msg)}this._spinner&&(this._spinner(),this._spinner=null,this.spinnerMessage="")};this.time=async(label,fn)=>{let promise=typeof fn=="function"?fn():fn;if(this.debugEnabled){let startLabel=typeof label=="function"?label():label;this.debug(startLabel);let start=Date.now(),r=await promise,endLabel=typeof label=="function"?label(r):label,duration=Date.now()-start,durationPretty=duration<1e3?`${duration}ms`:`${(duration/1e3).toFixed(2)}s`;return this.debug(`${endLabel} ${import_chalk3.default.gray(`[${durationPretty}]`)}`),r}return promise};this.link=(text,url,{fallback,color=import_chalk3.default.cyan}={})=>this.supportsHyperlink?ansiEscapes2.link(color?color(text):text,url):fallback===!1?link_default(text):typeof fallback=="function"?fallback():`${text} (${link_default(url)})`;this.spinnerMessage="",this._spinner=null,this.spinnersHidden=!1,this.initialize({...options,stream})}initialize({stream,debug:debugEnabled,supportsHyperlink,noColor,hideSpinners}={}){stream!==void 0&&(this.stream=stream),hideSpinners!==void 0&&(this.spinnersHidden=hideSpinners),debugEnabled!==void 0&&(this.debugEnabled=debugEnabled),supportsHyperlink===void 0?this.supportsHyperlink=(0,import_supports_hyperlinks.supportsHyperlink)(this.stream):this.supportsHyperlink=supportsHyperlink,noColor!==void 0&&(this.colorDisabled=getNoColor(noColor),this.colorDisabled?(defaultChalkColorLevel=import_chalk3.default.level,import_chalk3.default.level=0):import_chalk3.default.level=defaultChalkColorLevel)}};function getNoColor(noColorArg){return!!(process.env.FORCE_COLOR==="0"||process.env.NO_COLOR==="1"||noColorArg)}function debugToString(debug){return typeof debug=="string"?debug:inspect(debug)}var output=new Output(process.stderr,{debug:!1}),output_manager_default=output;export{link_default,require_signal_exit,eraseLines,Diagnostic,defineDiagnostics,dist_exports,init_dist,emoji,prependEmoji,chars_default,UNCLASSIFIED_ERROR_CODE,cliErrorFromUnknown,recordCliError,recordCliErrorFromOutput,takeCliError,output_manager_default,require_build_utils};
@@ -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{formatOption,jsonOption,limitOption,nextCursorOption,projectOption,yesOption}from"./chunk-ODB7LEAO.js";import{packageName}from"./chunk-JESNVRVR.js";var commentsProjectOption={...projectOption,shorthand:"p",description:"Project ID or name (default: linked project)"},messageContentOption={name:"message",shorthand:"m",type:String,argument:"TEXT",deprecated:!1,description:"Markdown message content"},fileOption={name:"file",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read Markdown content from a file; use `-` for stdin"},attachOption={name:"attach",shorthand:null,type:[String],argument:"URL",deprecated:!1,description:"Attach a file by https URL (repeatable, max 10)"},listSubcommand={name:"list",aliases:["ls"],default:!0,description:"List comments for a project",arguments:[],options:[commentsProjectOption,{name:"branch",shorthand:null,type:[String],argument:"BRANCH",deprecated:!1,description:"Filter by Git branch (repeatable) (default: the current branch when inferable)"},{name:"all-branches",shorthand:null,type:Boolean,deprecated:!1,description:"Show comments from every branch"},{name:"status",shorthand:null,type:String,argument:"STATUS",deprecated:!1,description:"unresolved, resolved, or all (default: unresolved)"},{name:"page-path",shorthand:null,type:[String],argument:"PATH",deprecated:!1,description:"Filter by recorded page path or glob (repeatable). Note: rewrites may record a different path than the browser URL"},{name:"page",shorthand:null,type:[String],argument:"PATH",deprecated:!0,description:"Filter by recorded page path or glob"},{name:"author",shorthand:null,type:[String],argument:"USER",deprecated:!1,description:"Filter by author user ID, or `me` (repeatable)"},{name:"content-id",shorthand:null,type:[String],argument:"ID",deprecated:!1,description:"Filter by CMS content ID (repeatable)"},{name:"search",shorthand:null,type:String,argument:"TEXT",deprecated:!1,description:"Search comment content"},limitOption,nextCursorOption,formatOption,jsonOption],examples:[{name:"List unresolved comments for the linked project",value:`${packageName} comments`},{name:"List comments on every branch",value:`${packageName} comments --all-branches --status all`},{name:"List comments as JSON",value:`${packageName} comments --json | jq '.threads[].id'`}]},inspectSubcommand={name:"inspect",aliases:["get"],description:"Show a comment thread with its full conversation",arguments:[{name:"thread",required:!1}],options:[commentsProjectOption,{name:"context",shorthand:null,type:Boolean,deprecated:!1,description:"Include framework and device context"},formatOption,jsonOption],examples:[{name:"Inspect a comment thread",value:`${packageName} comments inspect icZ9BnPPINuK`},{name:"Inspect a comment from its URL",value:`${packageName} comments inspect https://vercel.com/team/project/c/icZ9BnPPINuK`},{name:"Pick a comment interactively",value:`${packageName} comments inspect`},{name:"Inspect a thread whose ID starts with a dash",value:`${packageName} comments inspect -- -ULOL`}]},openSubcommand={name:"open",aliases:[],description:"Open a comment thread on vercel.com",arguments:[{name:"thread",required:!0}],options:[commentsProjectOption],examples:[{name:"Open a comment in the browser",value:`${packageName} comments open icZ9BnPPINuK`}]},replySubcommand={name:"reply",aliases:[],description:"Reply to a comment thread",arguments:[{name:"thread",required:!0}],options:[commentsProjectOption,messageContentOption,fileOption,attachOption,formatOption,jsonOption],examples:[{name:"Reply to a comment",value:`${packageName} comments reply icZ9BnPPINuK -m 'Fixed in **main**.'`},{name:"Reply from stdin",value:`git log -1 --format=%s | ${packageName} comments reply icZ9BnPPINuK`}]},resolveSubcommand={name:"resolve",aliases:[],description:"Resolve comment threads, optionally with a closing reply",arguments:[{name:"thread",required:!0,multiple:!0}],options:[commentsProjectOption,messageContentOption,yesOption,formatOption,jsonOption],examples:[{name:"Resolve a comment",value:`${packageName} comments resolve icZ9BnPPINuK`},{name:"Reply and resolve in one step",value:`${packageName} comments resolve icZ9BnPPINuK -m 'Fixed in the latest deployment'`}]},reopenSubcommand={name:"reopen",aliases:[],description:"Reopen resolved comment threads",arguments:[{name:"thread",required:!0,multiple:!0}],options:[commentsProjectOption,yesOption,formatOption,jsonOption],examples:[{name:"Reopen a comment",value:`${packageName} comments reopen icZ9BnPPINuK`}]},editSubcommand={name:"update",aliases:["edit"],description:"Update a comment message while preserving its attachments",arguments:[{name:"thread",required:!0},{name:"message-id",required:!0}],options:[commentsProjectOption,messageContentOption,fileOption,formatOption,jsonOption],examples:[{name:"Update a message",value:`${packageName} comments update icZ9BnPPINuK VvkhYF6dTqbpm7K -m 'Updated wording'`}]},deleteSubcommand={name:"delete",aliases:["rm","del"],description:"Delete a comment message",arguments:[{name:"thread",required:!0},{name:"message-id",required:!0}],options:[commentsProjectOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a message",value:`${packageName} comments delete icZ9BnPPINuK VvkhYF6dTqbpm7K`}]},commentsCommand={name:"comments",aliases:[],description:"Review and act on Vercel Toolbar comments from the command line",arguments:[],subcommands:[listSubcommand,inspectSubcommand,openSubcommand,replySubcommand,resolveSubcommand,reopenSubcommand,editSubcommand,deleteSubcommand],options:[],examples:[{name:"Review unresolved comments for the linked project",value:`${packageName} comments`},{name:"Inspect a comment and reply",value:`${packageName} comments inspect icZ9BnPPINuK`},{name:"Reply and resolve in one step",value:`${packageName} comments resolve icZ9BnPPINuK -m 'Fixed!'`}]};export{listSubcommand,inspectSubcommand,openSubcommand,replySubcommand,resolveSubcommand,reopenSubcommand,editSubcommand,deleteSubcommand,commentsCommand};
@@ -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{formatOption,jsonOption}from"./chunk-ODB7LEAO.js";import{packageName}from"./chunk-JESNVRVR.js";var specUrlOption={name:"spec-url",shorthand:null,type:String,argument:"URL",deprecated:!1,description:"Fetch endpoints from a custom OpenAPI spec URL instead of the public Vercel spec"},listSubcommand={name:"list",aliases:["ls"],description:"List all available API endpoints",arguments:[],options:[formatOption,jsonOption,specUrlOption,{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"}],examples:[{name:"List all endpoints in table format",value:`${packageName} api list`},{name:"List all endpoints as JSON",value:`${packageName} api list --json`},{name:"List endpoints from a custom OpenAPI spec",value:`${packageName} api list --spec-url https://openapi-internal.vercel.sh --refresh`}]},apiCommand={name:"api",aliases:[],description:"Make authenticated HTTP requests to the Vercel API",arguments:[{name:"endpoint",required:!1}],subcommands:[listSubcommand],options:[{name:"method",shorthand:"X",type:String,argument:"METHOD",deprecated:!1,description:"HTTP method (GET, POST, PUT, PATCH, DELETE) (default: GET, or POST if body is provided)"},{name:"field",shorthand:"F",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a typed parameter (numbers, booleans parsed). Use @file for file contents"},{name:"raw-field",shorthand:"f",type:[String],argument:"KEY=VALUE",deprecated:!1,description:"Add a string option (no type parsing)"},{name:"header",shorthand:"H",type:[String],argument:"KEY:VALUE",deprecated:!1,description:"Add a custom HTTP header"},{name:"input",shorthand:null,type:String,argument:"FILE",deprecated:!1,description:"Read request body from file (use - for stdin)"},{name:"paginate",shorthand:null,type:Boolean,deprecated:!1,description:"Fetch all pages of results"},{name:"include",shorthand:"i",type:Boolean,deprecated:!1,description:"Include response headers in output"},{name:"silent",shorthand:null,type:Boolean,deprecated:!1,description:"Suppress response output"},{name:"verbose",shorthand:null,type:Boolean,deprecated:!1,description:"Show debug information including full request/response"},{name:"raw",shorthand:null,type:Boolean,deprecated:!1,description:"Output raw JSON without pretty-printing (default: on when output is piped)"},{name:"refresh",shorthand:null,type:Boolean,deprecated:!1,description:"Force refresh the cached OpenAPI spec"},specUrlOption,{name:"generate",shorthand:null,type:String,argument:"FORMAT",deprecated:!1,description:"Generate output instead of executing (e.g., --generate=curl)"},{name:"dangerously-skip-permissions",shorthand:null,type:Boolean,deprecated:!1,description:"Skip confirmation prompts for DELETE operations (use with caution)"}],examples:[{name:"Get current user information",value:`${packageName} api /v2/user`},{name:"List projects with team scope",value:`${packageName} api /v9/projects --scope my-team`},{name:"Create a new project",value:`${packageName} api /v10/projects -X POST -F name=my-project`},{name:"Delete a deployment",value:`${packageName} api /v13/deployments/dpl_abc123 -X DELETE`},{name:"Paginate through all deployments",value:`${packageName} api /v6/deployments --paginate`},{name:"Post JSON from file",value:`${packageName} api /v10/projects -X POST --input config.json`},{name:"Add custom header",value:`${packageName} api /v2/user -H "X-Custom-Header: value"`},{name:"Interactive mode (select endpoint)",value:`${packageName} api`},{name:"Interactive mode with a custom OpenAPI spec",value:`${packageName} api --spec-url https://openapi-internal.vercel.sh --refresh`}]};export{listSubcommand,apiCommand};
@@ -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{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-ODB7LEAO.js";import{packageName}from"./chunk-JESNVRVR.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Continue from a previous response",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},imageLsSubcommand={name:"ls",aliases:["list"],description:"List images in a container registry repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"untagged",shorthand:null,type:Boolean,deprecated:!1,description:"Only list images that have no tags"},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List images in a repository",value:`${packageName} vcr image ls my-app`},{name:"List untagged images as JSON",value:`${packageName} vcr image ls my-app --untagged --json`}]},imageInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single image, including its layer history",arguments:[{name:"repository",required:!0},{name:"imageId",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect an image by id",value:`${packageName} vcr image inspect my-app img_abc123`}]},imageRmSubcommand={name:"delete",aliases:["rm","del","remove"],description:"Delete an image from a repository",arguments:[{name:"repository",required:!0},{name:"imageId",required:!0}],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete an image by id",value:`${packageName} vcr image delete my-app img_abc123`},{name:"Delete an image without the confirmation prompt",value:`${packageName} vcr image delete my-app img_abc123 --yes`}]},imageAggregateCommand={name:"image",aliases:["images"],description:"List, inspect, or delete images in a repository",arguments:[],subcommands:[imageLsSubcommand,imageInspectSubcommand,imageRmSubcommand],options:[],examples:[]};export{imageLsSubcommand,imageInspectSubcommand,imageRmSubcommand,imageAggregateCommand};
@@ -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{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR}from"./chunk-JIGCN5QS.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-XSDAUM4F.js";import{output_manager_default,require_build_utils}from"./chunk-M774HRX5.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
7
+ import{VERCEL_CONFIG_EXTENSIONS,VERCEL_DIR}from"./chunk-3XDTQFBL.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-AZ5OUZPP.js";import{output_manager_default,require_build_utils}from"./chunk-UGZ3HFHI.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
8
8
  `).forEach(function(line){var keyValueArr=line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);if(keyValueArr!=null){var key=keyValueArr[1],value=keyValueArr[2]?keyValueArr[2]:"",len=value?value.length:0;len>0&&value.charAt(0)==='"'&&value.charAt(len-1)==='"'&&(value=value.replace(/\\n/gm,`
9
9
  `)),value=value.replace(/(^['"]|['"]$)/g,"").trim(),obj[key]=value}}),obj}function config(options){var path=".env",encoding="utf8";options&&(options.path&&(path=options.path),options.encoding&&(encoding=options.encoding));try{var parsedObj=parse(fs.readFileSync(path,{encoding}));return Object.keys(parsedObj).forEach(function(key){process.env[key]=process.env[key]||parsedObj[key]}),{parsed:parsedObj}}catch(e){return{error:e}}}module.exports.config=config;module.exports.load=config;module.exports.parse=parse}});var import_dotenv=__toESM(require_main(),1);import{mkdir,readFile,writeFile,unlink,access}from"fs/promises";import{join,basename}from"path";import{fork}from"child_process";async function loadEsbuild(){let nativeLoader=Reflect.get(globalThis,Symbol.for("vercel.cli.loadEsbuild"));return typeof nativeLoader=="function"?nativeLoader():import("esbuild")}var import_build_utils=__toESM(require_build_utils(),1);function toRouteFormat(item){if("src"in item)return item;let{source,destination,headers,statusCode,permanent,...rest}=item,route={src:source,...rest};return destination&&(route.dest=destination),headers&&(route.headers=Object.fromEntries(headers.map(h=>[h.key,h.value]))),statusCode!==void 0?route.status=statusCode:permanent!==void 0&&(route.status=permanent?308:307),route}function normalizeConfig(config){let normalized={...config},{rewrites,redirects,headers}=normalized,allRoutes=normalized.routes||[],hasRoutes=allRoutes.length>0,hasRewrites=(rewrites?.length??0)>0,hasRedirects=(redirects?.length??0)>0,hasHeaders=(headers?.length??0)>0;function hasRouteFormat(items){return items?.some(item=>"src"in item)??!1}if(hasRoutes&&(hasRewrites||hasRedirects||hasHeaders))return normalized;let shouldConvertRewrites=hasRewrites&&hasRouteFormat(rewrites),shouldConvertRedirects=hasRedirects&&hasRouteFormat(redirects),shouldConvertHeaders=hasHeaders&&hasRouteFormat(headers);if((shouldConvertRewrites||shouldConvertRedirects||shouldConvertHeaders)&&(hasRewrites&&!shouldConvertRewrites||hasRedirects&&!shouldConvertRedirects||hasHeaders&&!shouldConvertHeaders))throw new import_build_utils.NowBuildError({code:"INVALID_VERCEL_CONFIG",message:"Transforms (e.g., requestHeaders) require the `routes` format, which cannot be used alongside `rewrites`, `redirects`, or `headers`. Move everything into the `routes` array instead.",link:"https://vercel.com/docs/projects/project-configuration#routes"});return rewrites&&shouldConvertRewrites&&(allRoutes=[...allRoutes,...rewrites.map(toRouteFormat)],delete normalized.rewrites),redirects&&shouldConvertRedirects&&(allRoutes=[...allRoutes,...redirects.map(toRouteFormat)],delete normalized.redirects),headers&&shouldConvertHeaders&&(allRoutes=[...allRoutes,...headers.map(toRouteFormat)],delete normalized.headers),allRoutes.length>0&&(normalized.routes=allRoutes.map(toRouteFormat)),normalized}async function fileExists(filePath){try{return await access(filePath),!0}catch{return!1}}async function findAllVercelConfigFiles(workPath){let foundFiles=[];for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);await fileExists(configPath)&&foundFiles.push(configPath)}return foundFiles}async function findSourceVercelConfigFile(workPath){for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);if(await fileExists(configPath))return basename(configPath)}let tomlPath=join(workPath,"vercel.toml");return await fileExists(tomlPath)?"vercel.toml":null}async function findVercelConfigFile(workPath){let foundFiles=await findAllVercelConfigFiles(workPath);if(foundFiles.length>1)throw new ConflictingConfigFiles(foundFiles,"Multiple vercel config files found. Please use only one configuration file.","https://vercel.com/docs/projects/project-configuration");return foundFiles[0]||null}function parseConfigLoaderError(stderr){if(!stderr.trim())return"";let moduleNotFoundMatch=stderr.match(/Error \[ERR_MODULE_NOT_FOUND\]: Cannot find package '([^']+)'/);if(moduleNotFoundMatch)return`Cannot find package '${moduleNotFoundMatch[1]}'. Make sure it's installed in your project dependencies.`;let syntaxErrorMatch=stderr.match(/SyntaxError: (.+?)(?:\n|$)/);if(syntaxErrorMatch)return`Syntax error: ${syntaxErrorMatch[1]}`;let errorMatch=stderr.match(/^(?:Error|TypeError|ReferenceError): (.+?)(?:\n|$)/m);return errorMatch?errorMatch[1]:stderr.trim()}async function compileVercelConfig(workPath){let vercelJsonPath=join(workPath,"vercel.json"),nowJsonPath=join(workPath,"now.json"),vercelTomlPath=join(workPath,"vercel.toml"),hasVercelJson=await fileExists(vercelJsonPath),hasNowJson=await fileExists(nowJsonPath),hasVercelToml=await fileExists(vercelTomlPath),vercelConfigPath=await findVercelConfigFile(workPath),vercelDir=join(workPath,VERCEL_DIR),compiledConfigPath=join(vercelDir,"vercel.json");if(hasNowJson)throw new DeprecatedNowJson(nowJsonPath);let foundConfigs=[];if(hasVercelJson&&foundConfigs.push(vercelJsonPath),hasVercelToml&&foundConfigs.push(vercelTomlPath),vercelConfigPath&&foundConfigs.push(vercelConfigPath),foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs,`Multiple config files found: ${foundConfigs.map(f=>basename(f)).join(", ")}. Please use only one configuration method.`,"https://vercel.com/docs/projects/project-configuration");if(!vercelConfigPath&&!hasVercelToml)return hasVercelJson?{configPath:vercelJsonPath,wasCompiled:!1}:await fileExists(compiledConfigPath)?{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:await findSourceVercelConfigFile(workPath)??void 0}:{configPath:null,wasCompiled:!1};if(hasVercelToml)try{let{parse:tomlParse}=await import("smol-toml"),tomlContent=await readFile(vercelTomlPath,"utf8"),config=tomlParse(tomlContent),normalizedConfig=normalizeConfig(config);return await mkdir(vercelDir,{recursive:!0}),await writeFile(compiledConfigPath,JSON.stringify(normalizedConfig,null,2),"utf-8"),output_manager_default.debug(`Compiled ${vercelTomlPath} -> ${compiledConfigPath}`),{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:"vercel.toml"}}catch(error){throw new import_build_utils.NowBuildError({code:error.code??"vercel_toml_parse_failed",message:`Failed to parse vercel.toml: ${error.message}`,link:error.link??"https://vercel.com/docs/projects/project-configuration"})}let sourceConfigPath=vercelConfigPath;(0,import_dotenv.config)({path:join(workPath,".env")}),(0,import_dotenv.config)({path:join(workPath,".env.local")});let tempOutPath=join(vercelDir,"vercel-temp.mjs"),loaderPath=join(vercelDir,"vercel-loader.mjs");try{let{build}=await loadEsbuild();await mkdir(vercelDir,{recursive:!0}),await build({entryPoints:[sourceConfigPath],bundle:!0,platform:"node",format:"esm",outfile:tempOutPath,packages:"external",target:"node20",sourcemap:"inline"}),await writeFile(loaderPath,`
10
10
  import { pathToFileURL } from 'url';