@vercel/cli-support 66.6.0 → 68.0.0-snapshot-c9dfd83f2293

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 (404) hide show
  1. package/dist/chunks/add-NIIHCHGH.js +8 -0
  2. package/dist/chunks/add-ORZO4EJ7.js +8 -0
  3. package/dist/chunks/add-SKRNSMC6.js +8 -0
  4. package/dist/chunks/{alerts-72Q42HNT.js → alerts-MNMZH6BO.js} +1 -1
  5. package/dist/chunks/build-P7KKWO4O.js +7 -0
  6. package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
  7. package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
  8. package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
  9. package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
  10. package/dist/chunks/{chunk-D2TVI7KK.js → chunk-2HFP22IP.js} +4 -4
  11. package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
  12. package/dist/chunks/{chunk-YEDS2UMW.js → chunk-2ZN4JRDA.js} +1 -1
  13. package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
  14. package/dist/chunks/{chunk-FOFX7LHS.js → chunk-3OPLG6HM.js} +1 -1
  15. package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
  16. package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
  17. package/dist/chunks/{chunk-XAGG5BJT.js → chunk-43XDA7ST.js} +1 -1
  18. package/dist/chunks/{chunk-OXS5VO4X.js → chunk-4D5DAM3D.js} +1 -1
  19. package/dist/chunks/chunk-4Z6R5KHZ.js +78 -0
  20. package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
  21. package/dist/chunks/{chunk-6GE4V7MW.js → chunk-572VGS6P.js} +2 -2
  22. package/dist/chunks/{chunk-O7GNYVVM.js → chunk-5OGPMRRQ.js} +2 -2
  23. package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
  24. package/dist/chunks/chunk-67GZ5REA.js +7 -0
  25. package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
  26. package/dist/chunks/chunk-6JTZZSFH.js +7 -0
  27. package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
  28. package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
  29. package/dist/chunks/{chunk-5O4AXCN7.js → chunk-6OJVCMG5.js} +1 -1
  30. package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
  31. package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
  32. package/dist/chunks/{chunk-VPSR2O55.js → chunk-7AAYWDIZ.js} +3 -3
  33. package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-7GJ37QPL.js} +1 -1
  34. package/dist/chunks/chunk-7HQZRU25.js +10 -0
  35. package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
  36. package/dist/chunks/{chunk-KSGN5OCV.js → chunk-7K5ZWVDL.js} +1 -1
  37. package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
  38. package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
  39. package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
  40. package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
  41. package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
  42. package/dist/chunks/chunk-AOPFMMUK.js +13 -0
  43. package/dist/chunks/{chunk-2OMI3IUW.js → chunk-AVXX4Q6S.js} +1 -1
  44. package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
  45. package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
  46. package/dist/chunks/{chunk-IF6GA273.js → chunk-BGIGZUFG.js} +1 -1
  47. package/dist/chunks/{chunk-YLLFLPNA.js → chunk-BHL2HM6I.js} +1 -1
  48. package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
  49. package/dist/chunks/chunk-BS32OUOC.js +7 -0
  50. package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
  51. package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
  52. package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
  53. package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
  54. package/dist/chunks/chunk-CDJ25IKC.js +7 -0
  55. package/dist/chunks/chunk-CJMNUD2I.js +12 -0
  56. package/dist/chunks/chunk-CSNP5RIM.js +11 -0
  57. package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
  58. package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
  59. package/dist/chunks/{chunk-6PDKIOAO.js → chunk-DEFA6XAB.js} +1 -1
  60. package/dist/chunks/{chunk-OE26EQSH.js → chunk-DEX4QU4S.js} +1 -1
  61. package/dist/chunks/{chunk-W2L24GM7.js → chunk-DMA77UYG.js} +1 -1
  62. package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
  63. package/dist/chunks/chunk-DORCX7UB.js +7 -0
  64. package/dist/chunks/{chunk-C335SWOB.js → chunk-DUSMVY4N.js} +1 -1
  65. package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
  66. package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
  67. package/dist/chunks/chunk-EYRBV6RM.js +25 -0
  68. package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
  69. package/dist/chunks/{chunk-DZ77BIEV.js → chunk-F4ZKTFQH.js} +1 -1
  70. package/dist/chunks/chunk-F7X6O4ZC.js +7 -0
  71. package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
  72. package/dist/chunks/{chunk-BCAI7MED.js → chunk-FGWYM3SF.js} +1 -1
  73. package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-FGXULLNK.js} +1 -1
  74. package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
  75. package/dist/chunks/{chunk-JBYROCAC.js → chunk-FYM5EUNW.js} +1 -1
  76. package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
  77. package/dist/chunks/chunk-GQXKF3PR.js +7 -0
  78. package/dist/chunks/{chunk-2G2SALNN.js → chunk-H2QMSLKJ.js} +1 -1
  79. package/dist/chunks/{chunk-33HVDSWP.js → chunk-HMJR6RVF.js} +1 -1
  80. package/dist/chunks/{chunk-S4AANAHX.js → chunk-HQ3ZFXXQ.js} +1 -1
  81. package/dist/chunks/chunk-HYGWJQN6.js +8 -0
  82. package/dist/chunks/chunk-I4O53MKV.js +8 -0
  83. package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
  84. package/dist/chunks/{chunk-FFN3EGSF.js → chunk-IKNAOU5O.js} +1 -1
  85. package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
  86. package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
  87. package/dist/chunks/{chunk-YOAQNRBN.js → chunk-IY7OKDHU.js} +3 -3
  88. package/dist/chunks/{chunk-2D5PTFAY.js → chunk-J7POLUHY.js} +1 -1
  89. package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
  90. package/dist/chunks/chunk-JR25PLC7.js +13 -0
  91. package/dist/chunks/chunk-JV3YIOCO.js +7 -0
  92. package/dist/chunks/{chunk-RBW62SOU.js → chunk-JXE7GYE3.js} +1 -1
  93. package/dist/chunks/{chunk-EFP3LK4G.js → chunk-K5SM5NIY.js} +1 -1
  94. package/dist/chunks/chunk-K6KS5GZD.js +16 -0
  95. package/dist/chunks/chunk-K7TSWIKR.js +12 -0
  96. package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
  97. package/dist/chunks/{chunk-GUGP6OY2.js → chunk-KFBA2MAV.js} +1 -1
  98. package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
  99. package/dist/chunks/chunk-KHMNANEN.js +7 -0
  100. package/dist/chunks/chunk-KVXEYKIX.js +7 -0
  101. package/dist/chunks/{chunk-F37XFLFP.js → chunk-L3YEI2RW.js} +1 -1
  102. package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
  103. package/dist/chunks/chunk-LD25KYMI.js +30 -0
  104. package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
  105. package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
  106. package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
  107. package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-MJ77FDK2.js} +1 -1
  108. package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
  109. package/dist/chunks/chunk-N4PID4SD.js +7 -0
  110. package/dist/chunks/chunk-N6MNUNZ4.js +37 -0
  111. package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
  112. package/dist/chunks/{chunk-QRG24GJG.js → chunk-NOAZDAOU.js} +1 -1
  113. package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
  114. package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
  115. package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OVWS4CFW.js} +1 -1
  116. package/dist/chunks/{chunk-WAFBTC45.js → chunk-PHPJS2G2.js} +1 -1
  117. package/dist/chunks/{chunk-TNQUCTJH.js → chunk-PPCZYUSO.js} +1 -1
  118. package/dist/chunks/chunk-PZL7NSDA.js +24 -0
  119. package/dist/chunks/{chunk-OISNKAC6.js → chunk-Q45SQL44.js} +2 -2
  120. package/dist/chunks/{chunk-XDWAUOFO.js → chunk-Q4XCBBWK.js} +1 -1
  121. package/dist/chunks/chunk-Q7HFUXJ4.js +10 -0
  122. package/dist/chunks/chunk-QFE3RPMA.js +19 -0
  123. package/dist/chunks/{chunk-L5PIUIUM.js → chunk-QFSIUMC6.js} +1 -1
  124. package/dist/chunks/{chunk-CSCUVSJM.js → chunk-QG5UBKDA.js} +1 -1
  125. package/dist/chunks/{chunk-KLYFOXYH.js → chunk-QGS3ERDZ.js} +3 -3
  126. package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
  127. package/dist/chunks/chunk-QU74BFN2.js +10 -0
  128. package/dist/chunks/{chunk-ACN6DBTC.js → chunk-R3QHEJL6.js} +1 -1
  129. package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
  130. package/dist/chunks/chunk-RPYIWRSN.js +7 -0
  131. package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
  132. package/dist/chunks/{chunk-N6JHFCWC.js → chunk-S7Y24A5X.js} +1 -1
  133. package/dist/chunks/chunk-SGNDE4YS.js +7 -0
  134. package/dist/chunks/{chunk-OF32Z3UP.js → chunk-SHJ3XTD3.js} +1 -1
  135. package/dist/chunks/{chunk-R33HJGYA.js → chunk-SHL6BPBV.js} +1 -1
  136. package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
  137. package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
  138. package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
  139. package/dist/chunks/chunk-T5JHWXS5.js +8 -0
  140. package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
  141. package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-TOCPUQ6N.js} +1 -1
  142. package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
  143. package/dist/chunks/chunk-UAS3WUFB.js +11 -0
  144. package/dist/chunks/chunk-VIOIR6II.js +7 -0
  145. package/dist/chunks/{chunk-3A3GU62R.js → chunk-VMRFCU6F.js} +1 -1
  146. package/dist/chunks/{chunk-Y77DXGGN.js → chunk-VQZ773A2.js} +1 -1
  147. package/dist/chunks/chunk-VWKA6RKB.js +7 -0
  148. package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
  149. package/dist/chunks/chunk-WBEPIG4S.js +31 -0
  150. package/dist/chunks/{chunk-AFHZC47H.js → chunk-WBXM3W44.js} +1 -1
  151. package/dist/chunks/{chunk-MINTHN6C.js → chunk-WEL2Y6OH.js} +1 -1
  152. package/dist/chunks/{chunk-RDDIWY3O.js → chunk-WGU2IQPY.js} +3 -3
  153. package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-WLD4SGKM.js} +1 -1
  154. package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
  155. package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
  156. package/dist/chunks/{chunk-QZKRVE44.js → chunk-XQZBXQZ2.js} +1 -1
  157. package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
  158. package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
  159. package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
  160. package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
  161. package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-YJJCELMY.js} +1 -1
  162. package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
  163. package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
  164. package/dist/chunks/chunk-YNMTP26U.js +7 -0
  165. package/dist/chunks/chunk-YTSGFU5T.js +7 -0
  166. package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
  167. package/dist/chunks/{chunk-QZJOKECY.js → chunk-YYDI5Q5K.js} +2 -2
  168. package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
  169. package/dist/chunks/chunk-Z643WTC4.js +15 -0
  170. package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
  171. package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
  172. package/dist/chunks/chunk-ZSEFELXB.js +23 -0
  173. package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
  174. package/dist/chunks/clear-B3I7ZYEY.js +8 -0
  175. package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
  176. package/dist/chunks/compile-vercel-config-ZQMPTEM6.js +7 -0
  177. package/dist/chunks/config-4GZY5MR4.js +7 -0
  178. package/dist/chunks/config-ZY22VRFX.js +8 -0
  179. package/dist/chunks/config-validator.mjs +1 -1
  180. package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
  181. package/dist/chunks/create-project-BTOHPKZB.js +7 -0
  182. package/dist/chunks/delete-K2HS7YCM.js +10 -0
  183. package/dist/chunks/delete-RVTGE4BU.js +9 -0
  184. package/dist/chunks/describe-5ZCOXUID.js +25 -0
  185. package/dist/chunks/detect-projects-AZXG6BRD.js +7 -0
  186. package/dist/chunks/detect-services-FLNYWWJS.js +7 -0
  187. package/dist/chunks/disable-AS6DQMHM.js +7 -0
  188. package/dist/chunks/discard-PYU5CG67.js +14 -0
  189. package/dist/chunks/edit-HSMIPVPN.js +9 -0
  190. package/dist/chunks/edit-RLRJSNZY.js +8 -0
  191. package/dist/chunks/enable-JPWR5EPC.js +7 -0
  192. package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
  193. package/dist/chunks/esm-5GQXHN7C.js +9 -0
  194. package/dist/chunks/esm-FJCIOBBV.js +7 -0
  195. package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
  196. package/dist/chunks/esm-LEQXRLFV.js +9 -0
  197. package/dist/chunks/esm-NHCCFW7Z.js +7 -0
  198. package/dist/chunks/esm-QQ3MUOW4.js +7 -0
  199. package/dist/chunks/esm-T655CG6O.js +7 -0
  200. package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
  201. package/dist/chunks/{export-TOSUN6JO.js → export-6WFWSAO4.js} +2 -3
  202. package/dist/chunks/future-QLQMHIPL.js +7 -0
  203. package/dist/chunks/generate-cert-for-deploy-JKVOVQ3B.js +7 -0
  204. package/dist/chunks/image-POIJ2G2Y.js +7 -0
  205. package/dist/chunks/import-builders-YF5MX6ZA.js +7 -0
  206. package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-4CURZZPU.js} +1 -1
  207. package/dist/chunks/{inspect-DFYVVIJW.js → inspect-BAYMK22S.js} +1 -1
  208. package/dist/chunks/inspect-JTBMNWWI.js +13 -0
  209. package/dist/chunks/{inspect-GBH7FAW6.js → inspect-TBQRBTX3.js} +1 -1
  210. package/dist/chunks/inspect-W4WSFBOF.js +9 -0
  211. package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-YKSWSH3T.js} +1 -1
  212. package/dist/chunks/{list-HD6KXAIG.js → list-E65OFWSS.js} +1 -1
  213. package/dist/chunks/list-EWYN3F4Y.js +12 -0
  214. package/dist/chunks/{list-MW2FV253.js → list-ZHES2WYK.js} +1 -1
  215. package/dist/chunks/{list-4RRL326Z.js → list-ZWJDFJNY.js} +1 -1
  216. package/dist/chunks/login-JAKNSTW3.js +9 -0
  217. package/dist/chunks/login-JRGX6HGZ.js +7 -0
  218. package/dist/chunks/logs-3DPLX3CB.js +7 -0
  219. package/dist/chunks/{ls-VFE7PE25.js → ls-5YLM3ICH.js} +1 -1
  220. package/dist/chunks/ls-6HPMZVYA.js +11 -0
  221. package/dist/chunks/{ls-RKOM46KV.js → ls-FWOTN6V6.js} +1 -1
  222. package/dist/chunks/{ls-I767MTW4.js → ls-MW3WIHH5.js} +1 -1
  223. package/dist/chunks/{ls-Q4WGEEBZ.js → ls-RAVFLQTQ.js} +1 -1
  224. package/dist/chunks/ls-SY2FW3WA.js +8 -0
  225. package/dist/chunks/{ls-TLEAYYXQ.js → ls-ZX5FNEK2.js} +1 -1
  226. package/dist/chunks/migrate-experimental-services-XYUCY2G6.js +7 -0
  227. package/dist/chunks/mutate-4KTZMM3X.js +9 -0
  228. package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
  229. package/dist/chunks/notifications-LBZ7KWGS.js +7 -0
  230. package/dist/chunks/open-PXLVSFII.js +7 -0
  231. package/dist/chunks/{openapi-NEYEIRF2.js → openapi-6RKKA6JG.js} +1 -1
  232. package/dist/chunks/permissions-DQ5AF6XL.js +7 -0
  233. package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-VU3R572E.js} +1 -1
  234. package/dist/chunks/prompt-missing-credentials-AJH3HM36.js +7 -0
  235. package/dist/chunks/publish-QJJL3IHG.js +15 -0
  236. package/dist/chunks/pull-3PQHXMPB.js +7 -0
  237. package/dist/chunks/purchase-domain-if-available-IFCQ4QFP.js +7 -0
  238. package/dist/chunks/push-4VIQFKP3.js +7 -0
  239. package/dist/chunks/query-BQ4HYVQ7.js +7 -0
  240. package/dist/chunks/raw-query-VA6VVMR4.js +8 -0
  241. package/dist/chunks/reauthenticate-2SMCQQHF.js +7 -0
  242. package/dist/chunks/{remove-IEEZGRB2.js → remove-CSIMGLLS.js} +1 -1
  243. package/dist/chunks/reorder-ERRB7OJL.js +10 -0
  244. package/dist/chunks/reply-XCBWXFWS.js +9 -0
  245. package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
  246. package/dist/chunks/resolve-VWGZ632M.js +12 -0
  247. package/dist/chunks/resolve-agent-team-NWELD5FN.js +7 -0
  248. package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
  249. package/dist/chunks/restore-SXZUZGZE.js +16 -0
  250. package/dist/chunks/rm-5TRC5YND.js +8 -0
  251. package/dist/chunks/rm-IQ33QTQ2.js +8 -0
  252. package/dist/chunks/rm-KURYLLD6.js +8 -0
  253. package/dist/chunks/rm-WCE3ISB2.js +8 -0
  254. package/dist/chunks/rm-XMWM76JA.js +8 -0
  255. package/dist/chunks/routes-SBMN6SDF.js +7 -0
  256. package/dist/chunks/rule-inspect-USW6K7Y7.js +8 -0
  257. package/dist/chunks/schema-2G5VJ7EY.js +14 -0
  258. package/dist/chunks/{schema-L5VCG6FJ.js → schema-LRRKG2KJ.js} +1 -1
  259. package/dist/chunks/select-org-JG6GRWTS.js +7 -0
  260. package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
  261. package/dist/chunks/set-4JTH62JO.js +7 -0
  262. package/dist/chunks/{set-6U4QIX7A.js → set-BS5KCRE4.js} +1 -1
  263. package/dist/chunks/setup-and-link-GY4O7UJP.js +7 -0
  264. package/dist/chunks/{skills-ZMFZGPQL.js → skills-SUGA6D3G.js} +4 -19
  265. package/dist/chunks/table-SCLK33K7.js +7 -0
  266. package/dist/chunks/tags-B7MKMQKJ.js +7 -0
  267. package/dist/chunks/{types-CVLZCTL2.js → types-YFDB4QZA.js} +1 -1
  268. package/dist/chunks/{update-A727QN7H.js → update-LWRCCEXG.js} +1 -1
  269. package/dist/chunks/usage-HABW5VJ7.js +15 -0
  270. package/dist/chunks/validate-config-LDOYJ4LL.js +7 -0
  271. package/dist/commands/build/index.js +1 -1
  272. package/dist/commands/deploy/index.js +28 -25
  273. package/dist/commands/dev/index.js +7 -7
  274. package/dist/commands/env/index.js +12 -11
  275. package/dist/commands/link/index.js +3 -3
  276. package/dist/commands/list/index.js +1 -1
  277. package/dist/commands/project/index.js +4 -4
  278. package/dist/commands/tunnel/index.js +1 -1
  279. package/dist/commands-account.js +18 -12
  280. package/dist/commands-ai.js +18 -11
  281. package/dist/commands-blob.js +6 -6
  282. package/dist/commands-core.js +34 -48
  283. package/dist/commands-deployments.js +12 -11
  284. package/dist/commands-flags.js +27 -22
  285. package/dist/commands-integrations.js +7 -10
  286. package/dist/commands-observability.js +38 -28
  287. package/dist/commands-routing.js +6 -7
  288. package/dist/help.js +1 -1
  289. package/dist/index.js +6 -6
  290. package/dist/internal-build-worker.js +1 -1
  291. package/dist/internal-build.js +1 -1
  292. package/dist/package.json +43 -43
  293. package/dist/version.mjs +1 -1
  294. package/package.json +44 -44
  295. package/dist/chunks/add-563RV6JX.js +0 -8
  296. package/dist/chunks/add-HRB6XY33.js +0 -8
  297. package/dist/chunks/add-IUTGTBA4.js +0 -8
  298. package/dist/chunks/build-OMIYCGMR.js +0 -7
  299. package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
  300. package/dist/chunks/chunk-2RRZCRWX.js +0 -7
  301. package/dist/chunks/chunk-4SS6W6JK.js +0 -11
  302. package/dist/chunks/chunk-5J4E2W4F.js +0 -12
  303. package/dist/chunks/chunk-76DSBD4X.js +0 -7
  304. package/dist/chunks/chunk-7W565DJB.js +0 -8
  305. package/dist/chunks/chunk-AIXEVICT.js +0 -37
  306. package/dist/chunks/chunk-AM46JVVN.js +0 -7
  307. package/dist/chunks/chunk-BULSRTQE.js +0 -7
  308. package/dist/chunks/chunk-C35SG42R.js +0 -7
  309. package/dist/chunks/chunk-CFJBDBYH.js +0 -7
  310. package/dist/chunks/chunk-DDPH26ZO.js +0 -7
  311. package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
  312. package/dist/chunks/chunk-EFFJUYYS.js +0 -31
  313. package/dist/chunks/chunk-GOI2VVI7.js +0 -19
  314. package/dist/chunks/chunk-GYUNOFDD.js +0 -10
  315. package/dist/chunks/chunk-H2KNSYPR.js +0 -16
  316. package/dist/chunks/chunk-KDCODXVL.js +0 -25
  317. package/dist/chunks/chunk-KMTHGHJV.js +0 -8
  318. package/dist/chunks/chunk-KQ6X77WP.js +0 -7
  319. package/dist/chunks/chunk-KRP4EMD2.js +0 -10
  320. package/dist/chunks/chunk-NLK7NGVP.js +0 -7
  321. package/dist/chunks/chunk-OCR5CRTH.js +0 -10
  322. package/dist/chunks/chunk-PKR32I2N.js +0 -30
  323. package/dist/chunks/chunk-QGHAD5A5.js +0 -12
  324. package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
  325. package/dist/chunks/chunk-SXW2G4WD.js +0 -10
  326. package/dist/chunks/chunk-TC4E2TFA.js +0 -8
  327. package/dist/chunks/chunk-TUB3APDV.js +0 -7
  328. package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
  329. package/dist/chunks/chunk-VF7XWPXA.js +0 -7
  330. package/dist/chunks/chunk-VKVH7LHB.js +0 -7
  331. package/dist/chunks/chunk-VUUU4KDL.js +0 -7
  332. package/dist/chunks/chunk-W3ZH27MN.js +0 -13
  333. package/dist/chunks/chunk-X47GV5HM.js +0 -15
  334. package/dist/chunks/chunk-XBHAU2M3.js +0 -9
  335. package/dist/chunks/chunk-XR2J7PQN.js +0 -12
  336. package/dist/chunks/chunk-YI7NKOCU.js +0 -23
  337. package/dist/chunks/chunk-Z2KANBOU.js +0 -69
  338. package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
  339. package/dist/chunks/clear-TH6G33QK.js +0 -8
  340. package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
  341. package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
  342. package/dist/chunks/config-2SBML7OY.js +0 -8
  343. package/dist/chunks/config-BCKJNJPS.js +0 -7
  344. package/dist/chunks/create-project-I7UXVWIR.js +0 -7
  345. package/dist/chunks/delete-RGHXL4JH.js +0 -9
  346. package/dist/chunks/delete-ZV4SHUTR.js +0 -10
  347. package/dist/chunks/describe-442UUQIF.js +0 -25
  348. package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
  349. package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
  350. package/dist/chunks/disable-MYGA6HVS.js +0 -7
  351. package/dist/chunks/discard-I5TKYCDJ.js +0 -14
  352. package/dist/chunks/edit-KGCUTTOZ.js +0 -8
  353. package/dist/chunks/edit-ZRNGGRVL.js +0 -9
  354. package/dist/chunks/enable-NODSFDKF.js +0 -7
  355. package/dist/chunks/esm-CF5UHWPM.js +0 -7
  356. package/dist/chunks/esm-EYOXGOVF.js +0 -7
  357. package/dist/chunks/esm-IUATPKKB.js +0 -9
  358. package/dist/chunks/esm-L6OKDFWP.js +0 -7
  359. package/dist/chunks/esm-ORQC2ZSA.js +0 -7
  360. package/dist/chunks/esm-PYIZNQIK.js +0 -9
  361. package/dist/chunks/future-RXI2OW2C.js +0 -7
  362. package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
  363. package/dist/chunks/image-6A2EJP4N.js +0 -7
  364. package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
  365. package/dist/chunks/inspect-STKCC3MC.js +0 -9
  366. package/dist/chunks/inspect-VFUV7BDM.js +0 -13
  367. package/dist/chunks/list-6ENV2ZGG.js +0 -12
  368. package/dist/chunks/login-O6NLJ42W.js +0 -7
  369. package/dist/chunks/login-U5VDJURN.js +0 -9
  370. package/dist/chunks/logs-X3KGHA3J.js +0 -7
  371. package/dist/chunks/ls-HRSD6VNW.js +0 -8
  372. package/dist/chunks/ls-OLJMGFTV.js +0 -11
  373. package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
  374. package/dist/chunks/mutate-BJXJON5E.js +0 -9
  375. package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
  376. package/dist/chunks/open-JK42ZTLB.js +0 -7
  377. package/dist/chunks/permissions-3AQO3DCH.js +0 -7
  378. package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
  379. package/dist/chunks/publish-7SCXBVZR.js +0 -15
  380. package/dist/chunks/pull-LAPD5XJG.js +0 -7
  381. package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
  382. package/dist/chunks/push-BCSGQBAM.js +0 -7
  383. package/dist/chunks/query-U72BDMAK.js +0 -7
  384. package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
  385. package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
  386. package/dist/chunks/reorder-YL6L6IWC.js +0 -10
  387. package/dist/chunks/reply-7Y5TN5UV.js +0 -9
  388. package/dist/chunks/resolve-C62436YM.js +0 -12
  389. package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
  390. package/dist/chunks/restore-Z63JM5CN.js +0 -16
  391. package/dist/chunks/rm-C6QSHEA2.js +0 -8
  392. package/dist/chunks/rm-DDKE62T7.js +0 -8
  393. package/dist/chunks/rm-IUB55CCM.js +0 -8
  394. package/dist/chunks/rm-NZX43GMQ.js +0 -8
  395. package/dist/chunks/rm-UBUI7JNY.js +0 -8
  396. package/dist/chunks/routes-TME3VYIF.js +0 -7
  397. package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
  398. package/dist/chunks/schema-P7DFLXCG.js +0 -14
  399. package/dist/chunks/select-org-MBBMOUK2.js +0 -7
  400. package/dist/chunks/set-SCKMJ7LZ.js +0 -7
  401. package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
  402. package/dist/chunks/tags-7M2EW6LU.js +0 -7
  403. package/dist/chunks/usage-HT5JXVAA.js +0 -13
  404. package/dist/chunks/validate-config-Q77XESW5.js +0 -7
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{collectBuildLogs,displayBuildLogs}from"./chunks/chunk-GUGP6OY2.js";import{InvalidEventsResponseError,RecordTooLargeError,decodeContinuation,encodeContinuation,fetchEventPages,recordLine,serializeTimeRange,sortIntervals,warningLine}from"./chunks/chunk-TC4E2TFA.js";import{getBuildMachineResourceConfig}from"./chunks/chunk-ZF27J6FQ.js";import{isDeploying}from"./chunks/chunk-ZFRNVIHI.js";import"./chunks/chunk-3A3GU62R.js";import{readStandardInput}from"./chunks/chunk-PSOVLGHP.js";import"./chunks/chunk-XOETL6DB.js";import{validateIntegerRangeWithDefault}from"./chunks/chunk-ZJNDLFZ7.js";import{external_exports}from"./chunks/chunk-2AMO2VMV.js";import{parseTimeFlag}from"./chunks/chunk-D3M2JG5C.js";import{summaryLine,writeJsonError}from"./chunks/chunk-KRP4EMD2.js";import{elapsed}from"./chunks/chunk-Q7D7RGXM.js";import{indent_default}from"./chunks/chunk-GZNDA6SV.js";import{getDeployment}from"./chunks/chunk-NBTFAXL4.js";import"./chunks/chunk-TJUZVODP.js";import{require_format}from"./chunks/chunk-PFD7LETF.js";import{getSubcommand}from"./chunks/chunk-ETV3C2CV.js";import{printNextPageCommand}from"./chunks/chunk-PFOOPXTN.js";import{getTeams}from"./chunks/chunk-DOMBKOLJ.js";import{BACKGROUND_FUNCTION_EXCLUSION,DEFAULT_LIMIT,DEFAULT_WINDOW,MAX_LIMIT,getCommandAliases,inspectCommand2 as inspectCommand,logsCommand,logsSources,requestsSubcommand2 as requestsSubcommand,runtimeSubcommand,sourceForEvent}from"./chunks/chunk-XR2J7PQN.js";import"./chunks/chunk-K3MGQQEP.js";import"./chunks/chunk-DDPH26ZO.js";import"./chunks/chunk-PIDEH4SJ.js";import"./chunks/chunk-IIK6GUVI.js";import"./chunks/chunk-C35SG42R.js";import"./chunks/chunk-2GBU6ULJ.js";import"./chunks/chunk-DOBV3XLO.js";import"./chunks/chunk-TUB3APDV.js";import"./chunks/chunk-BMIYC2MH.js";import"./chunks/chunk-6CJFPT4F.js";import"./chunks/chunk-ZZD5W5KT.js";import"./chunks/chunk-VHSAI6FS.js";import"./chunks/chunk-F7L5SXJM.js";import"./chunks/chunk-GLCSWIB4.js";import"./chunks/chunk-XECELSF5.js";import"./chunks/chunk-6FYPSSL4.js";import"./chunks/chunk-UQZZX2J7.js";import"./chunks/chunk-UDZJCD5W.js";import"./chunks/chunk-5ZCSFPWG.js";import"./chunks/chunk-RVIJRFVD.js";import"./chunks/chunk-XDYVJWGX.js";import"./chunks/chunk-JALVF3C2.js";import"./chunks/chunk-VZ4URN3U.js";import"./chunks/chunk-AB4WXRCO.js";import"./chunks/chunk-SYJXONEV.js";import{printError}from"./chunks/chunk-33HVDSWP.js";import"./chunks/chunk-BDXK4TCN.js";import{help}from"./chunks/chunk-5KSBRQI2.js";import{detectExplicitScope,getContextName}from"./chunks/chunk-NLK7NGVP.js";import{TelemetryClient}from"./chunks/chunk-KDCODXVL.js";import"./chunks/chunk-NWGBDBZI.js";import{getProjectLink,resolveProjectCwd,sleep}from"./chunks/chunk-Z2KANBOU.js";import"./chunks/chunk-M7FED5YP.js";import"./chunks/chunk-4HR3I3ML.js";import{getProjectByNameOrId}from"./chunks/chunk-DJZBJC2A.js";import"./chunks/chunk-LUX4PBJL.js";import"./chunks/chunk-MTZYPCZ7.js";import"./chunks/chunk-OPORM35X.js";import"./chunks/chunk-D6REP5QQ.js";import"./chunks/chunk-FBYA6LLM.js";import"./chunks/chunk-MY4MONOH.js";import"./chunks/chunk-UG3FZ5Q7.js";import{require_ms}from"./chunks/chunk-MXTC4ZAQ.js";import{isArgumentError,parseArguments}from"./chunks/chunk-CINNNQDJ.js";import{AGENT_REASON,argvHasNonInteractive,getErrorRecovery,getTeamByIdOrSlug}from"./chunks/chunk-4SS6W6JK.js";import{validateJsonOutput,warnDeprecatedSubcommand}from"./chunks/chunk-FEJD7MRH.js";import"./chunks/chunk-AW33SRYY.js";import"./chunks/chunk-4NTBYNFR.js";import"./chunks/chunk-4SAVH3H7.js";import{DeploymentNotFound,DeploymentPermissionDenied,InvalidDeploymentId,ProjectNotFound,isAPIError,require_bytes}from"./chunks/chunk-GOI2VVI7.js";import{getCommandName,getCommandNamePlain,require_lib}from"./chunks/chunk-B4KA3ZH2.js";import"./chunks/chunk-BOJDM3O7.js";import{output_manager_default}from"./chunks/chunk-AP6DZGTK.js";import"./chunks/chunk-BLUPZPAS.js";import{require_build_utils}from"./chunks/chunk-5MDNVAE6.js";import"./chunks/chunk-OCR5CRTH.js";import"./chunks/chunk-7EJQLVWX.js";import"./chunks/chunk-SCV7XEEO.js";import{require_dist}from"./chunks/chunk-MCYG7CCE.js";import"./chunks/chunk-YHPPP3SF.js";import"./chunks/chunk-24SIHFEW.js";import"./chunks/chunk-GLIQ4KNY.js";import{getFlagsSpecification,quoteArg}from"./chunks/chunk-CFJBDBYH.js";import"./chunks/chunk-2BKALEOP.js";import{require_source}from"./chunks/chunk-NB2WLB3J.js";import"./chunks/chunk-ISWW3DKF.js";import"./chunks/chunk-BRQUZ5NC.js";import{require_strip_ansi}from"./chunks/chunk-BULSRTQE.js";import{__toESM}from"./chunks/chunk-BZENIQ7N.js";var import_error_utils=__toESM(require_dist(),1),import_chalk3=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1),import_title=__toESM(require_lib(),1);var NOT_SAVED_LABELS={disabled:"not saved (caching disabled)",prebuilt:"not saved (prebuilt deployment)",no_cache_branch:"not saved (no branch to cache)",forced_skip:"not saved (skipped)",missing_metadata:"not saved (missing metadata)",no_files:"not saved (nothing to cache)"};function describeBuildCache(summary){let save=getKnownSave(summary);if(!save)return"unavailable";if(save.saved){let rows=[["size",`${formatCacheBytes(save.compressedSizeBytes)} / ${formatCacheBytes(save.cacheLimitBytes)} limit`]];return save.fileCount!==void 0&&rows.push(["file count",`~${save.fileCount.toLocaleString("en-US")} (approx., paths selected for packing)`]),rows}return"cacheLimitBytes"in save?`not saved (exceeded ${formatCacheBytes(save.cacheLimitBytes)} limit)`:save.reason==="failed"?"upload failed":NOT_SAVED_LABELS[save.reason]??"not saved"}function getBuildCacheJson(summary){if(!summary||typeof summary!="object")return;let{save}=summary;return save===void 0?void 0:{save}}function getKnownSave(summary){if(!summary||typeof summary!="object")return;let{version,save}=summary;if(!(version!==1||!save||typeof save!="object")){if(save.saved===!0)return isCount(save.compressedSizeBytes)&&isCount(save.cacheLimitBytes)&&(save.fileCount===void 0||isCount(save.fileCount))?save:void 0;if(!(save.saved!==!1||typeof save.reason!="string"))return save.reason==="size_exceeded"?isCount(save.cacheLimitBytes)?save:void 0:{saved:!1,reason:save.reason}}}function isCount(value){return typeof value=="number"&&Number.isSafeInteger(value)&&value>=0}var BINARY_UNITS=["B","KiB","MiB","GiB","TiB"];function formatCacheBytes(value){let unit=0,scaled=value;for(;scaled>=1024&&unit<BINARY_UNITS.length-1;)scaled/=1024,unit++;return`${Number(scaled.toFixed(2))} ${BINARY_UNITS[unit]}`}var import_chalk=__toESM(require_source(),1),import_bytes=__toESM(require_bytes(),1);var isReady=({readyState})=>readyState==="READY",isFailed=({readyState})=>readyState.endsWith("_ERROR")||readyState==="ERROR";var padding=8,MAX_BUILD_GROUPS=5,MAX_OUTPUTS_PER_GROUP=5,hasOutput=b=>Array.isArray(b.output)&&b.output.length>0,getCommonPath=buildGroup=>{let commonPath=[],splits=buildGroup.map(build=>getDirPath(build.entrypoint).split("/")),shortest=splits.reduce((prevValue,currentValue)=>Math.min(prevValue,currentValue.length),1/0);for(let i=0;i<=shortest;i++){let first=splits[0][i];if(splits.every(pathParts=>pathParts[i]===first)){commonPath.push(first);continue}break}return commonPath.join("/")||"/"},styleBuild=(build,times,longestSource)=>{let{entrypoint,id}=build,time=typeof times[id]=="string"?times[id]:"",pathColor=import_chalk.default.cyan;isFailed(build)&&(pathColor=import_chalk.default.red);let entry=entrypoint.padEnd(longestSource+padding),prefix=hasOutput(build)?"\u250C":"\u2576";return`${import_chalk.default.grey(prefix)} ${pathColor(entry)}${time}`},styleHiddenBuilds=(commonPath,buildGroup,times,longestSource,isHidden=!1)=>{let{id}=buildGroup[0],entry=commonPath.padEnd(longestSource+padding),time=typeof times[id]=="string"?times[id]:"",prefix=isHidden===!1&&buildGroup.some(hasOutput)?"\u250C":"\u2576",pathColor=import_chalk.default.cyan;return buildGroup.every(isFailed)&&(pathColor=import_chalk.default.red),isHidden&&(pathColor=import_chalk.default.grey),`${import_chalk.default.grey(prefix)} ${pathColor(entry)}${time}`},styleOutput=(output,readyState,isLast)=>{let{type,path,size,lambda}=output,prefix=type==="lambda"?"\u03BB ":"",finalSize=size?` ${import_chalk.default.grey(`(${(0,import_bytes.default)(size)})`)}`:"",color=import_chalk.default.grey,finalRegion="";if(isReady({readyState})?color=import_chalk.default:isFailed({readyState})&&(color=import_chalk.default.red),lambda){let{deployedTo}=lambda;deployedTo&&deployedTo.length>0&&(finalRegion=` ${import_chalk.default.grey(`[${deployedTo.join(", ")}]`)}`)}let corner=isLast?"\u2514\u2500\u2500":"\u251C\u2500\u2500",main=prefix+path+finalSize+finalRegion;return`${import_chalk.default.grey(corner)} ${color(main)}`},getDirPath=(path,level=0,highestLevel=null)=>{let parts=path.split("/").slice(0,-1);if(highestLevel===null||level===0)return parts.join("/");let reverseLevel=highestLevel-level;return parts.slice(0,reverseLevel).join("/")},sortByEntrypoint=(a,b)=>{let aPath=getDirPath(a.entrypoint),bPath=getDirPath(b.entrypoint);return aPath===""?1:bPath===""?-1:aPath>bPath?1:bPath>aPath?-1:0},groupBuilds=(buildList,highestLevel,counter)=>{let currentIndex=counter%buildList.length,__level=Math.ceil(counter/buildList.length),_level=(__level===0?1:__level)-1,level=_level>highestLevel?highestLevel:_level,currentPath=getDirPath(buildList[currentIndex][0].entrypoint,level,highestLevel),nextList=[],currentGroup=[];for(let i=0;i<buildList.length;i++){let group=buildList[i];getDirPath(group[0].entrypoint,level,highestLevel)===currentPath?currentGroup.push(...group):nextList.push(group)}return currentIndex===0?nextList.unshift(currentGroup):nextList.splice(currentIndex,0,currentGroup),nextList},builds_default=(builds,times)=>{let path=builds.sort(sortByEntrypoint).map(build=>[build]),highestLevel=builds.reduce((prev,curr)=>{let partCounter=curr.entrypoint.split("/").length-1;return partCounter>prev?partCounter:prev},0),counter=0;for(;path.length>MAX_BUILD_GROUPS;)path=groupBuilds(path,highestLevel,counter),counter++;path=path.reverse();let longestSource=builds.reduce((final2,current)=>{let{length}=current.entrypoint;return length>final2?length:final2},0),final=[],finalBuildsLength=path.length,lengthWithoutRootPaths=path.length,hiddenBuildGroup=[];path=(()=>{let nextList=[],rootList=[];for(let group of path)getCommonPath(group)==="/"?group.map(item=>rootList.push([item])):nextList.push(group);return lengthWithoutRootPaths=nextList.length,rootList.map(group=>nextList.push(group)),nextList})();for(let buildGroup of path){let commonPath=getCommonPath(buildGroup);if(commonPath==="/")if(lengthWithoutRootPaths<=MAX_BUILD_GROUPS&&finalBuildsLength<=MAX_BUILD_GROUPS){let item=buildGroup[0];final.push(`${styleBuild(item,times,longestSource)}
7
+ import{collectBuildLogs,displayBuildLogs}from"./chunks/chunk-KFBA2MAV.js";import{InvalidEventsResponseError,RecordTooLargeError,decodeContinuation,encodeContinuation,fetchEventPages,recordLine,serializeTimeRange,sortIntervals,warningLine}from"./chunks/chunk-HYGWJQN6.js";import{getBuildMachineResourceConfig}from"./chunks/chunk-ZF27J6FQ.js";import{isDeploying}from"./chunks/chunk-ZFRNVIHI.js";import"./chunks/chunk-VMRFCU6F.js";import{readStandardInput}from"./chunks/chunk-PSOVLGHP.js";import"./chunks/chunk-XOETL6DB.js";import{validateIntegerRangeWithDefault}from"./chunks/chunk-OOPF73RV.js";import{external_exports}from"./chunks/chunk-2AMO2VMV.js";import{parseTimeFlag}from"./chunks/chunk-D3M2JG5C.js";import{elapsed}from"./chunks/chunk-Q7D7RGXM.js";import{indent_default}from"./chunks/chunk-GZNDA6SV.js";import{getDeployment}from"./chunks/chunk-6Z5REGCM.js";import"./chunks/chunk-TLKBGAOL.js";import{require_format}from"./chunks/chunk-PFD7LETF.js";import{getSubcommand}from"./chunks/chunk-ETV3C2CV.js";import{printNextPageCommand}from"./chunks/chunk-7RABG6HV.js";import{getTeams}from"./chunks/chunk-WLD4SGKM.js";import{BACKGROUND_FUNCTION_EXCLUSION,DEFAULT_LIMIT,DEFAULT_WINDOW,MAX_LIMIT,functionInvocationsSubcommand,getCommandAliases,inspectCommand2 as inspectCommand,logsCommand,logsSources,requestsSubcommand2 as requestsSubcommand,runtimeSubcommand,sourceForEvent}from"./chunks/chunk-JR25PLC7.js";import"./chunks/chunk-2BK7SZQA.js";import"./chunks/chunk-D5JQZXL7.js";import"./chunks/chunk-SGNDE4YS.js";import"./chunks/chunk-T44RB754.js";import"./chunks/chunk-Z3YQZSU4.js";import"./chunks/chunk-GQXKF3PR.js";import"./chunks/chunk-CDJ25IKC.js";import"./chunks/chunk-RPYIWRSN.js";import"./chunks/chunk-YN3HZJXW.js";import"./chunks/chunk-JDDPCL3K.js";import"./chunks/chunk-23FY4PR3.js";import"./chunks/chunk-6FEMU5YF.js";import"./chunks/chunk-F7L5SXJM.js";import"./chunks/chunk-E7IN2DGU.js";import"./chunks/chunk-7JU5RJ3H.js";import"./chunks/chunk-X6JQI64G.js";import"./chunks/chunk-7OZ7OKPS.js";import"./chunks/chunk-6KNWKZR4.js";import"./chunks/chunk-MDRI27KN.js";import"./chunks/chunk-G24EKATW.js";import"./chunks/chunk-E5A7E7X6.js";import"./chunks/chunk-JALVF3C2.js";import"./chunks/chunk-BYBELFCP.js";import"./chunks/chunk-Y3V4JYK6.js";import"./chunks/chunk-A6CMQOL7.js";import{detectExplicitScope,getContextName}from"./chunks/chunk-VIOIR6II.js";import{TelemetryClient}from"./chunks/chunk-EYRBV6RM.js";import{getProjectLink,resolveProjectCwd,sleep,summaryLine,writeJsonError}from"./chunks/chunk-4Z6R5KHZ.js";import"./chunks/chunk-M2Q2DUHO.js";import"./chunks/chunk-4HR3I3ML.js";import{getProjectByNameOrId}from"./chunks/chunk-3AFEVHHY.js";import"./chunks/chunk-LUX4PBJL.js";import"./chunks/chunk-MTZYPCZ7.js";import"./chunks/chunk-OPORM35X.js";import"./chunks/chunk-D6REP5QQ.js";import"./chunks/chunk-FBYA6LLM.js";import"./chunks/chunk-MY4MONOH.js";import"./chunks/chunk-ZRFDZO7Y.js";import{require_ms}from"./chunks/chunk-MXTC4ZAQ.js";import{printError}from"./chunks/chunk-HMJR6RVF.js";import{isArgumentError,parseArguments}from"./chunks/chunk-INIZJZ3O.js";import{AGENT_REASON,argvHasNonInteractive,getErrorRecovery,getTeamByIdOrSlug}from"./chunks/chunk-CSNP5RIM.js";import{validateJsonOutput,warnDeprecatedSubcommand}from"./chunks/chunk-KA2KG3SY.js";import"./chunks/chunk-AW33SRYY.js";import"./chunks/chunk-4SAVH3H7.js";import"./chunks/chunk-4NTBYNFR.js";import{DeploymentNotFound,DeploymentPermissionDenied,InvalidDeploymentId,ProjectNotFound,isAPIError,require_bytes}from"./chunks/chunk-QFE3RPMA.js";import{getCommandName,getCommandNamePlain,require_lib}from"./chunks/chunk-B4KA3ZH2.js";import"./chunks/chunk-BOJDM3O7.js";import{output_manager_default}from"./chunks/chunk-RYSO5U3E.js";import"./chunks/chunk-BLUPZPAS.js";import{require_build_utils}from"./chunks/chunk-5MDNVAE6.js";import"./chunks/chunk-7HQZRU25.js";import"./chunks/chunk-YTSGFU5T.js";import"./chunks/chunk-7EJQLVWX.js";import"./chunks/chunk-SCV7XEEO.js";import{require_dist}from"./chunks/chunk-MCYG7CCE.js";import"./chunks/chunk-YHPPP3SF.js";import"./chunks/chunk-RHFNVIFD.js";import{help}from"./chunks/chunk-5727HGA6.js";import"./chunks/chunk-24SIHFEW.js";import{remoteText}from"./chunks/chunk-SQ62IODX.js";import{getFlagsSpecification,quoteArg}from"./chunks/chunk-DORCX7UB.js";import"./chunks/chunk-2BKALEOP.js";import{require_source}from"./chunks/chunk-NB2WLB3J.js";import"./chunks/chunk-ISWW3DKF.js";import"./chunks/chunk-BRQUZ5NC.js";import"./chunks/chunk-67GZ5REA.js";import{require_strip_ansi}from"./chunks/chunk-BS32OUOC.js";import{__toESM}from"./chunks/chunk-BZENIQ7N.js";var import_error_utils=__toESM(require_dist(),1),import_chalk3=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1),import_title=__toESM(require_lib(),1);var NOT_SAVED_LABELS={disabled:"not saved (caching disabled)",prebuilt:"not saved (prebuilt deployment)",no_cache_branch:"not saved (no branch to cache)",forced_skip:"not saved (skipped)",missing_metadata:"not saved (missing metadata)",no_files:"not saved (nothing to cache)"};function describeBuildCache(summary){let save=getKnownSave(summary);if(!save)return"unavailable";if(save.saved){let rows=[["size",`${formatCacheBytes(save.compressedSizeBytes)} / ${formatCacheBytes(save.cacheLimitBytes)} limit`]];return save.fileCount!==void 0&&rows.push(["file count",`~${save.fileCount.toLocaleString("en-US")} (approx., paths selected for packing)`]),rows}return"cacheLimitBytes"in save?`not saved (exceeded ${formatCacheBytes(save.cacheLimitBytes)} limit)`:save.reason==="failed"?"upload failed":NOT_SAVED_LABELS[save.reason]??"not saved"}function getBuildCacheJson(summary){if(!summary||typeof summary!="object")return;let{save}=summary;return save===void 0?void 0:{save}}function getKnownSave(summary){if(!summary||typeof summary!="object")return;let{version,save}=summary;if(!(version!==1||!save||typeof save!="object")){if(save.saved===!0)return isCount(save.compressedSizeBytes)&&isCount(save.cacheLimitBytes)&&(save.fileCount===void 0||isCount(save.fileCount))?save:void 0;if(!(save.saved!==!1||typeof save.reason!="string"))return save.reason==="size_exceeded"?isCount(save.cacheLimitBytes)?save:void 0:{saved:!1,reason:save.reason}}}function isCount(value){return typeof value=="number"&&Number.isSafeInteger(value)&&value>=0}var BINARY_UNITS=["B","KiB","MiB","GiB","TiB"];function formatCacheBytes(value){let unit=0,scaled=value;for(;scaled>=1024&&unit<BINARY_UNITS.length-1;)scaled/=1024,unit++;return`${Number(scaled.toFixed(2))} ${BINARY_UNITS[unit]}`}var import_chalk=__toESM(require_source(),1),import_bytes=__toESM(require_bytes(),1);var isReady=({readyState})=>readyState==="READY",isFailed=({readyState})=>readyState.endsWith("_ERROR")||readyState==="ERROR";var padding=8,MAX_BUILD_GROUPS=5,MAX_OUTPUTS_PER_GROUP=5,hasOutput=b=>Array.isArray(b.output)&&b.output.length>0,getCommonPath=buildGroup=>{let commonPath=[],splits=buildGroup.map(build=>getDirPath(build.entrypoint).split("/")),shortest=splits.reduce((prevValue,currentValue)=>Math.min(prevValue,currentValue.length),1/0);for(let i=0;i<=shortest;i++){let first=splits[0][i];if(splits.every(pathParts=>pathParts[i]===first)){commonPath.push(first);continue}break}return commonPath.join("/")||"/"},styleBuild=(build,times,longestSource)=>{let{entrypoint,id}=build,time=typeof times[id]=="string"?times[id]:"",pathColor=import_chalk.default.cyan;isFailed(build)&&(pathColor=import_chalk.default.red);let entry=entrypoint.padEnd(longestSource+padding),prefix=hasOutput(build)?"\u250C":"\u2576";return`${import_chalk.default.grey(prefix)} ${pathColor(entry)}${time}`},styleHiddenBuilds=(commonPath,buildGroup,times,longestSource,isHidden=!1)=>{let{id}=buildGroup[0],entry=commonPath.padEnd(longestSource+padding),time=typeof times[id]=="string"?times[id]:"",prefix=isHidden===!1&&buildGroup.some(hasOutput)?"\u250C":"\u2576",pathColor=import_chalk.default.cyan;return buildGroup.every(isFailed)&&(pathColor=import_chalk.default.red),isHidden&&(pathColor=import_chalk.default.grey),`${import_chalk.default.grey(prefix)} ${pathColor(entry)}${time}`},styleOutput=(output,readyState,isLast)=>{let{type,path,size,lambda}=output,prefix=type==="lambda"?"\u03BB ":"",finalSize=size?` ${import_chalk.default.grey(`(${(0,import_bytes.default)(size)})`)}`:"",color=import_chalk.default.grey,finalRegion="";if(isReady({readyState})?color=import_chalk.default:isFailed({readyState})&&(color=import_chalk.default.red),lambda){let{deployedTo}=lambda;deployedTo&&deployedTo.length>0&&(finalRegion=` ${import_chalk.default.grey(`[${deployedTo.join(", ")}]`)}`)}let corner=isLast?"\u2514\u2500\u2500":"\u251C\u2500\u2500",main=prefix+path+finalSize+finalRegion;return`${import_chalk.default.grey(corner)} ${color(main)}`},getDirPath=(path,level=0,highestLevel=null)=>{let parts=path.split("/").slice(0,-1);if(highestLevel===null||level===0)return parts.join("/");let reverseLevel=highestLevel-level;return parts.slice(0,reverseLevel).join("/")},sortByEntrypoint=(a,b)=>{let aPath=getDirPath(a.entrypoint),bPath=getDirPath(b.entrypoint);return aPath===""?1:bPath===""?-1:aPath>bPath?1:bPath>aPath?-1:0},groupBuilds=(buildList,highestLevel,counter)=>{let currentIndex=counter%buildList.length,__level=Math.ceil(counter/buildList.length),_level=(__level===0?1:__level)-1,level=_level>highestLevel?highestLevel:_level,currentPath=getDirPath(buildList[currentIndex][0].entrypoint,level,highestLevel),nextList=[],currentGroup=[];for(let i=0;i<buildList.length;i++){let group=buildList[i];getDirPath(group[0].entrypoint,level,highestLevel)===currentPath?currentGroup.push(...group):nextList.push(group)}return currentIndex===0?nextList.unshift(currentGroup):nextList.splice(currentIndex,0,currentGroup),nextList},builds_default=(builds,times)=>{let path=builds.sort(sortByEntrypoint).map(build=>[build]),highestLevel=builds.reduce((prev,curr)=>{let partCounter=curr.entrypoint.split("/").length-1;return partCounter>prev?partCounter:prev},0),counter=0;for(;path.length>MAX_BUILD_GROUPS;)path=groupBuilds(path,highestLevel,counter),counter++;path=path.reverse();let longestSource=builds.reduce((final2,current)=>{let{length}=current.entrypoint;return length>final2?length:final2},0),final=[],finalBuildsLength=path.length,lengthWithoutRootPaths=path.length,hiddenBuildGroup=[];path=(()=>{let nextList=[],rootList=[];for(let group of path)getCommonPath(group)==="/"?group.map(item=>rootList.push([item])):nextList.push(group);return lengthWithoutRootPaths=nextList.length,rootList.map(group=>nextList.push(group)),nextList})();for(let buildGroup of path){let commonPath=getCommonPath(buildGroup);if(commonPath==="/")if(lengthWithoutRootPaths<=MAX_BUILD_GROUPS&&finalBuildsLength<=MAX_BUILD_GROUPS){let item=buildGroup[0];final.push(`${styleBuild(item,times,longestSource)}
8
8
  `),finalBuildsLength++}else{hiddenBuildGroup.push(buildGroup[0]);continue}else if(buildGroup.length===1){let item=buildGroup[0];final.push(`${styleBuild(item,times,longestSource)}
9
9
  `),finalBuildsLength++}else final.push(`${styleHiddenBuilds(`${commonPath}/*`,buildGroup,times,longestSource)}
10
10
  `),finalBuildsLength++;let outputs=[];for(let build of buildGroup)Array.isArray(build.output)&&outputs.push(...build.output);outputs.slice(0,MAX_OUTPUTS_PER_GROUP).forEach((output,index)=>final.push(`${styleOutput(output,"READY",outputs.length===index+1)}
@@ -61,26 +61,27 @@ import{collectBuildLogs,displayBuildLogs}from"./chunks/chunk-GUGP6OY2.js";import
61
61
 
62
62
  `))}async function printJson({deployment,contextName,client,prefetchedBuilds}){let{id,name,url,createdAt,routes:routes2,readyState,readyStateReason,alias:aliases,target,customEnvironment,buildCacheSummary}=deployment,builds=deployment.version===2?await(prefetchedBuilds??fetchBuilds(client,id)):[],buildMachine=getBuildMachineResourceConfig(deployment),buildCacheJson=getBuildCacheJson(buildCacheSummary),jsonOutput={id,name,url,target:customEnvironment?.slug??target??"preview",readyState,...readyStateReason&&{readyStateReason},createdAt,...deployment.duration&&{duration:deployment.duration},...buildMachine&&{buildMachine},...buildCacheJson&&{buildCacheSummary:buildCacheJson},...aliases&&aliases.length>0&&{aliases},...builds.length>0&&{builds},...Array.isArray(routes2)&&routes2.length>0&&{routes:routes2},...contextName&&{contextName}};client.stdout.write(`${JSON.stringify(jsonOutput,null,2)}
63
63
  `)}async function fetchBuilds(client,deploymentId){let{builds}=await client.fetch(`/v11/deployments/${deploymentId}/builds`);return builds}function getPostBuildDuration(duration){if(duration?.timeToReady===void 0||duration.timeToContainerExit===void 0)return;let postBuildDuration=duration.timeToContainerExit-duration.timeToReady;return postBuildDuration>=0?postBuildDuration:void 0}function formatDuration(durationMs){if(durationMs===void 0)return"unavailable";if(durationMs<1e3)return`${durationMs}ms`;let totalSeconds=Math.round(durationMs/1e3),minutes=Math.floor(totalSeconds/60),seconds=totalSeconds%60;return minutes===0?`${seconds}s`:seconds===0?`${minutes}m`:`${minutes}m ${seconds}s`}function formatCpuMinutes(billedBuildCpuMs,billableDurationMs,assignedCpuCores){if(billedBuildCpuMs===void 0)return"unavailable";let minutes=billedBuildCpuMs/6e4,calculation=billableDurationMs!==void 0&&assignedCpuCores!==void 0?` (${formatDuration(billableDurationMs)} x ${assignedCpuCores}vCPU)`:"";return`${minutes} minutes${calculation}`}function printLogsJson(client,logs2){client.stdout.write(`${JSON.stringify(logs2,null,2)}
64
- `)}function exitCode(state){return state==="ERROR"||state==="CANCELED"?1:0}var import_chalk5=__toESM(require_source(),1),import_error_utils2=__toESM(require_dist(),1);function writeWithBackpressure(stream,text2){return new Promise((resolve,reject)=>{let cleanup=()=>{stream.removeListener("drain",onDrain),stream.removeListener("error",onError),stream.removeListener("close",onClose)},onDrain=()=>{cleanup(),resolve()},onError=err=>{cleanup(),reject(err)},onClose=()=>{cleanup(),reject(new Error("Output stream closed."))};if(stream.destroyed){onClose();return}stream.once("drain",onDrain),stream.once("error",onError),stream.once("close",onClose);try{stream.write(text2)&&onDrain()}catch(err){onError(err instanceof Error?err:new Error(String(err)))}})}var LogsTelemetryClient=class extends TelemetryClient{trackCliSubcommandRuntime(actual){this.trackCliSubcommand({subcommand:"runtime",value:actual})}trackCliSubcommandRequests(actual){this.trackCliSubcommand({subcommand:"requests",value:actual})}trackCliLegacyOption(name){this.trackCliOption({option:name,value:"removed"})}trackCliArgumentPositional(kind){this.trackCliArgument({arg:"positional",value:kind})}trackCliOptionDeployment(v){v&&this.trackCliOption({option:"deployment",value:this.redactedValue})}trackCliOptionEnvironment(v){if(v){let value=["production","preview"].includes(v)?v:this.redactedValue;this.trackCliOption({option:"environment",value})}}trackCliOptionQuery(v){v!==void 0&&this.trackCliOption({option:"query",value:this.redactedValue})}trackCliOptionNext(v){v!==void 0&&this.trackCliOption({option:"next",value:this.redactedValue})}trackCliOptionFormat(v){if(v){let value=v.toLowerCase()==="json"?"json":this.redactedValue;this.trackCliOption({option:"format",value})}}trackCliFlagJson(v){v&&this.trackCliFlag("json")}trackCliOptionLimit(v){typeof v=="number"&&this.trackCliOption({option:"limit",value:this.redactedValue})}trackCliOptionSince(v){v&&this.trackCliOption({option:"since",value:this.redactedValue})}trackCliOptionUntil(v){v&&this.trackCliOption({option:"until",value:this.redactedValue})}trackCliFlagFollow(v){v&&this.trackCliFlag("follow")}};var import_chalk4=__toESM(require_source(),1),import_format=__toESM(require_format(),1),import_strip_ansi=__toESM(require_strip_ansi(),1),TIME_ONLY_FORMAT="HH:mm:ss.SSS",DATE_TIME_FORMAT="MMM DD HH:mm:ss.SSS",LEVEL_WIDTH=7,PRODUCER_WIDTH=16,STATUS_WIDTH=6,METHOD_WIDTH=7,CACHE_WIDTH=9,REQUEST_ID_WIDTH=32,CONTROL_CHARACTERS=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function sanitize(value){return(0,import_strip_ansi.default)(value.replace(/\r\n?/g,`
64
+ `)}function exitCode(state){return state==="ERROR"||state==="CANCELED"?1:0}var import_chalk5=__toESM(require_source(),1),import_error_utils2=__toESM(require_dist(),1);function writeWithBackpressure(stream,text2){return new Promise((resolve,reject)=>{let cleanup=()=>{stream.removeListener("drain",onDrain),stream.removeListener("error",onError),stream.removeListener("close",onClose)},onDrain=()=>{cleanup(),resolve()},onError=err=>{cleanup(),reject(err)},onClose=()=>{cleanup(),reject(new Error("Output stream closed."))};if(stream.destroyed){onClose();return}stream.once("drain",onDrain),stream.once("error",onError),stream.once("close",onClose);try{stream.write(text2)&&onDrain()}catch(err){onError(err instanceof Error?err:new Error(String(err)))}})}var LogsTelemetryClient=class extends TelemetryClient{trackCliSubcommandRuntime(actual){this.trackCliSubcommand({subcommand:"runtime",value:actual})}trackCliSubcommandRequests(actual){this.trackCliSubcommand({subcommand:"requests",value:actual})}trackCliSubcommandFunctionInvocations(actual){this.trackCliSubcommand({subcommand:"function-invocations",value:actual})}trackCliError(code,status){this.trackErrorCode(code),this.trackErrorStatus(status)}trackCliLegacyOption(name){this.trackCliOption({option:name,value:"removed"})}trackCliArgumentPositional(kind){this.trackCliArgument({arg:"positional",value:kind})}trackCliOptionDeployment(v){v&&this.trackCliOption({option:"deployment",value:this.redactedValue})}trackCliOptionEnvironment(v){if(v){let value=["production","preview"].includes(v)?v:this.redactedValue;this.trackCliOption({option:"environment",value})}}trackCliOptionQuery(v){v!==void 0&&this.trackCliOption({option:"query",value:this.redactedValue})}trackCliOptionNext(v){v!==void 0&&this.trackCliOption({option:"next",value:this.redactedValue})}trackCliOptionFormat(v){if(v){let value=v.toLowerCase()==="json"?"json":this.redactedValue;this.trackCliOption({option:"format",value})}}trackCliFlagJson(v){v&&this.trackCliFlag("json")}trackCliOptionLimit(v){typeof v=="number"&&this.trackCliOption({option:"limit",value:this.redactedValue})}trackCliOptionSince(v){v&&this.trackCliOption({option:"since",value:this.redactedValue})}trackCliOptionUntil(v){v&&this.trackCliOption({option:"until",value:this.redactedValue})}trackCliFlagFollow(v){v&&this.trackCliFlag("follow")}};var import_chalk4=__toESM(require_source(),1),import_format=__toESM(require_format(),1),import_strip_ansi=__toESM(require_strip_ansi(),1);var TIME_ONLY_FORMAT="HH:mm:ss.SSS",DATE_TIME_FORMAT="MMM DD HH:mm:ss.SSS",LEVEL_WIDTH=7,PRODUCER_WIDTH=16,STATUS_WIDTH=6,METHOD_WIDTH=7,CACHE_WIDTH=9,DURATION_WIDTH=8,PATH_TYPE_WIDTH=17,REQUEST_ID_WIDTH=32,CONTROL_CHARACTERS=/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;function sanitize(value){return(0,import_strip_ansi.default)(value.replace(/\r\n?/g,`
65
65
  `)).replace(CONTROL_CHARACTERS,"")}function text(event,field){let value=event[field];return value==null?"":sanitize(typeof value=="string"?value:String(value))}function cell(value,width){return(value||"-").padEnd(width)}function timeFormatFor(range){return range.start.toDateString()===new Date(range.end.getTime()-1).toDateString()&&range.end.toDateString()===new Date().toDateString()?TIME_ONLY_FORMAT:DATE_TIME_FORMAT}function formatTime(event,timeFormat){let value=event.timestamp,date=typeof value=="string"||typeof value=="number"?new Date(value):void 0;return!date||isNaN(date.getTime())?text(event,"timestamp")||"-":(0,import_format.default)(date,timeFormat)}function colorizeLevel(value,level){switch(level){case"fatal":return import_chalk4.default.red.bold(value);case"error":return import_chalk4.default.red(value);case"warning":return import_chalk4.default.yellow(value);default:return import_chalk4.default.dim(value)}}function colorizeStatus(value,status){return status>=500?import_chalk4.default.red(value):status>=400?import_chalk4.default.yellow(value):status>=300?import_chalk4.default.cyan(value):status>=200?import_chalk4.default.green(value):import_chalk4.default.gray(value)}function runtimeRenderer(timeFormat,timeWidth){let messageIndent=" ".repeat(timeWidth+LEVEL_WIDTH+PRODUCER_WIDTH+6);return{header:()=>import_chalk4.default.dim(["TIME".padEnd(timeWidth),"LEVEL".padEnd(LEVEL_WIDTH),"SERVICE/SOURCE".padEnd(PRODUCER_WIDTH),"MESSAGE"].join(" ")),row:event=>{let level=text(event,"level"),producer=text(event,"service")||text(event,"source"),message=text(event,"message").replace(/\n+$/,""),[first="",...rest]=message.split(`
66
66
  `),truncated=event.truncated===!0,lines=[[import_chalk4.default.dim(formatTime(event,timeFormat).padEnd(timeWidth)),colorizeLevel(cell(level,LEVEL_WIDTH),level),cell(producer,PRODUCER_WIDTH),first||(rest.length===0?import_chalk4.default.dim("(no message)"):"")].join(" "),...rest.map(line=>`${messageIndent}${line}`)];return truncated&&lines.push(`${messageIndent}${import_chalk4.default.yellow("[message truncated]")}`),lines.join(`
67
- `)}}}function requestsRenderer(timeFormat,timeWidth){return{header:()=>import_chalk4.default.dim(["TIME".padEnd(timeWidth),"STATUS".padEnd(STATUS_WIDTH),"METHOD".padEnd(METHOD_WIDTH),"CACHE".padEnd(CACHE_WIDTH),"REQUEST ID".padEnd(REQUEST_ID_WIDTH),"HOST AND PATH"].join(" ")),row:event=>{let status=event.httpStatus,statusCell=(typeof status=="number"&&status>0?String(status):"-").padEnd(STATUS_WIDTH);return[import_chalk4.default.dim(formatTime(event,timeFormat).padEnd(timeWidth)),typeof status=="number"?colorizeStatus(statusCell,status):statusCell,cell(text(event,"requestMethod"),METHOD_WIDTH),cell(text(event,"cacheResult"),CACHE_WIDTH),cell(text(event,"requestId"),REQUEST_ID_WIDTH),`${text(event,"requestHostname")}${text(event,"requestPath")}`||"-"].join(" ")}}}function createRenderer(source,range){let timeFormat=timeFormatFor(range),timeWidth=(0,import_format.default)(new Date(0),timeFormat).length;return source==="runtime"?runtimeRenderer(timeFormat,timeWidth):requestsRenderer(timeFormat,timeWidth)}function formatWindow(range){let sameDay=range.start.toDateString()===range.end.toDateString(),start=(0,import_format.default)(range.start,"YYYY-MM-DD HH:mm:ss"),end=(0,import_format.default)(range.end,sameDay?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss"),zone=(0,import_format.default)(range.end,"Z");return`${start} to ${end} (UTC${zone})`}var issuesSchema=external_exports.array(external_exports.object({path:external_exports.string(),message:external_exports.string()})),REQUESTS_ACCESS_MESSAGE="CDN request logs require Observability Plus, a Priority project, or the Enterprise Agents & Apps entitlement.";function describeLogsApiError(client,err,source){if(!isAPIError(err))return;let serverMessage=sanitize(err.serverMessage||err.message),base={status:"error",...getErrorRecovery(err,client),data:{httpStatus:err.status,serverMessage,...typeof err.code=="string"?{code:err.code}:{}}};if(err.status===402)return{human:source==="requests"?`${REQUESTS_ACCESS_MESSAGE}
68
- ${serverMessage}`:serverMessage,json:{...base,reason:AGENT_REASON.PLAN_UPGRADE_REQUIRED,message:source==="requests"?REQUESTS_ACCESS_MESSAGE:"The selected team can't query runtime logs for this window."},exitCode:1};let issues=issuesSchema.safeParse(err.issues);if(err.status===400&&issues.success&&issues.data.length>0){let messages=issues.data.map(issue=>sanitize(issue.message)),timeIssue=issues.data.some(issue=>issue.path.startsWith("timeRange")),hint=timeIssue?"Adjust --since or --until.":`See ${getCommandNamePlain(`logs ${source} --help`)} for supported filter forms.`,humanHint=timeIssue?hint:`See ${getCommandName(`logs ${source} --help`)} for supported filter forms.`;return{human:`${source}: ${messages.join("; ")}
67
+ `)}}}function requestsRenderer(timeFormat,timeWidth){return{header:()=>import_chalk4.default.dim(["TIME".padEnd(timeWidth),"STATUS".padEnd(STATUS_WIDTH),"METHOD".padEnd(METHOD_WIDTH),"CACHE".padEnd(CACHE_WIDTH),"REQUEST ID".padEnd(REQUEST_ID_WIDTH),"HOST AND PATH"].join(" ")),row:event=>{let status=event.httpStatus,statusCell=(typeof status=="number"&&status>0?String(status):"-").padEnd(STATUS_WIDTH);return[import_chalk4.default.dim(formatTime(event,timeFormat).padEnd(timeWidth)),typeof status=="number"?colorizeStatus(statusCell,status):statusCell,cell(text(event,"requestMethod"),METHOD_WIDTH),cell(text(event,"cacheResult"),CACHE_WIDTH),cell(text(event,"requestId"),REQUEST_ID_WIDTH),`${text(event,"requestHostname")}${text(event,"requestPath")}`||"-"].join(" ")}}}function formatDurationMs(value){let ms3=typeof value=="string"?Number(value):value;if(typeof ms3!="number"||!Number.isFinite(ms3)||ms3<0)return"-";let rounded=Math.round(ms3);return rounded<1e3?`${rounded}ms`:`${(ms3/1e3).toFixed(1)}s`}function cellText(event,field){let value=event[field];return value==null?"":remoteText(typeof value=="string"?value:String(value))}function functionInvocationsRenderer(timeFormat,timeWidth){return{header:()=>import_chalk4.default.dim(["TIME".padEnd(timeWidth),"STATUS".padEnd(STATUS_WIDTH),"METHOD".padEnd(METHOD_WIDTH),"DURATION".padEnd(DURATION_WIDTH),"PATH TYPE".padEnd(PATH_TYPE_WIDTH),"REQUEST ID".padEnd(REQUEST_ID_WIDTH),"HOST AND PATH"].join(" ")),row:event=>{let status=event.httpStatus,statusCell=(typeof status=="number"&&status>0?String(status):"-").padEnd(STATUS_WIDTH),errorCode=cellText(event,"errorCode"),hostAndPath=`${cellText(event,"requestHostname")}${cellText(event,"requestPath")}`||"-";return[import_chalk4.default.dim(formatTime(event,timeFormat).padEnd(timeWidth)),typeof status=="number"?colorizeStatus(statusCell,status):statusCell,cell(cellText(event,"requestMethod"),METHOD_WIDTH),formatDurationMs(event.functionDurationMs).padEnd(DURATION_WIDTH),cell(cellText(event,"pathType"),PATH_TYPE_WIDTH),cell(cellText(event,"requestId"),REQUEST_ID_WIDTH),errorCode?`${hostAndPath} ${import_chalk4.default.red(`[${errorCode}]`)}`:hostAndPath].join(" ")}}}function createRenderer(source,range){let timeFormat=timeFormatFor(range),timeWidth=(0,import_format.default)(new Date(0),timeFormat).length;switch(source){case"runtime":return runtimeRenderer(timeFormat,timeWidth);case"requests":return requestsRenderer(timeFormat,timeWidth);case"function-invocations":return functionInvocationsRenderer(timeFormat,timeWidth)}}function formatWindow(range){let sameDay=range.start.toDateString()===range.end.toDateString(),start=(0,import_format.default)(range.start,"YYYY-MM-DD HH:mm:ss"),end=(0,import_format.default)(range.end,sameDay?"HH:mm:ss":"YYYY-MM-DD HH:mm:ss"),zone=(0,import_format.default)(range.end,"Z");return`${start} to ${end} (UTC${zone})`}var issuesSchema=external_exports.array(external_exports.object({path:external_exports.string(),message:external_exports.string()})),REQUESTS_ACCESS_MESSAGE="CDN request logs require Observability Plus, a Priority project, or the Enterprise Agents & Apps entitlement.",ACCESS_MESSAGES={runtime:"The selected team can't query runtime logs for this window.",requests:REQUESTS_ACCESS_MESSAGE,"function-invocations":"Function invocations require Observability Plus."},FUNCTION_INVOCATIONS_FREE_WINDOW_MESSAGE="Function invocations in this window require Observability Plus.",RECORDS_NOUNS={runtime:"runtime logs",requests:"requests logs","function-invocations":"function invocations"},CONTINUATION_FREE_WINDOW_HINT="This cursor's window now starts too long ago to search without Observability Plus. Run the query again without --next, and use a larger --limit to get more invocations in one run.";function describeLogsApiError(client,err,source,query){if(!isAPIError(err))return;let serverMessage=sanitize(err.serverMessage||err.message),recovery=getErrorRecovery(err,client),base={status:"error",...recovery,data:{httpStatus:err.status,serverMessage,...typeof err.code=="string"?{code:err.code}:{}}};if(err.status===402){let outsideFreeWindow=source==="function-invocations"&&isFreeWindowRefusal(err),message=outsideFreeWindow?FUNCTION_INVOCATIONS_FREE_WINDOW_MESSAGE:ACCESS_MESSAGES[source],continuationHint=outsideFreeWindow&&query?.continuation?CONTINUATION_FREE_WINDOW_HINT:void 0,human;source==="requests"?human=`${message}
68
+ ${serverMessage}`:continuationHint?human=`${serverMessage}
69
+ ${continuationHint}`:human=serverMessage;let hint=continuationHint?[continuationHint,recovery.hint].filter(Boolean).join(" "):void 0;return{human,json:{...base,reason:AGENT_REASON.PLAN_UPGRADE_REQUIRED,message,...hint?{hint}:{}},exitCode:1,...outsideFreeWindow?{outsideFreeWindow:!0}:{}}}let issues=issuesSchema.safeParse(err.issues);if(err.status===400&&issues.success&&issues.data.length>0){let messages=issues.data.map(issue=>sanitize(issue.message)),timeIssue=issues.data.some(issue=>issue.path.startsWith("timeRange")),hint=timeIssue?"Adjust --since or --until.":`See ${getCommandNamePlain(`logs ${source} --help`)} for supported filter forms.`,humanHint=timeIssue?hint:`See ${getCommandName(`logs ${source} --help`)} for supported filter forms.`;return{human:`${source}: ${messages.join("; ")}
69
70
  ${humanHint}`,json:{...base,reason:AGENT_REASON.INVALID_ARGUMENTS,message:`The ${source} query was rejected.`,hint,data:{...base.data,issues:issues.data.map(issue=>({field:issue.path,reason:"invalid",message:sanitize(issue.message)}))}},exitCode:2}}if(err.status===400&&/time range|retain/i.test(serverMessage)){let hint=`Use a later --since, or omit it to search the last ${DEFAULT_WINDOW}.`;return{human:`${serverMessage}
70
- ${hint}`,json:{...base,reason:AGENT_REASON.INVALID_ARGUMENTS,message:"The requested time range is outside the available retention.",hint},exitCode:2}}if(err.status===403)return{human:serverMessage,json:{...base,reason:AGENT_REASON.PERMISSION_DENIED,message:`You don't have access to ${source} logs for this project.`},exitCode:1};if(err.status===400)return{human:serverMessage,json:{...base,reason:AGENT_REASON.API_ERROR,message:`The API rejected the ${source} query.`},exitCode:1};if(err.status===504){let retries=typeof err.retries=="number"?err.retries:0,message=`Couldn't retrieve ${source} logs: the query timed out.`,hint="Narrow --query, --since, or --until, then try again.";return{human:`${message}
71
+ ${hint}`,json:{...base,reason:AGENT_REASON.INVALID_ARGUMENTS,message:"The requested time range is outside the available retention.",hint},exitCode:2}}if(err.status===403)return{human:serverMessage,json:{...base,reason:AGENT_REASON.PERMISSION_DENIED,message:`You don't have access to ${RECORDS_NOUNS[source]} for this project.`},exitCode:1};if(err.status===400)return{human:serverMessage,json:{...base,reason:AGENT_REASON.API_ERROR,message:`The API rejected the ${source} query.`},exitCode:1};if(err.status===504){let retries=typeof err.retries=="number"?err.retries:0,message=`Couldn't retrieve ${RECORDS_NOUNS[source]}: the query timed out.`,hint="Narrow --query, --since, or --until, then try again.";return{human:`${message}
71
72
  Retries: ${retries}
72
- ${hint}`,json:{...base,reason:AGENT_REASON.API_ERROR,message,hint,data:{...base.data,retries}},exitCode:1}}return err.status===429?{human:serverMessage,json:{...base,reason:AGENT_REASON.RATE_LIMITED,message:`Couldn't retrieve ${source} logs: the request limit was reached.`},exitCode:1}:{human:serverMessage,json:{...base,reason:AGENT_REASON.API_ERROR,message:`Couldn't retrieve ${source} logs.`},exitCode:1}}function printLogsApiError(client,err,source){let failure=describeLogsApiError(client,err,source);if(!failure){printError(err);return}let status=isAPIError(err)?err.status:void 0;if(failure.json.reason===AGENT_REASON.API_ERROR&&status!==400&&status!==504||failure.json.reason===AGENT_REASON.RATE_LIMITED){printError(err);return}output_manager_default.error(failure.human)}var legacyLogsOptions=[{name:"search",shorthand:null,type:String,deprecated:!0},{name:"branch",shorthand:"b",type:String,deprecated:!0},{name:"no-branch",shorthand:null,type:Boolean,deprecated:!0},{name:"no-follow",shorthand:null,type:Boolean,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!0},{name:"level",shorthand:null,type:[String],deprecated:!0},{name:"source",shorthand:null,type:[String],deprecated:!0},{name:"status-code",shorthand:null,type:String,deprecated:!0},{name:"expand",shorthand:"x",type:Boolean,deprecated:!0}],SIMPLE_VALUE=/^[\w.\-:/]+$/;function filterCommand(filter,source){return getCommandName(`logs${source?` ${source}`:""} --query '${filter}'`)}function alternatives(field,values){return values.length===1?`${field}:${values[0]}`:`${field}:(${values.join(" OR ")})`}function statusFilter(value){let statusClass=/^([1-5])xx$/i.exec(value);if(statusClass){let base=Number(statusClass[1])*100;return`httpStatus >= ${base} AND httpStatus < ${base+100}`}return/^\d{3}$/.test(value)?`httpStatus:${value}`:void 0}function sourceReplacement(values){let normalized=values.map(value=>value.trim().toLowerCase());return normalized.length>0&&normalized.every(v=>v==="static")?`--source was removed. Static and CDN traffic is in ${getCommandName("logs requests")}.`:normalized.length>0&&normalized.every(v=>v==="serverless")?`--source was removed. Use ${filterCommand("source:function")}.`:`--source was removed. Use ${filterCommand("source:<value>")}.
73
+ ${hint}`,json:{...base,reason:AGENT_REASON.API_ERROR,message,hint,data:{...base.data,retries}},exitCode:1}}return err.status===429?{human:serverMessage,json:{...base,reason:AGENT_REASON.RATE_LIMITED,message:`Couldn't retrieve ${RECORDS_NOUNS[source]}: the request limit was reached.`},exitCode:1}:{human:serverMessage,json:{...base,reason:AGENT_REASON.API_ERROR,message:`Couldn't retrieve ${RECORDS_NOUNS[source]}.`},exitCode:1}}function isFreeWindowRefusal(err){let meta=err.meta,value=err.availableFrom??(meta&&typeof meta=="object"?meta.availableFrom:void 0);return typeof value=="string"&&!Number.isNaN(Date.parse(value))}function printLogsApiError(client,err,source,query){let failure=describeLogsApiError(client,err,source,query);if(!failure){printError(err);return}let status=isAPIError(err)?err.status:void 0;if(failure.json.reason===AGENT_REASON.API_ERROR&&status!==400&&status!==504||failure.json.reason===AGENT_REASON.RATE_LIMITED){printError(err);return}output_manager_default.error(failure.human)}var legacyLogsOptions=[{name:"search",shorthand:null,type:String,deprecated:!0},{name:"branch",shorthand:"b",type:String,deprecated:!0},{name:"no-branch",shorthand:null,type:Boolean,deprecated:!0},{name:"no-follow",shorthand:null,type:Boolean,deprecated:!0},{name:"request-id",shorthand:null,type:String,deprecated:!0},{name:"level",shorthand:null,type:[String],deprecated:!0},{name:"source",shorthand:null,type:[String],deprecated:!0},{name:"status-code",shorthand:null,type:String,deprecated:!0},{name:"expand",shorthand:"x",type:Boolean,deprecated:!0}],SIMPLE_VALUE=/^[\w.\-:/]+$/;function filterCommand(filter,source){return getCommandName(`logs${source?` ${source}`:""} --query '${filter}'`)}function alternatives(field,values){return values.length===1?`${field}:${values[0]}`:`${field}:(${values.join(" OR ")})`}function statusFilter(value){let statusClass=/^([1-5])xx$/i.exec(value);if(statusClass){let base=Number(statusClass[1])*100;return`httpStatus >= ${base} AND httpStatus < ${base+100}`}return/^\d{3}$/.test(value)?`httpStatus:${value}`:void 0}function sourceReplacement(values){let normalized=values.map(value=>value.trim().toLowerCase());return normalized.length>0&&normalized.every(v=>v==="static")?`--source was removed. Static and CDN traffic is in ${getCommandName("logs requests")}.`:normalized.length>0&&normalized.every(v=>v==="serverless")?`--source was removed. Use ${filterCommand("source:function")}.`:`--source was removed. Use ${filterCommand("source:<value>")}.
73
74
  See ${getCommandName("logs runtime --help")} for filter fields and examples.`}function usedLegacyOptions(flags){return legacyLogsOptions.map(option=>option.name).filter(name=>flags[`--${name}`]!==void 0)}function requestIdError(requestId){let value=SIMPLE_VALUE.test(requestId)?requestId:"<request-id>";return`--request-id was removed. Use ${filterCommand(`requestId:"${value}"`)}.`}function levelError(levels){let values=levels.every(level=>SIMPLE_VALUE.test(level))?levels:["error"];return`--level was removed. Use ${filterCommand(alternatives("level",values))}.`}function statusCodeError(statusCode){return`--status-code was removed. Use ${filterCommand(statusFilter(statusCode.trim())??"httpStatus:500","requests")}.`}var OLD_LEVELS=new Set(["error","warning","info","fatal"]);function resolveLegacyOptions(flags,{explicitSource,query,next}){if(flags["--search"]!==void 0)return{error:`--search was replaced by --query, which uses a new KQL-inspired syntax.
74
- See ${getCommandName("logs runtime --help")} or ${getCommandName("logs requests --help")} for filter fields and examples.`};if(flags["--branch"]!==void 0)return{error:"--branch is no longer supported. Remove it from the command."};let sources=flags["--source"];if(sources!==void 0)return{error:sourceReplacement(sources)};if(flags["--expand"]!==void 0)return{error:"--expand was removed. Full runtime messages are shown by default; remove the option."};let requestId=flags["--request-id"],levels=flags["--level"],statusCode=flags["--status-code"]?.trim(),translated=[],filters=[];if(requestId!==void 0){if(!SIMPLE_VALUE.test(requestId))return{error:requestIdError(requestId)};translated.push("--request-id"),filters.push(`requestId:"${requestId}"`)}if(levels!==void 0){if(!levels.every(level=>OLD_LEVELS.has(level))||explicitSource==="requests"||statusCode!==void 0)return{error:levelError(levels)};translated.push("--level"),filters.push(alternatives("level",levels))}let source;if(statusCode!==void 0){let filter2=statusFilter(statusCode);if(filter2===void 0||explicitSource==="runtime")return{error:statusCodeError(statusCode)};translated.push("--status-code"),filters.push(filter2),source="requests"}if(next&&translated.length>0)return{error:`${translated[0]} can't be combined with --next. The cursor keeps the original target, filter, and time window.`};let warnings=[];for(let flag of["--no-branch","--no-follow"])flags[flag]!==void 0&&warnings.push(`${flag} was removed and has no effect. It was ignored.`);if(translated.length===0)return{warnings,translated};query&&filters.push(query);let filter=filters.length===1?filters[0]:filters.map(clause=>`(${clause})`).join(" AND ");return{warnings,filter,source,translated}}var OMITTED_OPTIONS=new Set(["--token","--query","--follow","--next","--help","--version",...legacyLogsOptions.map(option=>`--${option.name}`)]);function replacementCommand(flags,argv,{source,deployment,filter}){let out=["logs",...source?[source]:[]],seen=new Set;for(let[typedName,value]of Object.entries(flags)){let name=typedName==="--team"?"--scope":typedName;if(!(OMITTED_OPTIONS.has(name)||seen.has(name))){if(seen.add(name),name==="--non-interactive"){out.push(argvHasNonInteractive(argv)?"--non-interactive":"--non-interactive=false");continue}for(let item of Array.isArray(value)?value:[value])item===!0?out.push(name):(typeof item=="string"||typeof item=="number")&&out.push(name,quoteArg(String(item)))}}return deployment!==void 0&&!seen.has("--deployment")&&out.push("--deployment",quoteArg(deployment)),out.push("--query",shellQuote(filter)),getCommandName(out.join(" "))}function translationWarning(translated,command){return`${translated.length===1?`${translated[0]} was`:`${translated.slice(0,-1).join(", ")} and ${translated[translated.length-1]} were`} removed. Running ${command} instead. Use that command next time.`}function shellQuote(value){return value.includes("'")?quoteArg(value):`'${value}'`}var GATEWAY_TIMEOUT_RETRIES=1;function quoteFilterValue(value){return JSON.stringify(value)}function composeFilter({source,deploymentId,environment,filter}){let clauses=[];if(deploymentId&&clauses.push(`deploymentId:${quoteFilterValue(deploymentId)}`),environment&&clauses.push(`environment:${quoteFilterValue(environment)}`),clauses.push(...source.fixedFilters),filter&&clauses.push(filter),clauses.length!==0)return clauses.map(clause=>`(${clause})`).join(" AND ")}function fetchEventPages2(client,query,limit,startCursor){return fetchEventPages(client,{event:query.source.event,ownerId:query.teamId,projectIds:[query.projectId],timeRange:{start:query.timeRange.start.toISOString(),end:query.timeRange.end.toISOString()},filter:query.filter,select:query.source.select,queryReason:query.source.queryReason,gatewayTimeoutRetries:GATEWAY_TIMEOUT_RETRIES},limit,startCursor)}var import_build_utils=__toESM(require_build_utils(),1);var NOT_LINKED_MESSAGE=`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")}, or select a team and project with --scope <team> --project <name>.`;function fail(reason,error,exitCode2=1){return{error,exitCode:exitCode2,reason}}async function readLink(client,project){let orgId=(0,import_build_utils.getPlatformEnv)("ORG_ID"),projectId=(0,import_build_utils.getPlatformEnv)("PROJECT_ID");if(orgId&&projectId)return{link:{orgId,projectId}};if(orgId||projectId){let present=orgId?"`VERCEL_ORG_ID`":"`VERCEL_PROJECT_ID`",missing=orgId?"`VERCEL_PROJECT_ID`":"`VERCEL_ORG_ID`";return fail(AGENT_REASON.INVALID_CONFIGURATION,`You specified ${present} but you forgot to specify ${missing}. You need to specify both to select a custom project.`)}let path=await resolveProjectCwd(client.cwd);if(project){let selected=await getProjectLink(client,path,project,!0);if(selected)return{link:{orgId:selected.orgId,projectId:selected.projectId}}}let link=await getProjectLink(client,path);return{link:link?{orgId:link.orgId,projectId:link.projectId}:null}}async function teamLabel(client,teamId){try{return(await getTeamByIdOrSlug(client,teamId,{useCurrentTeam:!1})).slug||teamId}catch(err){return output_manager_default.debug(`Could not fetch team ${teamId}: ${err}`),teamId}}function isTeamId(ownerId){return ownerId.startsWith("team_")}var PERSONAL_ACCOUNT_MESSAGE="Logs are available for team-owned projects only. Select a team with --scope <team>.";async function resolveLogsTarget(client,{project:projectOption,deployment:deploymentOption,deploymentFromArgument=!1,quiet=!1}){let spinner=message=>{quiet||output_manager_default.spinner(message,1e3)},explicitScope=detectExplicitScope(client),explicitTeamId=explicitScope?client.config.currentTeam:void 0;if(explicitScope&&!explicitTeamId)return fail(AGENT_REASON.MISSING_SCOPE,PERSONAL_ACCOUNT_MESSAGE);let replacesLinkedProject=!!(projectOption||deploymentOption),link=null;if(!(explicitTeamId&&replacesLinkedProject)){let linkResult=await readLink(client,projectOption);if("error"in linkResult)return linkResult;link=linkResult.link}let teamId=explicitTeamId??link?.orgId;if(!teamId)return fail(AGENT_REASON.NOT_LINKED,NOT_LINKED_MESSAGE);if(!isTeamId(teamId))return fail(AGENT_REASON.MISSING_SCOPE,PERSONAL_ACCOUNT_MESSAGE);if(!replacesLinkedProject){if(!link)return fail(AGENT_REASON.NOT_LINKED,NOT_LINKED_MESSAGE);if(link.orgId!==teamId){let[requested,linked]=await Promise.all([teamLabel(client,teamId),teamLabel(client,link.orgId)]);return fail(AGENT_REASON.TARGET_CONFLICT,`This directory is linked to a project in team ${linked}, but ${requested} was selected.
75
+ See ${getCommandName("logs runtime --help")}, ${getCommandName("logs requests --help")}, or ${getCommandName("logs function-invocations --help")} for filter fields and examples.`};if(flags["--branch"]!==void 0)return{error:"--branch is no longer supported. Remove it from the command."};let sources=flags["--source"];if(sources!==void 0)return{error:sourceReplacement(sources)};if(flags["--expand"]!==void 0)return{error:"--expand was removed. Full runtime messages are shown by default; remove the option."};let requestId=flags["--request-id"],levels=flags["--level"],statusCode=flags["--status-code"]?.trim(),translated=[],filters=[];if(requestId!==void 0){if(!SIMPLE_VALUE.test(requestId))return{error:requestIdError(requestId)};translated.push("--request-id"),filters.push(`requestId:"${requestId}"`)}if(levels!==void 0){if(!levels.every(level=>OLD_LEVELS.has(level))||explicitSource!==void 0&&explicitSource!=="runtime"||statusCode!==void 0)return{error:levelError(levels)};translated.push("--level"),filters.push(alternatives("level",levels))}let source;if(statusCode!==void 0){let filter2=statusFilter(statusCode);if(filter2===void 0||explicitSource==="runtime")return{error:statusCodeError(statusCode)};translated.push("--status-code"),filters.push(filter2),source="requests"}if(next&&translated.length>0)return{error:`${translated[0]} can't be combined with --next. The cursor keeps the original target, filter, and time window.`};let warnings=[];for(let flag of["--no-branch","--no-follow"])flags[flag]!==void 0&&warnings.push(`${flag} was removed and has no effect. It was ignored.`);if(translated.length===0)return{warnings,translated};query&&filters.push(query);let filter=filters.length===1?filters[0]:filters.map(clause=>`(${clause})`).join(" AND ");return{warnings,filter,source,translated}}var OMITTED_OPTIONS=new Set(["--token","--query","--follow","--next","--help","--version",...legacyLogsOptions.map(option=>`--${option.name}`)]);function replacementCommand(flags,argv,{source,deployment,filter}){let out=["logs",...source?[source]:[]],seen=new Set;for(let[typedName,value]of Object.entries(flags)){let name=typedName==="--team"?"--scope":typedName;if(!(OMITTED_OPTIONS.has(name)||seen.has(name))){if(seen.add(name),name==="--non-interactive"){out.push(argvHasNonInteractive(argv)?"--non-interactive":"--non-interactive=false");continue}for(let item of Array.isArray(value)?value:[value])item===!0?out.push(name):(typeof item=="string"||typeof item=="number")&&out.push(name,quoteArg(String(item)))}}return deployment!==void 0&&!seen.has("--deployment")&&out.push("--deployment",quoteArg(deployment)),out.push("--query",shellQuote(filter)),getCommandName(out.join(" "))}function translationWarning(translated,command){return`${translated.length===1?`${translated[0]} was`:`${translated.slice(0,-1).join(", ")} and ${translated[translated.length-1]} were`} removed. Running ${command} instead. Use that command next time.`}function shellQuote(value){return value.includes("'")?quoteArg(value):`'${value}'`}var GATEWAY_TIMEOUT_RETRIES=1;function quoteFilterValue(value){return JSON.stringify(value)}function composeFilter({source,deploymentId,environment,filter}){let clauses=[];if(deploymentId&&clauses.push(`deploymentId:${quoteFilterValue(deploymentId)}`),environment&&clauses.push(`environment:${quoteFilterValue(environment)}`),clauses.push(...source.fixedFilters),filter&&clauses.push(filter),clauses.length!==0)return clauses.map(clause=>`(${clause})`).join(" AND ")}function fetchEventPages2(client,query,limit,startCursor){return fetchEventPages(client,{event:query.source.event,ownerId:query.teamId,projectIds:[query.projectId],timeRange:{start:query.timeRange.start.toISOString(),end:query.timeRange.end.toISOString()},filter:query.filter,select:query.source.select,queryReason:query.source.queryReason,gatewayTimeoutRetries:GATEWAY_TIMEOUT_RETRIES},limit,startCursor)}var import_build_utils=__toESM(require_build_utils(),1);var NOT_LINKED_MESSAGE=`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")}, or select a team and project with --scope <team> --project <name>.`;function fail(reason,error,exitCode2=1){return{error,exitCode:exitCode2,reason}}async function readLink(client,project){let orgId=(0,import_build_utils.getPlatformEnv)("ORG_ID"),projectId=(0,import_build_utils.getPlatformEnv)("PROJECT_ID");if(orgId&&projectId)return{link:{orgId,projectId}};if(orgId||projectId){let present=orgId?"`VERCEL_ORG_ID`":"`VERCEL_PROJECT_ID`",missing=orgId?"`VERCEL_PROJECT_ID`":"`VERCEL_ORG_ID`";return fail(AGENT_REASON.INVALID_CONFIGURATION,`You specified ${present} but you forgot to specify ${missing}. You need to specify both to select a custom project.`)}let path=await resolveProjectCwd(client.cwd);if(project){let selected=await getProjectLink(client,path,project,!0);if(selected)return{link:{orgId:selected.orgId,projectId:selected.projectId}}}let link=await getProjectLink(client,path);return{link:link?{orgId:link.orgId,projectId:link.projectId}:null}}async function teamLabel(client,teamId){try{return(await getTeamByIdOrSlug(client,teamId,{useCurrentTeam:!1})).slug||teamId}catch(err){return output_manager_default.debug(`Could not fetch team ${teamId}: ${err}`),teamId}}function isTeamId(ownerId){return ownerId.startsWith("team_")}var PERSONAL_ACCOUNT_MESSAGE="Logs are available for team-owned projects only. Select a team with --scope <team>.";async function resolveLogsTarget(client,{project:projectOption,deployment:deploymentOption,deploymentFromArgument=!1,quiet=!1}){let spinner=message=>{quiet||output_manager_default.spinner(message,1e3)},explicitScope=detectExplicitScope(client),explicitTeamId=explicitScope?client.config.currentTeam:void 0;if(explicitScope&&!explicitTeamId)return fail(AGENT_REASON.MISSING_SCOPE,PERSONAL_ACCOUNT_MESSAGE);let replacesLinkedProject=!!(projectOption||deploymentOption),link=null;if(!(explicitTeamId&&replacesLinkedProject)){let linkResult=await readLink(client,projectOption);if("error"in linkResult)return linkResult;link=linkResult.link}let teamId=explicitTeamId??link?.orgId;if(!teamId)return fail(AGENT_REASON.NOT_LINKED,NOT_LINKED_MESSAGE);if(!isTeamId(teamId))return fail(AGENT_REASON.MISSING_SCOPE,PERSONAL_ACCOUNT_MESSAGE);if(!replacesLinkedProject){if(!link)return fail(AGENT_REASON.NOT_LINKED,NOT_LINKED_MESSAGE);if(link.orgId!==teamId){let[requested,linked]=await Promise.all([teamLabel(client,teamId),teamLabel(client,link.orgId)]);return fail(AGENT_REASON.TARGET_CONFLICT,`This directory is linked to a project in team ${linked}, but ${requested} was selected.
75
76
  Select a project in ${requested} with --project <name>, select the linked team with --scope ${linked}, or run ${getCommandName("link")} to relink.`)}}client.config.currentTeam=teamId;let labelPromise,getLabel=()=>labelPromise??=teamLabel(client,teamId);quiet||getLabel();let deploymentId,deploymentProjectId;if(deploymentOption){spinner(`Resolving deployment "${deploymentOption}"`);try{let deployment=await getDeployment(client,teamId,deploymentOption);deploymentId=deployment.id,deploymentProjectId=deployment.projectId}catch(err){if(err instanceof DeploymentNotFound||err instanceof DeploymentPermissionDenied)return fail(AGENT_REASON.NOT_FOUND,`Deployment not found: ${deploymentOption} under ${await getLabel()}`);if(err instanceof InvalidDeploymentId)return fail(AGENT_REASON.NOT_FOUND,`Invalid deployment ID or URL: ${deploymentOption}`);throw err}finally{output_manager_default.stopSpinner()}if(!deploymentProjectId)return fail(AGENT_REASON.NOT_FOUND,`Deployment ${deploymentOption} is not associated with a project.`)}let projectIdOrName=projectOption??deploymentProjectId??link?.projectId;if(!projectIdOrName)return fail(AGENT_REASON.NOT_LINKED,NOT_LINKED_MESSAGE);let lookupProject=async()=>{let project2=await getProjectByNameOrId(client,projectIdOrName,teamId);if(project2 instanceof ProjectNotFound){let label=await getLabel();return!projectOption&&!deploymentProjectId?fail(AGENT_REASON.PROJECT_NOT_FOUND,`The linked project ${projectIdOrName} was not found under ${label}. Run ${getCommandName("link")} to relink, or select a project with --project <name>.`):fail(AGENT_REASON.PROJECT_NOT_FOUND,`Project not found: ${projectIdOrName} under ${label}`)}if(deploymentProjectId&&project2.id!==deploymentProjectId){let deploymentInput=deploymentFromArgument?"the deployment argument":"--deployment";return fail(AGENT_REASON.TARGET_CONFLICT,`Deployment ${deploymentOption} does not belong to project ${project2.name}. Remove ${deploymentInput} or --project.`)}return{project:project2}};if(projectIdOrName.startsWith("prj_")&&!(projectOption&&deploymentProjectId)){let namesPromise;return{target:{teamId,projectId:projectIdOrName,deploymentId,names:()=>namesPromise??=Promise.all([lookupProject(),getLabel()]).then(([lookup2,teamLabel2])=>"error"in lookup2?lookup2:{teamLabel:teamLabel2,projectName:lookup2.project.name}),deferredLookup:!0}}}spinner("Retrieving project\u2026");let lookup;try{lookup=await lookupProject()}finally{output_manager_default.stopSpinner()}if("error"in lookup)return lookup;let{project}=lookup;return{target:{teamId,projectId:project.id,deploymentId,names:async()=>({teamLabel:await getLabel(),projectName:project.name}),deferredLookup:!1}}}var import_ms2=__toESM(require_ms(),1);function parseBound(flag,value,now){try{return parseTimeFlag(value,now)}catch{return`Invalid time format "${value}" for ${flag}. Use a relative duration (1h, 30m, 2d), an ISO 8601 datetime, or now.`}}function resolveLogsTimeRange({since,until,now,wholeSeconds}){let end=until!==void 0?parseBound("--until",until,now):new Date(now);if(typeof end=="string")return{error:end};let start=since!==void 0?parseBound("--since",since,now):new Date(end.getTime()-(0,import_ms2.default)(DEFAULT_WINDOW));if(typeof start=="string")return{error:start};let range=wholeSeconds?{start:floorToSecond(start),end:floorToSecond(end)}:{start,end};return range.start.getTime()>=range.end.getTime()?{error:[`The time range is empty: the start (${range.start.toISOString()}) must be before the end (${range.end.toISOString()}).`,"Use --since to set an earlier start."].join(`
