vercel 65.0.0 → 65.1.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 (342) hide show
  1. package/dist/chunks/add-G44L5OSZ.js +8 -0
  2. package/dist/chunks/add-JATTZAMX.js +8 -0
  3. package/dist/chunks/add-QMLQDEWM.js +8 -0
  4. package/dist/chunks/build-ODRPV34E.js +7 -0
  5. package/dist/chunks/chunk-2N5LDFMR.js +10 -0
  6. package/dist/chunks/chunk-2NABMKFV.js +29 -0
  7. package/dist/chunks/chunk-2PKEEQ5W.js +25 -0
  8. package/dist/chunks/{chunk-27QCVNMI.js → chunk-3LIKVGFT.js} +1 -1
  9. package/dist/chunks/{chunk-VF2WX27D.js → chunk-3PMDNDOO.js} +2 -2
  10. package/dist/chunks/{chunk-VY63XWWU.js → chunk-3V6MUBCO.js} +1 -1
  11. package/dist/chunks/{chunk-RRWEIG6B.js → chunk-3XW7N4W3.js} +1 -1
  12. package/dist/chunks/{chunk-HBPSZHXX.js → chunk-4B45V3VM.js} +1 -1
  13. package/dist/chunks/{chunk-VO2XAQFF.js → chunk-4CKX6KUQ.js} +8 -9
  14. package/dist/chunks/{detect-projects-CHMBPFSE.js → chunk-4VFYJU37.js} +1 -1
  15. package/dist/chunks/chunk-4YDPE5DC.js +7 -0
  16. package/dist/chunks/{chunk-VAZQS475.js → chunk-572TYS62.js} +1 -1
  17. package/dist/chunks/{chunk-ZIWS57E4.js → chunk-5A46JI25.js} +1 -1
  18. package/dist/chunks/chunk-5Q7PEC6C.js +7 -0
  19. package/dist/chunks/chunk-5RMIM4S2.js +7 -0
  20. package/dist/chunks/{chunk-3XDTQFBL.js → chunk-5WTGQDJ7.js} +7 -7
  21. package/dist/chunks/chunk-64XCYUH7.js +7 -0
  22. package/dist/chunks/{chunk-KNTBWMVA.js → chunk-67NIX52O.js} +1 -1
  23. package/dist/chunks/{chunk-2UBZCG4F.js → chunk-6A4CDEBQ.js} +1 -1
  24. package/dist/chunks/chunk-6CXJXQ6W.js +8 -0
  25. package/dist/chunks/chunk-6HEPFWGT.js +7 -0
  26. package/dist/chunks/chunk-6IDNVZZR.js +7 -0
  27. package/dist/chunks/{chunk-Z6JDXW4A.js → chunk-6KF43YYP.js} +1 -1
  28. package/dist/chunks/{chunk-DBNQ45J5.js → chunk-6OVX3PWM.js} +1 -1
  29. package/dist/chunks/{chunk-OVV5MV5M.js → chunk-6RCYHBTM.js} +1 -1
  30. package/dist/chunks/{chunk-AZ5OUZPP.js → chunk-6VH56CX2.js} +1 -1
  31. package/dist/chunks/chunk-6Y2ZL5XJ.js +98 -0
  32. package/dist/chunks/{chunk-ENWROHWX.js → chunk-7MQHQTCJ.js} +1 -1
  33. package/dist/chunks/chunk-7YKFF6CE.js +7 -0
  34. package/dist/chunks/{chunk-WDWYKX2I.js → chunk-ADLBLGT3.js} +1 -1
  35. package/dist/chunks/{chunk-DGDNI76L.js → chunk-AMUAIMYY.js} +1 -1
  36. package/dist/chunks/chunk-ANMDN3EG.js +9 -0
  37. package/dist/chunks/chunk-BLUPZPAS.js +7 -0
  38. package/dist/chunks/chunk-BTI5TG6Q.js +7 -0
  39. package/dist/chunks/chunk-BUJITHGZ.js +8 -0
  40. package/dist/chunks/chunk-C6GY2G73.js +7 -0
  41. package/dist/chunks/chunk-CBXS6UFD.js +10 -0
  42. package/dist/chunks/{chunk-52JGR5SZ.js → chunk-CGSHQ7QM.js} +1 -1
  43. package/dist/chunks/chunk-CKZLNL5F.js +8 -0
  44. package/dist/chunks/chunk-CS532HK4.js +7 -0
  45. package/dist/chunks/{chunk-IYM5GO57.js → chunk-CV333GGZ.js} +1 -1
  46. package/dist/chunks/{chunk-WFSQ3OSN.js → chunk-CVDK3IYT.js} +6 -9
  47. package/dist/chunks/{chunk-BFJC3UDU.js → chunk-CWQJK5IX.js} +1 -1
  48. package/dist/chunks/chunk-D3M2JG5C.js +7 -0
  49. package/dist/chunks/{chunk-RUOOZ574.js → chunk-DHYND2QH.js} +1 -1
  50. package/dist/chunks/chunk-DQYCNHTR.js +21 -0
  51. package/dist/chunks/{chunk-VO36D4U4.js → chunk-DRT6ITIC.js} +1 -1
  52. package/dist/chunks/chunk-DWJRJK7I.js +7 -0
  53. package/dist/chunks/chunk-DWZBL4NK.js +7 -0
  54. package/dist/chunks/{chunk-SSKMT5SL.js → chunk-E432NQGO.js} +1 -1
  55. package/dist/chunks/chunk-ECQIO5K3.js +7 -0
  56. package/dist/chunks/{chunk-4T22AQTB.js → chunk-EKLONFSU.js} +1 -1
  57. package/dist/chunks/chunk-ESCYLPN6.js +7 -0
  58. package/dist/chunks/{chunk-EKMQNUO4.js → chunk-F2LZJWGH.js} +1 -1
  59. package/dist/chunks/{chunk-X5J7LOJK.js → chunk-F5QCUTBE.js} +1 -1
  60. package/dist/chunks/chunk-F7AVGV4Y.js +7 -0
  61. package/dist/chunks/{chunk-JETQEZ24.js → chunk-FDAMQA44.js} +2 -2
  62. package/dist/chunks/chunk-FDYDTFFM.js +7 -0
  63. package/dist/chunks/{chunk-KDABXEHF.js → chunk-FGEWQYON.js} +1 -1
  64. package/dist/chunks/{chunk-FPC5LINQ.js → chunk-FGFLTLEA.js} +1 -1
  65. package/dist/chunks/{chunk-2BAAJZBZ.js → chunk-FQ5EU3ML.js} +1 -1
  66. package/dist/chunks/chunk-FUX6LKNP.js +7 -0
  67. package/dist/chunks/{chunk-L5ANBZTX.js → chunk-GA277JFB.js} +1 -1
  68. package/dist/chunks/chunk-GD7AV7BO.js +9 -0
  69. package/dist/chunks/chunk-GENXRXFN.js +10 -0
  70. package/dist/chunks/{chunk-W7J5HTTY.js → chunk-GENZ5QV5.js} +1 -1
  71. package/dist/chunks/{chunk-KXHUMVXD.js → chunk-H2FI64HG.js} +1 -1
  72. package/dist/chunks/{chunk-PNUH3XXW.js → chunk-HBLBUOZ7.js} +2 -2
  73. package/dist/chunks/{chunk-EJINOHL3.js → chunk-HCRD3JFL.js} +1 -1
  74. package/dist/chunks/{chunk-X3VSVBXT.js → chunk-HO6ECDO3.js} +2 -2
  75. package/dist/chunks/chunk-HRR57QNP.js +7 -0
  76. package/dist/chunks/{chunk-AGDMSAYW.js → chunk-I26SSWTS.js} +1 -1
  77. package/dist/chunks/{chunk-XD2FF2PZ.js → chunk-IC27IY7N.js} +1 -1
  78. package/dist/chunks/{chunk-IKSZMJKB.js → chunk-IPZHE3OU.js} +2 -2
  79. package/dist/chunks/{chunk-WTBGMDQ7.js → chunk-IQKGQ2Y2.js} +1 -1
  80. package/dist/chunks/chunk-IWVEHRIU.js +7 -0
  81. package/dist/chunks/chunk-IZWASLQ6.js +7 -0
  82. package/dist/chunks/{chunk-JWX2YZVC.js → chunk-J2RX4B5S.js} +1 -1
  83. package/dist/chunks/chunk-J52VRTEQ.js +10 -0
  84. package/dist/chunks/{chunk-PXU645V7.js → chunk-JB7ZP4L4.js} +1 -1
  85. package/dist/chunks/{chunk-JDVUKDX3.js → chunk-JBUFVCTP.js} +1 -1
  86. package/dist/chunks/{chunk-6CXHR2ND.js → chunk-JELLVPCM.js} +2 -2
  87. package/dist/chunks/{chunk-CTKJQTC5.js → chunk-JLEJB6KM.js} +1 -1
  88. package/dist/chunks/{chunk-66262IYI.js → chunk-JP2W5MLV.js} +1 -1
  89. package/dist/chunks/chunk-JXLPHMKT.js +7 -0
  90. package/dist/chunks/{chunk-VCV3H73W.js → chunk-JY4EKLND.js} +1 -1
  91. package/dist/chunks/{chunk-RAN5LUZY.js → chunk-K246KRFS.js} +1 -1
  92. package/dist/chunks/chunk-K4AZWWRJ.js +7 -0
  93. package/dist/chunks/{chunk-7OMWRRY4.js → chunk-KINNDNJ3.js} +1 -1
  94. package/dist/chunks/chunk-KKRTKV62.js +7 -0
  95. package/dist/chunks/chunk-KRPY5FHJ.js +7 -0
  96. package/dist/chunks/{chunk-YXZGKFF3.js → chunk-KW6GSQXV.js} +1 -1
  97. package/dist/chunks/chunk-L3FAM6KS.js +8 -0
  98. package/dist/chunks/chunk-L3T6AEPG.js +7 -0
  99. package/dist/chunks/{chunk-YPX7BXJ6.js → chunk-L6TM45P4.js} +2 -2
  100. package/dist/chunks/chunk-M5WBBJRW.js +7 -0
  101. package/dist/chunks/{chunk-RTWGDRYT.js → chunk-MG7CRSO5.js} +1 -1
  102. package/dist/chunks/chunk-MTTYJO4W.js +8 -0
  103. package/dist/chunks/{chunk-MTETAZA4.js → chunk-NFEG7ONP.js} +1 -1
  104. package/dist/chunks/chunk-NFUAFRIC.js +7 -0
  105. package/dist/chunks/{chunk-WYJGP5QW.js → chunk-NHRZRW54.js} +1 -1
  106. package/dist/chunks/chunk-NNH2H4LZ.js +15 -0
  107. package/dist/chunks/chunk-OAM5NJCU.js +9 -0
  108. package/dist/chunks/chunk-OCR5CRTH.js +10 -0
  109. package/dist/chunks/chunk-OFDTADPQ.js +7 -0
  110. package/dist/chunks/{chunk-X7CLBXWL.js → chunk-OPORM35X.js} +1 -1
  111. package/dist/chunks/chunk-PA2A2V5Y.js +10 -0
  112. package/dist/chunks/{chunk-UDMEPP3K.js → chunk-PBC276AK.js} +1 -1
  113. package/dist/chunks/{chunk-B6U5434D.js → chunk-PCLWLNZC.js} +1 -1
  114. package/dist/chunks/chunk-PDY2YXG7.js +7 -0
  115. package/dist/chunks/{chunk-KCVCGYAR.js → chunk-PF6O7LHL.js} +2 -2
  116. package/dist/chunks/chunk-PFD7LETF.js +7 -0
  117. package/dist/chunks/{chunk-LJIQZ3LU.js → chunk-PRAWMNTU.js} +1 -1
  118. package/dist/chunks/chunk-PSOVLGHP.js +7 -0
  119. package/dist/chunks/chunk-PWNCGM6A.js +7 -0
  120. package/dist/chunks/{chunk-KUGFILF5.js → chunk-PXGJGWVA.js} +1 -1
  121. package/dist/chunks/chunk-QO7CBCML.js +7 -0
  122. package/dist/chunks/{chunk-66ODHUGV.js → chunk-QWE7OFE7.js} +1 -1
  123. package/dist/chunks/{chunk-CZ2KEML2.js → chunk-R6BEOVTU.js} +1 -1
  124. package/dist/chunks/chunk-RLKS5G6C.js +12 -0
  125. package/dist/chunks/{chunk-WFEEUZ6B.js → chunk-RX2VZBEZ.js} +1 -1
  126. package/dist/chunks/chunk-S3L2OHPO.js +7 -0
  127. package/dist/chunks/{chunk-JT273F22.js → chunk-S3QPCSQR.js} +1 -1
  128. package/dist/chunks/{chunk-7G72V52B.js → chunk-SDDKXGMK.js} +1 -1
  129. package/dist/chunks/chunk-SSULKPUE.js +12 -0
  130. package/dist/chunks/chunk-TAAWMNNL.js +7 -0
  131. package/dist/chunks/chunk-THRWLZ3N.js +7 -0
  132. package/dist/chunks/chunk-U4Z2MMOF.js +301 -0
  133. package/dist/chunks/chunk-UVHKXCR5.js +11 -0
  134. package/dist/chunks/chunk-UYOFNAH5.js +33 -0
  135. package/dist/chunks/{chunk-GRVLQZFQ.js → chunk-VG2AJII6.js} +1 -1
  136. package/dist/chunks/chunk-VPH6RJ5P.js +7 -0
  137. package/dist/chunks/chunk-VT3QK5IV.js +7 -0
  138. package/dist/chunks/{chunk-T5LBVZWY.js → chunk-VWIHFPW2.js} +1 -1
  139. package/dist/chunks/{chunk-F4ZFLPMT.js → chunk-W4FODG6F.js} +1 -1
  140. package/dist/chunks/{chunk-FN7TTXXY.js → chunk-W6RCABNS.js} +1 -1
  141. package/dist/chunks/{chunk-43T3YKNH.js → chunk-WFAZDFAR.js} +1 -1
  142. package/dist/chunks/{chunk-VWK26HHN.js → chunk-WSD53RLA.js} +1 -1
  143. package/dist/chunks/chunk-XGTKHQTT.js +7 -0
  144. package/dist/chunks/{chunk-UGZ3HFHI.js → chunk-XP3FT56R.js} +3 -3
  145. package/dist/chunks/chunk-XR6QY7RR.js +7 -0
  146. package/dist/chunks/chunk-XRRGT7CM.js +9 -0
  147. package/dist/chunks/chunk-Y3J6UDPB.js +7 -0
  148. package/dist/chunks/chunk-Y5RR6CRP.js +17 -0
  149. package/dist/chunks/chunk-YEYZP3IH.js +7 -0
  150. package/dist/chunks/{chunk-HNF2BEOE.js → chunk-YJXE7NJC.js} +1 -1
  151. package/dist/chunks/{chunk-7C5JHTHO.js → chunk-YPKKC232.js} +1 -1
  152. package/dist/chunks/chunk-ZF27J6FQ.js +7 -0
  153. package/dist/chunks/chunk-ZFRNVIHI.js +7 -0
  154. package/dist/chunks/chunk-ZPXMOZ4S.js +7 -0
  155. package/dist/chunks/clear-REFHHJJB.js +8 -0
  156. package/dist/chunks/compile-vercel-config-Q7JGV2RD.js +7 -0
  157. package/dist/chunks/config-DQ23X4AJ.js +7 -0
  158. package/dist/chunks/config-GKMT3G67.js +8 -0
  159. package/dist/chunks/config-validator.mjs +1 -1
  160. package/dist/chunks/connect-git-provider-FS5Q2HO4.js +7 -0
  161. package/dist/chunks/delete-5H7AMGTE.js +10 -0
  162. package/dist/chunks/delete-MIDLGXPG.js +9 -0
  163. package/dist/chunks/detect-projects-NLAYKNQX.js +7 -0
  164. package/dist/chunks/detect-services-CNIBYXAN.js +7 -0
  165. package/dist/chunks/disable-45GKGBKT.js +7 -0
  166. package/dist/chunks/discard-ZHC6DXON.js +14 -0
  167. package/dist/chunks/dist-33WTJLVQ.js +7 -0
  168. package/dist/chunks/dist-RXYNZPEA.js +7 -0
  169. package/dist/chunks/edit-N6D2VXVA.js +9 -0
  170. package/dist/chunks/edit-TVSUOODD.js +8 -0
  171. package/dist/chunks/enable-SXFQAYFU.js +7 -0
  172. package/dist/chunks/{exec-5ZWP5NC6.js → exec-OZSY46V6.js} +1 -1
  173. package/dist/chunks/{export-3OE2RWU7.js → export-5G7MAWTT.js} +1 -1
  174. package/dist/chunks/fetch-proxy-45DGILKR.js +67 -0
  175. package/dist/chunks/future-3BZKO5JV.js +7 -0
  176. package/dist/chunks/generate-cert-for-deploy-YAJHY6TW.js +7 -0
  177. package/dist/chunks/image-W5TWCF3B.js +7 -0
  178. package/dist/chunks/import-builders-PK2EHZ43.js +7 -0
  179. package/dist/chunks/{inspect-HYJULYCV.js → inspect-5PNUHNL2.js} +1 -1
  180. package/dist/chunks/{inspect-GD6JJPWG.js → inspect-BNOMQCB4.js} +1 -1
  181. package/dist/chunks/inspect-IS5SYBTI.js +9 -0
  182. package/dist/chunks/{inspect-JWDH7C6F.js → inspect-NWAB6AGM.js} +1 -1
  183. package/dist/chunks/inspect-O5IKZFOG.js +13 -0
  184. package/dist/chunks/{list-AGS47O5P.js → list-3Q5CBGFH.js} +1 -1
  185. package/dist/chunks/{list-4SZS2TB7.js → list-JF2OEQON.js} +1 -1
  186. package/dist/chunks/list-OVHNSNGA.js +12 -0
  187. package/dist/chunks/login-3BXNN3JH.js +7 -0
  188. package/dist/chunks/login-5FKYBEVP.js +9 -0
  189. package/dist/chunks/logs-ALPOUQZZ.js +7 -0
  190. package/dist/chunks/ls-4WMW65WV.js +8 -0
  191. package/dist/chunks/{ls-Y2JQYSVO.js → ls-DVHKDVJJ.js} +1 -1
  192. package/dist/chunks/{ls-LGL5ZKEJ.js → ls-GCFLDDFZ.js} +1 -1
  193. package/dist/chunks/{ls-ZPUNJ7ND.js → ls-MERY5XTJ.js} +1 -1
  194. package/dist/chunks/{ls-KNRG7G5K.js → ls-RO7VUFMS.js} +1 -1
  195. package/dist/chunks/{ls-WQX2DS4X.js → ls-RWBJBEIJ.js} +1 -1
  196. package/dist/chunks/ls-YOXQDZ7X.js +11 -0
  197. package/dist/chunks/mutate-TGIOOZVQ.js +9 -0
  198. package/dist/chunks/notifications-J24CW3SD.js +7 -0
  199. package/dist/chunks/open-5U4GN2S4.js +7 -0
  200. package/dist/chunks/openapi-CZCUACZA.js +7 -0
  201. package/dist/chunks/permissions-B2RJ4FS6.js +7 -0
  202. package/dist/chunks/plugin-offer-E4DLD4HU.js +9 -0
  203. package/dist/chunks/prompt-missing-credentials-WWEM2TVX.js +7 -0
  204. package/dist/chunks/publish-BK3BK3PV.js +15 -0
  205. package/dist/chunks/pull-CSFLO6P5.js +7 -0
  206. package/dist/chunks/purchase-domain-if-available-7VAJB3SY.js +7 -0
  207. package/dist/chunks/push-ENXU4VFN.js +7 -0
  208. package/dist/chunks/{query-JA5OWDSP.js → query-RW2DLTO5.js} +1 -1
  209. package/dist/chunks/reauthenticate-QKPBNAAH.js +7 -0
  210. package/dist/chunks/reorder-XXOCBKOR.js +10 -0
  211. package/dist/chunks/reply-IJ4UMSYT.js +9 -0
  212. package/dist/chunks/resolve-FHUXU6TQ.js +12 -0
  213. package/dist/chunks/resolve-agent-team-3432OTOK.js +7 -0
  214. package/dist/chunks/{resolve-deployment-framework-preset-JPT2MRPA.js → resolve-deployment-framework-preset-AXXYBFCL.js} +1 -1
  215. package/dist/chunks/restore-V2KCZWP3.js +16 -0
  216. package/dist/chunks/rm-5CDEDJXM.js +8 -0
  217. package/dist/chunks/rm-FN3G7ARM.js +8 -0
  218. package/dist/chunks/rm-MPREW2CR.js +8 -0
  219. package/dist/chunks/rm-VDEXQXNO.js +8 -0
  220. package/dist/chunks/rm-XUEOPXWC.js +8 -0
  221. package/dist/chunks/routes-KHBSGELO.js +7 -0
  222. package/dist/chunks/rule-inspect-27A23NWG.js +8 -0
  223. package/dist/chunks/schema-CE2N7SZP.js +14 -0
  224. package/dist/chunks/{schema-OV4SUO52.js → schema-JCJF3AUI.js} +1 -1
  225. package/dist/chunks/select-org-IAA5ZTIS.js +7 -0
  226. package/dist/chunks/set-YP4JEPJQ.js +7 -0
  227. package/dist/chunks/setup-and-link-HS4GH2QQ.js +7 -0
  228. package/dist/chunks/{skills-6EFE7KH7.js → skills-U52S6GRY.js} +1 -1
  229. package/dist/chunks/tags-7WRBB2U4.js +7 -0
  230. package/dist/chunks/token-W6P2KNI5.js +7 -0
  231. package/dist/chunks/token-util-JDQI37VN.js +7 -0
  232. package/dist/chunks/{types-2DDQTYAO.js → types-LKCU7WSY.js} +1 -1
  233. package/dist/chunks/{update-XUMH6CAJ.js → update-DUSQP2H7.js} +1 -1
  234. package/dist/chunks/zod-2C2SXNIK.js +7 -0
  235. package/dist/commands/build/index.js +1 -1
  236. package/dist/commands/deploy/index.js +6 -6
  237. package/dist/commands/dev/index.js +17 -15
  238. package/dist/commands/env/index.js +8 -8
  239. package/dist/commands/link/index.js +1 -1
  240. package/dist/commands/list/index.js +1 -1
  241. package/dist/commands/project/index.js +113 -0
  242. package/dist/commands-account.js +185 -0
  243. package/dist/commands-ai.js +200 -0
  244. package/dist/commands-blob.js +107 -0
  245. package/dist/commands-core.js +222 -0
  246. package/dist/commands-deployments.js +84 -0
  247. package/dist/commands-flags.js +377 -0
  248. package/dist/commands-integrations.js +143 -0
  249. package/dist/commands-observability.js +93 -0
  250. package/dist/commands-routing.js +273 -0
  251. package/dist/index.js +4 -4
  252. package/dist/internal-build-worker.js +1 -1
  253. package/dist/internal-build.js +2 -2
  254. package/dist/root-help-commands.mjs +1 -1
  255. package/dist/version.mjs +1 -1
  256. package/package.json +59 -58
  257. package/dist/chunks/add-2HOGPYWC.js +0 -8
  258. package/dist/chunks/add-2RYLJ442.js +0 -8
  259. package/dist/chunks/add-PAQE7CT2.js +0 -8
  260. package/dist/chunks/build-77Q2YPHO.js +0 -7
  261. package/dist/chunks/chunk-36N6VMW4.js +0 -7
  262. package/dist/chunks/chunk-3GXZPT7T.js +0 -7
  263. package/dist/chunks/chunk-3L4MAGRI.js +0 -31
  264. package/dist/chunks/chunk-732WJANV.js +0 -15
  265. package/dist/chunks/chunk-AW7DEWIM.js +0 -7
  266. package/dist/chunks/chunk-BHWEIKSP.js +0 -10
  267. package/dist/chunks/chunk-BJ5APZ6X.js +0 -7
  268. package/dist/chunks/chunk-BZQ7YWSB.js +0 -10
  269. package/dist/chunks/chunk-CLKHGKJA.js +0 -7
  270. package/dist/chunks/chunk-FRSHC2HN.js +0 -7
  271. package/dist/chunks/chunk-IMMMID5G.js +0 -7
  272. package/dist/chunks/chunk-INDGZ3JK.js +0 -30
  273. package/dist/chunks/chunk-MIKNK3B6.js +0 -7
  274. package/dist/chunks/chunk-MVCAUS4F.js +0 -36
  275. package/dist/chunks/chunk-NYKEU7DQ.js +0 -8
  276. package/dist/chunks/chunk-O3AL3QFA.js +0 -7
  277. package/dist/chunks/chunk-ODB7LEAO.js +0 -7
  278. package/dist/chunks/chunk-PS3KKHSI.js +0 -7
  279. package/dist/chunks/chunk-R3MRIQMO.js +0 -7
  280. package/dist/chunks/chunk-RH2SQQWH.js +0 -10
  281. package/dist/chunks/chunk-UMUPJDWU.js +0 -7
  282. package/dist/chunks/chunk-WKC7S5IW.js +0 -9
  283. package/dist/chunks/chunk-XBTLXKOI.js +0 -7
  284. package/dist/chunks/chunk-XDKCDGJF.js +0 -25
  285. package/dist/chunks/chunk-YNOLLMOG.js +0 -9
  286. package/dist/chunks/chunk-YTDK6AHS.js +0 -7
  287. package/dist/chunks/chunk-ZVRKM3UD.js +0 -12
  288. package/dist/chunks/clear-HPHGW2CD.js +0 -8
  289. package/dist/chunks/compile-vercel-config-YG2E5LXN.js +0 -7
  290. package/dist/chunks/config-PZ7HFZQZ.js +0 -8
  291. package/dist/chunks/config-XH532PP3.js +0 -7
  292. package/dist/chunks/connect-git-provider-WEFO2ESM.js +0 -7
  293. package/dist/chunks/delete-UPHMMYEJ.js +0 -10
  294. package/dist/chunks/delete-Z7PXYHTL.js +0 -9
  295. package/dist/chunks/detect-services-ZYHOOBMO.js +0 -7
  296. package/dist/chunks/disable-34LCZPFL.js +0 -7
  297. package/dist/chunks/discard-HDUCYAHG.js +0 -14
  298. package/dist/chunks/edit-4F7DADVN.js +0 -9
  299. package/dist/chunks/edit-5WKAHKCW.js +0 -8
  300. package/dist/chunks/enable-YV6I32W6.js +0 -7
  301. package/dist/chunks/fetch-proxy-OC6B22AW.js +0 -7
  302. package/dist/chunks/future-N2ZTDYVW.js +0 -7
  303. package/dist/chunks/generate-cert-for-deploy-ORS7XL64.js +0 -7
  304. package/dist/chunks/image-WTWQT7A4.js +0 -7
  305. package/dist/chunks/import-builders-XBGAW4MC.js +0 -7
  306. package/dist/chunks/inspect-ISRYYL7L.js +0 -13
  307. package/dist/chunks/inspect-MEYRAEVT.js +0 -9
  308. package/dist/chunks/list-O7FAMXMT.js +0 -12
  309. package/dist/chunks/login-KNE2BGUB.js +0 -9
  310. package/dist/chunks/login-NCAGHBZD.js +0 -7
  311. package/dist/chunks/logs-7H5XDI44.js +0 -7
  312. package/dist/chunks/ls-RI6BNJO7.js +0 -8
  313. package/dist/chunks/ls-UJHETSDA.js +0 -11
  314. package/dist/chunks/mutate-QHSLJCQU.js +0 -9
  315. package/dist/chunks/notifications-557GW5KI.js +0 -7
  316. package/dist/chunks/open-IYLA5OZF.js +0 -7
  317. package/dist/chunks/openapi-IVXUCJPM.js +0 -7
  318. package/dist/chunks/permissions-2XHSDRNE.js +0 -7
  319. package/dist/chunks/prompt-missing-credentials-BLT57RIR.js +0 -7
  320. package/dist/chunks/publish-MQ56IB4K.js +0 -15
  321. package/dist/chunks/pull-K3JVXGZM.js +0 -7
  322. package/dist/chunks/purchase-domain-if-available-VDMLT3J2.js +0 -7
  323. package/dist/chunks/push-YXUJGMP4.js +0 -7
  324. package/dist/chunks/reauthenticate-YZXHWSEC.js +0 -7
  325. package/dist/chunks/reorder-UNU63VF3.js +0 -10
  326. package/dist/chunks/reply-CTLC5KAK.js +0 -9
  327. package/dist/chunks/resolve-HTKF4MMV.js +0 -12
  328. package/dist/chunks/resolve-agent-team-DLIROIXX.js +0 -7
  329. package/dist/chunks/restore-CSZYM5WU.js +0 -16
  330. package/dist/chunks/rm-BGLDOP4N.js +0 -8
  331. package/dist/chunks/rm-O2XVUZOW.js +0 -8
  332. package/dist/chunks/rm-OSMI52XV.js +0 -8
  333. package/dist/chunks/rm-SZIT75ZY.js +0 -8
  334. package/dist/chunks/rm-WJERY4WM.js +0 -8
  335. package/dist/chunks/routes-ZNPZJERJ.js +0 -7
  336. package/dist/chunks/rule-inspect-NGI6XURL.js +0 -8
  337. package/dist/chunks/schema-JLQ7SNYR.js +0 -14
  338. package/dist/chunks/select-org-URO7GRAY.js +0 -7
  339. package/dist/chunks/set-RU227EQQ.js +0 -7
  340. package/dist/chunks/setup-and-link-WX6IEZZO.js +0 -7
  341. package/dist/chunks/tags-KJINDQSV.js +0 -7
  342. package/dist/commands-bulk.js +0 -1673
