@vercel/cli-support 65.9.0 → 65.10.0-snapshot-c80a43d75dc7

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 (271) hide show
  1. package/dist/chunks/add-A3SN7KWS.js +8 -0
  2. package/dist/chunks/add-RFPJCD35.js +8 -0
  3. package/dist/chunks/add-TOKTANDW.js +8 -0
  4. package/dist/chunks/build-25I6XOV7.js +7 -0
  5. package/dist/chunks/{chunk-5M3WBT3N.js → chunk-22UXDTCE.js} +1 -1
  6. package/dist/chunks/chunk-2AMO2VMV.js +68 -0
  7. package/dist/chunks/{chunk-U6KJOCXX.js → chunk-2DHDKWYN.js} +1 -1
  8. package/dist/chunks/chunk-2EFBGKRC.js +8 -0
  9. package/dist/chunks/{chunk-UOQGI6CL.js → chunk-2HLYY3KF.js} +1 -1
  10. package/dist/chunks/{chunk-7PGGP2QT.js → chunk-2JCJP43W.js} +1 -1
  11. package/dist/chunks/chunk-2VBFQZ72.js +7 -0
  12. package/dist/chunks/{chunk-EXLKCL5I.js → chunk-3AX7ZZJ7.js} +1 -1
  13. package/dist/chunks/{chunk-CMHL66LK.js → chunk-3F5BOG4A.js} +1 -1
  14. package/dist/chunks/chunk-3PXE5BLH.js +7 -0
  15. package/dist/chunks/{chunk-BZNRYQ6U.js → chunk-3WYSEF57.js} +1 -1
  16. package/dist/chunks/{chunk-EW62WSXG.js → chunk-4JWAXIIN.js} +1 -1
  17. package/dist/chunks/{chunk-R5ZLTWKB.js → chunk-4LGAV2WN.js} +1 -1
  18. package/dist/chunks/{chunk-7WY7ASKE.js → chunk-56UH6NQ3.js} +1 -1
  19. package/dist/chunks/{chunk-MXURT5TX.js → chunk-5I7CC45F.js} +1 -1
  20. package/dist/chunks/{chunk-QQA2OMXJ.js → chunk-5KE67O45.js} +1 -1
  21. package/dist/chunks/{chunk-4XJVEKTD.js → chunk-6AJWRPTY.js} +1 -1
  22. package/dist/chunks/{chunk-EBBDSEEU.js → chunk-6RUAAORO.js} +1 -1
  23. package/dist/chunks/{chunk-TRZDIAX3.js → chunk-77LSSWXL.js} +1 -1
  24. package/dist/chunks/{chunk-2JXQWOK5.js → chunk-7UFI6OYF.js} +1 -1
  25. package/dist/chunks/{chunk-EVH5524J.js → chunk-7ULLVH2G.js} +1 -1
  26. package/dist/chunks/{chunk-GHEGWXH2.js → chunk-ANCWFEOM.js} +1 -1
  27. package/dist/chunks/{chunk-7ULVGK67.js → chunk-BB5UMZMF.js} +1 -1
  28. package/dist/chunks/{chunk-4Z3APEBF.js → chunk-BJXLR2RE.js} +1 -1
  29. package/dist/chunks/{chunk-Y6WXTTZS.js → chunk-BPRGAX62.js} +1 -1
  30. package/dist/chunks/{chunk-G6HUSV7F.js → chunk-BZV2S4H6.js} +1 -1
  31. package/dist/chunks/{chunk-QY5RG6BB.js → chunk-C24IKNZN.js} +1 -1
  32. package/dist/chunks/chunk-C4N4LKPM.js +7 -0
  33. package/dist/chunks/chunk-CFYTFXX6.js +7 -0
  34. package/dist/chunks/chunk-CKTLP5GX.js +7 -0
  35. package/dist/chunks/{chunk-GCPPL24C.js → chunk-CUBRYWA2.js} +1 -1
  36. package/dist/chunks/{chunk-M73W4XNR.js → chunk-CZOD25BC.js} +1 -1
  37. package/dist/chunks/{chunk-UIJYRI3G.js → chunk-DBPN2VGJ.js} +1 -1
  38. package/dist/chunks/{chunk-IFCMWIRB.js → chunk-DRLGZXAL.js} +1 -1
  39. package/dist/chunks/{chunk-QKWJN6OE.js → chunk-DX2OHM56.js} +1 -1
  40. package/dist/chunks/{chunk-XBWISZCG.js → chunk-EJ34DLV4.js} +1 -1
  41. package/dist/chunks/{chunk-T5TOBY4D.js → chunk-EJZNJN4N.js} +1 -1
  42. package/dist/chunks/{chunk-TMXIVQ45.js → chunk-F2LNGJOZ.js} +1 -1
  43. package/dist/chunks/{chunk-G3LWP5CH.js → chunk-FAVZ6WVS.js} +1 -1
  44. package/dist/chunks/{chunk-D4ZEJM3T.js → chunk-FI5O4WHD.js} +1 -1
  45. package/dist/chunks/{chunk-UVE5COCG.js → chunk-FOQD62WW.js} +1 -1
  46. package/dist/chunks/{chunk-PBX7RJ2K.js → chunk-FPYHB76H.js} +1 -1
  47. package/dist/chunks/{chunk-4SJU5QSD.js → chunk-FQVIWQ6M.js} +1 -1
  48. package/dist/chunks/chunk-FTACGWII.js +14 -0
  49. package/dist/chunks/{chunk-FWTBSC7Z.js → chunk-FY4ORPZH.js} +1 -1
  50. package/dist/chunks/{chunk-VBKFCR5W.js → chunk-G5T6UQAL.js} +1 -1
  51. package/dist/chunks/chunk-G7H33IKQ.js +10 -0
  52. package/dist/chunks/{chunk-33U57CNE.js → chunk-GKALP6QD.js} +1 -1
  53. package/dist/chunks/{chunk-WGWGDC3N.js → chunk-GPISCZ2P.js} +1 -1
  54. package/dist/chunks/{chunk-DUPAU76G.js → chunk-HJ45TAM4.js} +1 -1
  55. package/dist/chunks/chunk-HR462OEG.js +10 -0
  56. package/dist/chunks/{chunk-JOXGYP5S.js → chunk-JVNIDSP5.js} +1 -1
  57. package/dist/chunks/chunk-KMPDQE4Q.js +7 -0
  58. package/dist/chunks/{chunk-OZPBJWYU.js → chunk-KNAOHPOI.js} +8 -8
  59. package/dist/chunks/{chunk-4OTI552J.js → chunk-KWXJIVBG.js} +1 -1
  60. package/dist/chunks/{chunk-QJAIUZVZ.js → chunk-L4QQTYUI.js} +5 -5
  61. package/dist/chunks/{chunk-43P35KUA.js → chunk-L6CZL2IQ.js} +1 -1
  62. package/dist/chunks/{chunk-6RCFEJZK.js → chunk-LC4BSDDG.js} +1 -1
  63. package/dist/chunks/{chunk-ZERZX6BZ.js → chunk-LQAQD5LG.js} +2 -2
  64. package/dist/chunks/{chunk-2DODPQ5J.js → chunk-MBL7MWP5.js} +1 -1
  65. package/dist/chunks/{chunk-VZKQP67Q.js → chunk-MKYFAYCD.js} +1 -1
  66. package/dist/chunks/{chunk-D2JHIOVH.js → chunk-MOF4QNZH.js} +1 -1
  67. package/dist/chunks/{chunk-32AS5X7G.js → chunk-MUNGQJGO.js} +1 -1
  68. package/dist/chunks/{chunk-UZTDRGCW.js → chunk-NAEY6HG5.js} +1 -1
  69. package/dist/chunks/{chunk-E5CN62HO.js → chunk-NAJCRBQB.js} +1 -1
  70. package/dist/chunks/{chunk-GN5IAG3M.js → chunk-NGHFFOD2.js} +1 -1
  71. package/dist/chunks/{chunk-4BZ3DNGM.js → chunk-NLKM5LR5.js} +1 -1
  72. package/dist/chunks/{chunk-NEUQZYBL.js → chunk-PMEYNJU2.js} +1 -1
  73. package/dist/chunks/{chunk-5K4UTJSY.js → chunk-PXQAWH7E.js} +1 -1
  74. package/dist/chunks/{chunk-SNCQOAFU.js → chunk-Q25FOMOX.js} +1 -1
  75. package/dist/chunks/{chunk-BWS3ZOHJ.js → chunk-Q4GX2UTG.js} +1 -1
  76. package/dist/chunks/{chunk-CBVVVYUP.js → chunk-QCIIUQV3.js} +1 -1
  77. package/dist/chunks/chunk-QGZZL6YY.js +7 -0
  78. package/dist/chunks/{chunk-GCXUSXB4.js → chunk-QVMU7ZKQ.js} +1 -1
  79. package/dist/chunks/{chunk-DASHFOKO.js → chunk-QXYCICNB.js} +1 -1
  80. package/dist/chunks/{chunk-ZGKJLJ47.js → chunk-R2P4PNRQ.js} +1 -1
  81. package/dist/chunks/{chunk-Y5YXAXK3.js → chunk-R3D4M5RE.js} +1 -1
  82. package/dist/chunks/{chunk-H34SGIVS.js → chunk-S5JBQCBA.js} +1 -1
  83. package/dist/chunks/chunk-SHY7P3C6.js +10 -0
  84. package/dist/chunks/{chunk-QBOY2CXL.js → chunk-SODZSOOL.js} +1 -1
  85. package/dist/chunks/{chunk-TGPYWWX3.js → chunk-SXEOJSZQ.js} +1 -1
  86. package/dist/chunks/{chunk-KV2DYFUG.js → chunk-T7HE23VK.js} +1 -1
  87. package/dist/chunks/{chunk-2H4DUZJZ.js → chunk-TL4ZLZ2Q.js} +1 -1
  88. package/dist/chunks/{chunk-DUJAQS7I.js → chunk-TNNEKGGF.js} +1 -1
  89. package/dist/chunks/{chunk-USYEDO7R.js → chunk-TNUQME3L.js} +1 -1
  90. package/dist/chunks/chunk-TZ6MSTOI.js +7 -0
  91. package/dist/chunks/chunk-U6XJYQJS.js +7 -0
  92. package/dist/chunks/chunk-UWJ3UPS5.js +11 -0
  93. package/dist/chunks/chunk-V32V4SXB.js +7 -0
  94. package/dist/chunks/{chunk-ECQKK4JU.js → chunk-VD2FK6OF.js} +1 -1
  95. package/dist/chunks/chunk-VPUYTI5E.js +25 -0
  96. package/dist/chunks/{chunk-2JNDJISE.js → chunk-VYRMHE34.js} +1 -1
  97. package/dist/chunks/{chunk-WFOJ2LEA.js → chunk-VZGTL3YC.js} +1 -1
  98. package/dist/chunks/{chunk-ZBZPCKTW.js → chunk-W5GHMAHP.js} +1 -1
  99. package/dist/chunks/{chunk-ZCXKEZS4.js → chunk-WHUZRBYL.js} +1 -1
  100. package/dist/chunks/{chunk-BRETAWE7.js → chunk-XEXOSJIU.js} +1 -1
  101. package/dist/chunks/{chunk-JMAXX2I6.js → chunk-XGOELSYA.js} +1 -1
  102. package/dist/chunks/{chunk-TCB4XM23.js → chunk-Y57DK3ZN.js} +1 -1
  103. package/dist/chunks/{chunk-WKYFWE37.js → chunk-YO6SJCZP.js} +1 -1
  104. package/dist/chunks/chunk-YOWMZJPA.js +7 -0
  105. package/dist/chunks/{chunk-EDOTKQ7L.js → chunk-ZGQNI22M.js} +1 -1
  106. package/dist/chunks/chunk-ZUI5EMXD.js +11 -0
  107. package/dist/chunks/clear-B764MEAM.js +8 -0
  108. package/dist/chunks/{compile-vercel-config-DRTOWZK6.js → compile-vercel-config-EWCB7SIC.js} +1 -1
  109. package/dist/chunks/{config-MNRKCDQA.js → config-CW4JO67Q.js} +1 -1
  110. package/dist/chunks/config-D4WY2HG4.js +8 -0
  111. package/dist/chunks/delete-SKYFHUWD.js +10 -0
  112. package/dist/chunks/delete-W3GMFAKA.js +9 -0
  113. package/dist/chunks/{detect-services-GXKWIX52.js → detect-services-3TRRRLES.js} +1 -1
  114. package/dist/chunks/disable-EBPZ2LYC.js +7 -0
  115. package/dist/chunks/discard-SMVPENSP.js +14 -0
  116. package/dist/chunks/edit-A3M3GBGP.js +8 -0
  117. package/dist/chunks/edit-CGTNGJKY.js +9 -0
  118. package/dist/chunks/enable-6A5THWDP.js +7 -0
  119. package/dist/chunks/{export-N5F7EY7B.js → export-R5IUWAW5.js} +1 -1
  120. package/dist/chunks/future-CPJUUZTU.js +7 -0
  121. package/dist/chunks/generate-cert-for-deploy-Z3HCAR5H.js +7 -0
  122. package/dist/chunks/image-VNSN2SKE.js +7 -0
  123. package/dist/chunks/{import-builders-OAGJKQNW.js → import-builders-GPJQAMXT.js} +1 -1
  124. package/dist/chunks/{inspect-UDUI3ETL.js → inspect-6FEL5DYV.js} +1 -1
  125. package/dist/chunks/inspect-BO2ACFEG.js +13 -0
  126. package/dist/chunks/{inspect-35WHAXL2.js → inspect-TEPB7KVC.js} +1 -1
  127. package/dist/chunks/inspect-WC2C4MDP.js +9 -0
  128. package/dist/chunks/{inspect-GX34WQGR.js → inspect-WWOHWQKS.js} +1 -1
  129. package/dist/chunks/{list-VVND632B.js → list-4KSJEP23.js} +1 -1
  130. package/dist/chunks/{list-BINT67HQ.js → list-C5GUZ35P.js} +1 -1
  131. package/dist/chunks/list-EZWZSVM4.js +12 -0
  132. package/dist/chunks/login-PDZT4PQR.js +7 -0
  133. package/dist/chunks/login-ZNCCVA4H.js +9 -0
  134. package/dist/chunks/logs-YKQMUTMG.js +7 -0
  135. package/dist/chunks/{ls-2MJY6EKD.js → ls-3HUS6KS6.js} +1 -1
  136. package/dist/chunks/ls-KQJYKADC.js +8 -0
  137. package/dist/chunks/{ls-7OZ5TSNW.js → ls-LYVPEIIT.js} +1 -1
  138. package/dist/chunks/{ls-6HYUGM62.js → ls-RBPRE6BF.js} +1 -1
  139. package/dist/chunks/{ls-YT3MWU4U.js → ls-TASQJDLF.js} +1 -1
  140. package/dist/chunks/{ls-HTNWWU45.js → ls-WX4BJRDV.js} +1 -1
  141. package/dist/chunks/ls-ZP7OBTTV.js +11 -0
  142. package/dist/chunks/mutate-5N6DMBYS.js +9 -0
  143. package/dist/chunks/{native-self-update-75UJCHGZ.js → native-self-update-7OAY4AVR.js} +1 -1
  144. package/dist/chunks/notifications-OVFMQLHL.js +7 -0
  145. package/dist/chunks/open-DOBOKUEK.js +7 -0
  146. package/dist/chunks/{openapi-KYC6JIXI.js → openapi-YAZA3237.js} +1 -1
  147. package/dist/chunks/permissions-PHCOVDWK.js +7 -0
  148. package/dist/chunks/{plugin-offer-URT5JNEU.js → plugin-offer-M7KJSJU6.js} +1 -1
  149. package/dist/chunks/prompt-missing-credentials-RTNCHH6Y.js +7 -0
  150. package/dist/chunks/{publish-LH5CIXCP.js → publish-JIFRJNDV.js} +1 -1
  151. package/dist/chunks/pull-HLJSW3W4.js +7 -0
  152. package/dist/chunks/purchase-domain-if-available-3EBONBX3.js +7 -0
  153. package/dist/chunks/push-ZN6CBJLJ.js +7 -0
  154. package/dist/chunks/{query-POTX2HYL.js → query-MT6ID6C7.js} +1 -1
  155. package/dist/chunks/reauthenticate-OXFB64PS.js +7 -0
  156. package/dist/chunks/reorder-N2L43LXD.js +10 -0
  157. package/dist/chunks/reply-WBR3XXBJ.js +9 -0
  158. package/dist/chunks/resolve-NMR24Y67.js +12 -0
  159. package/dist/chunks/resolve-agent-team-KRTLBC5D.js +7 -0
  160. package/dist/chunks/{restore-L3T5KOG7.js → restore-AKAVSLAK.js} +1 -1
  161. package/dist/chunks/rm-DGMHU3CU.js +8 -0
  162. package/dist/chunks/rm-ERBTFH3G.js +8 -0
  163. package/dist/chunks/rm-H2T7HB3F.js +8 -0
  164. package/dist/chunks/rm-Q3ZXEMGI.js +8 -0
  165. package/dist/chunks/rm-TNGYCAFJ.js +8 -0
  166. package/dist/chunks/{routes-S75L7Z7A.js → routes-4WGST7VN.js} +1 -1
  167. package/dist/chunks/rule-inspect-ZVHPS2PL.js +8 -0
  168. package/dist/chunks/{schema-P4T4GQBF.js → schema-TSHU5NN6.js} +1 -1
  169. package/dist/chunks/{schema-TOVLKRPJ.js → schema-YUXTIJSB.js} +1 -1
  170. package/dist/chunks/select-org-35NFUKXO.js +7 -0
  171. package/dist/chunks/set-PP5K4NBO.js +7 -0
  172. package/dist/chunks/setup-and-link-ACSPPTME.js +7 -0
  173. package/dist/chunks/{skills-DZYJV7BE.js → skills-X5TPVYXW.js} +1 -1
  174. package/dist/chunks/{statuspage-45LJ2XYT.js → statuspage-KHTMA4WL.js} +1 -1
  175. package/dist/chunks/tags-6QB3FP3B.js +7 -0
  176. package/dist/chunks/{types-YA6BOCRV.js → types-SENK43U4.js} +1 -1
  177. package/dist/chunks/{update-YSAO36V7.js → update-QA3NLSTV.js} +1 -1
  178. package/dist/chunks/zod-Y3ZBY67C.js +7 -0
  179. package/dist/commands/build/index.js +1 -1
  180. package/dist/commands/deploy/index.js +30 -23
  181. package/dist/commands/dev/index.js +2 -2
  182. package/dist/commands/env/index.js +1 -1
  183. package/dist/commands/link/index.js +1 -1
  184. package/dist/commands/list/index.js +1 -1
  185. package/dist/commands/project/index.js +7 -7
  186. package/dist/commands-account.js +18 -3
  187. package/dist/commands-ai.js +2 -2
  188. package/dist/commands-blob.js +1 -1
  189. package/dist/commands-core.js +6 -6
  190. package/dist/commands-deployments.js +5 -3
  191. package/dist/commands-flags.js +7 -9
  192. package/dist/commands-integrations.js +1 -1
  193. package/dist/commands-observability.js +5 -5
  194. package/dist/commands-routing.js +2 -2
  195. package/dist/help.js +1 -1
  196. package/dist/index.js +4 -4
  197. package/dist/internal-build-worker.js +1 -1
  198. package/dist/internal-build.js +1 -1
  199. package/dist/launcher-errors.js +11 -0
  200. package/dist/native-download.js +1 -1
  201. package/dist/package.json +29 -29
  202. package/dist/vc.js +355 -86
  203. package/dist/version.mjs +1 -1
  204. package/package.json +22 -22
  205. package/dist/chunks/add-6YFDZCAK.js +0 -8
  206. package/dist/chunks/add-QDZPCCUD.js +0 -8
  207. package/dist/chunks/add-Z24IIQDY.js +0 -8
  208. package/dist/chunks/build-HLU4YO37.js +0 -7
  209. package/dist/chunks/chunk-2CSCY66I.js +0 -11
  210. package/dist/chunks/chunk-2NABMKFV.js +0 -29
  211. package/dist/chunks/chunk-2TRNHR72.js +0 -7
  212. package/dist/chunks/chunk-32NXYHYC.js +0 -10
  213. package/dist/chunks/chunk-4CQKN5TW.js +0 -10
  214. package/dist/chunks/chunk-7DM3IJ7L.js +0 -10
  215. package/dist/chunks/chunk-AUCTNGW2.js +0 -7
  216. package/dist/chunks/chunk-C6525MLX.js +0 -10
  217. package/dist/chunks/chunk-CGTD4QFC.js +0 -7
  218. package/dist/chunks/chunk-DSNIVABS.js +0 -7
  219. package/dist/chunks/chunk-F53OKXYI.js +0 -7
  220. package/dist/chunks/chunk-K5YO4UD7.js +0 -7
  221. package/dist/chunks/chunk-NAU6URTI.js +0 -25
  222. package/dist/chunks/chunk-NNIQPNGP.js +0 -7
  223. package/dist/chunks/chunk-NTUDWWSL.js +0 -14
  224. package/dist/chunks/chunk-RZY54T7B.js +0 -7
  225. package/dist/chunks/chunk-SR2SHYJA.js +0 -7
  226. package/dist/chunks/chunk-WGVIQTOI.js +0 -8
  227. package/dist/chunks/chunk-YPPDRKVC.js +0 -7
  228. package/dist/chunks/clear-RU72IUXU.js +0 -8
  229. package/dist/chunks/config-PIFTR3UF.js +0 -8
  230. package/dist/chunks/delete-47BF6SIO.js +0 -9
  231. package/dist/chunks/delete-QNSKEIGO.js +0 -10
  232. package/dist/chunks/disable-SBFW3F7B.js +0 -7
  233. package/dist/chunks/discard-DUZR3OWZ.js +0 -14
  234. package/dist/chunks/edit-6BQ7FZC4.js +0 -8
  235. package/dist/chunks/edit-WO7FLNW2.js +0 -9
  236. package/dist/chunks/enable-OK4MR3Z6.js +0 -7
  237. package/dist/chunks/future-5AQIYILU.js +0 -7
  238. package/dist/chunks/generate-cert-for-deploy-7ERAHVOV.js +0 -7
  239. package/dist/chunks/image-IRC2NJVA.js +0 -7
  240. package/dist/chunks/inspect-5FKOSDTK.js +0 -13
  241. package/dist/chunks/inspect-ACNGICEF.js +0 -9
  242. package/dist/chunks/list-TRFGY6WP.js +0 -12
  243. package/dist/chunks/login-MYVTOBRG.js +0 -9
  244. package/dist/chunks/login-SOZ5ME3D.js +0 -7
  245. package/dist/chunks/logs-EMAGPMIZ.js +0 -7
  246. package/dist/chunks/ls-KU35N6DP.js +0 -8
  247. package/dist/chunks/ls-WFC636QK.js +0 -11
  248. package/dist/chunks/mutate-JVDDZLVE.js +0 -9
  249. package/dist/chunks/notifications-CXDBNBHU.js +0 -7
  250. package/dist/chunks/open-3CD5ZNKU.js +0 -7
  251. package/dist/chunks/permissions-PNBST4WN.js +0 -7
  252. package/dist/chunks/prompt-missing-credentials-Q5JCRP3R.js +0 -7
  253. package/dist/chunks/pull-XLZXPTLS.js +0 -7
  254. package/dist/chunks/purchase-domain-if-available-PDJGZ6MY.js +0 -7
  255. package/dist/chunks/push-XB57XK6H.js +0 -7
  256. package/dist/chunks/reauthenticate-CRI4D2BQ.js +0 -7
  257. package/dist/chunks/reorder-KUQ5EQBV.js +0 -10
  258. package/dist/chunks/reply-LO76EKEE.js +0 -9
  259. package/dist/chunks/resolve-KZJYJJLA.js +0 -12
  260. package/dist/chunks/resolve-agent-team-N7QMB7UO.js +0 -7
  261. package/dist/chunks/rm-7UKXTIZW.js +0 -8
  262. package/dist/chunks/rm-AKKEQN32.js +0 -8
  263. package/dist/chunks/rm-ELC57ULY.js +0 -8
  264. package/dist/chunks/rm-K7XEZ7TY.js +0 -8
  265. package/dist/chunks/rm-MOYCAXNO.js +0 -8
  266. package/dist/chunks/rule-inspect-ZCS4EBKR.js +0 -8
  267. package/dist/chunks/select-org-6NEM7F25.js +0 -7
  268. package/dist/chunks/set-NXFB6JXG.js +0 -7
  269. package/dist/chunks/setup-and-link-L67MMSUD.js +0 -7
  270. package/dist/chunks/tags-5AV6WAOF.js +0 -7
  271. package/dist/chunks/zod-2C2SXNIK.js +0 -7