76
- `)}:{range}}function floorToSecond(date){return new Date(Math.floor(date.getTime()/1e3)*1e3)}var COMMAND_CONFIG={runtime:getCommandAliases(runtimeSubcommand),requests:getCommandAliases(requestsSubcommand)},SUBCOMMAND_METADATA={runtime:runtimeSubcommand,requests:requestsSubcommand},SOURCE_TITLES={runtime:"Runtime logs",requests:"CDN requests"},CONTINUATION_CONFLICTS=["--project","--deployment","--environment","--query","--since","--until"];function looksLikeDeployment(value){return value.startsWith("dpl_")||value.includes(".")||/^https?:\/\//i.test(value)}function deploymentHost(value){try{return new URL(value).hostname}catch{return value}}function argvRequestsJson(argv){let args=argv.slice(2);for(let[index,arg]of args.entries()){if(arg==="--")break;if(arg==="--json")return!0;if(arg.startsWith("--json=")){if(arg.slice(7).toLowerCase()!=="false")return!0;continue}if(arg.toLowerCase()==="--format=json"||arg.startsWith("-F=")&&arg.slice(3).toLowerCase()==="json"||(arg==="--format"||arg==="-F")&&args[index+1]?.toLowerCase()==="json")return!0}return!1}function isRemovedJsonShorthandError(err){return isArgumentError(err)&&err.invalidOption==="-j"}function argvHasScopeFlag(argv){for(let arg of argv.slice(2)){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"||arg.startsWith("--scope=")||arg.startsWith("--team="))return!0}return!1}function deploymentFlag(value){return`--deployment ${quoteArg(deploymentHost(value))}`}function positionalError(value,explicitSource){let sourcePart=explicitSource?` ${explicitSource}`:"";return looksLikeDeployment(value)?`Select a deployment with --deployment: ${getCommandName(`logs${sourcePart} ${deploymentFlag(value)}`)}`:explicitSource?`Unexpected argument "${value}". ${getCommandName(`logs ${explicitSource}`)} takes no arguments.`:`Unknown data source "${value}". Use runtime or requests. See ${getCommandName("logs --help")}.`}function isClosedOutputError(err){return err instanceof Error&&(err.code==="EPIPE"||err.message==="Output stream closed.")}function streamGapMessage(interval){return`Results omit ${sanitize(interval.start)} to ${sanitize(interval.end)}: data for this period is unavailable to this query.`}async function logs(client){let commandStart=Date.now(),telemetry=new LogsTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArguments;try{parsedArguments=parseArguments(client.argv.slice(2),getFlagsSpecification([...logsCommand.options,...legacyLogsOptions]))}catch(err){let removedShorthand=isRemovedJsonShorthandError(err);removedShorthand&&telemetry.trackCliLegacyOption("j");let message=removedShorthand?"-j was removed. Use --json.":err instanceof Error?err.message:String(err);return client.nonInteractive||argvRequestsJson(client.argv)?writeJsonError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:"vercel logs --help"}]}):removedShorthand?(output_manager_default.error(message),2):(printError(err),output_manager_default.print(`Run ${getCommandName("logs --help")} for usage.
77
- `),2)}parsedArguments.args[0]==="log"&&warnDeprecatedSubcommand(client,"log","logs");let{flags}=parsedArguments,formatResult=validateJsonOutput(flags),json=!!flags["--json"]||formatResult.valid&&formatResult.jsonOutput||argvRequestsJson(client.argv)||client.nonInteractive,{subcommand,subcommandOriginal,args}=getSubcommand(parsedArguments.args.slice(1),COMMAND_CONFIG),explicitSource=subcommand==="runtime"||subcommand==="requests"?subcommand:void 0;if(flags["--help"])return telemetry.trackCliFlagHelp("logs",explicitSource&&subcommandOriginal),output_manager_default.print(help(explicitSource?SUBCOMMAND_METADATA[explicitSource]:logsCommand,{stream:client.stderr,parent:explicitSource?logsCommand:void 0,columns:client.stderr.columns})),0;let nextOption=flags["--next"],trimmedNext=nextOption?.trim(),continuation=trimmedNext?decodeContinuation(trimmedNext):void 0,continuationSource=continuation?sourceForEvent(continuation.event):void 0,queryOption=flags["--query"],legacy=resolveLegacyOptions(flags,{explicitSource,query:queryOption?.trim(),next:nextOption!==void 0}),sourceName=explicitSource??continuationSource?.name??("source"in legacy?legacy.source:void 0)??"runtime";sourceName==="requests"?telemetry.trackCliSubcommandRequests(subcommandOriginal):telemetry.trackCliSubcommandRuntime(subcommandOriginal);let projectOption=flags["--project"],deploymentOption=flags["--deployment"],environmentOption=flags["--environment"],sinceOption=flags["--since"],untilOption=flags["--until"],limitOption=flags["--limit"];telemetry.trackCliOptionProject(projectOption),telemetry.trackCliOptionDeployment(deploymentOption),telemetry.trackCliOptionEnvironment(environmentOption),telemetry.trackCliOptionQuery(queryOption),telemetry.trackCliOptionSince(sinceOption),telemetry.trackCliOptionUntil(untilOption),telemetry.trackCliOptionLimit(limitOption),telemetry.trackCliOptionNext(nextOption),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliFlagFollow(flags["--follow"]);let fail2=(reason,message,exitCode2,extra={})=>(output_manager_default.stopSpinner(),json?writeJsonError(client,{status:"error",reason,message,...extra},exitCode2):(output_manager_default.error(message),exitCode2??(reason===AGENT_REASON.INVALID_ARGUMENTS?2:1))),usageError=message=>fail2(AGENT_REASON.INVALID_ARGUMENTS,message,2),failUnexpected=err=>{if(output_manager_default.stopSpinner(),!json)return printError(err),1;let failure=describeLogsApiError(client,err,sourceName);return failure?writeJsonError(client,failure.json,failure.exitCode):writeJsonError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:(0,import_error_utils2.errorToString)(err)})};if(!formatResult.valid)return usageError(formatResult.error);let legacyOptions=usedLegacyOptions(flags);for(let name of legacyOptions)telemetry.trackCliLegacyOption(name);if("error"in legacy)return usageError(legacy.error);let{warnings:legacyWarnings,filter:legacyFilter,translated:legacyTranslated}=legacy,positionalDeployment;if(args.length>0){if(telemetry.trackCliArgumentPositional(looksLikeDeployment(args[0])?"deployment":"unknown"),args.length>1||!looksLikeDeployment(args[0]))return usageError(positionalError(args[0],explicitSource));if(deploymentOption!==void 0)return usageError("Pass the deployment once, with --deployment. Remove the deployment argument.");if(nextOption!==void 0)return usageError("A deployment argument can't be combined with --next. The cursor keeps the original target, filter, and time window.");positionalDeployment=args[0]}let upfrontWarnings=[],warn=(reason,message,data)=>{json?upfrontWarnings.push(warningLine({reason,message,data})):output_manager_default.warning(message)};for(let message of legacyWarnings)warn("deprecated",message);legacyFilter!==void 0&&warn("deprecated",translationWarning(legacyTranslated,replacementCommand(flags,client.argv,{source:explicitSource??legacy.source,deployment:positionalDeployment!==void 0?deploymentHost(positionalDeployment):void 0,filter:legacyFilter}))),flags["--follow"]&&warn("deprecated","--follow is deprecated and no longer streams logs. Showing a bounded result; remove --follow."),positionalDeployment!==void 0&&warn("deprecated",`Passing a deployment as an argument is deprecated. Use ${deploymentFlag(positionalDeployment)}.`);let limit;if(typeof limitOption=="number"&&Number.isInteger(limitOption)&&limitOption>MAX_LIMIT)limit=MAX_LIMIT,warn("limit_clamped",`--limit ${limitOption} is above the maximum of ${MAX_LIMIT}. Using ${MAX_LIMIT}.`,{requested:limitOption,limit:MAX_LIMIT});else{let limitResult=validateIntegerRangeWithDefault(limitOption,{flag:"--limit",min:1,max:MAX_LIMIT,defaultValue:DEFAULT_LIMIT});if(!limitResult.valid)return usageError(limitResult.message);limit=limitResult.value}let plan;if(nextOption!==void 0){let planResult=await planContinuation();if(typeof planResult=="number")return planResult;plan=planResult}else{let planResult=await planQuery();if(typeof planResult=="number")return planResult;plan=planResult}async function planContinuation(){if(!trimmedNext)return usageError("--next must not be empty.");let invalidCursor=`--next is not a valid cursor. Use the pagination.next value from the summary of a previous ${getCommandName("logs --json")} run.`;if(!continuation||!continuationSource)return usageError(invalidCursor);let parsed=parseContinuation(continuation);if(!parsed)return usageError(invalidCursor);if(explicitSource&&explicitSource!==continuationSource.name)return usageError(`The --next cursor continues a ${continuationSource.name} query. Use ${getCommandName("logs --next <CURSOR>")} without "${explicitSource}".`);for(let flag of CONTINUATION_CONFLICTS)if(flags[flag]!==void 0)return usageError(`${flag} can't be combined with --next. The cursor keeps the original target, filter, and time window.`);if(argvHasScopeFlag(client.argv)&&client.config.currentTeam!==continuation.ownerId)return usageError("The --next cursor belongs to a different team than --scope. Remove --scope to use the team in the cursor.");let{teamId,projectId,timeRange:timeRange2}=parsed;return{source:continuationSource,teamId,projectId,timeRange:timeRange2,filter:continuation.filter,startCursor:continuation.cursor,context:async()=>{let[label,project]=await Promise.all([teamLabel(client,teamId),getProjectByNameOrId(client,projectId,teamId).catch(()=>null)]),projectName=project&&!(project instanceof ProjectNotFound)?project.name:projectId;return`${SOURCE_TITLES[continuationSource.name]} for ${label}/${projectName} (continued), ${formatWindow(timeRange2)}`}}}async function planQuery(){let source2=logsSources[sourceName],query=queryOption?.trim();if(queryOption!==void 0&&!query)return usageError("--query must not be empty.");let filter=legacyFilter??query,environment=environmentOption?.trim();if(environmentOption!==void 0&&!environment)return usageError("--environment must not be empty.");let deploymentInput=deploymentOption??positionalDeployment,deployment=deploymentInput?.trim();if(deploymentInput!==void 0&&!deployment)return usageError("--deployment must not be empty.");let project=projectOption?.trim();if(projectOption!==void 0&&!project)return usageError("--project must not be empty.");let timeRangeResult=resolveLogsTimeRange({since:sinceOption,until:untilOption,now:commandStart,wholeSeconds:source2.wholeSecondBounds});if("error"in timeRangeResult)return usageError(timeRangeResult.error);let timeRange2=timeRangeResult.range,targetResult;try{targetResult=await resolveLogsTarget(client,{project,deployment:deployment&&deploymentHost(deployment),deploymentFromArgument:positionalDeployment!==void 0,quiet:json})}catch(err){return failUnexpected(err)}if("error"in targetResult)return fail2(targetResult.reason,targetResult.error,targetResult.exitCode);let{target}=targetResult;return{source:source2,teamId:target.teamId,projectId:target.projectId,timeRange:timeRange2,filter:composeFilter({source:source2,deploymentId:target.deploymentId,environment,filter}),context:async()=>{let names=await target.names();if("error"in names)return names;let details=[target.deploymentId?`deployment ${target.deploymentId}`:void 0,environment?`environment ${environment}`:void 0].filter(Boolean);return`${SOURCE_TITLES[source2.name]} for ${names.teamLabel}/${names.projectName}`+(details.length>0?` (${details.join(", ")})`:"")+`, ${formatWindow(timeRange2)}`},deferredLookup:target.deferredLookup}}let{source,timeRange}=plan,serializedTimeRange=serializeTimeRange(timeRange),tokenFor=cursor=>encodeContinuation({event:source.event,ownerId:plan.teamId,projectIds:[plan.projectId],timeRange:serializedTimeRange,...plan.filter!==void 0?{filter:plan.filter}:{},order:"desc",cursor}),write=async text2=>{try{return await writeWithBackpressure(client.stdout,text2),!0}catch(err){if(isClosedOutputError(err))return!1;throw err}},pages=fetchEventPages2(client,{source,teamId:plan.teamId,projectId:plan.projectId,timeRange,filter:plan.filter},limit,plan.startCursor),firstPage=json?pages.next():void 0;firstPage?.catch(()=>{});let renderer=json?void 0:createRenderer(source.name,timeRange),excludedIntervals=new Map,written=0,pagesFetched=0,resumeCursor=plan.startCursor,result,checkTarget=async()=>{let context;try{context=await plan.context()}catch(err){return failUnexpected(err)}return typeof context=="string"?context:fail2(context.reason,context.error,context.exitCode)},writeUpfrontWarnings=async()=>upfrontWarnings.length===0||write(upfrontWarnings.join(""));try{if(!json){plan.deferredLookup&&output_manager_default.spinner("Retrieving project\u2026",1e3);let context=await checkTarget();if(output_manager_default.stopSpinner(),typeof context=="number")return context;output_manager_default.print(import_chalk5.default.dim(`${context}
77
+ `)}:{range}}function floorToSecond(date){return new Date(Math.floor(date.getTime()/1e3)*1e3)}var COMMAND_CONFIG={runtime:getCommandAliases(runtimeSubcommand),requests:getCommandAliases(requestsSubcommand),"function-invocations":getCommandAliases(functionInvocationsSubcommand)},SUBCOMMAND_METADATA={runtime:runtimeSubcommand,requests:requestsSubcommand,"function-invocations":functionInvocationsSubcommand},SOURCE_TITLES={runtime:"Runtime logs",requests:"CDN requests","function-invocations":"Function invocations"};function isLogsSourceName(value){return Object.hasOwn(SUBCOMMAND_METADATA,value)}var CONTINUATION_CONFLICTS=["--project","--deployment","--environment","--query","--since","--until"];function looksLikeDeployment(value){return value.startsWith("dpl_")||value.includes(".")||/^https?:\/\//i.test(value)}function deploymentHost(value){try{return new URL(value).hostname}catch{return value}}function argvRequestsJson(argv){let args=argv.slice(2);for(let[index,arg]of args.entries()){if(arg==="--")break;if(arg==="--json")return!0;if(arg.startsWith("--json=")){if(arg.slice(7).toLowerCase()!=="false")return!0;continue}if(arg.toLowerCase()==="--format=json"||arg.startsWith("-F=")&&arg.slice(3).toLowerCase()==="json"||(arg==="--format"||arg==="-F")&&args[index+1]?.toLowerCase()==="json")return!0}return!1}function isRemovedJsonShorthandError(err){return isArgumentError(err)&&err.invalidOption==="-j"}function argvHasScopeFlag(argv){for(let arg of argv.slice(2)){if(arg==="--")break;if(arg==="--scope"||arg==="--team"||arg==="-S"||arg==="-T"||arg.startsWith("--scope=")||arg.startsWith("--team="))return!0}return!1}function deploymentFlag(value){return`--deployment ${quoteArg(deploymentHost(value))}`}function positionalError(value,explicitSource){let sourcePart=explicitSource?` ${explicitSource}`:"";return looksLikeDeployment(value)?`Select a deployment with --deployment: ${getCommandName(`logs${sourcePart} ${deploymentFlag(value)}`)}`:explicitSource?`Unexpected argument "${value}". ${getCommandName(`logs ${explicitSource}`)} takes no arguments.`:`Unknown data source "${value}". Use runtime, requests, or function-invocations. See ${getCommandName("logs --help")}.`}function isClosedOutputError(err){return err instanceof Error&&(err.code==="EPIPE"||err.message==="Output stream closed.")}function streamGapMessage(interval){return`Results omit ${sanitize(interval.start)} to ${sanitize(interval.end)}: data for this period is unavailable to this query.`}async function logs(client){let commandStart=Date.now(),telemetry=new LogsTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArguments;try{parsedArguments=parseArguments(client.argv.slice(2),getFlagsSpecification([...logsCommand.options,...legacyLogsOptions]))}catch(err){let removedShorthand=isRemovedJsonShorthandError(err);removedShorthand&&telemetry.trackCliLegacyOption("j");let message=removedShorthand?"-j was removed. Use --json.":err instanceof Error?err.message:String(err);return client.nonInteractive||argvRequestsJson(client.argv)?writeJsonError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:"vercel logs --help"}]}):removedShorthand?(output_manager_default.error(message),2):(printError(err),output_manager_default.print(`Run ${getCommandName("logs --help")} for usage.
78
+ `),2)}parsedArguments.args[0]==="log"&&warnDeprecatedSubcommand(client,"log","logs");let{flags}=parsedArguments,formatResult=validateJsonOutput(flags),json=!!flags["--json"]||formatResult.valid&&formatResult.jsonOutput||argvRequestsJson(client.argv)||client.nonInteractive,{subcommand,subcommandOriginal,args}=getSubcommand(parsedArguments.args.slice(1),COMMAND_CONFIG),explicitSource=typeof subcommand=="string"&&isLogsSourceName(subcommand)?subcommand:void 0;if(flags["--help"])return telemetry.trackCliFlagHelp("logs",explicitSource&&subcommandOriginal),output_manager_default.print(help(explicitSource?SUBCOMMAND_METADATA[explicitSource]:logsCommand,{stream:client.stderr,parent:explicitSource?logsCommand:void 0,columns:client.stderr.columns})),0;let nextOption=flags["--next"],trimmedNext=nextOption?.trim(),continuation=trimmedNext?decodeContinuation(trimmedNext):void 0,continuationSource=continuation?sourceForEvent(continuation.event):void 0,queryOption=flags["--query"],legacy=resolveLegacyOptions(flags,{explicitSource,query:queryOption?.trim(),next:nextOption!==void 0}),sourceName=explicitSource??continuationSource?.name??("source"in legacy?legacy.source:void 0)??"runtime";switch(sourceName){case"requests":telemetry.trackCliSubcommandRequests(subcommandOriginal);break;case"function-invocations":telemetry.trackCliSubcommandFunctionInvocations(subcommandOriginal);break;case"runtime":telemetry.trackCliSubcommandRuntime(subcommandOriginal);break}let projectOption=flags["--project"],deploymentOption=flags["--deployment"],environmentOption=flags["--environment"],sinceOption=flags["--since"],untilOption=flags["--until"],limitOption=flags["--limit"];telemetry.trackCliOptionProject(projectOption),telemetry.trackCliOptionDeployment(deploymentOption),telemetry.trackCliOptionEnvironment(environmentOption),telemetry.trackCliOptionQuery(queryOption),telemetry.trackCliOptionSince(sinceOption),telemetry.trackCliOptionUntil(untilOption),telemetry.trackCliOptionLimit(limitOption),telemetry.trackCliOptionNext(nextOption),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliFlagFollow(flags["--follow"]);let fail2=(reason,message,exitCode2,extra={})=>(output_manager_default.stopSpinner(),json?writeJsonError(client,{status:"error",reason,message,...extra},exitCode2):(output_manager_default.error(message),exitCode2??(reason===AGENT_REASON.INVALID_ARGUMENTS?2:1))),usageError=message=>fail2(AGENT_REASON.INVALID_ARGUMENTS,message,2),failUnexpected=err=>{if(output_manager_default.stopSpinner(),!json)return printError(err),1;let failure=describeLogsApiError(client,err,sourceName);return failure?writeJsonError(client,failure.json,failure.exitCode):writeJsonError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:(0,import_error_utils2.errorToString)(err)})};if(!formatResult.valid)return usageError(formatResult.error);let legacyOptions=usedLegacyOptions(flags);for(let name of legacyOptions)telemetry.trackCliLegacyOption(name);if("error"in legacy)return usageError(legacy.error);let{warnings:legacyWarnings,filter:legacyFilter,translated:legacyTranslated}=legacy,positionalDeployment;if(args.length>0){if(telemetry.trackCliArgumentPositional(looksLikeDeployment(args[0])?"deployment":"unknown"),args.length>1||!looksLikeDeployment(args[0]))return usageError(positionalError(args[0],explicitSource));if(deploymentOption!==void 0)return usageError("Pass the deployment once, with --deployment. Remove the deployment argument.");if(nextOption!==void 0)return usageError("A deployment argument can't be combined with --next. The cursor keeps the original target, filter, and time window.");positionalDeployment=args[0]}let upfrontWarnings=[],warn=(reason,message,data)=>{json?upfrontWarnings.push(warningLine({reason,message,data})):output_manager_default.warning(message)};for(let message of legacyWarnings)warn("deprecated",message);legacyFilter!==void 0&&warn("deprecated",translationWarning(legacyTranslated,replacementCommand(flags,client.argv,{source:explicitSource??legacy.source,deployment:positionalDeployment!==void 0?deploymentHost(positionalDeployment):void 0,filter:legacyFilter}))),flags["--follow"]&&warn("deprecated","--follow is deprecated and no longer streams logs. Showing a bounded result; remove --follow."),positionalDeployment!==void 0&&warn("deprecated",`Passing a deployment as an argument is deprecated. Use ${deploymentFlag(positionalDeployment)}.`);let limit;if(typeof limitOption=="number"&&Number.isInteger(limitOption)&&limitOption>MAX_LIMIT)limit=MAX_LIMIT,warn("limit_clamped",`--limit ${limitOption} is above the maximum of ${MAX_LIMIT}. Using ${MAX_LIMIT}.`,{requested:limitOption,limit:MAX_LIMIT});else{let limitResult=validateIntegerRangeWithDefault(limitOption,{flag:"--limit",min:1,max:MAX_LIMIT,defaultValue:DEFAULT_LIMIT});if(!limitResult.valid)return usageError(limitResult.message);limit=limitResult.value}let plan;if(nextOption!==void 0){let planResult=await planContinuation();if(typeof planResult=="number")return planResult;plan=planResult}else{let planResult=await planQuery();if(typeof planResult=="number")return planResult;plan=planResult}async function planContinuation(){if(!trimmedNext)return usageError("--next must not be empty.");let invalidCursor=`--next is not a valid cursor. Use the pagination.next value from the summary of a previous ${getCommandName("logs --json")} run.`;if(!continuation||!continuationSource)return usageError(invalidCursor);let parsed=parseContinuation(continuation);if(!parsed)return usageError(invalidCursor);if(explicitSource&&explicitSource!==continuationSource.name)return usageError(`The --next cursor continues a ${continuationSource.name} query. Use ${getCommandName("logs --next <CURSOR>")} without "${explicitSource}".`);for(let flag of CONTINUATION_CONFLICTS)if(flags[flag]!==void 0)return usageError(`${flag} can't be combined with --next. The cursor keeps the original target, filter, and time window.`);if(argvHasScopeFlag(client.argv)&&client.config.currentTeam!==continuation.ownerId)return usageError("The --next cursor belongs to a different team than --scope. Remove --scope to use the team in the cursor.");let{teamId,projectId,timeRange:timeRange2}=parsed;return{source:continuationSource,teamId,projectId,timeRange:timeRange2,filter:continuation.filter,startCursor:continuation.cursor,context:async()=>{let[label,project]=await Promise.all([teamLabel(client,teamId),getProjectByNameOrId(client,projectId,teamId).catch(()=>null)]),projectName=project&&!(project instanceof ProjectNotFound)?project.name:projectId;return`${SOURCE_TITLES[continuationSource.name]} for ${label}/${projectName} (continued), ${formatWindow(timeRange2)}`}}}async function planQuery(){let source2=logsSources[sourceName],query=queryOption?.trim();if(queryOption!==void 0&&!query)return usageError("--query must not be empty.");let filter=legacyFilter??query,environment=environmentOption?.trim();if(environmentOption!==void 0&&!environment)return usageError("--environment must not be empty.");let deploymentInput=deploymentOption??positionalDeployment,deployment=deploymentInput?.trim();if(deploymentInput!==void 0&&!deployment)return usageError("--deployment must not be empty.");let project=projectOption?.trim();if(projectOption!==void 0&&!project)return usageError("--project must not be empty.");let timeRangeResult=resolveLogsTimeRange({since:sinceOption,until:untilOption,now:commandStart,wholeSeconds:source2.wholeSecondBounds});if("error"in timeRangeResult)return usageError(timeRangeResult.error);let timeRange2=timeRangeResult.range,targetResult;try{targetResult=await resolveLogsTarget(client,{project,deployment:deployment&&deploymentHost(deployment),deploymentFromArgument:positionalDeployment!==void 0,quiet:json})}catch(err){return failUnexpected(err)}if("error"in targetResult)return fail2(targetResult.reason,targetResult.error,targetResult.exitCode);let{target}=targetResult;return{source:source2,teamId:target.teamId,projectId:target.projectId,timeRange:timeRange2,filter:composeFilter({source:source2,deploymentId:target.deploymentId,environment,filter}),context:async()=>{let names=await target.names();if("error"in names)return names;let details=[target.deploymentId?`deployment ${target.deploymentId}`:void 0,environment?`environment ${environment}`:void 0].filter(Boolean);return`${SOURCE_TITLES[source2.name]} for ${names.teamLabel}/${names.projectName}`+(details.length>0?` (${details.join(", ")})`:"")+`, ${formatWindow(timeRange2)}`},deferredLookup:target.deferredLookup}}let{source,timeRange}=plan,serializedTimeRange=serializeTimeRange(timeRange),tokenFor=cursor=>encodeContinuation({event:source.event,ownerId:plan.teamId,projectIds:[plan.projectId],timeRange:serializedTimeRange,...plan.filter!==void 0?{filter:plan.filter}:{},order:"desc",cursor}),write=async text2=>{try{return await writeWithBackpressure(client.stdout,text2),!0}catch(err){if(isClosedOutputError(err))return!1;throw err}},querySource=json||!source.textSelect?source:{...source,select:source.textSelect},pages=fetchEventPages2(client,{source:querySource,teamId:plan.teamId,projectId:plan.projectId,timeRange,filter:plan.filter},limit,plan.startCursor),firstPage=json?pages.next():void 0;firstPage?.catch(()=>{});let renderer=json?void 0:createRenderer(source.name,timeRange),excludedIntervals=new Map,written=0,pagesFetched=0,resumeCursor=plan.startCursor,result,checkTarget=async()=>{let context;try{context=await plan.context()}catch(err){return failUnexpected(err)}return typeof context=="string"?context:fail2(context.reason,context.error,context.exitCode)},writeUpfrontWarnings=async()=>upfrontWarnings.length===0||write(upfrontWarnings.join(""));try{if(!json){plan.deferredLookup&&output_manager_default.spinner("Retrieving project\u2026",1e3);let context=await checkTarget();if(output_manager_default.stopSpinner(),typeof context=="number")return context;output_manager_default.print(import_chalk5.default.dim(`${context}
78
79
  `))}for(;;){!json&&pagesFetched===0&&output_manager_default.spinner(`Fetching ${source.recordsLabel}\u2026`,1e3);let first=pagesFetched===0,pending=firstPage;firstPage=void 0;let next;try{next=await(pending??pages.next())}catch(err){if(first){if(plan.deferredLookup){let context=await checkTarget();if(typeof context=="number")return context}if(!await writeUpfrontWarnings())return 0}return reportFetchFailure(err)}if(output_manager_default.stopSpinner(),first&&!await writeUpfrontWarnings())return 0;if(pagesFetched+=1,next.done){result=next.value;break}for(let interval of next.value.excludedIntervals)excludedIntervals.set(`${interval.start}/${interval.end}`,interval);let{events}=next.value,chunk="";if(renderer){written===0&&events.length>0&&(chunk+=`${renderer.header()}