@@ -1,25 +0,0 @@
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_dist}from"./chunk-PUKYAALC.js";import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_graceful_fs,require_load_json_file,require_pify}from"./chunk-4NTBYNFR.js";import{output_manager_default,require_build_utils,require_signal_exit}from"./chunk-UGZ3HFHI.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)}}});import{randomUUID as randomUUID2}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}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}.${randomUUID()}.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:randomUUID(),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??randomUUID(),...libc?{libc}:{}};return(!existing||libc)&&writePersistedCliDevice(opts.filePath,device),device}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:randomUUID2(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){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"})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}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})}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=randomUUID2()),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.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.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID2(),this.deviceId=randomUUID2(),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=randomUUID2()}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)}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}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));return}if(this.enabled){let 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}}),payload={invocationId:this.invocationId,headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events};await this.sendToSubprocess(payload,output_manager_default.debugEnabled&&!detach)}}async sendToSubprocess(payload,outputDebugEnabled){let flushArgs=["telemetry","flush",JSON.stringify(payload)],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:["ignore","pipe","pipe"]});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)});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(),timeout.unref(),resolve()})});spawn(nodeBinaryPath,script,{stdio:"ignore",env,windowsHide:!0,detached:!0}).unref()}};export{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
- */
@@ -1,9 +0,0 @@
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{writeProjectSettings}from"./chunk-F4ZFLPMT.js";import{autoInstallVercelPlugin}from"./chunk-3L4MAGRI.js";import{envPullCommandLogic}from"./chunk-RTWGDRYT.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import{ensureLink}from"./chunk-BZQ7YWSB.js";import{pullCommand}from"./chunk-36N6VMW4.js";import{parseTarget,warnDeprecatedProdFlag}from"./chunk-7C5JHTHO.js";import{help}from"./chunk-PNUH3XXW.js";import{printError}from"./chunk-OVV5MV5M.js";import{TelemetryClient}from"./chunk-XDKCDGJF.js";import{VERCEL_DIR,VERCEL_DIR_PROJECT,humanizePath}from"./chunk-3XDTQFBL.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import{emoji,output_manager_default,prependEmoji}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{join}from"node:path";var PullTelemetryClient=class extends TelemetryClient{trackCliArgumentProjectPath(value){value&&this.trackCliArgument({arg:"projectPath",value:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:this.redactedTargetName(environment)})}trackCliOptionGitBranch(gitBranch){gitBranch&&this.trackCliOption({option:"git-branch",value:this.redactedValue})}trackCliFlagProd(isProduction){isProduction&&this.trackCliFlag("prod")}trackCliFlagYes(yes){yes&&this.trackCliFlag("yes")}};async function pullAllEnvFiles(environment,client,link,flags,cwd){let environmentFile=`.env.${environment}.local`;return await envPullCommandLogic(client,join(".vercel",environmentFile),!!flags["--yes"],environment,link,flags["--git-branch"],cwd,"vercel-cli:pull"),0}async function main(client){let parsedArgs=null,flagsSpecification=getFlagsSpecification(pullCommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(error){return printError(error),2}let telemetryClient=new PullTelemetryClient({opts:{store:client.telemetryEventStore}});if(parsedArgs.flags["--help"])return telemetryClient.trackCliFlagHelp("pull"),output_manager_default.print(help(pullCommand,{columns:client.stderr.columns})),0;let cwd=parsedArgs.args[1]||client.cwd,autoConfirm=!!parsedArgs.flags["--yes"],isProduction=!!parsedArgs.flags["--prod"];warnDeprecatedProdFlag(client,parsedArgs.flags);let environment=parseTarget({flagName:"environment",flags:parsedArgs.flags})||"development";telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]),telemetryClient.trackCliFlagYes(autoConfirm),telemetryClient.trackCliFlagProd(isProduction),telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]),telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]),telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]);let returnCode=await pullCommandLogic(client,cwd,autoConfirm,environment,parsedArgs.flags,parsedArgs.flags["--project"]);return returnCode===0&&!autoConfirm&&await autoInstallVercelPlugin(client),returnCode}async function pullCommandLogic(client,cwd,autoConfirm,environment,flags,projectNameOrId){let link=await ensureLink("pull",client,cwd,{autoConfirm,pullEnv:!1,projectName:projectNameOrId,failIfNotFound:!!projectNameOrId,skipOwnerLookup:!0});if(typeof link=="number")return link;let{project,org,repoRoot}=link,currentDirectory;repoRoot?currentDirectory=join(repoRoot,project.rootDirectory||""):currentDirectory=cwd,client.config.currentTeam=org.type==="team"?org.id:void 0;let pullResultCode=await pullAllEnvFiles(environment,client,link,flags,currentDirectory);if(pullResultCode!==0)return pullResultCode;output_manager_default.print(`
8
- `),output_manager_default.log("Downloading project settings"),await writeProjectSettings(currentDirectory,project,org,typeof repoRoot=="string");let settingsStamp=stamp_default();return output_manager_default.print(`${prependEmoji(`Downloaded project settings to ${import_chalk.default.bold(humanizePath(join(currentDirectory,VERCEL_DIR,VERCEL_DIR_PROJECT)))} ${import_chalk.default.gray(settingsStamp())}`,emoji("success"))}
9
- `),0}export{main,pullCommandLogic};
@@ -1,7 +0,0 @@
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{require_source}from"./chunk-NB2WLB3J.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.js";var require_is_date=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/is_date/index.js"(exports,module){function isDate(argument){return argument instanceof Date}module.exports=isDate}});var require_parse=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/parse/index.js"(exports,module){var isDate=require_is_date(),MILLISECONDS_IN_HOUR=36e5,MILLISECONDS_IN_MINUTE=6e4,DEFAULT_ADDITIONAL_DIGITS=2,parseTokenDateTimeDelimeter=/[T ]/,parseTokenPlainTime=/:/,parseTokenYY=/^(\d{2})$/,parseTokensYYY=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],parseTokenYYYY=/^(\d{4})/,parseTokensYYYYY=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],parseTokenMM=/^-(\d{2})$/,parseTokenDDD=/^-?(\d{3})$/,parseTokenMMDD=/^-?(\d{2})-?(\d{2})$/,parseTokenWww=/^-?W(\d{2})$/,parseTokenWwwD=/^-?W(\d{2})-?(\d{1})$/,parseTokenHH=/^(\d{2}([.,]\d*)?)$/,parseTokenHHMM=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,parseTokenHHMMSS=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,parseTokenTimezone=/([Z+-].*)$/,parseTokenTimezoneZ=/^(Z)$/,parseTokenTimezoneHH=/^([+-])(\d{2})$/,parseTokenTimezoneHHMM=/^([+-])(\d{2}):?(\d{2})$/;function parse(argument,dirtyOptions){if(isDate(argument))return new Date(argument.getTime());if(typeof argument!="string")return new Date(argument);var options=dirtyOptions||{},additionalDigits=options.additionalDigits;additionalDigits==null?additionalDigits=DEFAULT_ADDITIONAL_DIGITS:additionalDigits=Number(additionalDigits);var dateStrings=splitDateString(argument),parseYearResult=parseYear(dateStrings.date,additionalDigits),year=parseYearResult.year,restDateString=parseYearResult.restDateString,date=parseDate(restDateString,year);if(date){var timestamp=date.getTime(),time=0,offset;return dateStrings.time&&(time=parseTime(dateStrings.time)),dateStrings.timezone?offset=parseTimezone(dateStrings.timezone):(offset=new Date(timestamp+time).getTimezoneOffset(),offset=new Date(timestamp+time+offset*MILLISECONDS_IN_MINUTE).getTimezoneOffset()),new Date(timestamp+time+offset*MILLISECONDS_IN_MINUTE)}else return new Date(argument)}function splitDateString(dateString){var dateStrings={},array=dateString.split(parseTokenDateTimeDelimeter),timeString;if(parseTokenPlainTime.test(array[0])?(dateStrings.date=null,timeString=array[0]):(dateStrings.date=array[0],timeString=array[1]),timeString){var token=parseTokenTimezone.exec(timeString);token?(dateStrings.time=timeString.replace(token[1],""),dateStrings.timezone=token[1]):dateStrings.time=timeString}return dateStrings}function parseYear(dateString,additionalDigits){var parseTokenYYY=parseTokensYYY[additionalDigits],parseTokenYYYYY=parseTokensYYYYY[additionalDigits],token;if(token=parseTokenYYYY.exec(dateString)||parseTokenYYYYY.exec(dateString),token){var yearString=token[1];return{year:parseInt(yearString,10),restDateString:dateString.slice(yearString.length)}}if(token=parseTokenYY.exec(dateString)||parseTokenYYY.exec(dateString),token){var centuryString=token[1];return{year:parseInt(centuryString,10)*100,restDateString:dateString.slice(centuryString.length)}}return{year:null}}function parseDate(dateString,year){if(year===null)return null;var token,date,month,week;if(dateString.length===0)return date=new Date(0),date.setUTCFullYear(year),date;if(token=parseTokenMM.exec(dateString),token)return date=new Date(0),month=parseInt(token[1],10)-1,date.setUTCFullYear(year,month),date;if(token=parseTokenDDD.exec(dateString),token){date=new Date(0);var dayOfYear=parseInt(token[1],10);return date.setUTCFullYear(year,0,dayOfYear),date}if(token=parseTokenMMDD.exec(dateString),token){date=new Date(0),month=parseInt(token[1],10)-1;var day=parseInt(token[2],10);return date.setUTCFullYear(year,month,day),date}if(token=parseTokenWww.exec(dateString),token)return week=parseInt(token[1],10)-1,dayOfISOYear(year,week);if(token=parseTokenWwwD.exec(dateString),token){week=parseInt(token[1],10)-1;var dayOfWeek=parseInt(token[2],10)-1;return dayOfISOYear(year,week,dayOfWeek)}return null}function parseTime(timeString){var token,hours,minutes;if(token=parseTokenHH.exec(timeString),token)return hours=parseFloat(token[1].replace(",",".")),hours%24*MILLISECONDS_IN_HOUR;if(token=parseTokenHHMM.exec(timeString),token)return hours=parseInt(token[1],10),minutes=parseFloat(token[2].replace(",",".")),hours%24*MILLISECONDS_IN_HOUR+minutes*MILLISECONDS_IN_MINUTE;if(token=parseTokenHHMMSS.exec(timeString),token){hours=parseInt(token[1],10),minutes=parseInt(token[2],10);var seconds=parseFloat(token[3].replace(",","."));return hours%24*MILLISECONDS_IN_HOUR+minutes*MILLISECONDS_IN_MINUTE+seconds*1e3}return null}function parseTimezone(timezoneString){var token,absoluteOffset;return token=parseTokenTimezoneZ.exec(timezoneString),token?0:(token=parseTokenTimezoneHH.exec(timezoneString),token?(absoluteOffset=parseInt(token[2],10)*60,token[1]==="+"?-absoluteOffset:absoluteOffset):(token=parseTokenTimezoneHHMM.exec(timezoneString),token?(absoluteOffset=parseInt(token[2],10)*60+parseInt(token[3],10),token[1]==="+"?-absoluteOffset:absoluteOffset):0))}function dayOfISOYear(isoYear,week,day){week=week||0,day=day||0;var date=new Date(0);date.setUTCFullYear(isoYear,0,4);var fourthOfJanuaryDay=date.getUTCDay()||7,diff=week*7+day+1-fourthOfJanuaryDay;return date.setUTCDate(date.getUTCDate()+diff),date}module.exports=parse}});var require_start_of_year=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/start_of_year/index.js"(exports,module){var parse=require_parse();function startOfYear(dirtyDate){var cleanDate=parse(dirtyDate),date=new Date(0);return date.setFullYear(cleanDate.getFullYear(),0,1),date.setHours(0,0,0,0),date}module.exports=startOfYear}});var require_start_of_day=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/start_of_day/index.js"(exports,module){var parse=require_parse();function startOfDay(dirtyDate){var date=parse(dirtyDate);return date.setHours(0,0,0,0),date}module.exports=startOfDay}});var require_difference_in_calendar_days=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/difference_in_calendar_days/index.js"(exports,module){var startOfDay=require_start_of_day(),MILLISECONDS_IN_MINUTE=6e4,MILLISECONDS_IN_DAY=864e5;function differenceInCalendarDays(dirtyDateLeft,dirtyDateRight){var startOfDayLeft=startOfDay(dirtyDateLeft),startOfDayRight=startOfDay(dirtyDateRight),timestampLeft=startOfDayLeft.getTime()-startOfDayLeft.getTimezoneOffset()*MILLISECONDS_IN_MINUTE,timestampRight=startOfDayRight.getTime()-startOfDayRight.getTimezoneOffset()*MILLISECONDS_IN_MINUTE;return Math.round((timestampLeft-timestampRight)/MILLISECONDS_IN_DAY)}module.exports=differenceInCalendarDays}});var require_get_day_of_year=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/get_day_of_year/index.js"(exports,module){var parse=require_parse(),startOfYear=require_start_of_year(),differenceInCalendarDays=require_difference_in_calendar_days();function getDayOfYear(dirtyDate){var date=parse(dirtyDate),diff=differenceInCalendarDays(date,startOfYear(date)),dayOfYear=diff+1;return dayOfYear}module.exports=getDayOfYear}});var require_start_of_week=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/start_of_week/index.js"(exports,module){var parse=require_parse();function startOfWeek(dirtyDate,dirtyOptions){var weekStartsOn=dirtyOptions&&Number(dirtyOptions.weekStartsOn)||0,date=parse(dirtyDate),day=date.getDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setDate(date.getDate()-diff),date.setHours(0,0,0,0),date}module.exports=startOfWeek}});var require_start_of_iso_week=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/start_of_iso_week/index.js"(exports,module){var startOfWeek=require_start_of_week();function startOfISOWeek(dirtyDate){return startOfWeek(dirtyDate,{weekStartsOn:1})}module.exports=startOfISOWeek}});var require_get_iso_year=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/get_iso_year/index.js"(exports,module){var parse=require_parse(),startOfISOWeek=require_start_of_iso_week();function getISOYear(dirtyDate){var date=parse(dirtyDate),year=date.getFullYear(),fourthOfJanuaryOfNextYear=new Date(0);fourthOfJanuaryOfNextYear.setFullYear(year+1,0,4),fourthOfJanuaryOfNextYear.setHours(0,0,0,0);var startOfNextYear=startOfISOWeek(fourthOfJanuaryOfNextYear),fourthOfJanuaryOfThisYear=new Date(0);fourthOfJanuaryOfThisYear.setFullYear(year,0,4),fourthOfJanuaryOfThisYear.setHours(0,0,0,0);var startOfThisYear=startOfISOWeek(fourthOfJanuaryOfThisYear);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}module.exports=getISOYear}});var require_start_of_iso_year=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/start_of_iso_year/index.js"(exports,module){var getISOYear=require_get_iso_year(),startOfISOWeek=require_start_of_iso_week();function startOfISOYear(dirtyDate){var year=getISOYear(dirtyDate),fourthOfJanuary=new Date(0);fourthOfJanuary.setFullYear(year,0,4),fourthOfJanuary.setHours(0,0,0,0);var date=startOfISOWeek(fourthOfJanuary);return date}module.exports=startOfISOYear}});var require_get_iso_week=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/get_iso_week/index.js"(exports,module){var parse=require_parse(),startOfISOWeek=require_start_of_iso_week(),startOfISOYear=require_start_of_iso_year(),MILLISECONDS_IN_WEEK=6048e5;function getISOWeek(dirtyDate){var date=parse(dirtyDate),diff=startOfISOWeek(date).getTime()-startOfISOYear(date).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK)+1}module.exports=getISOWeek}});var require_is_valid=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/is_valid/index.js"(exports,module){var isDate=require_is_date();function isValid(dirtyDate){if(isDate(dirtyDate))return!isNaN(dirtyDate);throw new TypeError(toString.call(dirtyDate)+" is not an instance of Date")}module.exports=isValid}});var require_build_distance_in_words_locale=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/locale/en/build_distance_in_words_locale/index.js"(exports,module){function buildDistanceInWordsLocale(){var distanceInWordsLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function localize(token,count,options){options=options||{};var result;return typeof distanceInWordsLocale[token]=="string"?result=distanceInWordsLocale[token]:count===1?result=distanceInWordsLocale[token].one:result=distanceInWordsLocale[token].other.replace("{{count}}",count),options.addSuffix?options.comparison>0?"in "+result:result+" ago":result}return{localize}}module.exports=buildDistanceInWordsLocale}});var require_build_formatting_tokens_reg_exp=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/locale/_lib/build_formatting_tokens_reg_exp/index.js"(exports,module){var commonFormatterKeys=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];function buildFormattingTokensRegExp(formatters){var formatterKeys=[];for(var key in formatters)formatters.hasOwnProperty(key)&&formatterKeys.push(key);var formattingTokens=commonFormatterKeys.concat(formatterKeys).sort().reverse(),formattingTokensRegExp=new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+formattingTokens.join("|")+"|.)","g");return formattingTokensRegExp}module.exports=buildFormattingTokensRegExp}});var require_build_format_locale=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/locale/en/build_format_locale/index.js"(exports,module){var buildFormattingTokensRegExp=require_build_formatting_tokens_reg_exp();function buildFormatLocale(){var months3char=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsFull=["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays2char=["Su","Mo","Tu","We","Th","Fr","Sa"],weekdays3char=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysFull=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],meridiemUppercase=["AM","PM"],meridiemLowercase=["am","pm"],meridiemFull=["a.m.","p.m."],formatters={MMM:function(date){return months3char[date.getMonth()]},MMMM:function(date){return monthsFull[date.getMonth()]},dd:function(date){return weekdays2char[date.getDay()]},ddd:function(date){return weekdays3char[date.getDay()]},dddd:function(date){return weekdaysFull[date.getDay()]},A:function(date){return date.getHours()/12>=1?meridiemUppercase[1]:meridiemUppercase[0]},a:function(date){return date.getHours()/12>=1?meridiemLowercase[1]:meridiemLowercase[0]},aa:function(date){return date.getHours()/12>=1?meridiemFull[1]:meridiemFull[0]}},ordinalFormatters=["M","D","DDD","d","Q","W"];return ordinalFormatters.forEach(function(formatterToken){formatters[formatterToken+"o"]=function(date,formatters2){return ordinal(formatters2[formatterToken](date))}}),{formatters,formattingTokensRegExp:buildFormattingTokensRegExp(formatters)}}function ordinal(number){var rem100=number%100;if(rem100>20||rem100<10)switch(rem100%10){case 1:return number+"st";case 2:return number+"nd";case 3:return number+"rd"}return number+"th"}module.exports=buildFormatLocale}});var require_en=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/locale/en/index.js"(exports,module){var buildDistanceInWordsLocale=require_build_distance_in_words_locale(),buildFormatLocale=require_build_format_locale();module.exports={distanceInWords:buildDistanceInWordsLocale(),format:buildFormatLocale()}}});var require_format=__commonJS({"../../node_modules/.pnpm/date-fns@1.29.0/node_modules/date-fns/format/index.js"(exports,module){var getDayOfYear=require_get_day_of_year(),getISOWeek=require_get_iso_week(),getISOYear=require_get_iso_year(),parse=require_parse(),isValid=require_is_valid(),enLocale=require_en();function format2(dirtyDate,dirtyFormatStr,dirtyOptions){var formatStr=dirtyFormatStr?String(dirtyFormatStr):"YYYY-MM-DDTHH:mm:ss.SSSZ",options=dirtyOptions||{},locale=options.locale,localeFormatters=enLocale.format.formatters,formattingTokensRegExp=enLocale.format.formattingTokensRegExp;locale&&locale.format&&locale.format.formatters&&(localeFormatters=locale.format.formatters,locale.format.formattingTokensRegExp&&(formattingTokensRegExp=locale.format.formattingTokensRegExp));var date=parse(dirtyDate);if(!isValid(date))return"Invalid Date";var formatFn=buildFormatFn(formatStr,localeFormatters,formattingTokensRegExp);return formatFn(date)}var formatters={M:function(date){return date.getMonth()+1},MM:function(date){return addLeadingZeros(date.getMonth()+1,2)},Q:function(date){return Math.ceil((date.getMonth()+1)/3)},D:function(date){return date.getDate()},DD:function(date){return addLeadingZeros(date.getDate(),2)},DDD:function(date){return getDayOfYear(date)},DDDD:function(date){return addLeadingZeros(getDayOfYear(date),3)},d:function(date){return date.getDay()},E:function(date){return date.getDay()||7},W:function(date){return getISOWeek(date)},WW:function(date){return addLeadingZeros(getISOWeek(date),2)},YY:function(date){return addLeadingZeros(date.getFullYear(),4).substr(2)},YYYY:function(date){return addLeadingZeros(date.getFullYear(),4)},GG:function(date){return String(getISOYear(date)).substr(2)},GGGG:function(date){return getISOYear(date)},H:function(date){return date.getHours()},HH:function(date){return addLeadingZeros(date.getHours(),2)},h:function(date){var hours=date.getHours();return hours===0?12:hours>12?hours%12:hours},hh:function(date){return addLeadingZeros(formatters.h(date),2)},m:function(date){return date.getMinutes()},mm:function(date){return addLeadingZeros(date.getMinutes(),2)},s:function(date){return date.getSeconds()},ss:function(date){return addLeadingZeros(date.getSeconds(),2)},S:function(date){return Math.floor(date.getMilliseconds()/100)},SS:function(date){return addLeadingZeros(Math.floor(date.getMilliseconds()/10),2)},SSS:function(date){return addLeadingZeros(date.getMilliseconds(),3)},Z:function(date){return formatTimezone(date.getTimezoneOffset(),":")},ZZ:function(date){return formatTimezone(date.getTimezoneOffset())},X:function(date){return Math.floor(date.getTime()/1e3)},x:function(date){return date.getTime()}};function buildFormatFn(formatStr,localeFormatters,formattingTokensRegExp){var array=formatStr.match(formattingTokensRegExp),length=array.length,i,formatter;for(i=0;i<length;i++)formatter=localeFormatters[array[i]]||formatters[array[i]],formatter?array[i]=formatter:array[i]=removeFormattingTokens(array[i]);return function(date){for(var output="",i2=0;i2<length;i2++)array[i2]instanceof Function?output+=array[i2](date,formatters):output+=array[i2];return output}}function removeFormattingTokens(input){return input.match(/\[[\s\S]/)?input.replace(/^\[|]$/g,""):input.replace(/\\/g,"")}function formatTimezone(offset,delimeter){delimeter=delimeter||"";var sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=Math.floor(absOffset/60),minutes=absOffset%60;return sign+addLeadingZeros(hours,2)+delimeter+addLeadingZeros(minutes,2)}function addLeadingZeros(number,targetLength){for(var output=Math.abs(number).toString();output.length<targetLength;)output="0"+output;return output}module.exports=format2}});var import_ms=__toESM(require_ms(),1),import_chalk=__toESM(require_source(),1),import_format=__toESM(require_format(),1);function isMissingDate(value){return value==null||value===""}function formatDate(dateStrOrNumber){if(isMissingDate(dateStrOrNumber))return import_chalk.default.gray("-");let date=new Date(dateStrOrNumber),diff=date.getTime()-Date.now();return diff<0?`${(0,import_format.default)(date,"DD MMMM YYYY HH:mm:ss")} ${import_chalk.default.gray(`[${(0,import_ms.default)(-diff)} ago]`)}`:`${(0,import_format.default)(date,"DD MMMM YYYY HH:mm:ss")} ${import_chalk.default.gray(`[in ${(0,import_ms.default)(diff)}]`)}`}function formatDateWithoutTime(dateStrOrNumber){if(isMissingDate(dateStrOrNumber))return import_chalk.default.gray("-");let date=new Date(dateStrOrNumber),diff=date.getTime()-Date.now();return diff<0?`${(0,import_format.default)(date,"MMM DD YYYY")} ${import_chalk.default.gray(`[${(0,import_ms.default)(-diff)} ago]`)}`:`${(0,import_format.default)(date,"MMM DD YYYY")} ${import_chalk.default.gray(`[in ${(0,import_ms.default)(diff)}]`)}`}export{require_format,formatDate,formatDateWithoutTime};
@@ -1,12 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import{readJSONFile}from"./chunk-43T3YKNH.js";import{require_dist as require_dist2,validateConfig}from"./chunk-CLKHGKJA.js";import{require_dist2 as require_dist}from"./chunk-WFSQ3OSN.js";import{compileVercelConfig}from"./chunk-VF2WX27D.js";import{CantParseJSONFile}from"./chunk-AZ5OUZPP.js";import{require_build_utils}from"./chunk-UGZ3HFHI.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename,join as join2}from"path";import{parse as tomlParse,stringify as tomlStringify}from"smol-toml";var import_build_utils=__toESM(require_build_utils(),1);import{join}from"path";function createDetectEntrypoint(projectRoot){return async({workPath,framework})=>{let absWorkPath=(0,import_build_utils.normalizePath)(join(projectRoot,workPath)),builderName;if((0,import_build_utils.isPythonFramework)(framework))builderName="@vercel/python";else if((0,import_build_utils.isNodeBackendFramework)(framework))builderName="@vercel/backends";else if(framework==="go")builderName="@vercel/go";else if(framework==="rust")builderName="@vercel/rust";else return null;let detectEntrypoint=await loadBuilderDetectEntrypoint(builderName,projectRoot);return detectEntrypoint?detectEntrypoint(builderName==="@vercel/python"?{workPath:absWorkPath,framework}:{workPath:absWorkPath}):null}}async function loadBuilderDetectEntrypoint(name,projectRoot){let{importBuilders}=await import("./import-builders-XBGAW4MC.js"),loaded=(await importBuilders(new Set([name]),projectRoot)).get(name);if(!loaded)return;let detect=loaded.builder.detectEntrypoint;return typeof detect=="function"?detect:void 0}function getServicesConfiguration(config){let configuredServices=config?.services??config?.experimentalServicesV2??config?.experimentalServices,configuredServicesType=config?.services?"services":config?.experimentalServicesV2?"experimentalServicesV2":config?.experimentalServices?"experimentalServices":void 0;return{configuredServices,configuredServicesType}}async function loadVercelConfig(cwd){try{let{configPath}=await compileVercelConfig(cwd);if(!configPath)return null;let config=await readJSONFile(configPath);return config instanceof Error?null:config}catch{return null}}function isServicesEnvEnabled(){let value=process.env.VERCEL_USE_EXPERIMENTAL_SERVICES;return value==="1"||value?.toLowerCase()==="true"}async function isExperimentalServicesEnabled(cwd){let{configuredServices}=getServicesConfiguration(await loadVercelConfig(cwd));return isServicesEnvEnabled()||configuredServices!==void 0}async function tryDetectServices(cwd,config){config===void 0&&(config=await loadVercelConfig(cwd));let configuration=getServicesConfiguration(config);if(!isServicesEnvEnabled()&&!configuration.configuredServices)return null;let fs=new import_fs_detectors.LocalFileSystemDetector(cwd),result=await(0,import_service_topology.detectServices)({fs,configuredServices:configuration.configuredServices,configuredServicesType:configuration.configuredServicesType,detectEntrypoint:createDetectEntrypoint(cwd)});return result.errors.some(e=>e.code==="NO_SERVICES_CONFIGURED")?null:result}async function writeServicesConfig(cwd,config){let prepared=await prepareServicesConfigWrite(cwd,config);return await writeFile(prepared.configPath,prepared.content,"utf8"),{configFileName:basename(prepared.configPath)}}async function getServicesConfigWriteBlocker(cwd,config){try{return await prepareServicesConfigWrite(cwd,config),null}catch(error){return getServicesConfigWriteBlockerFromError(error)}}function toProjectServicesConfigPatch(config){let services={};for(let[name,svc]of Object.entries(config)){let buildCommand=svc.preDeployCommand&&svc.buildCommand?`${svc.buildCommand} && ${svc.preDeployCommand}`:svc.preDeployCommand||svc.buildCommand;services[name]={root:svc.root,...svc.framework?{framework:svc.framework}:{},...svc.entrypoint?{entrypoint:svc.entrypoint}:{},...buildCommand?{buildCommand}:{}}}let rewrites=(0,import_service_topology.generateServiceRewrites)(config);return{services,...rewrites.length>0?{rewrites}:{}}}async function prepareServicesConfigWrite(cwd,config){let compileResult=await compileVercelConfig(cwd),configPath=join2(cwd,"vercel.json");if(compileResult.sourceFile==="vercel.toml")return prepareTomlServicesConfigWrite(join2(cwd,"vercel.toml"),config);if(compileResult.wasCompiled)throw new Error(`Cannot automatically update ${compileResult.sourceFile??"the current Vercel config"}.`);let existingConfig={};if(compileResult.configPath&&basename(compileResult.configPath)==="vercel.json"){let result=await readJSONFile(configPath);if(result instanceof CantParseJSONFile)throw result;existingConfig=result??{}}let patch=toProjectServicesConfigPatch(config),nextConfig={...existingConfig,...patch,...patch.rewrites?{rewrites:[...existingConfig.rewrites??[],...patch.rewrites]}:{}},validationError=validateConfig(nextConfig);if(validationError)throw validationError;return{configPath,content:JSON.stringify(nextConfig,null,2)+`
8
- `}}async function prepareTomlServicesConfigWrite(configPath,config){let patch=toProjectServicesConfigPatch(config),patchKeys=Object.keys(patch),existingContent;try{existingContent=await readFile(configPath,"utf8")}catch{existingContent=""}if(existingContent.trim()){let existingParsed=tomlParse(existingContent),overlapping=patchKeys.filter(key=>key in existingParsed);if(overlapping.length>0){let plural=overlapping.length>1,keyList=overlapping.map(k=>`"${k}"`).join(", ");throw new Error(`Cannot automatically update vercel.toml: key${plural?"s":""} ${keyList} already exist${plural?"":"s"}.`)}}let patchToml=tomlStringify(patch),content=existingContent.trim()?existingContent.trimEnd()+`
9
-
10
- `+patchToml+`
11
- `:patchToml+`
12
- `;return{configPath,content}}function getServicesConfigWriteBlockerFromError(error){switch(error?.code){case"EXPERIMENTAL_SERVICES_AND_BUILDS":case"SERVICES_AND_BUILDS":return"builds";case"EXPERIMENTAL_SERVICES_AND_FUNCTIONS":case"SERVICES_AND_FUNCTIONS":return"functions";default:return null}}export{createDetectEntrypoint,loadVercelConfig,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig,getServicesConfigWriteBlocker};
@@ -1,8 +0,0 @@
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{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-XD2FF2PZ.js";import"./chunk-NYKEU7DQ.js";import"./chunk-BHWEIKSP.js";import{permissionsClearSubcommand}from"./chunk-LJIQZ3LU.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{printError}from"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr permissions <repository> clear");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
8
- `):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};
@@ -1,7 +0,0 @@
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{compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig}from"./chunk-VF2WX27D.js";import{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS}from"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{DEFAULT_VERCEL_CONFIG_FILENAME,VERCEL_CONFIG_EXTENSIONS,compileVercelConfig,findSourceVercelConfigFile,getVercelConfigPath,normalizeConfig};
@@ -1,8 +0,0 @@
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{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrChoice,validateVcrJsonOutput}from"./chunk-XD2FF2PZ.js";import{outputError}from"./chunk-NYKEU7DQ.js";import"./chunk-BHWEIKSP.js";import{configSubcommand}from"./chunk-3GXZPT7T.js";import"./chunk-VCV3H73W.js";import"./chunk-LJIQZ3LU.js";import"./chunk-KUGFILF5.js";import"./chunk-FBYA6LLM.js";import"./chunk-SCV7XEEO.js";import{printError}from"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var USAGE="vcr update <repository> --public <true|false>";async function config(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(configSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],publicValue=parsedArgs.flags["--public"],invalidChoice=validateVcrChoice(client,"--public",publicValue,["true","false"],fr.jsonOutput);if(typeof invalidChoice=="number")return invalidChoice;telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionPublic(publicValue);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,USAGE);if(typeof missingRepository=="number")return missingRepository;if(publicValue===void 0){let message="Missing a setting to change. Pass --public true to make the repository public, or --public false to make it private.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with --public true or --public false"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",message)}let desiredPublic=publicValue==="true",scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPath(scope,repository);output_manager_default.spinner("Updating repository...");try{let updated=await client.fetch(path,{method:"PATCH",body:{public:desiredPublic}});if(fr.jsonOutput)client.stdout.write(`${JSON.stringify(updated,null,2)}
8
- `);else{let isPublic=updated.repository?.public??desiredPublic;output_manager_default.success(`Repository ${updated.repository?.name??repository} is now ${isPublic?"public":"private"}`)}return 0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to confirm the name or id"}});throw err}finally{output_manager_default.stopSpinner()}}export{config as default};
@@ -1,7 +0,0 @@
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{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-732WJANV.js";import"./chunk-GRVLQZFQ.js";import{tracesCommand}from"./chunk-WYJGP5QW.js";import{lsSubcommand,rmSubcommand,setSubcommand,tracesConfigCommand}from"./chunk-7G72V52B.js";import"./chunk-3GXZPT7T.js";import"./chunk-VCV3H73W.js";import"./chunk-LJIQZ3LU.js";import"./chunk-KUGFILF5.js";import"./chunk-BJ5APZ6X.js";import"./chunk-IMMMID5G.js";import"./chunk-4T22AQTB.js";import"./chunk-UMUPJDWU.js";import"./chunk-HBPSZHXX.js";import"./chunk-AGDMSAYW.js";import"./chunk-B4YYOSPY.js";import"./chunk-VAZQS475.js";import"./chunk-36N6VMW4.js";import"./chunk-52JGR5SZ.js";import"./chunk-JALVF3C2.js";import"./chunk-AW7DEWIM.js";import"./chunk-MIKNK3B6.js";import{help}from"./chunk-PNUH3XXW.js";import"./chunk-773GOZIR.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import{TelemetryClient}from"./chunk-XDKCDGJF.js";import"./chunk-PUKYAALC.js";import"./chunk-NWGBDBZI.js";import"./chunk-FRSHC2HN.js";import"./chunk-4NTBYNFR.js";import{warnDeprecatedSubcommand}from"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var TracesConfigTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSet(actual){this.trackCliSubcommand({subcommand:"set",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}};var COMMAND_CONFIG={ls:getCommandAliases(lsSubcommand),set:getCommandAliases(setSubcommand),remove:getCommandAliases(rmSubcommand)},SUBCOMMAND_METADATA={ls:lsSubcommand,set:setSubcommand,remove:rmSubcommand};async function config(client,{args,needHelp,subcommandOriginal,telemetry}){let{subcommand:action,subcommandOriginal:actionOriginal}=getSubcommand(args,COMMAND_CONFIG),actionMetadata=typeof action=="string"?SUBCOMMAND_METADATA[action]:void 0;function printHelp(command){return output_manager_default.print(help(command,{parent:tracesCommand,columns:client.stderr.columns})),needHelp?0:2}if(needHelp)return telemetry.trackCliFlagHelp("traces",subcommandOriginal),printHelp(actionMetadata||tracesConfigCommand);telemetry.trackCliSubcommandConfig(subcommandOriginal);let configTelemetry=new TracesConfigTelemetryClient({opts:{store:client.telemetryEventStore}});switch(action){case"ls":return configTelemetry.trackCliSubcommandLs(actionOriginal),(await import("./ls-ZPUNJ7ND.js")).default(client);case"set":return configTelemetry.trackCliSubcommandSet(actionOriginal),(await import("./set-RU227EQQ.js")).default(client);case"remove":return configTelemetry.trackCliSubcommandRemove(actionOriginal),actionOriginal==="delete"&&warnDeprecatedSubcommand(client,"traces config delete","traces config remove"),(await import("./rm-WJERY4WM.js")).default(client);default:return printHelp(tracesConfigCommand)}}export{config as default};
@@ -1,7 +0,0 @@
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{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl}from"./chunk-WTBGMDQ7.js";import"./chunk-EAUDC24V.js";import"./chunk-RRDNKB2X.js";import"./chunk-MVGTMPMI.js";import"./chunk-SACGQMVQ.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{buildRepoUrl,checkExistsAndConnect,connectGitProvider,disconnectGitProvider,formatProvider,parseRepoUrl,printRemoteUrls,selectAndParseRemoteUrl,selectRemoteUrl};
@@ -1,10 +0,0 @@
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{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoutes,withGlobalFlags}from"./chunk-JETQEZ24.js";import"./chunk-X5J7LOJK.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-2BAAJZBZ.js";import{deleteSubcommand}from"./chunk-BJ5APZ6X.js";import"./chunk-Q7D7RGXM.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"];if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes remove <name-or-id> --yes"),when:"pass one or more ids/names and --yes to skip confirm"}]},2),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes remove <name-or-id> [...]")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
8
- `),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be removed:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
9
- `)}if(output_manager_default.print(`
10
- `),!skipConfirmation&&(client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Removing routes requires confirmation. Pass --yes to skip the prompt in non-interactive mode.",next:[{command:withGlobalFlags(client,`routes remove ${args.join(" ")} --yes`),when:"re-run with --yes to confirm without prompt"}]},1),!await client.input.confirm(`Remove ${resolved.length===1?"this route":`these ${resolved.length} routes`}?`,!1)))return output_manager_default.log("Aborted."),0;let deleteStamp=stamp_default();output_manager_default.spinner(`Removing ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Removed")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to remove routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to remove routes"),1}}export{deleteRoute as default};
@@ -1,9 +0,0 @@
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{parseThreadArg}from"./chunk-2S6PE6GB.js";import{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-Z6JDXW4A.js";import{outputError}from"./chunk-NYKEU7DQ.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import"./chunk-X5J7LOJK.js";import"./chunk-2BAAJZBZ.js";import{deleteSubcommand}from"./chunk-UMUPJDWU.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import{validateJsonOutput}from"./chunk-RAN5LUZY.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function deleteCommentMessage(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(deleteSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"delete")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;if(!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED","Pass --yes to delete the message non-interactively.");if(!await client.input.confirm(`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug??scope.teamId}? This cannot be undone.`,!1))return output_manager_default.log("Canceled."),0}telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);try{let result=await deleteMessage(client,scope.teamId,threadId,messageId);return jsonOutput?(client.stdout.write(`${JSON.stringify(result,null,2)}
8
- `),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
9
- `),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{deleteCommentMessage as default};
@@ -1,7 +0,0 @@
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{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig}from"./chunk-ZVRKM3UD.js";import"./chunk-43T3YKNH.js";import"./chunk-CLKHGKJA.js";import"./chunk-WFSQ3OSN.js";import"./chunk-VF2WX27D.js";import"./chunk-25565AGS.js";import"./chunk-MVCAUS4F.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{getServicesConfigWriteBlocker,isExperimentalServicesEnabled,loadVercelConfig,tryDetectServices,writeServicesConfig};
@@ -1,7 +0,0 @@
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{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-JETQEZ24.js";import"./chunk-X5J7LOJK.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-2BAAJZBZ.js";import{disableSubcommand}from"./chunk-BJ5APZ6X.js";import"./chunk-Q7D7RGXM.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function disable(client,argv){let parsed=await parseSubcommandArgs(argv,disableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes disable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes disable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled===!1)return output_manager_default.log(`Route "${route.name}" is already disabled.`),0;let disableStamp=stamp_default();output_manager_default.spinner(`Disabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!1,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Disabled")} route "${route.name}" ${import_chalk.default.gray(disableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to disable route"},1),output_manager_default.error(error.message||"Failed to disable route"),1}}export{disable as default};
@@ -1,14 +0,0 @@
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{updateRouteVersion}from"./chunk-6QKS6QK7.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{confirmAction,getRoutes,parseSubcommandArgs,printDiffSummary,requireProjectContext,withGlobalFlags}from"./chunk-JETQEZ24.js";import"./chunk-X5J7LOJK.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-2BAAJZBZ.js";import{discardSubcommand}from"./chunk-BJ5APZ6X.js";import"./chunk-Q7D7RGXM.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function discard(client,argv){let parsed=await parseSubcommandArgs(argv,discardSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0;output_manager_default.spinner(`Fetching route versions for ${import_chalk.default.bold(project.name)}`);let{versions}=await getRouteVersions(client,project.id,{teamId}),stagingVersion=versions.find(v=>v.isStaging);if(!stagingVersion)return output_manager_default.warn(`No staged changes to discard. Make changes first with ${import_chalk.default.cyan(withGlobalFlags(client,"routes add"))}.`),0;output_manager_default.spinner("Fetching staged changes");let{routes:diffRoutes}=await getRoutes(client,project.id,{teamId,versionId:stagingVersion.id,diff:!0}),changedRoutes=diffRoutes.filter(r=>r.action!==void 0);if(changedRoutes.length>0?(output_manager_default.print(`
8
- ${import_chalk.default.bold("Changes to be discarded:")}
9
-
10
- `),printDiffSummary(changedRoutes),output_manager_default.print(`
11
- `)):output_manager_default.print(`
12
- ${import_chalk.default.gray("No changes detected in staging version.")}
13
-
14
- `),!await confirmAction(client,parsed.flags["--yes"],"Discard all staged changes?","This action cannot be undone."))return output_manager_default.log("Canceled"),0;let updateStamp=stamp_default();output_manager_default.spinner("Discarding staged changes");try{return await updateRouteVersion(client,project.id,stagingVersion.id,"discard",{teamId}),output_manager_default.log(`${import_chalk.default.cyan("Success!")} Staged changes discarded ${import_chalk.default.gray(updateStamp())}`),0}catch(e){let msg=e.message||"Failed to discard staged changes";return client.nonInteractive?(outputAgentError(client,{status:"error",reason:"api_error",message:msg,next:[{command:withGlobalFlags(client,"routes discard --yes")}]}),process.exit(1),1):(output_manager_default.error(msg),1)}}export{discard as default};
@@ -1,9 +0,0 @@
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{resolveMessageContent}from"./chunk-B6U5434D.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateMessage}from"./chunk-Z6JDXW4A.js";import{outputError}from"./chunk-NYKEU7DQ.js";import"./chunk-IQ7FPAI4.js";import"./chunk-X5J7LOJK.js";import"./chunk-2BAAJZBZ.js";import{editSubcommand}from"./chunk-UMUPJDWU.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import{validateJsonOutput}from"./chunk-RAN5LUZY.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(editSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"update")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]),telemetry.trackCliOptionFile(parsedArgs.flags["--file"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments update <thread> <message-id> -m <text>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"]},jsonOutput);if(typeof content=="number")return content;if(content===void 0)return outputError(client,jsonOutput,"MISSING_CONTENT","Pass the new content with -m <text> or --file <path>.");telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;try{let message=await updateMessage(client,scope.teamId,threadId,messageId,{markdown:content});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
8
- `),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Updated message ${messageId}
9
- `),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{edit as default};
@@ -1,8 +0,0 @@
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{editRoute}from"./chunk-AM46JVVN.js";import{applyFlagMutations,cloneRoute,convertRouteToCurrentRoute,generateRoute,generatedRouteToAddInput,hasAnyTransformFlags,populateRouteEnv,printGeneratedRoutePreview,printRouteConfig,routingRuleToCurrentRoute,runInteractiveEditLoop}from"./chunk-JT273F22.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,shellQuoteRouteIdentifierForSuggestion,withGlobalFlags}from"./chunk-JETQEZ24.js";import"./chunk-X5J7LOJK.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-2BAAJZBZ.js";import{editSubcommand}from"./chunk-BJ5APZ6X.js";import"./chunk-Q7D7RGXM.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function edit(client,argv){let parsed=await parseSubcommandArgs(argv,editSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed,skipConfirmation=flags["--yes"],identifier=args[0],{RoutesEditTelemetryClient}=await import("./routes-ZNPZJERJ.js"),telemetry=new RoutesEditTelemetryClient({opts:{store:client.telemetryEventStore}});if(telemetry.trackCliArgumentNameOrId(identifier),telemetry.trackCliFlagYes(skipConfirmation),telemetry.trackCliOptionName(flags["--name"]),telemetry.trackCliOptionDescription(flags["--description"]),telemetry.trackCliOptionSrc(flags["--src"]),telemetry.trackCliOptionSrcSyntax(flags["--src-syntax"]),telemetry.trackCliOptionAction(flags["--action"]),telemetry.trackCliOptionDest(flags["--dest"]),telemetry.trackCliOptionStatus(flags["--status"]),telemetry.trackCliFlagNoDest(flags["--no-dest"]),telemetry.trackCliFlagNoStatus(flags["--no-status"]),telemetry.trackCliFlagClearConditions(flags["--clear-conditions"]),telemetry.trackCliFlagClearHeaders(flags["--clear-headers"]),telemetry.trackCliFlagClearTransforms(flags["--clear-transforms"]),telemetry.trackCliOptionSetResponseHeader(flags["--set-response-header"]),telemetry.trackCliOptionAppendResponseHeader(flags["--append-response-header"]),telemetry.trackCliOptionDeleteResponseHeader(flags["--delete-response-header"]),telemetry.trackCliOptionSetRequestHeader(flags["--set-request-header"]),telemetry.trackCliOptionAppendRequestHeader(flags["--append-request-header"]),telemetry.trackCliOptionDeleteRequestHeader(flags["--delete-request-header"]),telemetry.trackCliOptionSetRequestQuery(flags["--set-request-query"]),telemetry.trackCliOptionAppendRequestQuery(flags["--append-request-query"]),telemetry.trackCliOptionDeleteRequestQuery(flags["--delete-request-query"]),telemetry.trackCliOptionHas(flags["--has"]),telemetry.trackCliOptionMissing(flags["--missing"]),telemetry.trackCliOptionAi(flags["--ai"]),!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required as the first argument after routes update.",next:[{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"replace <name-or-id> with route name or id from routes list"},{command:withGlobalFlags(client,"routes list"),when:"to list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes update <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --ai <description> --yes"),when:"add a route first (or use full flags)"}]},1),output_manager_default.error("No routes found in this project."),1;let originalRoute=await resolveRoute(client,routes,identifier);if(!originalRoute)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"to list routes and pick an exact name or id"},{command:withGlobalFlags(client,"routes update <name-or-id>"),when:"retry with a unique name or id"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;let aiPrompt=flags["--ai"];if(aiPrompt){let usedConflicts=["--name","--description","--src","--src-syntax","--action","--dest","--status","--no-dest","--no-status","--has","--missing","--set-response-header","--append-response-header","--delete-response-header","--set-request-header","--append-request-header","--delete-request-header","--set-request-query","--append-request-query","--delete-request-query","--clear-conditions","--clear-headers","--clear-transforms"].filter(f=>flags[f]!==void 0);return usedConflicts.length>0?(client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --ai <description> --yes`),when:"use only --ai with route id/name already set"}]},2),output_manager_default.error(`Cannot use --ai with ${usedConflicts.join(", ")}. Use --ai alone to describe changes.`),2):await handleAIEdit(client,project.id,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion)}let route=cloneRoute(originalRoute);if(flags["--name"]!==void 0||flags["--description"]!==void 0||flags["--src"]!==void 0||flags["--src-syntax"]!==void 0||flags["--action"]!==void 0||flags["--dest"]!==void 0||flags["--status"]!==void 0||flags["--no-dest"]!==void 0||flags["--no-status"]!==void 0||flags["--has"]!==void 0||flags["--missing"]!==void 0||flags["--clear-conditions"]!==void 0||flags["--clear-headers"]!==void 0||flags["--clear-transforms"]!==void 0||hasAnyTransformFlags(flags)){let error=applyFlagMutations(route,flags);if(error)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"invalid_arguments",message:error,next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} ...`),when:"fix flags per message; see routes update --help"}]},2),output_manager_default.error(error),2}else{if(!client.stdin.isTTY||client.nonInteractive)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"No update flags provided. In non-interactive mode pass flags such as --name, --src, --dest, --action, header flags, or --ai <description> --yes.",next:[{command:withGlobalFlags(client,`routes update ${shellQuoteRouteIdentifierForSuggestion(identifier)} --dest <dest> --yes`),when:"example: set destination; see routes update --help"}],hint:"Run vercel routes update --help for all flag options."},2),output_manager_default.error(`No update flags provided. When running non-interactively, use flags like --name, --dest, --src, etc. Run ${withGlobalFlags(client,"routes update --help")} for all options.`),2;if(output_manager_default.log(`
8
- Editing route "${originalRoute.name}"`),printRouteConfig(route),await client.input.select({message:"How would you like to update this route?",choices:[{name:"Describe changes (AI-powered)",value:"ai"},{name:"Edit manually (field by field)",value:"manual"}]})==="ai")return telemetry.trackCliOptionAi("interactive"),await handleAIEdit(client,project.id,teamId,originalRoute,void 0,skipConfirmation,existingStagingVersion);await runInteractiveEditLoop(client,route)}if(populateRouteEnv(route.route,route.srcSyntax),JSON.stringify(route)===JSON.stringify(originalRoute))return output_manager_default.log("No changes made."),0;let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${route.name}"`);try{let{version}=await editRoute(client,project.id,originalRoute.id,{route:{name:route.name,description:route.description,enabled:route.enabled,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${route.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}async function handleAIEdit(client,projectId,teamId,originalRoute,aiPrompt,skipConfirmation,existingStagingVersion){let currentRoute=routingRuleToCurrentRoute(originalRoute),prompt=aiPrompt,currentGenerated;for(;;){prompt||(prompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"})),output_manager_default.spinner("Generating updated route...");let errorMessage;try{let result=await generateRoute(client,projectId,{prompt,currentRoute},{teamId});result.error?errorMessage=result.error:result.route?currentGenerated=result.route:errorMessage="Could not apply changes. Try rephrasing."}catch(e){errorMessage=e.message||"Failed to generate updated route"}if(currentGenerated)break;if(output_manager_default.error(errorMessage),skipConfirmation||!client.stdin.isTTY)return 1;if(await client.input.select({message:"What would you like to do?",choices:[{name:"Try again with a different description",value:"retry"},{name:"Cancel",value:"cancel"}]})==="cancel")return output_manager_default.log("No changes made."),0;prompt=void 0}if(printGeneratedRoutePreview(currentGenerated),skipConfirmation)return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(!client.stdin.isTTY)return output_manager_default.error(`Cannot interactively confirm route changes in a non-TTY environment. Use ${withGlobalFlags(client,'routes update <name-or-id> --ai "..." --yes')} to skip confirmation.`),1;for(;;){let choice=await client.input.select({message:"What would you like to do?",choices:[{name:"Confirm changes",value:"confirm"},{name:"Edit again with AI",value:"ai-edit"},{name:"Edit manually",value:"manual"},{name:"Discard",value:"discard"}],pageSize:4,loop:!1});if(choice==="confirm")return await applyAIEdit(client,projectId,teamId,originalRoute,currentGenerated,existingStagingVersion,skipConfirmation);if(choice==="ai-edit"){let editPrompt=await client.input.text({message:"Describe what you'd like to change:",validate:val=>val?val.length>2e3?"Description must be 2000 characters or less":!0:"A description is required"});output_manager_default.spinner("Updating route...");try{let editResult=await generateRoute(client,projectId,{prompt:editPrompt,currentRoute:convertRouteToCurrentRoute(currentGenerated)},{teamId});if(editResult.error){output_manager_default.error(editResult.error),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}if(!editResult.route){output_manager_default.error("Could not apply changes. Try rephrasing."),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated);continue}currentGenerated=editResult.route,printGeneratedRoutePreview(currentGenerated)}catch(e){let error=e;output_manager_default.error(error.message||"Failed to update route"),output_manager_default.log("Keeping previous route:"),printGeneratedRoutePreview(currentGenerated)}continue}if(choice==="manual"){let routeInput=generatedRouteToAddInput(currentGenerated),manualRoute=cloneRoute(originalRoute);manualRoute.name=routeInput.name,manualRoute.description=routeInput.description,manualRoute.srcSyntax=routeInput.srcSyntax,manualRoute.route=routeInput.route,await runInteractiveEditLoop(client,manualRoute),populateRouteEnv(manualRoute.route,manualRoute.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${manualRoute.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:manualRoute.name,description:manualRoute.description,enabled:manualRoute.enabled,srcSyntax:manualRoute.srcSyntax,route:manualRoute.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${manualRoute.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}return output_manager_default.log("No changes made."),0}}async function applyAIEdit(client,projectId,teamId,originalRoute,generated,existingStagingVersion,skipConfirmation){let routeInput=generatedRouteToAddInput(generated);populateRouteEnv(routeInput.route,routeInput.srcSyntax);let editStamp=stamp_default();output_manager_default.spinner(`Updating route "${routeInput.name}"`);try{let{version}=await editRoute(client,projectId,originalRoute.id,{route:{name:routeInput.name,description:routeInput.description,enabled:originalRoute.enabled,srcSyntax:routeInput.srcSyntax,route:routeInput.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Updated")} route "${routeInput.name}" ${import_chalk.default.gray(editStamp())}`),await offerAutoPromote(client,projectId,version,!!existingStagingVersion,{teamId,skipPrompts:skipConfirmation}),0}catch(e){let error=e;return output_manager_default.error(error.message||"Failed to update route"),1}}export{edit as default};
@@ -1,7 +0,0 @@
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{editRoute}from"./chunk-AM46JVVN.js";import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{getRoutes,offerAutoPromote,parseSubcommandArgs,requireProjectContext,resolveRoute,withGlobalFlags}from"./chunk-JETQEZ24.js";import"./chunk-X5J7LOJK.js";import{stamp_default}from"./chunk-A2RZZQEP.js";import"./chunk-2BAAJZBZ.js";import{enableSubcommand}from"./chunk-BJ5APZ6X.js";import"./chunk-Q7D7RGXM.js";import"./chunk-OVV5MV5M.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);async function enable(client,argv){let parsed=await parseSubcommandArgs(argv,enableSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args}=parsed,identifier=args[0];if(!identifier)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"missing_arguments",message:"Route name or ID is required.",next:[{command:withGlobalFlags(client,"routes enable <name-or-id>"),when:"replace <name-or-id>"},{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},2),output_manager_default.error(`Route name or ID is required. Usage: ${withGlobalFlags(client,"routes enable <name-or-id>")}`),2;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging);output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:"No routes found in this project.",next:[{command:withGlobalFlags(client,"routes add --help"),when:"add routes first"}]},1),output_manager_default.error("No routes found in this project."),1;let route=await resolveRoute(client,routes,identifier);if(!route)return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"not_found",message:`No route found matching "${identifier}".`,next:[{command:withGlobalFlags(client,"routes list"),when:"list routes"}]},1),output_manager_default.error(`No route found matching "${identifier}". Run ${import_chalk.default.cyan(withGlobalFlags(client,"routes list"))} to see all routes.`),1;if(route.enabled!==!1)return output_manager_default.log(`Route "${route.name}" is already enabled.`),0;let enableStamp=stamp_default();output_manager_default.spinner(`Enabling route "${route.name}"`);try{let{version}=await editRoute(client,project.id,route.id,{route:{name:route.name,description:route.description,enabled:!0,srcSyntax:route.srcSyntax,route:route.route}},{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Enabled")} route "${route.name}" ${import_chalk.default.gray(enableStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:"error",reason:"api_error",message:error.message||"Failed to enable route"},1),output_manager_default.error(error.message||"Failed to enable route"),1}}export{enable as default};
@@ -1,7 +0,0 @@
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"./chunk-BZENIQ7N.js";import{Agent,ProxyAgent}from"undici";var DEFAULT_PORTS={"http:":80,"https:":443};function getEnv(name){return process.env[name.toLowerCase()]||process.env[name.toUpperCase()]}function normalizeProxyUrl(value){let proxyUrl=value.includes("://")?value:`http://${value}`,protocol=new URL(proxyUrl).protocol;if(protocol!=="http:"&&protocol!=="https:")throw new TypeError(`Unsupported proxy protocol: ${protocol}`);return proxyUrl}var EnvProxyDispatcher=class{constructor(options={}){this.noProxyValue="";this.noProxyEntries=[];let createProxyAgent=options.createProxyAgent||(url=>new ProxyAgent(url)),allProxy=getEnv("all_proxy"),httpProxy=getEnv("http_proxy")||allProxy,httpsProxy=getEnv("https_proxy")||httpProxy||allProxy;this.directAgent=options.directAgent||new Agent,this.httpAgent=httpProxy?createProxyAgent(normalizeProxyUrl(httpProxy)):this.directAgent,this.httpsAgent=httpsProxy?createProxyAgent(normalizeProxyUrl(httpsProxy)):this.httpAgent,this.parseNoProxy()}dispatch(options,handler){let url=new URL(String(options.origin));return this.getAgent(url).dispatch(options,handler)}async close(){await Promise.all([...this.agents()].map(agent=>agent.close()))}async destroy(error){await Promise.all([...this.agents()].map(agent=>agent.destroy(error||null)))}agents(){return new Set([this.directAgent,this.httpAgent,this.httpsAgent])}getAgent(url){this.noProxyValue!==(getEnv("no_proxy")||"")&&this.parseNoProxy();let hostname=url.hostname.toLowerCase(),port=Number.parseInt(url.port,10)||DEFAULT_PORTS[url.protocol];return this.shouldProxy(hostname,port)?url.protocol==="https:"?this.httpsAgent:this.httpAgent:this.directAgent}shouldProxy(hostname,port){if(this.noProxyEntries.length===0)return!0;if(this.noProxyValue==="*")return!1;for(let entry of this.noProxyEntries)if(!(entry.port&&entry.port!==port)){if(!entry.hostname.startsWith(".")&&!entry.hostname.startsWith("*")){if(hostname===entry.hostname)return!1}else if(hostname.endsWith(entry.hostname.replace(/^\*/,"")))return!1}return!0}parseNoProxy(){this.noProxyValue=getEnv("no_proxy")||"",this.noProxyEntries=this.noProxyValue.toLowerCase().split(/[,\s]/).filter(Boolean).map(value=>{let parsed=value.match(/^(.+):(\d+)$/);return{hostname:parsed?parsed[1]:value,port:parsed?Number.parseInt(parsed[2],10):0}})}};export{EnvProxyDispatcher};
@@ -1,7 +0,0 @@
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{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens}from"./chunk-2UBZCG4F.js";import"./chunk-PVASGBEF.js";import"./chunk-OVV5MV5M.js";import"./chunk-FPC5LINQ.js";import"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";export{getSignupVerificationUrl,login,performDeviceCodeFlow,saveDeviceCodeTokens};
@@ -1,7 +0,0 @@
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{createCertForCns,require_cjs,setupDomain}from"./chunk-PS3KKHSI.js";import"./chunk-R3MRIQMO.js";import"./chunk-A2RZZQEP.js";import"./chunk-3G3FQYMW.js";import"./chunk-Q7D7RGXM.js";import"./chunk-EJINOHL3.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import{InvalidDomain,NowError}from"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_tldts=__toESM(require_cjs(),1);async function generateCertForDeploy(client,contextName,deployURL){let parsedDomain=(0,import_tldts.parse)(deployURL),{domain}=parsedDomain;if(!domain)return new InvalidDomain(deployURL);output_manager_default.spinner(`Setting custom suffix domain ${domain}`);let result=await setupDomain(client,domain,contextName);if(output_manager_default.stopSpinner(),result instanceof NowError)return result;output_manager_default.spinner(`Generating a wildcard certificate for ${domain}`);let cert=await createCertForCns(client,[domain,`*.${domain}`],contextName);if(output_manager_default.stopSpinner(),cert instanceof NowError)return cert}export{generateCertForDeploy as default};
@@ -1,7 +0,0 @@
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{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-732WJANV.js";import"./chunk-GRVLQZFQ.js";import"./chunk-WYJGP5QW.js";import"./chunk-7G72V52B.js";import"./chunk-3GXZPT7T.js";import{imageRmSubcommand}from"./chunk-VCV3H73W.js";import"./chunk-LJIQZ3LU.js";import"./chunk-KUGFILF5.js";import"./chunk-BJ5APZ6X.js";import"./chunk-IMMMID5G.js";import"./chunk-4T22AQTB.js";import"./chunk-UMUPJDWU.js";import"./chunk-HBPSZHXX.js";import"./chunk-AGDMSAYW.js";import"./chunk-B4YYOSPY.js";import"./chunk-VAZQS475.js";import"./chunk-36N6VMW4.js";import"./chunk-52JGR5SZ.js";import"./chunk-JALVF3C2.js";import"./chunk-AW7DEWIM.js";import"./chunk-MIKNK3B6.js";import"./chunk-PNUH3XXW.js";import"./chunk-773GOZIR.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-PUKYAALC.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import"./chunk-F53OKXYI.js";import{warnDeprecatedSubcommand}from"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var IMAGE_CONFIG={ls:["ls","list"],inspect:["inspect","get"],delete:getCommandAliases(imageRmSubcommand)};async function image(client,argv,telemetry){let{subcommand,args,subcommandOriginal}=getSubcommand(argv,IMAGE_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(IMAGE_CONFIG):`Unknown "vcr image" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image --help"),when:"Show valid image subcommands"}]},2),output_manager_default.error(`${message} Run \`vercel vcr image --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-WQX2DS4X.js")).default(client,args,telemetry);case"inspect":return(await import("./inspect-JWDH7C6F.js")).default(client,args,telemetry);case"delete":return subcommandOriginal==="remove"&&warnDeprecatedSubcommand(client,"vcr image remove","vcr image delete"),(await import("./rm-O2XVUZOW.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled image subcommand: ${subcommand}`),1}}export{image as default};
@@ -1,7 +0,0 @@
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{getVltPreloadState,importBuilders,import_import_builders,preloadVltBuilderImports}from"./chunk-HNF2BEOE.js";import"./chunk-4CACOKMS.js";import"./chunk-43T3YKNH.js";import"./chunk-WFSQ3OSN.js";import"./chunk-VF2WX27D.js";import"./chunk-BPUANOGW.js";import"./chunk-BHWEIKSP.js";import"./chunk-25565AGS.js";import"./chunk-MVCAUS4F.js";import"./chunk-FBYA6LLM.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-NWGBDBZI.js";import"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import"./chunk-RAN5LUZY.js";import"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import"./chunk-AZ5OUZPP.js";import"./chunk-JESNVRVR.js";import"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BZENIQ7N.js";var export_formatResolvedBuilders=import_import_builders.formatResolvedBuilders;var export_getBuildersDir=import_import_builders.getBuildersDir;export{export_formatResolvedBuilders as formatResolvedBuilders,export_getBuildersDir as getBuildersDir,getVltPreloadState,importBuilders,preloadVltBuilderImports};
@@ -1,13 +0,0 @@
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{formatTriggerOperator,getGroupStartedAt,getGroupTitle,getGroupType,humanizeReference,normalizeTimestamp,renderAlertTable}from"./chunk-RRWEIG6B.js";import{resolveRulesTeam}from"./chunk-SSKMT5SL.js";import{resolveAlertsScope,scopeFromLinkedProject}from"./chunk-KXHUMVXD.js";import{formatGranularity}from"./chunk-IVSSTHB6.js";import{formatDate}from"./chunk-YTDK6AHS.js";import"./chunk-GZNDA6SV.js";import{outputError}from"./chunk-NYKEU7DQ.js";import"./chunk-GHAY4PSD.js";import{truncateEnd,truncateMiddle}from"./chunk-ID663OJ7.js";import{inspectSubcommand}from"./chunk-4T22AQTB.js";import"./chunk-773GOZIR.js";import{printError}from"./chunk-OVV5MV5M.js";import"./chunk-67GZ5REA.js";import"./chunk-BS32OUOC.js";import"./chunk-T5LBVZWY.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-FPC5LINQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-RH2SQQWH.js";import"./chunk-FRSHC2HN.js";import{getLinkedProject}from"./chunk-3XDTQFBL.js";import"./chunk-WDWYKX2I.js";import"./chunk-X7CLBXWL.js";import"./chunk-JDVUKDX3.js";import"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import"./chunk-F53OKXYI.js";import{validateJsonOutput}from"./chunk-RAN5LUZY.js";import{getFlagsSpecification}from"./chunk-ODB7LEAO.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-AZ5OUZPP.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import"./chunk-RM3ZDRYE.js";import"./chunk-OO572JUC.js";import"./chunk-D3AHZ5LI.js";import"./chunk-2GHZGOWT.js";import"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var aggregationLabels={sum:"Sum",avg:"Average",min:"Min",max:"Max",p50:"P50",p75:"P75",p90:"P90",p95:"P95",p99:"P99",stddev:"Std Dev",unique:"Unique",persecond:"Per Second",percent:"Percent"},formatCustomAlertRatioBelowFivePercent=new Intl.NumberFormat("en-US",{maximumFractionDigits:2,minimumFractionDigits:2,style:"percent"}),formatCustomAlertRatioThresholdValue=new Intl.NumberFormat("en-US",{maximumFractionDigits:4,minimumFractionDigits:0,style:"percent"});function getGroupStatus(group){if(group.status)return group.status;let alerts=group.alerts??[];return alerts.some(alert=>alert.status==="active")?"active":alerts.length>0?"resolved":"-"}function humanizeLabel(value){return humanizeReference(value,{case:"title"})}function formatAlertFieldValue(value,maxLength=64){if(value==null)return;let displayValue=typeof value=="number"?formatNumber(value):String(value);if(displayValue)return truncateMiddle(displayValue,maxLength)}function formatNumber(value){let absValue=Math.abs(value),sign=value<0?"-":"";for(let[threshold,suffix]of[[1e9,"B"],[1e6,"M"],[1e3,"k"]])if(absValue>=threshold)return`${sign}${(absValue/threshold).toFixed(1).replace(/\.0$/,"")}${suffix}`;return Number.isInteger(value)?String(value):value.toFixed(2).replace(/\.?0+$/,"")}function parseFormattedNumber(value){let trimmed=value.trim();if(!trimmed)return;let number=Number(trimmed.replace(/,/g,""));return Number.isFinite(number)?number:void 0}function formatRatio(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);if(number===void 0)return value;let percent=number*100;return percent>=5?`${Math.floor(percent)}%`:formatCustomAlertRatioBelowFivePercent.format(number)}function formatRatioThreshold(value){if(value.trim().endsWith("%"))return value;let number=parseFormattedNumber(value);return number===void 0?value:formatCustomAlertRatioThresholdValue.format(number)}function getAlertSonarQuery(alert){return alert.sonarQuery??alert.data?.sonarQuery}function getCustomAlertBaselineTitle(alert){let granularity=getAlertSonarQuery(alert)?.granularity;return(granularity&&("hours"in granularity||"days"in granularity)?"7-day baseline":"24-hour baseline").replace(/\b[a-z]/g,character=>character.toUpperCase())}function appendUnit(value,unit){return!unit||unit==="score"?value:unit==="ratio"?formatRatio(value):unit==="%"?value.endsWith("%")?value:`${value}%`:value.toLowerCase().includes(unit.toLowerCase())?value:`${value} ${unit}`}function formatThreshold(alert){let data=alert.data,formatted=alert.formattedValues?.formattedThreshold??(data?.triggerThreshold===void 0?void 0:formatNumber(data.triggerThreshold));if(!formatted)return;let operator=formatTriggerOperator(data?.triggerOperator),threshold=data?.triggerType==="anomaly"?`${formatted} z-score`:alert.unit==="ratio"?formatRatioThreshold(formatted):appendUnit(formatted,alert.unit);return[operator,threshold].filter(Boolean).join(" ")}function getRuleIds(alert){let ids=new Set,dataRuleId=alert.data?.ruleId;dataRuleId&&ids.add(dataRuleId);for(let ruleId of alert.rules??[])ruleId&&ids.add(ruleId);return[...ids]}function getAlertResolvedAt(alert){return normalizeTimestamp(alert.recordedResolvedAt??alert.resolvedAt)}function getSignalRows(alert){let rows=[],formattedValues=alert.formattedValues??{},observed=formattedValues.formattedCount,baseline=formattedValues.formattedAvg,change=[formattedValues.changeDirection,formattedValues.changeAmount].filter(Boolean).join(" "),zscore=alert.data?.zscore,threshold=formatThreshold(alert),minThreshold=alert.data?.minThreshold,isRatioFormulaAlert=!!getCustomAlertFormula(alert);return alert.eventLabel&&rows.push(["Event",alert.eventLabel]),alert.measureLabel&&rows.push(["Measure",alert.measureLabel]),observed&&rows.push(["Observed Value",appendUnit(observed,alert.unit)]),baseline&&rows.push([alert.type==="custom_alert"&&alert.data?.triggerType==="anomaly"?getCustomAlertBaselineTitle(alert):"Baseline",appendUnit(baseline,alert.unit)]),change&&rows.push(["Change",change]),zscore!==void 0&&rows.push(["Observed Deviation",`${formatNumber(zscore)} z-score`]),threshold&&rows.push(["Threshold",threshold]),minThreshold!==void 0&&!isRatioFormulaAlert&&rows.push(["Minimum",alert.unit==="ratio"?formatNumber(minThreshold):appendUnit(formatNumber(minThreshold),alert.unit)]),formattedValues.errorRate&&rows.push(["Error Rate",formattedValues.errorRate]),formattedValues.avgErrorRate&&rows.push(["Baseline Error Rate",formattedValues.avgErrorRate]),rows.push(...getFieldRows(alert)),rows}function getFieldRows(alert){let fields=alert.data?.fields;if(!fields)return[];let groupBy=getAlertSonarQuery(alert)?.groupBy??[];return[...groupBy,...Object.keys(fields).filter(key=>!groupBy.includes(key))].flatMap(key=>{let value=fields[key],displayValue=formatAlertFieldValue(value);return displayValue?[[humanizeLabel(key),displayValue]]:[]})}function formatAggregation(value){return value?aggregationLabels[value]??humanizeLabel(value):void 0}function formatQueryReference(value){return value?humanizeLabel(value):void 0}function formatRollupDetail(rollup,fallbackMeasure){if(!rollup)return;let aggregation=formatAggregation(rollup.aggregation),measure=fallbackMeasure??formatQueryReference(rollup.measure);return[aggregation,measure].filter(Boolean).join(" ")||void 0}function getPrimaryRollup(rollups){return Object.values(rollups??{})[0]}function getCustomAlertFormula(alert){let formula=alert.data?.formula;if(formula?.operator==="divide"&&formula.left&&formula.right)return{operator:formula.operator,left:formula.left,right:formula.right}}function getQueryRows(alert){if(alert.type!=="custom_alert")return[];let query=getAlertSonarQuery(alert);if(!query)return[];let formula=getCustomAlertFormula(alert),rows=[],addRow=(label,value)=>{value&&rows.push([label,truncateMiddle(value,120)])};if(addRow("Event",alert.eventLabel??formatQueryReference(query.event)),formula)addRow("Numerator",formatRollupDetail(query.rollups?.[formula.left])),addRow("Denominator",formatRollupDetail(query.rollups?.[formula.right]));else{let primaryRollup=getPrimaryRollup(query.rollups);addRow("Measure",alert.measureLabel??formatQueryReference(primaryRollup?.measure)),addRow("Aggregation",formatAggregation(primaryRollup?.aggregation))}addRow("Granularity",formatGranularity(query.granularity));let groupBy=query.groupBy?.filter(Boolean)??[];if(groupBy.length>0&&addRow("Group by",groupBy.map(humanizeLabel).join(", ")),formula&&typeof alert.data?.minThreshold=="number"&&addRow("Minimum Numerator",formatNumber(alert.data.minThreshold)),addRow("Filter by",query.filter?.trim()),formula)for(let[label,rollupName]of[["Numerator filter",formula.left],["Denominator filter",formula.right]])addRow(label,query.rollups?.[rollupName]?.filter?.trim());return rows}function getDetailRows(alert){let data=alert.data;if(!data)return[];let rows=[],addRow=(label,value)=>{let displayValue=formatAlertFieldValue(value);displayValue&&rows.push([label,displayValue])};return addRow("Route",data.route),addRow("Status Group",data.statusGroup),addRow("Deployment ID",data.deploymentId),rows}function renderAlertSections(alert){let lines=[],signalRows=getSignalRows(alert);signalRows.length>0&&(lines.push(import_chalk.default.cyan("Signals")),lines.push(renderAlertTable(signalRows,3)));let queryRows=getQueryRows(alert);return queryRows.length>0&&(lines.push(import_chalk.default.cyan("Query")),lines.push(renderAlertTable(queryRows,3))),lines.join(`
8
- `)}function renderAlert(alert,index,totalAlerts){let title=alert.title||`Alert ${index+1}`,ruleIds=getRuleIds(alert),resolvedAt=getAlertResolvedAt(alert),sections=renderAlertSections(alert),summaryRows=[["Alert id",alert.id||"-"],["Type",alert.type||"-"],["Status",alert.status||"-"],["Started At",formatDate(normalizeTimestamp(alert.recordedStartedAt??alert.startedAt))],...resolvedAt!==void 0?[["Resolved At",formatDate(resolvedAt)]]:[],...ruleIds.length>0?[["Rule id",ruleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...getDetailRows(alert)];return[import_chalk.default.bold(totalAlerts>1?`Alert ${index+1}: ${title}`:title),renderAlertTable(summaryRows,3),...sections?[sections]:[]].join(`
9
- `)}function printAlertGroup(group,groupId){let alerts=group.alerts??[],singleAlert=alerts.length===1?alerts[0]:void 0,singleAlertRuleIds=singleAlert?getRuleIds(singleAlert):[],singleAlertResolvedAt=singleAlert?getAlertResolvedAt(singleAlert):void 0,summaryRows=[["Title",truncateEnd(getGroupTitle(group),80)],["Group id",group.id||groupId],["Type",getGroupType(group)],["Status",getGroupStatus(group)],["Started At",formatDate(getGroupStartedAt(group))],...singleAlertResolvedAt!==void 0?[["Resolved At",formatDate(singleAlertResolvedAt)]]:[],["Alerts",String(alerts.length)],...singleAlert?.id?[["Alert id",singleAlert.id]]:[],...singleAlertRuleIds.length>0?[["Rule id",singleAlertRuleIds.map(id=>truncateMiddle(id,48)).join(", ")]]:[],...singleAlert?getDetailRows(singleAlert):[]],renderedAlerts=alerts.length>0?alerts.length===1?renderAlertSections(alerts[0]):alerts.map((alert,index)=>renderAlert(alert,index,alerts.length)).join(`
10
-
11
- `):"No alerts in this group.";output_manager_default.print(["",`${import_chalk.default.bold("Alert group")} ${import_chalk.default.cyan(group.id||groupId)}`,renderAlertTable(summaryRows,3),"",renderedAlerts,""].join(`
12
- `))}async function inspect(client,argv){let parsedArgs,spec=getFlagsSpecification(inspectSubcommand.options);try{parsedArgs=parseArguments(argv,spec)}catch(e){let msg=e instanceof Error?e.message:String(e),projectFlagMissingArg=msg.includes("--project")&&msg.includes("requires argument");return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:projectFlagMissingArg?"`--project` requires a project name or id (for example `--project my-app`).":msg,next:projectFlagMissingArg?[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId> --project <name-or-id>"),when:"Re-run with placeholders replaced"}]:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect --help"),when:"See valid `alerts inspect` usage"}]},2),printError(e),2}let groupId=parsedArgs.args[0],fr=validateJsonOutput(parsedArgs.flags);if(!fr.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:fr.error},2),output_manager_default.error(fr.error),2;if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group id. Example: ${packageName} alerts inspect <groupId>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts inspect <groupId>"),when:"Replace <groupId> with a group id from `vercel alerts`"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel alerts inspect <groupId>`");let scope=await resolveInspectScope(client,{project:parsedArgs.flags["--project"],all:parsedArgs.flags["--all"],jsonOutput:fr.jsonOutput,command:`alerts inspect ${groupId}`});if(typeof scope=="number")return scope;let query=new URLSearchParams({teamId:scope.teamId});scope.projectId&&query.set("projectId",scope.projectId);let path=`/alerts/v3/groups/${encodeURIComponent(groupId)}?${query.toString()}`;output_manager_default.spinner("Fetching alert group...");try{let group=await client.fetch(path);return fr.jsonOutput?client.stdout.write(`${JSON.stringify({group},null,2)}
13
- `):printAlertGroup(group,groupId),0}catch(err){if(isAPIError(err)){let msg=err.serverMessage||`API error (${err.status}).`,reason=err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR;return outputAgentError(client,{status:"error",reason,message:msg,...err.status===401||err.status===403||err.status===404?{hint:scope.projectId?"The request was scoped to a project. Use --all, and --scope <team-slug> if the group belongs to another team.":"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,scope.projectId?`alerts inspect ${groupId} --all`:`alerts inspect ${groupId}`),when:"Retry after fixing scope or permissions"}]}:{}},1),outputError(client,fr.jsonOutput,err.code||"API_ERROR",msg)}throw err}finally{output_manager_default.stopSpinner()}}async function resolveInspectScope(client,opts){if(opts.project||opts.all)return resolveAlertsScope(client,opts);let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?linkedProject.exitCode:linkedProject.status==="linked"?scopeFromLinkedProject(linkedProject):resolveRulesTeam(client,opts.jsonOutput)}export{inspect as default};