@@ -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{outputAgentError}from"./chunk-ZUI5EMXD.js";import{findProjectsFromPath,getConfigFilePath,getLinkFromDir,getRepoLink,getUser,getVercelDirectory,inspectTokenRequest,processInspectTokenResponse}from"./chunk-KNAOHPOI.js";import{getTeamByIdOrSlug}from"./chunk-2VBFQZ72.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{InvalidToken,TeamDeleted}from"./chunk-T2FCF46I.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{AGENT_REASON}from"./chunk-CFYTFXX6.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_build_utils=__toESM(require_build_utils(),1);var VERCEL_API_ORIGIN="https://api.vercel.com";async function introspectToken(client){let token=client.authConfig.token;if(!token)throw new Error("No token to introspect");if(new URL(client.apiUrl).origin!==VERCEL_API_ORIGIN)throw new Error("Token introspection is unavailable for custom API origins");let[error,introspection]=await processInspectTokenResponse(await inspectTokenRequest(token));if(error)throw error;return introspection}function isAppPrincipalEnabled(){return!!process.env.APP_PRINCIPAL_ENABLED}function resolveAppFromToken(token){return!token.active||!token.client_id?null:{id:token.client_id,name:token.client_name}}async function getAppTokenTeamId(client){try{await getUser(client);return}catch{let token=await introspectToken(client).catch(()=>null);return token&&resolveAppFromToken(token)?token.team?.id:void 0}}function assertOrgIdMatchesAppTeam(client,appTeamId){let envOrgId=(0,import_build_utils.getPlatformEnv)("ORG_ID");if(!envOrgId||envOrgId===appTeamId)return;let message=`This token only works with team ${appTeamId}, but VERCEL_ORG_ID is set to ${envOrgId}.`;throw outputAgentError(client,{status:"error",reason:AGENT_REASON.SCOPE_NOT_ACCESSIBLE,message}),new Error(message)}async function resolveAppTokenScope(client,scope){let token=await introspectToken(client).catch(()=>null),app=token?resolveAppFromToken(token):null,team=token?.team;return!app||!team||team.id!==scope&&team.slug!==scope?!1:(client.config.currentTeam=team.id,!0)}async function isActiveAppToken(client){let token=await introspectToken(client).catch(()=>null);return!!(token&&resolveAppFromToken(token))}var import_cli_config=__toESM(require_cli_config(),1),import_ms=__toESM(require_ms(),1);var TEAM_SLUG_TTL_MS=(0,import_ms.default)("1d");function getCachedTeamSlug(config,teamId,now=Date.now()){let saved=config.cachedTeamSlugs?.[teamId];if(!isSavedTeamSlug(saved))return;let age=now-saved.savedAt;return age>=0&&age<TEAM_SLUG_TTL_MS?saved.slug:void 0}function setCachedTeamSlug(client,teamId,slug){if(getCachedTeamSlug(client.config,teamId)===slug)return;let saved={slug,savedAt:Date.now()};updateCachedTeamSlugs(client,slugs=>({...slugs,[teamId]:saved}))}function forgetCachedTeamSlug(client,teamId){let slugs=client.config.cachedTeamSlugs;!slugs||!(teamId in slugs)||updateCachedTeamSlugs(client,saved=>{let rest={...saved};return delete rest[teamId],rest})}function isSavedTeamSlug(value){return typeof value=="object"&&value!==null&&typeof value.slug=="string"&&typeof value.savedAt=="number"}function updateCachedTeamSlugs(client,update){try{let configPath=getConfigFilePath(),savedConfig=(0,import_cli_config.readGlobalConfigFile)(configPath),cachedTeamSlugs=update(savedConfig.cachedTeamSlugs??{}),config={...savedConfig,cachedTeamSlugs};(0,import_cli_config.writeGlobalConfigFile)(configPath,config),client.config.cachedTeamSlugs=cachedTeamSlugs}catch{output_manager_default.debug("Failed to persist cached team slugs.")}}var import_build_utils2=__toESM(require_build_utils(),1);import{relative}from"path";async function getScope(client,opts={}){let{user,app,token}=await getPrincipal(client),defaultTeamId=user?.version==="northstar"&&!client.ignoresSavedTeam?user.defaultTeamId:void 0,appTeamId=!user&&app?token?.team?.id:void 0;if(!user&&app&&opts.getTeam===!1)throw new Error("App principal scope resolution requires a team lookup.");!user&&app&&(client.ignoresSavedTeam&&appTeamId&&assertOrgIdMatchesAppTeam(client,appTeamId),client.config.currentTeam=appTeamId),!client.config.currentTeam&&defaultTeamId&&(client.config.currentTeam=defaultTeamId),client.isTeamUnchosen()&&await client.chooseTeam({ask:opts.chooseTeam!==!1});let teamId=client.config.currentTeam||defaultTeamId,team=teamId&&opts.getTeam!==!1?await getTeam(client,teamId):null,contextName=team?.slug||user?.username||user?.email;if(!contextName)throw new Error("Unable to determine context name");return opts.resolveLocalScope?resolveLocalScopeContext(client,{user,app,team}):{contextName,team,user,app}}async function getContextName(client,opts={}){let teamId=client.config.currentTeam,cachedSlug=teamId&&!client.authConfig.tokenSource?getCachedTeamSlug(client.config,teamId):void 0;if(cachedSlug&&!(opts.resolveLocalScope&&await hasLocalScope(client)))return output_manager_default.debug(`Using saved name "${cachedSlug}" for team ${teamId}`),cachedSlug;let{contextName,team}=opts.resolveLocalScope?await getScope(client,{resolveLocalScope:!0}):await getScope(client);return team&&!client.authConfig.tokenSource&&setCachedTeamSlug(client,team.id,team.slug),contextName}async function hasLocalScope(client){if(detectExplicitScope(client))return!1;let{localOrgId,isCrossTeamRepo}=await findLocalLink(client);return!!localOrgId||isCrossTeamRepo}async function getPrincipal(client){if(!isAppPrincipalEnabled())return{user:await getUser(client),app:null,token:null};let[userResult,tokenResult]=await Promise.allSettled([getUser(client),introspectToken(client)]),token=tokenResult.status==="fulfilled"?tokenResult.value:null,app=token?resolveAppFromToken(token):null;if(userResult.status==="rejected"&&!(app&&userResult.reason instanceof InvalidToken))throw userResult.reason;return{user:userResult.status==="fulfilled"?userResult.value:null,app,token}}async function resolveLocalScopeContext(client,{user,app,team}){let explicitScopeProvided=detectExplicitScope(client)||client.ignoresSavedTeam&&!!(0,import_build_utils2.getPlatformEnv)("ORG_ID"),globalTeamId=client.config.currentTeam,{localOrgId,linkedRepo,isCrossTeamRepo}=await findLocalLink(client),isAppPrincipal=!user&&!!app,effectiveLocalOrgId=isAppPrincipal?void 0:localOrgId,scopeMismatch=!!(effectiveLocalOrgId&&globalTeamId&&globalTeamId!==effectiveLocalOrgId);!isAppPrincipal&&!explicitScopeProvided&&!effectiveLocalOrgId&&isCrossTeamRepo&&output_manager_default.warn("This repository has projects across multiple teams. Use `--scope` to specify which team, or `cd` into a project directory.");let resolvedTeam=!explicitScopeProvided&&effectiveLocalOrgId?await applyLocalOrg(client,effectiveLocalOrgId):team,{org,contextName}=resolveOrg(resolvedTeam,user);return{org,contextName,user,team:resolvedTeam,app,globalTeam:team,linkedRepo,isCrossTeamRepo,localOrgId:effectiveLocalOrgId,scopeMismatch,explicitScopeProvided}}async function applyLocalOrg(client,localOrgId){return client.config.currentTeam=localOrgId.startsWith("team_")?localOrgId:void 0,client.config.currentTeam?await getTeamByIdOrSlug(client,client.config.currentTeam):null}async function getTeam(client,teamId){let team=await getTeamByIdOrSlug(client,teamId);if(!team)throw new TeamDeleted;return team}function resolveOrg(team,user){if(team)return{org:{type:"team",id:team.id,slug:team.slug},contextName:team.slug};if(user)return{org:{type:"user",id:user.id,slug:user.username},contextName:user.username||user.email};throw new Error("Unable to determine scope: no team or personal account is available for this token. Use `--scope` to specify a team.")}async function getLocalOrgId(client){return(await findLocalLink(client)).localOrgId}async function findLocalLink(client){let[projectLink,repoLink]=await Promise.all([findProjectLink(client),findRepoLink(client)]);return{localOrgId:findLocalOrgId(client.cwd,projectLink,repoLink),linkedRepo:repoLink?.repoConfig?{repoConfig:repoLink.repoConfig,rootPath:repoLink.rootPath}:null,isCrossTeamRepo:detectCrossTeamRepo(repoLink?.repoConfig)}}async function findProjectLink(client){try{return await getLinkFromDir(getVercelDirectory(client.cwd))}catch{return null}}async function findRepoLink(client){try{return await getRepoLink(client,client.cwd)}catch{return null}}function findLocalOrgId(cwd,projectLink,repoLink){if(projectLink)return projectLink.orgId;if(repoLink?.repoConfig)return findRepoOrgId(repoLink.repoConfig,relative(repoLink.rootPath,cwd))}function findRepoOrgId(repoConfig,pathFromRepoRoot){let matchedProjects=findProjectsFromPath(repoConfig.projects,pathFromRepoRoot),projects=matchedProjects.length===0&&pathFromRepoRoot===""?repoConfig.projects:matchedProjects,orgIds=new Set(projects.map(p=>p.orgId??repoConfig.orgId??""));if(orgIds.size!==1)return;let[orgId]=orgIds;return orgId||void 0}function scopeFlagPassed(argv){for(let arg of argv){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg.startsWith("--scope=")||arg.startsWith("--team=")||arg==="-S"||arg==="-T")return!0}return!1}function detectExplicitScope(client){return scopeFlagPassed(client.argv)||!!client.localConfig?.scope}function detectCrossTeamRepo(repoConfig){if(!repoConfig?.projects||repoConfig.projects.length<2)return!1;let orgIds=new Set;for(let project of repoConfig.projects){let orgId=project.orgId??repoConfig.orgId;orgId&&orgIds.add(orgId)}return orgIds.size>1}export{introspectToken,isAppPrincipalEnabled,resolveAppFromToken,getAppTokenTeamId,assertOrgIdMatchesAppTeam,resolveAppTokenScope,isActiveAppToken,forgetCachedTeamSlug,getScope,getContextName,resolveOrg,getLocalOrgId,scopeFlagPassed,detectExplicitScope};
@@ -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{resolveProjectContext}from"./chunk-DX2OHM56.js";import{printError}from"./chunk-Q4GX2UTG.js";import{detectExplicitScope}from"./chunk-TZ6MSTOI.js";import{buildCommandWithGlobalFlags,getErrorRecovery,outputActionRequired,outputAgentError}from"./chunk-ZUI5EMXD.js";import{getProjectByNameOrId}from"./chunk-KNAOHPOI.js";import{ProjectNotFound,isAPIError}from"./chunk-T2FCF46I.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{AGENT_REASON,AGENT_STATUS,getExitCodeForReason}from"./chunk-CFYTFXX6.js";function tracingErrorMessage(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function tracingErrorReason(err){let status=isAPIError(err)?err.status:void 0;return status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:status===429?AGENT_REASON.RATE_LIMITED:AGENT_REASON.API_ERROR}function handleTracingApiError(client,err){if(client.nonInteractive){let apiError=isAPIError(err)?err:void 0;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:tracingErrorReason(err),message:tracingErrorMessage(err),...apiError?.status===429&&getErrorRecovery(apiError,client)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(tracingErrorMessage(err)),1):(printError(err),1)}function configError(client,reason,message){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),getExitCodeForReason(reason)}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function missingEnvironment(client,message){return outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.MISSING_ENVIRONMENT,message}),output_manager_default.error(message),getExitCodeForReason(AGENT_REASON.MISSING_ENVIRONMENT)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}var MISSING_BOTH_MESSAGE="No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";async function resolveScope({client,flags={},linkedProject}){let flagScope=flags.scope?.trim()||void 0,flagProject=flags.project?.trim()||void 0;if(linkedProject.status==="linked"){if(!flagScope&&!flagProject)return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name};let teamId=flagScope?client.config.currentTeam:linkedProject.org.id;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject??linkedProject.project.id,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}if(flagScope&&flagProject){let teamId=client.config.currentTeam;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id,projectName:project.name}}return{reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE}}async function resolveConfigScope(client,flags){let link=await resolveProjectContext({client,projectNameOrId:flags.project});return link.status==="error"?{exitCode:link.exitCode}:link.status==="not_linked"?(outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE,hint:"Link a project or pass --scope and --project.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"link this directory to a project"}]}),output_manager_default.error(MISSING_BOTH_MESSAGE),{exitCode:1}):flags.project===void 0&&detectExplicitScope(client)&&link.org.id!==client.config.currentTeam?{exitCode:invalidArguments(client,`The linked project ${link.project.name} belongs to ${link.org.slug||link.org.id}, which is not the scope that was passed. Pass --project <name> to act on a project in that scope.`)}:{teamId:link.org.id,projectId:link.project.id,projectName:link.project.name}}export{resolveScope,tracingErrorMessage,tracingErrorReason,handleTracingApiError,invalidArguments,missingEnvironment,ruleNotFound,confirmationRequired,resolveConfigScope};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{writeActionRequired}from"./chunk-ZUI5EMXD.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{AGENT_REASON}from"./chunk-CFYTFXX6.js";function isNonProductionTarget(target){return!!target&&target!=="production"}async function hasDeployment(client,org,projectId){let{deployments}=await client.fetch(`/v6/deployments?projectId=${encodeURIComponent(projectId)}&limit=1`,{accountId:org.id});return deployments.length>0}async function hasEarlierDeployment(client,org,projectId,listedDeployments){if(listedDeployments?.length)return!0;try{return await hasDeployment(client,org,projectId)}catch(err){return output_manager_default.debug(`Couldn't check the project for earlier deployments: ${err}`),!0}}function refuseFirstDeployment(client,{target,newProject,prodCommand,prepareCommands=[]}){let environment=target==="preview"?"Preview":target,cause=newProject?"This deploy would create a new project":"This project has no deployments yet",recovery=prepareCommands.length?"pull its Production settings, build again with --prod, then retry with --prod":"retry with --prod",message=`Can't create a ${environment} deployment. ${cause}, and a project's first deployment is assigned to Production. To deploy to Production, ${recovery}. Later deployments can use --environment ${target}.`,note=prodCommand.note?`; ${prodCommand.note}`:"",steps=prepareCommands.length?[...prepareCommands,{command:prodCommand.command,action:`deploy the build to Production${note}`}]:[{command:prodCommand.command,action:`deploy to Production instead${note}`}];return client.nonInteractive&&writeActionRequired(client,{status:"action_required",reason:AGENT_REASON.FIRST_DEPLOYMENT_PRODUCTION,message,userActionRequired:!0,hint:"Ask the user before deploying to Production.",next:steps.map((step,i)=>({command:step.command,when:i===0?`Only after the user approves: ${step.action}`:`Then ${step.action}`}))}),output_manager_default.error(`${message}
8
+
9
+ ${steps.map((step,i)=>`${i===0?"To":"Then"} ${step.action}:
10
+ ${step.command}`).join(`
11
+ `)}`),1}export{isNonProductionTarget,hasDeployment,hasEarlierDeployment,refuseFirstDeployment};
@@ -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{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-ZUI5EMXD.js";import{output_manager_default}from"./chunk-W634OFUG.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-CFYTFXX6.js";function withWarnings(result,warnings){let added=warnings.filter(warning=>warning!==void 0);if(added.length===0)return result;let existing=result.warnings;return{...result,warnings:[...Array.isArray(existing)?existing:[],...added]}}function getRenamedOption(flags,name,oldName,{json=!1,typedName=oldName}={}){let value=flags[name],oldValue=flags[oldName];if(value!==void 0&&oldValue!==void 0)return{error:`Can't use ${name} with ${typedName}.`};if(typeof value=="string"&&value.trim()==="")return{error:`${name} can't be empty.`};if(oldValue===void 0)return{value};let message=`${typedName} is deprecated. Use ${name}.`;return json?{value:oldValue,warning:{reason:AGENT_REASON.DEPRECATED,message}}:(output_manager_default.warning(message),{value:oldValue})}function reportRenamedOptionError(client,message,{json=!1}={}){return json||shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message}):output_manager_default.error(message),2}function renameOptionInArgs(args,oldName,name){let end=args.indexOf("--");return args.map((arg,index)=>(end===-1||index<end)&&(arg===oldName||arg.startsWith(`${oldName}=`))?`${name}${arg.slice(oldName.length)}`:arg)}export{withWarnings,getRenamedOption,reportRenamedOptionError,renameOptionInArgs};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption,limitOption,projectOption}from"./chunk-YPPDRKVC.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},TAGS_SORT_BY_CHOICES=["updatedAt","tag"],TAGS_SORT_ORDER_CHOICES=["asc","desc"],tagsLsSubcommand={name:"ls",aliases:["list"],description:"List a repository's tags",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"sort-by",shorthand:null,type:String,deprecated:!1,description:"Field to sort tags by (default: updatedAt)",argument:"FIELD",choices:TAGS_SORT_BY_CHOICES},{name:"sort-order",shorthand:null,type:String,deprecated:!1,description:"Sort direction (default: desc)",argument:"ORDER",choices:TAGS_SORT_ORDER_CHOICES},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List a repository's tags",value:`${packageName} vcr tag ls my-app`}]},tagsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single tag",arguments:[{name:"repository",required:!0},{name:"tag",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a tag by name",value:`${packageName} vcr tag inspect my-app latest`}]},tagsAggregateCommand={name:"tag",aliases:["tags"],description:"List or inspect a repository's tags",arguments:[],subcommands:[tagsLsSubcommand,tagsInspectSubcommand],options:[],examples:[]};export{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand,tagsInspectSubcommand,tagsAggregateCommand};
7
+ import{packageName}from"./chunk-VRH7LWOC.js";import{formatOption,jsonOption,limitOption,projectOption}from"./chunk-CKTLP5GX.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},TAGS_SORT_BY_CHOICES=["updatedAt","tag"],TAGS_SORT_ORDER_CHOICES=["asc","desc"],tagsLsSubcommand={name:"ls",aliases:["list"],description:"List a repository's tags",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,{name:"sort-by",shorthand:null,type:String,deprecated:!1,description:"Field to sort tags by (default: updatedAt)",argument:"FIELD",choices:TAGS_SORT_BY_CHOICES},{name:"sort-order",shorthand:null,type:String,deprecated:!1,description:"Sort direction (default: desc)",argument:"ORDER",choices:TAGS_SORT_ORDER_CHOICES},limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List a repository's tags",value:`${packageName} vcr tag ls my-app`}]},tagsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single tag",arguments:[{name:"repository",required:!0},{name:"tag",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a tag by name",value:`${packageName} vcr tag inspect my-app latest`}]},tagsAggregateCommand={name:"tag",aliases:["tags"],description:"List or inspect a repository's tags",arguments:[],subcommands:[tagsLsSubcommand,tagsInspectSubcommand],options:[],examples:[]};export{TAGS_SORT_BY_CHOICES,TAGS_SORT_ORDER_CHOICES,tagsLsSubcommand,tagsInspectSubcommand,tagsAggregateCommand};
@@ -0,0 +1,25 @@
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_ci_info}from"./chunk-2EYYB6YN.js";import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_graceful_fs,require_load_json_file,require_pify}from"./chunk-4NTBYNFR.js";import{UNCLASSIFIED_ERROR_CODE,output_manager_default,peekCliError}from"./chunk-W634OFUG.js";import{require_signal_exit}from"./chunk-BLUPZPAS.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_dist}from"./chunk-PUKYAALC.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
8
+ `,{mode:opts.mode})}),mainSync=(fp,data,opts)=>{let indent=opts.indent;if(opts.detectIndent)try{let file=fs.readFileSync(fp,"utf8");indent=detectIndent(file).indent}catch(err){if(err.code!=="ENOENT")throw err}let json=JSON.stringify(data,opts.replacer,indent);return writeFileAtomic.sync(fp,`${json}
9
+ `,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});var import_ci_info=__toESM(require_ci_info(),1);var launchTargets=["cli-support","darwin-arm64","darwin-x64","linux-arm64","linux-arm64-musl","linux-x64","linux-x64-musl","win32-arm64","win32-x64"],launchFallbackReasons=["target_missing","ENOENT","EACCES","ENOEXEC","EPERM","EFTYPE","UNKNOWN","opt_out","inherited_native_env","download_failed","cache_unwritable","not_in_node_modules"],launchSources=["download","cache"],downloadErrors=["timed_out","proxy_refused","proxy_auth_required","dns","connection_refused","connection_reset","connect_timeout","network","tls","http_403","http_404","http_other","checksum_mismatch","bad_metadata","no_binary","binary_did_not_start","binary_killed","binary_exited","version_mismatch","filesystem","other"],downloadPhases=["setup","metadata","tarball","extract","check","install"],downloadCodes=["ENOTFOUND","EAI_AGAIN","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EHOSTUNREACH","ENETUNREACH","ENETDOWN","EPIPE","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_SOCKET","EACCES","EPERM","ENOSPC","EROFS","EEXIST","ENOENT","EISDIR","ENOTDIR","EDQUOT","EMFILE","Z_DATA_ERROR","Z_BUF_ERROR","SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_HAS_EXPIRED","ERR_TLS_CERT_ALTNAME_INVALID","ENOEXEC","E2BIG","SIGKILL","SIGTERM","SIGABRT","SIGSEGV","SIGBUS","SIGILL","SIGTRAP"],downloadTimeouts=["metadata","stall","total"],downloadAttempts=["1","2"],downloadFailures=["1","2","3_or_more"],downloadProgress=["none","under_half","over_half","complete","unknown"],launchValues=["native","dist","cli-support","other","true","false","default","custom",...launchTargets,...launchFallbackReasons,...launchSources,...downloadErrors,...downloadPhases,...downloadCodes,...downloadTimeouts,...downloadAttempts,...downloadFailures,...downloadProgress];function oneOf(value,allowed){return typeof value=="string"&&allowed.includes(value)?value:"other"}function readLaunch(){let launch=globalThis[Symbol.for("vercel.cli.launch")];if(launch?.runtime==="native")return launch.source===void 0?{runtime:"native"}:{runtime:"native",source:oneOf(launch.source,launchSources),...launch.downloadAttempts!==void 0&&{downloadAttempts:oneOf(launch.downloadAttempts,downloadAttempts)}};if(launch?.runtime==="cli-support")return{runtime:"cli-support"};if(launch?.runtime==="dist")return{runtime:"dist",target:oneOf(launch.target,launchTargets),reason:oneOf(launch.reason,launchFallbackReasons),...launch.downloadError!==void 0&&{downloadError:oneOf(launch.downloadError,downloadErrors)},...launch.downloadPhase!==void 0&&{downloadPhase:oneOf(launch.downloadPhase,downloadPhases)},...launch.downloadCode!==void 0&&{downloadCode:oneOf(launch.downloadCode,downloadCodes)},...launch.downloadAttempts!==void 0&&{downloadAttempts:oneOf(launch.downloadAttempts,downloadAttempts)},...launch.downloadFailures!==void 0&&{downloadFailures:oneOf(launch.downloadFailures,downloadFailures)},...launch.downloadTimeout!==void 0&&{downloadTimeout:oneOf(launch.downloadTimeout,downloadTimeouts)},...launch.downloadProgress!==void 0&&{downloadProgress:oneOf(launch.downloadProgress,downloadProgress)},...launch.downloadProxy!==void 0&&{downloadProxy:oneOf(launch.downloadProxy,["true","false"])},...launch.npmRegistry!==void 0&&{npmRegistry:oneOf(launch.npmRegistry,["default","custom"])},...launch.npmProxy!==void 0&&{npmProxy:oneOf(launch.npmProxy,["true","false"])},...launch.npmTls!==void 0&&{npmTls:oneOf(launch.npmTls,["true","false"])}}}function launchTags(launch){return launch?launch.runtime==="native"?{launcher:"native",...launch.source&&{launcher_source:launch.source}}:launch.runtime==="cli-support"?{launcher:"cli-support"}:{launcher:"dist",launcher_target:launch.target,launcher_fallback:launch.reason,...launch.downloadError&&{launcher_download_error:launch.downloadError}}:{}}var BRIDGE_TAG=/^[a-zA-Z0-9_.:-]{1,80}$/,ERROR_CODE=/^[A-Za-z][A-Za-z0-9_-]{0,79}$/;function getStartupDurationMs(excludedMs=0){let entryAt=Reflect.get(globalThis,Symbol.for("vercel.cli.entry-at"));return typeof entryAt=="number"?Math.max(0,performance.now()-entryAt-excludedMs):void 0}function getOutcome({exitCode,completion}){return exitCode===130?"canceled":exitCode!==0?"failure":completion==="process_exit"?"unknown":"success"}function toCommandTrace(event,context){let tags={command:context.command,invocation_id:context.invocationId,cli_version:context.cliVersion,release_channel:context.releaseChannel,platform:process.platform,arch:process.arch,is_agent:String(context.isAgent),exit_code:String(context.exitCode),completion:context.completion,outcome:getOutcome(context)};if(tags.outcome==="failure"){let details=peekCliError();tags.error_code=details?.code&&ERROR_CODE.test(details.code)?details.code:UNCLASSIFIED_ERROR_CODE,tags.error_source=context.errorSource??(details?"recorded":"unknown")}return context.agentName&&BRIDGE_TAG.test(context.agentName)&&(tags.agent_name=context.agentName),import_ci_info.default.id&&(tags.ci=import_ci_info.default.id),context.subcommand&&BRIDGE_TAG.test(context.subcommand)&&(tags.subcommand=context.subcommand),context.startupDurationMs!==void 0&&(tags.startup_duration_ms=context.startupDurationMs.toFixed(3)),Object.assign(tags,launchTags(readLaunch())),{id:event.id,name:event.name,timestamp:event.timestamp,startTime:event.startTime,duration:event.duration,tags}}var SPAN_NAME=/^vc(?:\.[a-zA-Z0-9_.]{1,77})?$/,safeCount=value=>/^(0|[1-9][0-9]{0,15})$/.test(value)&&Number.isSafeInteger(Number(value))?value:void 0,SAFE_TAGS={phase:value=>BRIDGE_TAG.test(value)?value:void 0,http_method:value=>/^[A-Z]{1,7}$/.test(value)?value:void 0,http_route:value=>/^[a-z0-9/:*_-]{1,80}$/i.test(value)?value:void 0,http_status_code:value=>/^[1-5][0-9]{2}$/.test(value)?value:void 0,error:()=>"true",file_count:safeCount,byte_count:safeCount,function_count:safeCount,layer_count:safeCount,attempt:safeCount,dropped_spans:safeCount,cache_hit:value=>["true","false"].includes(value)?value:void 0,deployment_state:value=>["INITIALIZING","ANALYZING","BUILDING","DEPLOYING","READY","QUEUED","CANCELED","ERROR"].includes(value)?value:void 0},MAX_SPANS=1e3;function localWaterfall(command,events){let runId=command.parentId;if(!runId)return[];let candidates=events.filter(event=>event.name!=="vc.cli.command"&&event.id!==runId&&SPAN_NAME.test(event.name)),byId=new Map(candidates.map(event=>[event.id,event])),selected=new Map;for(let span of candidates){let chain=[],seen=new Set,current=span,complete=!1;for(;current&&!(seen.has(current.id)||chain.length>=31);){if(seen.add(current.id),chain.push(current),current.parentId===runId||current.parentId===command.id){complete=!0;break}current=byId.get(current.parentId??"")}let missing=chain.filter(ancestor=>!selected.has(ancestor.id));if(!(!complete||selected.size+missing.length>MAX_SPANS))for(let ancestor of missing.reverse())selected.set(ancestor.id,ancestor)}let commandEnd=command.timestamp+command.duration,spans=[...selected.values()].sort((a,b)=>a.timestamp-b.timestamp).map(span=>({id:span.id,name:span.name,timestamp:span.timestamp,startTime:span.startTime,duration:span.duration,parentId:span.parentId===runId&&span.timestamp>=command.timestamp&&span.timestamp<commandEnd?command.id:span.parentId,tags:Object.fromEntries(Object.entries(SAFE_TAGS).flatMap(([key,safe])=>{let value=span.tags[key]&&safe(span.tags[key]);return value?[[key,value]]:[]}))}));if(!spans.length)return[];let start=Math.min(command.timestamp,...spans.map(span=>span.timestamp)),end=Math.max(command.timestamp+command.duration,...spans.map(span=>span.timestamp+span.duration));return[{id:runId,name:"vc.cli.run",timestamp:start,startTime:command.startTime+Math.floor((start-command.timestamp)/1e3),duration:end-start,tags:selected.size<candidates.length?{dropped_spans:String(candidates.length-selected.size)}:{}},...spans]}import{randomUUID}from"node:crypto";function timings(){return Reflect.get(globalThis,Symbol.for("vercel.cli.startup-timings"))}function markStartup(phase){timings()?.marks.push({phase,timestamp:Number(process.hrtime.bigint()/BigInt(1e3))})}function startupEvents(command){let marks=timings()?.marks.filter(mark=>mark.timestamp<=command.timestamp);if(!marks?.length||!command.parentId)return[];let group={id:randomUUID(),parentId:command.parentId,name:"vc.cli.startup",timestamp:marks[0].timestamp,startTime:command.startTime+Math.floor((marks[0].timestamp-command.timestamp)/1e3),duration:command.timestamp-marks[0].timestamp,tags:{}};return[group,...marks.map((mark,index)=>({id:randomUUID(),parentId:group.id,name:`vc.cli.startup.${mark.phase}`,timestamp:mark.timestamp,startTime:command.startTime+Math.floor((mark.timestamp-command.timestamp)/1e3),duration:(marks[index+1]?.timestamp??command.timestamp)-mark.timestamp,tags:{}}))]}import{randomUUID as randomUUID3}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID as randomUUID2}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";import{readdirSync}from"node:fs";function isLibc(value){return value==="glibc"||value==="musl"}function hasMuslLoader(){try{return readdirSync("/lib").some(name=>name.startsWith("ld-musl-")&&name.endsWith(".so.1"))}catch{return!1}}function detectLibcFromReport(){let report=process.report;if(!report||typeof report.getReport!="function")return;let originalExcludeNetwork=report.excludeNetwork;try{report.excludeNetwork=!0;let{header}=report.getReport();return header?.glibcVersionRuntime?"glibc":"musl"}catch{return}finally{report.excludeNetwork=originalExcludeNetwork}}function detectLibc(){if(process.platform==="linux")return detectLibcFromReport()??(hasMuslLoader()?"musl":"glibc")}var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){if(!value||typeof value!="object")return!1;let device=value;return typeof device.id=="string"&&(device.libc===void 0||isLibc(device.libc))}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID2()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
10
+ `,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID2(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing?.libc)return existing;let libc=(opts.detectLibc??detectLibc)(),device={id:existing?.id??randomUUID2(),...libc?{libc}:{}};return(!existing||libc)&&writePersistedCliDevice(opts.filePath,device),device}import{gzipSync,gunzipSync}from"node:zlib";var COMPRESSION_THRESHOLD=64*1024,MAX_DECOMPRESSED_BYTES=4*1024*1024;function encodeHandoff(payload){let serialized=JSON.stringify(payload),bytes=Buffer.byteLength(serialized);return bytes>COMPRESSION_THRESHOLD&&bytes<=MAX_DECOMPRESSED_BYTES?gzipSync(serialized,{level:1}):serialized}function decodeHandoff(bytes){return(bytes[0]===31&&bytes[1]===139?gunzipSync(new Uint8Array(bytes),{maxOutputLength:MAX_DECOMPRESSED_BYTES}):bytes).toString("utf8")}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID3(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.store.commandSubcommand=eventData.subcommand,this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackRedactedCliOption(option,value){value&&this.trackCliOption({option,value:this.redactedValue})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackDeprecatedShorthand(shorthand){this.track({key:"deprecated_shorthand",value:shorthand})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackDpopKeyStorage(storage){this.track({key:"dpop-key",value:storage})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackLibc(libc){libc&&this.track({key:"libc",value:libc})}trackLaunch(launch){this.track({key:"launcher",value:launch.runtime}),launch.runtime==="native"&&launch.source&&this.track({key:"launcher_source",value:launch.source}),launch.runtime==="native"&&launch.downloadAttempts&&this.track({key:"launcher_download_attempts",value:launch.downloadAttempts}),launch.runtime==="dist"&&(this.track({key:"launcher_target",value:launch.target}),this.track({key:"launcher_fallback",value:launch.reason}),launch.downloadError&&this.track({key:"launcher_download_error",value:launch.downloadError}),launch.downloadAttempts&&this.track({key:"launcher_download_attempts",value:launch.downloadAttempts}),launch.downloadFailures&&this.track({key:"launcher_download_failures",value:launch.downloadFailures}),launch.downloadPhase&&this.track({key:"launcher_download_phase",value:launch.downloadPhase}),launch.downloadCode&&this.track({key:"launcher_download_code",value:launch.downloadCode}),launch.downloadTimeout&&this.track({key:"launcher_download_timeout",value:launch.downloadTimeout}),launch.downloadProgress&&this.track({key:"launcher_download_progress",value:launch.downloadProgress}),launch.downloadProxy&&this.track({key:"launcher_download_proxy",value:launch.downloadProxy}),launch.npmRegistry&&this.track({key:"launcher_npm_registry",value:launch.npmRegistry}),launch.npmProxy&&this.track({key:"launcher_npm_proxy",value:launch.npmProxy}),launch.npmTls&&this.track({key:"launcher_npm_tls",value:launch.npmTls}))}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID3()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}},TelemetryEventStore=class{constructor(opts){this.localEvents=[];this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.globalConfigDir=opts?.globalConfigDir,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID3(),this.deviceId=randomUUID3(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID3()}add(event){event.sessionId=this.sessionId,event.invocationId=this.invocationId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateConfig(config){this.config=config}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentLibc(){return this.cliDevice?.libc}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[]}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}setCommandTrace(event,buildLabel,localEvent,localEvents=[]){this.commandTrace={event,buildLabel},this.localCommandEvent=localEvent,this.localEvents=localEvents}getCommandTrace(){let local=this.localCommandEvent;if(!this.commandTrace||!local)return this.commandTrace;let spans=localWaterfall(local,[...startupEvents(local),...this.localEvents]);return spans.length?{...this.commandTrace,event:{...this.commandTrace.event,parentId:local.parentId},spans}:this.commandTrace}async save({detach=!1}={}){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));let commandTrace=this.getCommandTrace();commandTrace&&output_manager_default.log(`${LogLabel} Command trace ${JSON.stringify(commandTrace)}`);return}if(this.enabled){let commandTrace=this.getCommandTrace(),sessionId=this.events[0]?.sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{let{eventTime,invocationId,...rest}=event;return delete rest.sessionId,delete rest.teamId,delete rest.userId,delete rest.projectId,{event_time:eventTime,invocation_id:invocationId,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}});if(detach&&commandTrace?.spans&&Buffer.byteLength(JSON.stringify(commandTrace))>16384){let{parentId:_parentId,...event}=commandTrace.event;commandTrace={event,buildLabel:commandTrace.buildLabel}}let payload={invocationId:this.invocationId,headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events,...commandTrace?{commandTrace}:{}};await this.sendToSubprocess(payload,output_manager_default.debugEnabled&&!detach)}}async sendToSubprocess(payload,outputDebugEnabled){let serialized=encodeHandoff(payload),flushArgs=["telemetry","flush"];this.globalConfigDir&&flushArgs.push("--global-config",this.globalConfigDir);let nodeBinaryPath,script;if(isNativeBinaryInstall())nodeBinaryPath=process.execPath,script=flushArgs;else{let args=[process.execPath,process.argv[0],process.argv[1]];args[0]===args[1]&&args.shift(),nodeBinaryPath=args[0],script=[...args.slice(1),...flushArgs]}let env=(0,import_build_utils.cloneEnv)(process.env,{VERCEL_TELEMETRY_DISABLED:"1"});if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{env,stdio:["pipe","pipe","pipe"]});childProcess.stdin.on("error",()=>{}),childProcess.stdin.end(serialized),childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d),clearTimeout(timeout),resolve()});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),clearTimeout(timeout),resolve()})});{let childProcess=spawn(nodeBinaryPath,script,{stdio:["pipe","ignore","ignore"],env,windowsHide:!0,detached:!0});childProcess.on("error",()=>{}),childProcess.stdin.on("error",()=>{}),childProcess.stdin.end(serialized),childProcess.unref()}}};export{readLaunch,getStartupDurationMs,toCommandTrace,markStartup,decodeHandoff,TelemetryClient,TelemetryEventStore};
11
+ /*! Bundled license information:
12
+
13
+ imurmurhash/imurmurhash.js:
14
+ (**
15
+ * @preserve
16
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
17
+ *
18
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
19
+ * @see http://github.com/homebrewing/brauhaus-diff
20
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
21
+ * @see http://github.com/garycourt/murmurhash-js
22
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
23
+ * @see http://sites.google.com/site/murmurhash/
24
+ *)
25
+ */
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_dist as require_dist2}from"./chunk-XRIM4BUF.js";import{validateConfig}from"./chunk-RBIHS5QI.js";import{require_dist2 as require_dist}from"./chunk-NIS66BFX.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-MXURT5TX.js";import{applyEdits,findNodeAtLocation,init_main,modify,parse,parseTree}from"./chunk-J24BABG4.js";import{init_dist,stringify}from"./chunk-U4Z2MMOF.js";import{printAlignedLabel}from"./chunk-64UCX5JM.js";import{code}from"./chunk-T2FCF46I.js";import{link_default,output_manager_default}from"./chunk-W634OFUG.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);init_main();init_dist();var import_build_utils=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename}from"path";var EXPERIMENTAL_SERVICES_DOCS_URL="https://vercel.com/docs/services/experimental";async function prepareExperimentalServicesMigration(cwd,detectServicesResult){let compileResult=await compileVercelConfig(cwd);if(!compileResult.configPath)return null;let rawConfig=await readFile(compileResult.configPath,"utf8"),config=parse(rawConfig);if(!config||!(0,import_service_topology.hasLegacyServicesConfig)(config))return null;let resolvedServices=detectServicesResult?.resolved?.source==="configured"?detectServicesResult.services.filter(s=>(0,import_build_utils.isExperimentalService)(s)):void 0,plan=await(0,import_service_topology.migrateExperimentalServices)({fs:new import_fs_detectors.LocalFileSystemDetector(cwd),config,resolvedServices:resolvedServices&&resolvedServices.length>0?resolvedServices:void 0}),sourceFile=compileResult.sourceFile??basename(compileResult.configPath),preparation={plan,sourceFile,snippet:renderSnippet(sourceFile,plan)};if(plan.errors.length>0)return preparation;if(compileResult.wasCompiled)return preparation.writeBlocker=`${sourceFile} can't be updated automatically.`,preparation;let content=applyPlanToJson(rawConfig,config,plan),parseErrors=[],nextConfig=parse(content,parseErrors);if(parseErrors.length>0)return preparation.writeBlocker=`Couldn't produce a valid ${sourceFile}.`,preparation;let validationError=validateConfig(nextConfig);return validationError?(preparation.writeBlocker=validationError.message,preparation):(preparation.write={configPath:compileResult.configPath,content},preparation)}function applyPlanToJson(rawConfig,config,plan){let eol=rawConfig.includes(`\r
7
+ import{require_dist as require_dist2}from"./chunk-XRIM4BUF.js";import{validateConfig}from"./chunk-RBIHS5QI.js";import{applyEdits,findNodeAtLocation,init_main,modify,parse,parseTree}from"./chunk-J24BABG4.js";import{init_dist,stringify}from"./chunk-U4Z2MMOF.js";import{require_dist2 as require_dist}from"./chunk-NIS66BFX.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-5I7CC45F.js";import{printAlignedLabel}from"./chunk-64UCX5JM.js";import{code}from"./chunk-T2FCF46I.js";import{link_default,output_manager_default}from"./chunk-W634OFUG.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);init_main();init_dist();var import_build_utils=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename}from"path";var EXPERIMENTAL_SERVICES_DOCS_URL="https://vercel.com/docs/services/experimental";async function prepareExperimentalServicesMigration(cwd,detectServicesResult){let compileResult=await compileVercelConfig(cwd);if(!compileResult.configPath)return null;let rawConfig=await readFile(compileResult.configPath,"utf8"),config=parse(rawConfig);if(!config||!(0,import_service_topology.hasLegacyServicesConfig)(config))return null;let resolvedServices=detectServicesResult?.resolved?.source==="configured"?detectServicesResult.services.filter(s=>(0,import_build_utils.isExperimentalService)(s)):void 0,plan=await(0,import_service_topology.migrateExperimentalServices)({fs:new import_fs_detectors.LocalFileSystemDetector(cwd),config,resolvedServices:resolvedServices&&resolvedServices.length>0?resolvedServices:void 0}),sourceFile=compileResult.sourceFile??basename(compileResult.configPath),preparation={plan,sourceFile,snippet:renderSnippet(sourceFile,plan)};if(plan.errors.length>0)return preparation;if(compileResult.wasCompiled)return preparation.writeBlocker=`${sourceFile} can't be updated automatically.`,preparation;let content=applyPlanToJson(rawConfig,config,plan),parseErrors=[],nextConfig=parse(content,parseErrors);if(parseErrors.length>0)return preparation.writeBlocker=`Couldn't produce a valid ${sourceFile}.`,preparation;let validationError=validateConfig(nextConfig);return validationError?(preparation.writeBlocker=validationError.message,preparation):(preparation.write={configPath:compileResult.configPath,content},preparation)}function applyPlanToJson(rawConfig,config,plan){let eol=rawConfig.includes(`\r
8
8
  `)?`\r