79
80
  `);for(let event of events)chunk+=`${renderer.row(event)}
80
- `}else for(let event of events)chunk+=recordLine(source.recordType,event);if(chunk&&!await write(chunk))return 0;written+=events.length,resumeCursor=next.value.nextCursor??void 0}let intervals=sortIntervals(excludedIntervals.values()),nextToken=result.nextCursor?tokenFor(result.nextCursor):null;if(json){let tail=intervals.map(interval=>warningLine({reason:"stream_gap",message:streamGapMessage(interval),data:{start:interval.start,end:interval.end}})).join("")+summaryLine({recordsReturned:written,timeRange:serializedTimeRange,pagination:{hasMore:result.hasMore,next:nextToken},excludedIntervals:intervals});return await write(tail),0}for(let interval of intervals)output_manager_default.warning(streamGapMessage(interval));if(written===0){let notes=[`No ${source.recordsLabel} found in this window. Use an earlier --since to search further back.`];source.fixedFilters.includes(BACKGROUND_FUNCTION_EXCLUSION)&&notes.push("Background function executions are always excluded."),output_manager_default.print(import_chalk5.default.dim(`${notes.join(`
81
+ `}else for(let event of events)chunk+=recordLine(source.recordType,event);if(chunk&&!await write(chunk))return 0;written+=events.length,resumeCursor=next.value.nextCursor??void 0}let intervals=sortIntervals(excludedIntervals.values()),nextToken=result.nextCursor?tokenFor(result.nextCursor):null;if(json){let tail=intervals.map(interval=>warningLine({reason:"stream_gap",message:streamGapMessage(interval),data:{start:interval.start,end:interval.end}})).join("")+summaryLine({recordsReturned:written,timeRange:serializedTimeRange,pagination:{hasMore:result.hasMore,next:nextToken},excludedIntervals:intervals});return await write(tail),0}for(let interval of intervals)output_manager_default.warning(streamGapMessage(interval));if(written===0){let notes=[`No ${source.recordsLabel} found in this window. Use an earlier --since to search further back.`];source.fixedFilters.includes(BACKGROUND_FUNCTION_EXCLUSION)&&notes.push(`Background function executions are always excluded. Use ${getCommandNamePlain("logs function-invocations")} to display them.`),output_manager_default.print(import_chalk5.default.dim(`${notes.join(`
81
82
  `)}
82
83
  `))}return result.hasMore&&(output_manager_default.log(`More ${source.recordsLabel} matched.`),nextToken&&(output_manager_default.print(`
83
84
  `),printNextPageCommand(getCommandNamePlain(`logs --next ${nextToken}`))),(!nextToken||limit===MAX_LIMIT)&&output_manager_default.print(`Narrow --query, --since, or --until to see the rest.
84
- `)),0}catch(err){return fail2("output_error",`Couldn't write the output: ${(0,import_error_utils2.errorToString)(err)}`,1)}function reportFetchFailure(err){output_manager_default.stopSpinner();let intervals=sortIntervals(excludedIntervals.values()),progress=written>0?{recordsReturned:written,outputIncomplete:!0,timeRange:serializedTimeRange,pagination:{hasMore:!0,next:resumeCursor?tokenFor(resumeCursor):null},excludedIntervals:intervals}:void 0,knownError=err instanceof RecordTooLargeError||err instanceof InvalidEventsResponseError;if(json){if(knownError)return writeJsonError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:err.message,...progress?{data:progress}:{}});let failure=describeLogsApiError(client,err,source.name),payload=failure?failure.json:{status:"error",reason:AGENT_REASON.API_ERROR,message:(0,import_error_utils2.errorToString)(err)};return writeJsonError(client,progress?{...payload,data:{...payload.data,...progress}}:payload,failure?.exitCode??1)}let exitCode2=1;return knownError?output_manager_default.error(err.message):(exitCode2=describeLogsApiError(client,err,source.name)?.exitCode??1,printLogsApiError(client,err,source.name)),progress&&(output_manager_default.error(`Output is incomplete: ${written} ${source.recordsLabel} were printed before the failure.`),progress.pagination.next&&output_manager_default.print(`Retry the failed page:
85
+ `)),0}catch(err){return fail2("output_error",`Couldn't write the output: ${(0,import_error_utils2.errorToString)(err)}`,1)}function reportFetchFailure(err){output_manager_default.stopSpinner();let knownError=err instanceof RecordTooLargeError||err instanceof InvalidEventsResponseError,queryContext={continuation:plan.startCursor!==void 0},failure=knownError?void 0:describeLogsApiError(client,err,source.name,queryContext),retryable=!failure?.outsideFreeWindow;failure?.outsideFreeWindow&&telemetry.trackCliError("OUTSIDE_FREE_WINDOW",402);let intervals=sortIntervals(excludedIntervals.values()),progress=written>0?{recordsReturned:written,outputIncomplete:!0,timeRange:serializedTimeRange,pagination:{hasMore:!0,next:resumeCursor&&retryable?tokenFor(resumeCursor):null},excludedIntervals:intervals}:void 0;if(json){if(knownError)return writeJsonError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:err.message,...progress?{data:progress}:{}});let payload=failure?failure.json:{status:"error",reason:AGENT_REASON.API_ERROR,message:(0,import_error_utils2.errorToString)(err)};return writeJsonError(client,progress?{...payload,data:{...payload.data,...progress}}:payload,failure?.exitCode??1)}let exitCode2=1;return knownError?output_manager_default.error(err.message):(exitCode2=failure?.exitCode??1,printLogsApiError(client,err,source.name,queryContext)),progress&&(output_manager_default.error(`Output is incomplete: ${written} ${source.recordsLabel} were printed before the failure.`),progress.pagination.next&&output_manager_default.print(`Retry the failed page:
85
86
  ${getCommandName(`logs --next ${progress.pagination.next}`)}
86
87
  `)),exitCode2}}function parseContinuation(continuation){let projectIds=continuation.projectIds??[];if(projectIds.length!==1||continuation.order!=="desc")return;let start=new Date(continuation.timeRange.start),end=new Date(continuation.timeRange.end);if(!(Number.isNaN(start.getTime())||Number.isNaN(end.getTime())||start.getTime()>=end.getTime()||start.toISOString()!==continuation.timeRange.start||end.toISOString()!==continuation.timeRange.end))return{teamId:continuation.ownerId,projectId:projectIds[0],timeRange:{start,end}}}export{inspect,logs};