9
9
  `:`
10
10
  `,indent2=/^([ \t]+)\S/m.exec(rawConfig)?.[1]??" ",formattingOptions={eol,insertSpaces:!indent2.startsWith(" "),tabSize:indent2.startsWith(" ")?1:indent2.length},legacyKey=config.experimentalServices?"experimentalServices":"experimentalServicesV2",key=findNodeAtLocation(parseTree(rawConfig),[legacyKey]).parent.children[0],text=applyEdits(rawConfig,[{offset:key.offset,length:key.length,content:'"services"'}]);text=applyEdits(text,modify(text,["services"],plan.patch.services,{formattingOptions}));for(let key2 of plan.removeKeys)key2!==legacyKey&&(text=applyEdits(text,modify(text,[key2],void 0,{formattingOptions})));for(let[key2,value]of Object.entries(plan.patch.build?.env??{}))text=applyEdits(text,modify(text,["build","env",key2],value,{formattingOptions}));if(plan.patch.rewrites.length>0)if(Array.isArray(config.rewrites))for(let rewrite of plan.patch.rewrites)text=applyEdits(text,modify(text,["rewrites",-1],rewrite,{formattingOptions}));else text=applyEdits(text,modify(text,["rewrites"],plan.patch.rewrites,{formattingOptions,getInsertionIndex:keys=>keys.indexOf("services")+1}));return text.endsWith(`