@vercel/cli-support 65.17.0 → 66.0.0-snapshot-f90d5a1ebf99

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 (198) hide show
  1. package/README.md +6 -3
  2. package/dist/chunks/{add-6M3AALI3.js → add-2FSKW22V.js} +1 -1
  3. package/dist/chunks/{add-C6VTEFXX.js → add-COPZ3FPF.js} +1 -1
  4. package/dist/chunks/{add-NU6HG5B7.js → add-FIBV3KLT.js} +1 -1
  5. package/dist/chunks/alerts-7YJBYDMI.js +8 -0
  6. package/dist/chunks/api-endpoints-A6O4YT4B.js +7 -0
  7. package/dist/chunks/{build-6ZQB7L52.js → build-2Z7LPR3D.js} +1 -1
  8. package/dist/chunks/{chunk-UDQBYPFA.js → chunk-3DQEBAXQ.js} +1 -1
  9. package/dist/chunks/chunk-3FVMCV7T.js +7 -0
  10. package/dist/chunks/{chunk-4IRZBCXZ.js → chunk-3KNARS4W.js} +1 -1
  11. package/dist/chunks/{chunk-6VSZ6NDD.js → chunk-3M5PFRXQ.js} +1 -1
  12. package/dist/chunks/{chunk-6MQAEEY6.js → chunk-3MU3JC2I.js} +1 -1
  13. package/dist/chunks/{chunk-W5MWGVQT.js → chunk-3U7XYLSN.js} +1 -1
  14. package/dist/chunks/{chunk-2A6NUKKE.js → chunk-3XTN2FNA.js} +1 -1
  15. package/dist/chunks/{chunk-OS3Y2WGS.js → chunk-4BTYJMGY.js} +1 -1
  16. package/dist/chunks/{chunk-K3FIH7VS.js → chunk-4CIPMTB6.js} +2 -2
  17. package/dist/chunks/{chunk-4E2SYQVZ.js → chunk-4OU5MBMP.js} +1 -1
  18. package/dist/chunks/{chunk-5ZOZ6UI3.js → chunk-4WXR3W6D.js} +1 -1
  19. package/dist/chunks/{chunk-FENHM66N.js → chunk-5QNMP64F.js} +1 -1
  20. package/dist/chunks/{chunk-PPAXB7AB.js → chunk-62MZ4RMI.js} +1 -1
  21. package/dist/chunks/{chunk-JCMUCY6R.js → chunk-666NINFO.js} +2 -2
  22. package/dist/chunks/{chunk-UGHD3ALY.js → chunk-66VYZZTY.js} +1 -1
  23. package/dist/chunks/{chunk-5XWTMJ5A.js → chunk-7CWCAPEU.js} +1 -1
  24. package/dist/chunks/{chunk-XDPSUC2N.js → chunk-7ECYJHY4.js} +1 -1
  25. package/dist/chunks/{chunk-2UV736RO.js → chunk-7GJKRQV2.js} +1 -1
  26. package/dist/chunks/{chunk-GSEOOO5M.js → chunk-7THDUCSM.js} +1 -1
  27. package/dist/chunks/{chunk-3PNXCIIV.js → chunk-AH4NS3JJ.js} +1 -1
  28. package/dist/chunks/{chunk-CDDG77YO.js → chunk-APSIPJAY.js} +1 -1
  29. package/dist/chunks/{chunk-2RPWRZMR.js → chunk-AQTNGHTB.js} +1 -1
  30. package/dist/chunks/{chunk-IYBBF4IU.js → chunk-AVRED7XL.js} +2 -2
  31. package/dist/chunks/{chunk-L7OQ5CUT.js → chunk-B4MRD6RJ.js} +1 -1
  32. package/dist/chunks/{chunk-OXD4SLRA.js → chunk-BBR5M3EZ.js} +1 -1
  33. package/dist/chunks/chunk-CT7EIS3H.js +10 -0
  34. package/dist/chunks/chunk-CY5KJ42N.js +13 -0
  35. package/dist/chunks/{chunk-TJ5F4BSH.js → chunk-DW5AXCVQ.js} +1 -1
  36. package/dist/chunks/{chunk-4BCU4KFD.js → chunk-EA55QLHA.js} +1 -1
  37. package/dist/chunks/{chunk-H5G36TLP.js → chunk-F2UIIWKS.js} +1 -1
  38. package/dist/chunks/chunk-FCTTEFC5.js +7 -0
  39. package/dist/chunks/{chunk-TJYRGELW.js → chunk-FRKDI2ZH.js} +1 -1
  40. package/dist/chunks/{chunk-CDGGZKIG.js → chunk-FSZJSIOF.js} +1 -1
  41. package/dist/chunks/{chunk-Y2CSNIOJ.js → chunk-FZBYQQQQ.js} +1 -1
  42. package/dist/chunks/chunk-GQU7IE6F.js +12 -0
  43. package/dist/chunks/{chunk-AKFCJNJF.js → chunk-GYXHNS2O.js} +1 -1
  44. package/dist/chunks/{chunk-YERISP3L.js → chunk-H4QCL7P4.js} +1 -1
  45. package/dist/chunks/{chunk-VHVBGL5G.js → chunk-HQWR3EDU.js} +1 -1
  46. package/dist/chunks/{chunk-JYEKC35M.js → chunk-IHVN6YZJ.js} +1 -1
  47. package/dist/chunks/{chunk-QIWCDJY6.js → chunk-IIOIVUQV.js} +1 -1
  48. package/dist/chunks/{chunk-YKZ4N2KF.js → chunk-IL27CVNF.js} +1 -1
  49. package/dist/chunks/{chunk-2PQM7TCT.js → chunk-JV4KLSS2.js} +1 -1
  50. package/dist/chunks/{chunk-IUO6VPHD.js → chunk-JVHNHBIE.js} +1 -1
  51. package/dist/chunks/chunk-KK5C7HVP.js +7 -0
  52. package/dist/chunks/{chunk-65YRE7OX.js → chunk-KTWGUBNP.js} +1 -1
  53. package/dist/chunks/{chunk-WZCLCG4J.js → chunk-KXK4TF6L.js} +1 -1
  54. package/dist/chunks/{chunk-ITMLCNB4.js → chunk-LTW7KZBV.js} +1 -1
  55. package/dist/chunks/{chunk-R4QGGO5B.js → chunk-MQKAVUTX.js} +1 -1
  56. package/dist/chunks/{chunk-ACUK5DV4.js → chunk-NZNC5EU4.js} +1 -1
  57. package/dist/chunks/{chunk-K36E52T6.js → chunk-OFZYIAUF.js} +1 -1
  58. package/dist/chunks/{chunk-J4S66QK6.js → chunk-OH2A2APZ.js} +1 -1
  59. package/dist/chunks/{chunk-54XPSLKL.js → chunk-OYB676KT.js} +6 -6
  60. package/dist/chunks/{chunk-4EYMHKPB.js → chunk-OYQOYJSJ.js} +1 -1
  61. package/dist/chunks/{chunk-RXEXEY5E.js → chunk-P35EU77P.js} +1 -1
  62. package/dist/chunks/{chunk-7BZRYBNY.js → chunk-PEIULHMW.js} +1 -1
  63. package/dist/chunks/chunk-PJSTANJI.js +7 -0
  64. package/dist/chunks/chunk-PNWRO3XW.js +11 -0
  65. package/dist/chunks/{chunk-L3FMGAEY.js → chunk-Q2R3VQER.js} +1 -1
  66. package/dist/chunks/{chunk-W44QMOQF.js → chunk-QYUKDP2E.js} +1 -1
  67. package/dist/chunks/{chunk-JENTVCIM.js → chunk-QZHSJ43U.js} +1 -1
  68. package/dist/chunks/{chunk-4UZDMIRB.js → chunk-R2JNS7E3.js} +1 -1
  69. package/dist/chunks/{chunk-YSUBZ4H6.js → chunk-RLSTNUAE.js} +1 -1
  70. package/dist/chunks/{chunk-V6O3MHVH.js → chunk-RYR72TZY.js} +1 -1
  71. package/dist/chunks/{chunk-2XLCSCWH.js → chunk-SJ5BMZE5.js} +1 -1
  72. package/dist/chunks/{chunk-B3AVML3E.js → chunk-SW26TCUB.js} +1 -1
  73. package/dist/chunks/{chunk-ISFOL3XU.js → chunk-TIPYUIAC.js} +1 -1
  74. package/dist/chunks/{chunk-DMU3EFXU.js → chunk-U7MSPEXO.js} +1 -1
  75. package/dist/chunks/{chunk-SYI4LBMR.js → chunk-UEJ332R4.js} +1 -1
  76. package/dist/chunks/{chunk-M2HZOFN5.js → chunk-UK7P2E6X.js} +1 -1
  77. package/dist/chunks/{chunk-ZBBATLPQ.js → chunk-UQ3FLLMH.js} +1 -1
  78. package/dist/chunks/{chunk-I2RMTV2E.js → chunk-UVPYKYFW.js} +1 -1
  79. package/dist/chunks/{chunk-FUASV2IR.js → chunk-WEQK6GS2.js} +1 -1
  80. package/dist/chunks/{chunk-AMHVWM5D.js → chunk-WOD4NOA2.js} +1 -1
  81. package/dist/chunks/{chunk-KFFXZGVC.js → chunk-XD73SQ24.js} +1 -1
  82. package/dist/chunks/{chunk-ZC4E5ZZT.js → chunk-XQNFBZZW.js} +1 -1
  83. package/dist/chunks/{chunk-GLGJWYR5.js → chunk-XRUKC3AS.js} +1 -1
  84. package/dist/chunks/{chunk-LJHCDSQE.js → chunk-XU55SQAN.js} +1 -1
  85. package/dist/chunks/{chunk-OCLUZVEL.js → chunk-YCFIEWWM.js} +1 -1
  86. package/dist/chunks/{chunk-ODHZ2KFO.js → chunk-Z7LKJDWH.js} +1 -1
  87. package/dist/chunks/{chunk-ISPY2QPO.js → chunk-Z7O5ETSL.js} +1 -1
  88. package/dist/chunks/{chunk-52AG3KYV.js → chunk-ZTBJHHYO.js} +1 -1
  89. package/dist/chunks/{clear-3DUM5NVE.js → clear-N24S2QWU.js} +1 -1
  90. package/dist/chunks/{compile-vercel-config-7EGD4KID.js → compile-vercel-config-25LLK6AQ.js} +1 -1
  91. package/dist/chunks/{config-CM5FGY56.js → config-ANILUDFP.js} +1 -1
  92. package/dist/chunks/config-TNWHWWVG.js +7 -0
  93. package/dist/chunks/{contract-UXF35JHG.js → contract-7FW34GJR.js} +1 -1
  94. package/dist/chunks/{delete-L22JUSLG.js → delete-EECRNXXE.js} +1 -1
  95. package/dist/chunks/{delete-7PAC36H5.js → delete-SYBPS5N6.js} +1 -1
  96. package/dist/chunks/{describe-BVOVNTIK.js → describe-QNG3GF3O.js} +1 -1
  97. package/dist/chunks/{detect-services-RLGDB3XS.js → detect-services-RO5UT2MD.js} +1 -1
  98. package/dist/chunks/{disable-2ILULETZ.js → disable-EPEVAMOU.js} +1 -1
  99. package/dist/chunks/{discard-ZQDVF2BV.js → discard-Z3ULRZ6X.js} +1 -1
  100. package/dist/chunks/{edit-B5HKAA3Y.js → edit-4I6JSZCQ.js} +1 -1
  101. package/dist/chunks/{edit-2THCJXU6.js → edit-SPMRQUYE.js} +1 -1
  102. package/dist/chunks/{enable-KFEAC56T.js → enable-3Q2QJ3PH.js} +1 -1
  103. package/dist/chunks/{export-DWSSJSHN.js → export-526HEFAF.js} +1 -1
  104. package/dist/chunks/{future-27CSSTSM.js → future-YDPYOXO6.js} +1 -1
  105. package/dist/chunks/{generate-cert-for-deploy-5HKKOLXE.js → generate-cert-for-deploy-FKWT3Z2T.js} +1 -1
  106. package/dist/chunks/image-M7BU6IJH.js +7 -0
  107. package/dist/chunks/{import-builders-5RBWN5OQ.js → import-builders-EINRCTXS.js} +1 -1
  108. package/dist/chunks/{inspect-V4I6FLTI.js → inspect-2YFBZIXH.js} +1 -1
  109. package/dist/chunks/{inspect-CJREE2KA.js → inspect-CCILGGZK.js} +1 -1
  110. package/dist/chunks/{inspect-Q3UKNIAX.js → inspect-EBSRI3SL.js} +1 -1
  111. package/dist/chunks/{inspect-CRP6NH6E.js → inspect-EUK2S5FJ.js} +1 -1
  112. package/dist/chunks/{inspect-RVJWMV2P.js → inspect-G6ATTJHN.js} +1 -1
  113. package/dist/chunks/{inspect-IGX2RQZF.js → inspect-SOXSES5T.js} +1 -1
  114. package/dist/chunks/{list-ECJGXPCX.js → list-7CSLDIXH.js} +1 -1
  115. package/dist/chunks/{list-NWCLD63A.js → list-ANE5NF4G.js} +1 -1
  116. package/dist/chunks/{list-MLXQFP32.js → list-LRV6CWNG.js} +1 -1
  117. package/dist/chunks/{list-EE5LP3XI.js → list-RTHOJV4K.js} +1 -1
  118. package/dist/chunks/{login-FX3HON7Y.js → login-PPBUHDQK.js} +1 -1
  119. package/dist/chunks/{login-KC2GH746.js → login-VCWQXNKH.js} +1 -1
  120. package/dist/chunks/{logs-LT5VYAYH.js → logs-5MZFROAK.js} +1 -1
  121. package/dist/chunks/{ls-IVYLE77U.js → ls-4DY2PURD.js} +1 -1
  122. package/dist/chunks/{ls-SNCO5B5A.js → ls-EMESQVFD.js} +1 -1
  123. package/dist/chunks/{ls-SAFP4AEL.js → ls-OVV7AOJQ.js} +1 -1
  124. package/dist/chunks/{ls-IO7UILP7.js → ls-Q5DBF27O.js} +1 -1
  125. package/dist/chunks/{ls-2R2MR3CO.js → ls-QI4X6DCM.js} +1 -1
  126. package/dist/chunks/{ls-ULSRILNF.js → ls-SYW6TU5B.js} +1 -1
  127. package/dist/chunks/{ls-X6LE4ZFD.js → ls-XBL6OZOC.js} +1 -1
  128. package/dist/chunks/{migrate-experimental-services-AJ6GVF6O.js → migrate-experimental-services-OSV2ELWS.js} +1 -1
  129. package/dist/chunks/{mutate-3NJKAHAD.js → mutate-YSH4SBHS.js} +1 -1
  130. package/dist/chunks/{notifications-73Y6R45H.js → notifications-N7UYURAZ.js} +1 -1
  131. package/dist/chunks/{open-VIVK2UDK.js → open-R6OAIKVV.js} +1 -1
  132. package/dist/chunks/{openapi-SUHPIPUZ.js → openapi-4KMLRPJV.js} +1 -1
  133. package/dist/chunks/{permissions-GZZN7UUK.js → permissions-CQTL4HKM.js} +1 -1
  134. package/dist/chunks/{plugin-offer-2SMMNBHS.js → plugin-offer-F5HLZ3OL.js} +1 -1
  135. package/dist/chunks/{prompt-missing-credentials-UFFTUCXU.js → prompt-missing-credentials-5XBS5NDG.js} +1 -1
  136. package/dist/chunks/{publish-QUC6TMRK.js → publish-2QPK4WOF.js} +1 -1
  137. package/dist/chunks/{pull-67X4FSMU.js → pull-VETLKX67.js} +1 -1
  138. package/dist/chunks/{purchase-domain-if-available-Z6JVVRSD.js → purchase-domain-if-available-TQXTNTV4.js} +1 -1
  139. package/dist/chunks/{push-QVHS7FDF.js → push-V5H2NOK5.js} +1 -1
  140. package/dist/chunks/{query-BDDPR2EX.js → query-AXIRIY5Z.js} +1 -1
  141. package/dist/chunks/{raw-query-NE7NWCB7.js → raw-query-WMZFHB3U.js} +1 -1
  142. package/dist/chunks/{reauthenticate-IC7BSJ3P.js → reauthenticate-UQL2TX2N.js} +1 -1
  143. package/dist/chunks/{remove-BHN6WPUV.js → remove-T4EBT5XK.js} +1 -1
  144. package/dist/chunks/{reorder-EIDH4EJE.js → reorder-YW6DXYDQ.js} +1 -1
  145. package/dist/chunks/{reply-WDAJW5SL.js → reply-WLOPDMDJ.js} +1 -1
  146. package/dist/chunks/{resolve-V47ENQW3.js → resolve-A7EQGQCL.js} +1 -1
  147. package/dist/chunks/{resolve-agent-team-MFQQGFOV.js → resolve-agent-team-HGSKBZ3F.js} +1 -1
  148. package/dist/chunks/{restore-ROZT6YF2.js → restore-5HQ7IMHH.js} +1 -1
  149. package/dist/chunks/{rm-2QIQDOGW.js → rm-DBPDFQYV.js} +1 -1
  150. package/dist/chunks/{rm-RILNS5CN.js → rm-MJ2FA6FH.js} +1 -1
  151. package/dist/chunks/{rm-3KID2JH7.js → rm-MZSCODYC.js} +1 -1
  152. package/dist/chunks/{rm-5TR2TCLE.js → rm-W7TMJPPY.js} +1 -1
  153. package/dist/chunks/{rm-JLFAI2BI.js → rm-YN2BG552.js} +1 -1
  154. package/dist/chunks/{rule-inspect-S2V5GLHH.js → rule-inspect-364N4DO6.js} +1 -1
  155. package/dist/chunks/{schema-UW2SZTDK.js → schema-FHK3FRRZ.js} +1 -1
  156. package/dist/chunks/{schema-BACGWLK7.js → schema-VUCPXOJM.js} +1 -1
  157. package/dist/chunks/{select-org-PENSE6DG.js → select-org-EHWFPSAI.js} +1 -1
  158. package/dist/chunks/{set-T44OQCFV.js → set-P4UCYA2I.js} +1 -1
  159. package/dist/chunks/{set-VCRWNXA2.js → set-PKLCP3YM.js} +1 -1
  160. package/dist/chunks/{setup-and-link-KBW7TFOU.js → setup-and-link-DQUZFSDI.js} +1 -1
  161. package/dist/chunks/{skills-MWEEGIZS.js → skills-DO7WMK5K.js} +6 -44
  162. package/dist/chunks/{tags-SU3K34BB.js → tags-T7YTLRJG.js} +1 -1
  163. package/dist/chunks/{types-VZQUPHE4.js → types-S7I5EBVX.js} +1 -1
  164. package/dist/chunks/{update-LCBI7RYJ.js → update-X4BFNY7R.js} +1 -1
  165. package/dist/chunks/{usage-IIY5U3TT.js → usage-KI7ILI3G.js} +1 -1
  166. package/dist/commands/build/index.js +5 -5
  167. package/dist/commands/deploy/index.js +4 -4
  168. package/dist/commands/dev/index.js +3 -3
  169. package/dist/commands/env/index.js +1 -1
  170. package/dist/commands/link/index.js +1 -1
  171. package/dist/commands/list/index.js +1 -1
  172. package/dist/commands/project/index.js +24 -8
  173. package/dist/commands/tunnel/index.js +1 -1
  174. package/dist/commands-account.js +4 -4
  175. package/dist/commands-ai.js +3 -3
  176. package/dist/commands-blob.js +1 -1
  177. package/dist/commands-core.js +64 -52
  178. package/dist/commands-deployments.js +1 -1
  179. package/dist/commands-flags.js +18 -16
  180. package/dist/commands-integrations.js +4 -4
  181. package/dist/commands-observability.js +2 -2
  182. package/dist/commands-routing.js +2 -2
  183. package/dist/help.js +1 -1
  184. package/dist/index.js +5 -5
  185. package/dist/internal-build.js +1 -1
  186. package/dist/package.json +40 -40
  187. package/dist/root-help-commands.mjs +1 -1
  188. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +1 -2
  189. package/dist/version.mjs +1 -1
  190. package/package.json +57 -42
  191. package/dist/chunks/alerts-JNBP5ZOD.js +0 -8
  192. package/dist/chunks/chunk-57INWX4T.js +0 -7
  193. package/dist/chunks/chunk-7YNV6Q6G.js +0 -12
  194. package/dist/chunks/chunk-LZ3KMDYM.js +0 -9
  195. package/dist/chunks/chunk-N465KVPA.js +0 -11
  196. package/dist/chunks/chunk-NJFTAKDY.js +0 -10
  197. package/dist/chunks/config-Q6RCDUPL.js +0 -7
  198. package/dist/chunks/image-ZTFQVIWL.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{warnIfFidMetric}from"./chunk-5IZI5QH6.js";import{fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit,formatErrorJson}from"./chunk-4EYMHKPB.js";import{formatTable}from"./chunk-YIOMTAUF.js";import{indent_default}from"./chunk-GZNDA6SV.js";import"./chunk-CDGGZKIG.js";import"./chunk-CJZE7647.js";import{schemaSubcommand}from"./chunk-GLCSWIB4.js";import{printError}from"./chunk-LZ3KMDYM.js";import"./chunk-GLIQ4KNY.js";import{getScope}from"./chunk-2A6NUKKE.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-54XPSLKL.js";import{require_pluralize}from"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_pluralize=__toESM(require_pluralize(),1);async function schema(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(schemaSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err,client),2}let flags=parsedArgs.flags,positionalArgs=parsedArgs.args.slice(1),positionalMetric=positionalArgs[0]==="schema"?positionalArgs[1]:positionalArgs[0],formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,metric=positionalMetric;warnIfFidMetric(metric),telemetry.trackCliArgumentMetricId(metric),telemetry.trackCliOptionFormat(flags["--format"]);let{team}=await getScope(client);if(!team){let message="The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again.";return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_UNAUTHORIZED",message)):output_manager_default.error(message),1}if(metric){let detail=await fetchCatalogMetricDetailOrExit(client,team.id,jsonOutput,metric,metric.startsWith("vercel.")?"system":"custom");if(typeof detail=="number")return detail;if(detail.length===0){let message=`No metrics match "${metric}". Run \`vercel metrics schema\` to see available metrics.`;return jsonOutput?client.stdout.write(formatErrorJson("METRIC_NOT_FOUND",message)):output_manager_default.error(message),1}if(jsonOutput)return client.stdout.write(JSON.stringify(detail,null,2)),0;output_manager_default.log(`Metric: ${metric}`);let metricsTable=formatMetricsTable(detail);return metricsTable&&(output_manager_default.print(metricsTable),output_manager_default.print(`
7
+ import{warnIfFidMetric}from"./chunk-5IZI5QH6.js";import{fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit,formatErrorJson}from"./chunk-OYQOYJSJ.js";import{formatTable}from"./chunk-YIOMTAUF.js";import{indent_default}from"./chunk-GZNDA6SV.js";import"./chunk-FSZJSIOF.js";import"./chunk-CJZE7647.js";import{schemaSubcommand}from"./chunk-GLCSWIB4.js";import{printError}from"./chunk-CY5KJ42N.js";import"./chunk-GLIQ4KNY.js";import{getScope}from"./chunk-3XTN2FNA.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-OYB676KT.js";import"./chunk-M7FED5YP.js";import{require_pluralize}from"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7HLAWGY2.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_pluralize=__toESM(require_pluralize(),1);async function schema(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(schemaSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err,client),2}let flags=parsedArgs.flags,positionalArgs=parsedArgs.args.slice(1),positionalMetric=positionalArgs[0]==="schema"?positionalArgs[1]:positionalArgs[0],formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,metric=positionalMetric;warnIfFidMetric(metric),telemetry.trackCliArgumentMetricId(metric),telemetry.trackCliOptionFormat(flags["--format"]);let{team}=await getScope(client);if(!team){let message="The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again.";return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_UNAUTHORIZED",message)):output_manager_default.error(message),1}if(metric){let detail=await fetchCatalogMetricDetailOrExit(client,team.id,jsonOutput,metric,metric.startsWith("vercel.")?"system":"custom");if(typeof detail=="number")return detail;if(detail.length===0){let message=`No metrics match "${metric}". Run \`vercel metrics schema\` to see available metrics.`;return jsonOutput?client.stdout.write(formatErrorJson("METRIC_NOT_FOUND",message)):output_manager_default.error(message),1}if(jsonOutput)return client.stdout.write(JSON.stringify(detail,null,2)),0;output_manager_default.log(`Metric: ${metric}`);let metricsTable=formatMetricsTable(detail);return metricsTable&&(output_manager_default.print(metricsTable),output_manager_default.print(`
8
8
  `)),0}let metricsOrExitCode=await fetchMetricCatalogListOrExit(client,team.id,jsonOutput);return typeof metricsOrExitCode=="number"?metricsOrExitCode:(jsonOutput?client.stdout.write(JSON.stringify(metricsOrExitCode,null,2)):(output_manager_default.log(`${(0,import_pluralize.default)("Metric",metricsOrExitCode.length,!0)} found`),output_manager_default.print(formatMetricListTable(metricsOrExitCode)),output_manager_default.print(`
9
9
  `)),0)}function formatMetricListTable(metrics){return indent_default(formatTable(["Metric","Description"],["l","l"],[{rows:metrics.map(metric=>[metric.id,metric.description])}]),1)}function formatMetricsTable(metrics){if(metrics.length===0)return null;let dimensionsByMetric=metrics.map(metric=>metric.dimensions),sharedDimensions=dimensionsByMetric[0].filter(dimension=>dimensionsByMetric.every(metricDimensions=>metricDimensions.includes(dimension))),rows=metrics.map(metric=>{let extraDimensions=metric.dimensions.filter(dimension=>!sharedDimensions.includes(dimension)).map(dimension=>`+${dimension}`),aggregations=metric.aggregations.join(", ");return{metric:metric.id,description:metric.description,unit:metric.unit,aggregations,extraDimensions}}),hasExtraDimensions=rows.some(row=>row.extraDimensions.length>0),tableHeaders=hasExtraDimensions?["Metric","Description","Unit","Aggregations","Dimensions"]:["Metric","Description","Unit","Aggregations"],tableRows=rows.map(row=>hasExtraDimensions?[row.metric,row.description,row.unit,row.aggregations,row.extraDimensions.join(", ")||"\u2014"]:[row.metric,row.description,row.unit,row.aggregations]),sharedDimensionsLine=sharedDimensions.length>0?metrics.length===1?`Dimensions:
10
10
  ${sharedDimensions.join(", ")}`:`Shared dimensions:
@@ -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{resolveRulesTeam}from"./chunk-QIWCDJY6.js";import"./chunk-FUASV2IR.js";import{handleRulesApiError,outputRulesError,rulesSchemaPath}from"./chunk-RXEXEY5E.js";import"./chunk-ZJNDLFZ7.js";import"./chunk-D3M2JG5C.js";import{formatTable}from"./chunk-YIOMTAUF.js";import{indent_default}from"./chunk-GZNDA6SV.js";import"./chunk-CJZE7647.js";import{monitorsSchemaSubcommand}from"./chunk-5ZCSFPWG.js";import{printError}from"./chunk-LZ3KMDYM.js";import"./chunk-2A6NUKKE.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-54XPSLKL.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";async function schema(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsSchemaSubcommand.options))}catch(error){return printError(error),2}let format=validateJsonOutput(parsedArgs.flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let value=parsedArgs.flags["--type"];if(value!==void 0&&value!=="built-in"&&value!=="custom")return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE",`Invalid monitor type "${String(value)}". Expected a supported monitor type.`);let type=value,scope=await resolveRulesTeam(client,format.jsonOutput);if(typeof scope=="number")return scope;output_manager_default.spinner("Fetching monitor schema\u2026");try{let document=await client.fetch(rulesSchemaPath(api,scope.teamId,type));if(format.jsonOutput)return client.stdout.write(`${JSON.stringify(document,null,2)}
7
+ import{resolveRulesTeam}from"./chunk-IIOIVUQV.js";import"./chunk-WEQK6GS2.js";import{handleRulesApiError,outputRulesError,rulesSchemaPath}from"./chunk-P35EU77P.js";import"./chunk-ZJNDLFZ7.js";import"./chunk-D3M2JG5C.js";import{formatTable}from"./chunk-YIOMTAUF.js";import{indent_default}from"./chunk-GZNDA6SV.js";import"./chunk-CJZE7647.js";import{monitorsSchemaSubcommand}from"./chunk-5ZCSFPWG.js";import{printError}from"./chunk-CY5KJ42N.js";import"./chunk-3XTN2FNA.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-OYB676KT.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7HLAWGY2.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";async function schema(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsSchemaSubcommand.options))}catch(error){return printError(error),2}let format=validateJsonOutput(parsedArgs.flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let value=parsedArgs.flags["--type"];if(value!==void 0&&value!=="built-in"&&value!=="custom")return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE",`Invalid monitor type "${String(value)}". Expected a supported monitor type.`);let type=value,scope=await resolveRulesTeam(client,format.jsonOutput);if(typeof scope=="number")return scope;output_manager_default.spinner("Fetching monitor schema\u2026");try{let document=await client.fetch(rulesSchemaPath(api,scope.teamId,type));if(format.jsonOutput)return client.stdout.write(`${JSON.stringify(document,null,2)}
8
8
  `),0;if(!type)return printSchemaIndex(document[api.typesKey]),0;let ruleSchema=document[api.typesKey].find(item=>item.type===type);return ruleSchema?(printSchema(ruleSchema),0):outputRulesError(client,!1,"INVALID_SCHEMA_RESPONSE",`The API did not return the ${type} monitor schema.`)}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}function printSchemaIndex(ruleTypes){output_manager_default.log("Monitor schemas"),output_manager_default.print(`${formatRows(["Type","Description"],ruleTypes.map(item=>[item.type,item.description]))}
9
9
  Run \`${packageName} monitors schema --type <type>\` for fields and examples.
10
10
  `)}function printSchema(schema2){output_manager_default.log(`Monitor schema: ${schema2.type}`),output_manager_default.print(`${schema2.description}
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{selectOrg}from"./chunk-6VSZ6NDD.js";import"./chunk-Y2FVJ7YO.js";import"./chunk-3G3FQYMW.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-54XPSLKL.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";export{selectOrg as default};
7
+ import{selectOrg}from"./chunk-3M5PFRXQ.js";import"./chunk-Y2FVJ7YO.js";import"./chunk-3G3FQYMW.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-OYB676KT.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7HLAWGY2.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";export{selectOrg as default};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{EMPTY_PATH_ERROR,ENVIRONMENT_ERROR,RATE_ERROR,RULE_LIMIT,formatRate,formatRuleTarget,hasSameKey,isRuleEnvironment,parseSampleRate,readTracingConfig,resolveRuleEnvironment,subcommandArguments,toApiRate,toRule,writeConfigJson,writeSamplingRules}from"./chunk-65YRE7OX.js";import{handleTracingApiError,invalidArguments,missingEnvironment,resolveConfigScope}from"./chunk-PPAXB7AB.js";import"./chunk-K36E52T6.js";import"./chunk-ZC4E5ZZT.js";import{tracesCommand}from"./chunk-DDPH26ZO.js";import{setSubcommand}from"./chunk-PIDEH4SJ.js";import{printError}from"./chunk-LZ3KMDYM.js";import{help}from"./chunk-7KCRYDGK.js";import"./chunk-GLIQ4KNY.js";import"./chunk-2A6NUKKE.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-54XPSLKL.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var TracesConfigSetTelemetryClient=class extends TelemetryClient{trackCliArgumentEnvironment(environment){environment&&this.trackCliArgument({arg:"environment",value:isRuleEnvironment(environment)?environment:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:isRuleEnvironment(environment)?environment:this.redactedValue})}trackCliArgumentRate(rate){rate&&this.trackCliArgument({arg:"rate",value:this.redactedValue})}trackCliArgumentRequestPath(requestPath){requestPath&&this.trackCliArgument({arg:"requestPath",value:this.redactedValue})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var USAGE="traces config set <rate> [requestPath] --environment <environment>";async function set(client){let telemetry=new TracesConfigSetTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(setSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs,ruleEnvironment=resolveRuleEnvironment(client,flags["--environment"],subcommandArguments(parsedArgs.args));if("error"in ruleEnvironment)return invalidArguments(client,ruleEnvironment.error);let environmentArg=ruleEnvironment.environment,[rateArg,...pathArgs]=ruleEnvironment.args,pathArg=pathArgs[0];if(flags["--environment"]===void 0&&telemetry.trackCliArgumentEnvironment(environmentArg),telemetry.trackCliOptionEnvironment(flags["--environment"]),telemetry.trackCliArgumentRate(rateArg),telemetry.trackCliArgumentRequestPath(pathArg),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliOptionProject(flags["--project"]),environmentArg===void 0&&rateArg!==void 0)return missingEnvironment(client,`Can't set a sampling rule without --environment. Usage: ${getCommandName(USAGE)}`);if(environmentArg===void 0||rateArg===void 0)return output_manager_default.print(help(setSubcommand,{stream:client.stderr,parent:tracesCommand,columns:client.stderr.columns})),2;if(pathArgs.length>1)return output_manager_default.error(`Too many arguments. Usage: ${getCommandName(USAGE)}`),2;if(!isRuleEnvironment(environmentArg))return invalidArguments(client,`${ENVIRONMENT_ERROR} Received: ${environmentArg}`);let sampleRate=parseSampleRate(rateArg);if(sampleRate===void 0)return invalidArguments(client,`${RATE_ERROR} Received: ${rateArg}`);if(pathArg!==void 0&&pathArg.trim()==="")return invalidArguments(client,EMPTY_PATH_ERROR);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let asJson=formatResult.jsonOutput||client.nonInteractive,scope=await resolveConfigScope(client,{project:flags["--project"]});if("exitCode"in scope)return scope.exitCode;let rule={environment:environmentArg,requestPath:pathArg??null,sampleRate};asJson||output_manager_default.spinner("Updating trace sampling rules\u2026");let project,entries;try{({project,entries}=await readTracingConfig({client,...scope}))}catch(err){return output_manager_default.stopSpinner(),handleTracingApiError(client,err)}let matchingEntries=entries.filter(entry=>hasSameKey(entry.row,rule)),previousSampleRate=matchingEntries.length?Math.max(...matchingEntries.map(entry=>entry.row.sampleRate)):null,nextRules=matchingEntries.length===0?[...entries.map(entry=>entry.rule),toRule(rule)]:entries.map(entry=>hasSameKey(entry.row,rule)?{...entry.rule,rate:toApiRate(rule.sampleRate)}:entry.rule);if(nextRules.length>RULE_LIMIT)return output_manager_default.stopSpinner(),invalidArguments(client,`A project can have at most ${RULE_LIMIT} trace sampling rules, and ${project.name} already has ${entries.length}. Remove one with ${getCommandName("traces config remove [requestPath] --environment <environment>")} first.`);try{await writeSamplingRules({client,...scope,rules:nextRules})}catch(err){return output_manager_default.stopSpinner(),handleTracingApiError(client,err)}output_manager_default.stopSpinner();let target=formatRuleTarget(rule.environment,rule.requestPath),wasClause=previousSampleRate!==null?` (was ${formatRate(previousSampleRate)})`:"",successLine=subject=>`Set ${subject} to ${formatRate(rule.sampleRate)}${wasClause}. ${nextRules.length} of ${RULE_LIMIT} rules.`;return asJson?(writeConfigJson(client,{project,bare:rule,envelope:{rule,previousSampleRate,ruleCount:nextRules.length,ruleLimit:RULE_LIMIT},message:successLine(target),next:[{command:getCommandNamePlain("traces config ls"),when:"Read back every sampling rule"}]}),0):(output_manager_default.success(successLine(import_chalk.default.bold(target))),0)}export{set as default};
7
+ import{EMPTY_PATH_ERROR,ENVIRONMENT_ERROR,RATE_ERROR,RULE_LIMIT,formatRate,formatRuleTarget,hasSameKey,isRuleEnvironment,parseSampleRate,readTracingConfig,resolveRuleEnvironment,subcommandArguments,toApiRate,toRule,writeConfigJson,writeSamplingRules}from"./chunk-KTWGUBNP.js";import{handleTracingApiError,invalidArguments,missingEnvironment,resolveConfigScope}from"./chunk-62MZ4RMI.js";import"./chunk-OFZYIAUF.js";import"./chunk-XQNFBZZW.js";import{tracesCommand}from"./chunk-DDPH26ZO.js";import{setSubcommand}from"./chunk-PIDEH4SJ.js";import{printError}from"./chunk-CY5KJ42N.js";import{help}from"./chunk-7KCRYDGK.js";import"./chunk-GLIQ4KNY.js";import"./chunk-3XTN2FNA.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-OYB676KT.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7HLAWGY2.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var TracesConfigSetTelemetryClient=class extends TelemetryClient{trackCliArgumentEnvironment(environment){environment&&this.trackCliArgument({arg:"environment",value:isRuleEnvironment(environment)?environment:this.redactedValue})}trackCliOptionEnvironment(environment){environment&&this.trackCliOption({option:"environment",value:isRuleEnvironment(environment)?environment:this.redactedValue})}trackCliArgumentRate(rate){rate&&this.trackCliArgument({arg:"rate",value:this.redactedValue})}trackCliArgumentRequestPath(requestPath){requestPath&&this.trackCliArgument({arg:"requestPath",value:this.redactedValue})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};var USAGE="traces config set <rate> [requestPath] --environment <environment>";async function set(client){let telemetry=new TracesConfigSetTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(setSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let{flags}=parsedArgs,ruleEnvironment=resolveRuleEnvironment(client,flags["--environment"],subcommandArguments(parsedArgs.args));if("error"in ruleEnvironment)return invalidArguments(client,ruleEnvironment.error);let environmentArg=ruleEnvironment.environment,[rateArg,...pathArgs]=ruleEnvironment.args,pathArg=pathArgs[0];if(flags["--environment"]===void 0&&telemetry.trackCliArgumentEnvironment(environmentArg),telemetry.trackCliOptionEnvironment(flags["--environment"]),telemetry.trackCliArgumentRate(rateArg),telemetry.trackCliArgumentRequestPath(pathArg),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliOptionProject(flags["--project"]),environmentArg===void 0&&rateArg!==void 0)return missingEnvironment(client,`Can't set a sampling rule without --environment. Usage: ${getCommandName(USAGE)}`);if(environmentArg===void 0||rateArg===void 0)return output_manager_default.print(help(setSubcommand,{stream:client.stderr,parent:tracesCommand,columns:client.stderr.columns})),2;if(pathArgs.length>1)return output_manager_default.error(`Too many arguments. Usage: ${getCommandName(USAGE)}`),2;if(!isRuleEnvironment(environmentArg))return invalidArguments(client,`${ENVIRONMENT_ERROR} Received: ${environmentArg}`);let sampleRate=parseSampleRate(rateArg);if(sampleRate===void 0)return invalidArguments(client,`${RATE_ERROR} Received: ${rateArg}`);if(pathArg!==void 0&&pathArg.trim()==="")return invalidArguments(client,EMPTY_PATH_ERROR);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let asJson=formatResult.jsonOutput||client.nonInteractive,scope=await resolveConfigScope(client,{project:flags["--project"]});if("exitCode"in scope)return scope.exitCode;let rule={environment:environmentArg,requestPath:pathArg??null,sampleRate};asJson||output_manager_default.spinner("Updating trace sampling rules\u2026");let project,entries;try{({project,entries}=await readTracingConfig({client,...scope}))}catch(err){return output_manager_default.stopSpinner(),handleTracingApiError(client,err)}let matchingEntries=entries.filter(entry=>hasSameKey(entry.row,rule)),previousSampleRate=matchingEntries.length?Math.max(...matchingEntries.map(entry=>entry.row.sampleRate)):null,nextRules=matchingEntries.length===0?[...entries.map(entry=>entry.rule),toRule(rule)]:entries.map(entry=>hasSameKey(entry.row,rule)?{...entry.rule,rate:toApiRate(rule.sampleRate)}:entry.rule);if(nextRules.length>RULE_LIMIT)return output_manager_default.stopSpinner(),invalidArguments(client,`A project can have at most ${RULE_LIMIT} trace sampling rules, and ${project.name} already has ${entries.length}. Remove one with ${getCommandName("traces config remove [requestPath] --environment <environment>")} first.`);try{await writeSamplingRules({client,...scope,rules:nextRules})}catch(err){return output_manager_default.stopSpinner(),handleTracingApiError(client,err)}output_manager_default.stopSpinner();let target=formatRuleTarget(rule.environment,rule.requestPath),wasClause=previousSampleRate!==null?` (was ${formatRate(previousSampleRate)})`:"",successLine=subject=>`Set ${subject} to ${formatRate(rule.sampleRate)}${wasClause}. ${nextRules.length} of ${RULE_LIMIT} rules.`;return asJson?(writeConfigJson(client,{project,bare:rule,envelope:{rule,previousSampleRate,ruleCount:nextRules.length,ruleLimit:RULE_LIMIT},message:successLine(target),next:[{command:getCommandNamePlain("traces config ls"),when:"Read back every sampling rule"}]}),0):(output_manager_default.success(successLine(import_chalk.default.bold(target))),0)}export{set as default};
@@ -4,5 +4,5 @@ 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{scopedBudgetCommand}from"./chunk-TJYRGELW.js";import{printBudgetsTable,targetScopeNames,warnUnavailableWebhooks}from"./chunk-L3FMGAEY.js";import{parseBudgetScopeOptions,rejectUnexpectedArgs,resolveBudgetOwner,resolveBudgetTarget,scopeOptionArgs,trackScopeOptions}from"./chunk-UGHD3ALY.js";import"./chunk-VHVBGL5G.js";import"./chunk-ZKQ47ZXI.js";import"./chunk-2AMO2VMV.js";import{budgetPauses,createBudget,findBudget,formatUsdWhole,hasPauseThreshold,isPreviousPlanBudgetError,pausePercentsOutside100,setReceipt,thresholdsForSet,updateBudget}from"./chunk-IG5ACFU6.js";import"./chunk-CJZE7647.js";import"./chunk-D44WCAOX.js";import{scopeCanPause,setSubcommand}from"./chunk-C35SG42R.js";import{printError}from"./chunk-LZ3KMDYM.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-LOA7SZWH.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";var BudgetSetTelemetryClient=class extends TelemetryClient{trackCliOptionOrganization(organization){organization&&this.trackCliOption({option:"organization",value:this.redactedValue})}trackCliOptionProject(project){project&&this.trackCliOption({option:"project",value:this.redactedValue})}trackCliOptionProduct(product){product&&this.trackCliOption({option:"product",value:this.redactedValue})}trackCliOptionAmount(amount){amount!==void 0&&this.trackCliOption({option:"amount",value:this.redactedValue})}trackCliFlagPause(pause){pause&&this.trackCliFlag("pause")}trackCliFlagNoPause(noPause){noPause&&this.trackCliFlag("no-pause")}trackCliOptionWebhook(webhook){webhook&&this.trackCliOption({option:"webhook",value:this.redactedValue})}trackCliFlagNoWebhook(noWebhook){noWebhook&&this.trackCliFlag("no-webhook")}trackCliOptionFormat(format){format&&this.trackCliOption({option:"format",value:format})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};async function set(client,argv){let telemetry=new BudgetSetTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(setSubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(error){return printError(error),2}let{flags:opts,args}=parsedArgs;if(rejectUnexpectedArgs(args,"billing budgets set"))return 2;let scopeArgs=parseBudgetScopeOptions(opts);if("error"in scopeArgs)return output_manager_default.error(scopeArgs.error),2;let scope=scopeArgs.value?.scope??"team",amountFlag=opts["--amount"],pauseFlag=opts["--pause"],noPauseFlag=opts["--no-pause"],webhookFlag=opts["--webhook"],noWebhookFlag=opts["--no-webhook"],pauseSpecified=!!(pauseFlag||noPauseFlag),webhookSpecified=webhookFlag!==void 0||!!noWebhookFlag,formatResult=validateJsonOutput(opts);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let asJson=formatResult.jsonOutput;if(trackScopeOptions(telemetry,opts),telemetry.trackCliOptionAmount(amountFlag),telemetry.trackCliFlagPause(pauseFlag),telemetry.trackCliFlagNoPause(noPauseFlag),telemetry.trackCliOptionWebhook(webhookFlag),telemetry.trackCliFlagNoWebhook(noWebhookFlag),telemetry.trackCliOptionFormat(opts["--format"]?"json":void 0),telemetry.trackCliFlagJson(opts["--json"]),pauseFlag&&noPauseFlag)return output_manager_default.error("Cannot use --pause and --no-pause together."),2;if(webhookFlag!==void 0&&noWebhookFlag)return output_manager_default.error("Cannot use --webhook and --no-webhook together."),2;if(webhookFlag!==void 0&&webhookFlag.trim()==="")return output_manager_default.error("Provide a webhook URL, or use --no-webhook to remove it."),2;if(pauseFlag&&!scopeCanPause(scope))return output_manager_default.error(`${scope[0].toUpperCase()}${scope.slice(1)} budgets can't pause usage. They notify and call the webhook.`),2;if(amountFlag===void 0&&!pauseSpecified&&!webhookSpecified)return output_manager_default.error(`Specify ${getCommandName(`billing budgets set${scopeOptionArgs(scopeArgs.value)} --amount <dollars>`)} to create a budget, or --pause / --webhook to update the existing one.`),2;if(amountFlag!==void 0){if(!Number.isInteger(amountFlag))return output_manager_default.error("A budget must be a whole number of dollars."),2;if(amountFlag<1)return output_manager_default.error("A budget must be at least $1."),2}let resolvedOwner=await resolveBudgetOwner(client,scopeArgs.value);if(!resolvedOwner)return 2;if("error"in resolvedOwner)return output_manager_default.error(resolvedOwner.error),resolvedOwner.usage?2:1;let owner=resolvedOwner.value;output_manager_default.spinner("Fetching budget\u2026");let resolved=await resolveBudgetTarget(client,owner,scopeArgs.value);if("error"in resolved)return output_manager_default.stopSpinner(),output_manager_default.error(resolved.error),resolved.usage?2:1;let target=resolved.value;try{let existing=await findBudget(client,target.selector),amount;if(amountFlag!==void 0)amount=amountFlag;else if(existing)amount=existing.amount;else return output_manager_default.stopSpinner(),output_manager_default.error(`No budget to update ${target.where}. Create one with ${scopedBudgetCommand(client,owner,`billing budgets set${target.args} --amount <dollars>`)}.`),1;let pause;pauseFlag?pause=!0:noPauseFlag?pause=!1:existing?pause=budgetPauses(existing):pause=!1;let webhookUrl=webhookFlag!==void 0?webhookFlag.trim():void 0,thresholds=thresholdsForSet({existing:existing?.thresholds,pause,pauseSpecified,webhookUrl,webhookSpecified});if(pauseFlag&&!hasPauseThreshold(thresholds))return output_manager_default.stopSpinner(),output_manager_default.error("Pause only applies at 100% of the budget. This budget has no 100% threshold."),1;let invalidPause=pausePercentsOutside100(thresholds);if(invalidPause.length>0)return output_manager_default.stopSpinner(),output_manager_default.error(`Pause only applies at 100% of the budget. This budget pauses at ${invalidPause.map(percent=>`${percent}%`).join(", ")}. Re-run with --pause to move it to 100%, or --no-pause to clear it.`),1;output_manager_default.stopSpinner(),pauseFlag&&target.pauses&&!asJson&&output_manager_default.log(`Pause ${target.pauses} at 100% (${formatUsdWhole(amount)}). Production deployments become unavailable.`),output_manager_default.spinner("Saving budget\u2026");let saved,created=!existing;if(existing)try{saved=await updateBudget(client,existing.id,{amount,thresholds,webhookUrl:noWebhookFlag?null:webhookUrl},target.selector)}catch(err){if(!isPreviousPlanBudgetError(err))throw err;let keptWebhookUrl=noWebhookFlag?void 0:webhookUrl??existing.webhook?.url??void 0;saved=await createBudget(client,{amount,thresholds,...target.selector,...keptWebhookUrl?{webhookUrl:keptWebhookUrl}:{}}),created=!0}else saved=await createBudget(client,{amount,thresholds,...target.selector,...webhookUrl?{webhookUrl}:{}});return output_manager_default.stopSpinner(),asJson?(client.stdout.write(`${JSON.stringify(setReceipt({owner,target:target.json,outcome:created?"created":"updated",budget:saved}),null,2)}
7
+ import{scopedBudgetCommand}from"./chunk-FRKDI2ZH.js";import{printBudgetsTable,targetScopeNames,warnUnavailableWebhooks}from"./chunk-Q2R3VQER.js";import{parseBudgetScopeOptions,rejectUnexpectedArgs,resolveBudgetOwner,resolveBudgetTarget,scopeOptionArgs,trackScopeOptions}from"./chunk-66VYZZTY.js";import"./chunk-HQWR3EDU.js";import"./chunk-ZKQ47ZXI.js";import"./chunk-2AMO2VMV.js";import{budgetPauses,createBudget,findBudget,formatUsdWhole,hasPauseThreshold,isPreviousPlanBudgetError,pausePercentsOutside100,setReceipt,thresholdsForSet,updateBudget}from"./chunk-IG5ACFU6.js";import"./chunk-CJZE7647.js";import"./chunk-D44WCAOX.js";import{scopeCanPause,setSubcommand}from"./chunk-C35SG42R.js";import{printError}from"./chunk-CY5KJ42N.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-LOA7SZWH.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";var BudgetSetTelemetryClient=class extends TelemetryClient{trackCliOptionOrganization(organization){organization&&this.trackCliOption({option:"organization",value:this.redactedValue})}trackCliOptionProject(project){project&&this.trackCliOption({option:"project",value:this.redactedValue})}trackCliOptionProduct(product){product&&this.trackCliOption({option:"product",value:this.redactedValue})}trackCliOptionAmount(amount){amount!==void 0&&this.trackCliOption({option:"amount",value:this.redactedValue})}trackCliFlagPause(pause){pause&&this.trackCliFlag("pause")}trackCliFlagNoPause(noPause){noPause&&this.trackCliFlag("no-pause")}trackCliOptionWebhook(webhook){webhook&&this.trackCliOption({option:"webhook",value:this.redactedValue})}trackCliFlagNoWebhook(noWebhook){noWebhook&&this.trackCliFlag("no-webhook")}trackCliOptionFormat(format){format&&this.trackCliOption({option:"format",value:format})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};async function set(client,argv){let telemetry=new BudgetSetTelemetryClient({opts:{store:client.telemetryEventStore}}),parsedArgs,flagsSpecification=getFlagsSpecification(setSubcommand.options);try{parsedArgs=parseArguments(argv,flagsSpecification)}catch(error){return printError(error),2}let{flags:opts,args}=parsedArgs;if(rejectUnexpectedArgs(args,"billing budgets set"))return 2;let scopeArgs=parseBudgetScopeOptions(opts);if("error"in scopeArgs)return output_manager_default.error(scopeArgs.error),2;let scope=scopeArgs.value?.scope??"team",amountFlag=opts["--amount"],pauseFlag=opts["--pause"],noPauseFlag=opts["--no-pause"],webhookFlag=opts["--webhook"],noWebhookFlag=opts["--no-webhook"],pauseSpecified=!!(pauseFlag||noPauseFlag),webhookSpecified=webhookFlag!==void 0||!!noWebhookFlag,formatResult=validateJsonOutput(opts);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let asJson=formatResult.jsonOutput;if(trackScopeOptions(telemetry,opts),telemetry.trackCliOptionAmount(amountFlag),telemetry.trackCliFlagPause(pauseFlag),telemetry.trackCliFlagNoPause(noPauseFlag),telemetry.trackCliOptionWebhook(webhookFlag),telemetry.trackCliFlagNoWebhook(noWebhookFlag),telemetry.trackCliOptionFormat(opts["--format"]?"json":void 0),telemetry.trackCliFlagJson(opts["--json"]),pauseFlag&&noPauseFlag)return output_manager_default.error("Cannot use --pause and --no-pause together."),2;if(webhookFlag!==void 0&&noWebhookFlag)return output_manager_default.error("Cannot use --webhook and --no-webhook together."),2;if(webhookFlag!==void 0&&webhookFlag.trim()==="")return output_manager_default.error("Provide a webhook URL, or use --no-webhook to remove it."),2;if(pauseFlag&&!scopeCanPause(scope))return output_manager_default.error(`${scope[0].toUpperCase()}${scope.slice(1)} budgets can't pause usage. They notify and call the webhook.`),2;if(amountFlag===void 0&&!pauseSpecified&&!webhookSpecified)return output_manager_default.error(`Specify ${getCommandName(`billing budgets set${scopeOptionArgs(scopeArgs.value)} --amount <dollars>`)} to create a budget, or --pause / --webhook to update the existing one.`),2;if(amountFlag!==void 0){if(!Number.isInteger(amountFlag))return output_manager_default.error("A budget must be a whole number of dollars."),2;if(amountFlag<1)return output_manager_default.error("A budget must be at least $1."),2}let resolvedOwner=await resolveBudgetOwner(client,scopeArgs.value);if(!resolvedOwner)return 2;if("error"in resolvedOwner)return output_manager_default.error(resolvedOwner.error),resolvedOwner.usage?2:1;let owner=resolvedOwner.value;output_manager_default.spinner("Fetching budget\u2026");let resolved=await resolveBudgetTarget(client,owner,scopeArgs.value);if("error"in resolved)return output_manager_default.stopSpinner(),output_manager_default.error(resolved.error),resolved.usage?2:1;let target=resolved.value;try{let existing=await findBudget(client,target.selector),amount;if(amountFlag!==void 0)amount=amountFlag;else if(existing)amount=existing.amount;else return output_manager_default.stopSpinner(),output_manager_default.error(`No budget to update ${target.where}. Create one with ${scopedBudgetCommand(client,owner,`billing budgets set${target.args} --amount <dollars>`)}.`),1;let pause;pauseFlag?pause=!0:noPauseFlag?pause=!1:existing?pause=budgetPauses(existing):pause=!1;let webhookUrl=webhookFlag!==void 0?webhookFlag.trim():void 0,thresholds=thresholdsForSet({existing:existing?.thresholds,pause,pauseSpecified,webhookUrl,webhookSpecified});if(pauseFlag&&!hasPauseThreshold(thresholds))return output_manager_default.stopSpinner(),output_manager_default.error("Pause only applies at 100% of the budget. This budget has no 100% threshold."),1;let invalidPause=pausePercentsOutside100(thresholds);if(invalidPause.length>0)return output_manager_default.stopSpinner(),output_manager_default.error(`Pause only applies at 100% of the budget. This budget pauses at ${invalidPause.map(percent=>`${percent}%`).join(", ")}. Re-run with --pause to move it to 100%, or --no-pause to clear it.`),1;output_manager_default.stopSpinner(),pauseFlag&&target.pauses&&!asJson&&output_manager_default.log(`Pause ${target.pauses} at 100% (${formatUsdWhole(amount)}). Production deployments become unavailable.`),output_manager_default.spinner("Saving budget\u2026");let saved,created=!existing;if(existing)try{saved=await updateBudget(client,existing.id,{amount,thresholds,webhookUrl:noWebhookFlag?null:webhookUrl},target.selector)}catch(err){if(!isPreviousPlanBudgetError(err))throw err;let keptWebhookUrl=noWebhookFlag?void 0:webhookUrl??existing.webhook?.url??void 0;saved=await createBudget(client,{amount,thresholds,...target.selector,...keptWebhookUrl?{webhookUrl:keptWebhookUrl}:{}}),created=!0}else saved=await createBudget(client,{amount,thresholds,...target.selector,...webhookUrl?{webhookUrl}:{}});return output_manager_default.stopSpinner(),asJson?(client.stdout.write(`${JSON.stringify(setReceipt({owner,target:target.json,outcome:created?"created":"updated",budget:saved}),null,2)}
8
8
  `),0):(output_manager_default.success(`Budget ${created?"created":"updated"} ${target.where}.`),warnUnavailableWebhooks([saved]),client.stdout.write(printBudgetsTable([saved],void 0,targetScopeNames(target,[saved]))),printWebhookSecret(saved.webhook?.secret),0)}catch(err){return output_manager_default.stopSpinner(),printSetFailure(err,client,owner,target)}}function printSetFailure(err,client,owner,target){return isAPIError(err)?(output_manager_default.error(err.message),err.status>=500&&printInspectBeforeRetry(client,owner,target),1):(output_manager_default.error(err instanceof Error?err.message:"Failed to save budget."),printInspectBeforeRetry(client,owner,target),1)}function printInspectBeforeRetry(client,owner,target){let list=target.args?`billing budgets list${target.args}`:"billing budgets";output_manager_default.log(`If the budget may already exist, run ${scopedBudgetCommand(client,owner,list)} before retrying. Retrying this save can drop a new webhook secret.`)}function printWebhookSecret(secret){secret&&(output_manager_default.log(`Webhook secret: ${secret}`),output_manager_default.log("Store it now \u2014 it cannot be retrieved later."))}export{set as default};
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{applyGitConnectIntent,connectGitRepository,resolveGitConnectIntent,setupAndLink,shouldPromptForRootDirectory}from"./chunk-ODHZ2KFO.js";import"./chunk-R4QGGO5B.js";import"./chunk-W45TAELJ.js";import"./chunk-PLRVNB34.js";import"./chunk-QH6W55RZ.js";import"./chunk-OCLUZVEL.js";import"./chunk-COD3WAUI.js";import"./chunk-ANIA2G6F.js";import"./chunk-4UZDMIRB.js";import"./chunk-ACUK5DV4.js";import"./chunk-L75A5BMY.js";import"./chunk-5TMHRECT.js";import"./chunk-JUAHDOL6.js";import"./chunk-YTRKHRL3.js";import"./chunk-54FY6GJ5.js";import"./chunk-U4Z2MMOF.js";import"./chunk-6VSZ6NDD.js";import"./chunk-5T7OTGUG.js";import"./chunk-REJLEESP.js";import"./chunk-ISSNEDG5.js";import"./chunk-2PQM7TCT.js";import"./chunk-6MQAEEY6.js";import"./chunk-ZKNEIE44.js";import"./chunk-KR4DMT3I.js";import"./chunk-HAGBKLAS.js";import"./chunk-OS3Y2WGS.js";import"./chunk-5XWTMJ5A.js";import"./chunk-K36E52T6.js";import"./chunk-7YKFF6CE.js";import"./chunk-3UZE566G.js";import"./chunk-SZO73QV5.js";import"./chunk-TAAWMNNL.js";import"./chunk-25565AGS.js";import"./chunk-PVASGBEF.js";import"./chunk-IYBBF4IU.js";import"./chunk-ZC4E5ZZT.js";import"./chunk-NBTFAXL4.js";import"./chunk-TJUZVODP.js";import"./chunk-IQ7FPAI4.js";import"./chunk-YJNMDXEG.js";import"./chunk-CDGGZKIG.js";import"./chunk-CJZE7647.js";import"./chunk-Y2FVJ7YO.js";import"./chunk-BPIGFKNN.js";import"./chunk-LZ3KMDYM.js";import"./chunk-3G3FQYMW.js";import"./chunk-2A6NUKKE.js";import"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-54XPSLKL.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";export{applyGitConnectIntent,connectGitRepository,setupAndLink as default,resolveGitConnectIntent,shouldPromptForRootDirectory};
7
+ import{applyGitConnectIntent,connectGitRepository,resolveGitConnectIntent,setupAndLink,shouldPromptForRootDirectory}from"./chunk-Z7LKJDWH.js";import"./chunk-MQKAVUTX.js";import"./chunk-W45TAELJ.js";import"./chunk-PLRVNB34.js";import"./chunk-QH6W55RZ.js";import"./chunk-YCFIEWWM.js";import"./chunk-COD3WAUI.js";import"./chunk-ANIA2G6F.js";import"./chunk-R2JNS7E3.js";import"./chunk-NZNC5EU4.js";import"./chunk-L75A5BMY.js";import"./chunk-5TMHRECT.js";import"./chunk-JUAHDOL6.js";import"./chunk-YTRKHRL3.js";import"./chunk-54FY6GJ5.js";import"./chunk-U4Z2MMOF.js";import"./chunk-3M5PFRXQ.js";import"./chunk-5T7OTGUG.js";import"./chunk-REJLEESP.js";import"./chunk-ISSNEDG5.js";import"./chunk-JV4KLSS2.js";import"./chunk-3MU3JC2I.js";import"./chunk-ZKNEIE44.js";import"./chunk-KR4DMT3I.js";import"./chunk-HAGBKLAS.js";import"./chunk-4BTYJMGY.js";import"./chunk-7CWCAPEU.js";import"./chunk-OFZYIAUF.js";import"./chunk-7YKFF6CE.js";import"./chunk-3UZE566G.js";import"./chunk-SZO73QV5.js";import"./chunk-TAAWMNNL.js";import"./chunk-25565AGS.js";import"./chunk-PVASGBEF.js";import"./chunk-AVRED7XL.js";import"./chunk-XQNFBZZW.js";import"./chunk-NBTFAXL4.js";import"./chunk-TJUZVODP.js";import"./chunk-IQ7FPAI4.js";import"./chunk-YJNMDXEG.js";import"./chunk-FSZJSIOF.js";import"./chunk-CJZE7647.js";import"./chunk-Y2FVJ7YO.js";import"./chunk-BPIGFKNN.js";import"./chunk-CY5KJ42N.js";import"./chunk-3G3FQYMW.js";import"./chunk-3XTN2FNA.js";import"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-OYB676KT.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7HLAWGY2.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";export{applyGitConnectIntent,connectGitRepository,setupAndLink as default,resolveGitConnectIntent,shouldPromptForRootDirectory};
@@ -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{skillsSubcommand}from"./chunk-QOLGACFD.js";import{printError}from"./chunk-LZ3KMDYM.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import{AGENT_REASON,buildCommandWithGlobalFlags,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import{printAlignedLabel}from"./chunk-M7FED5YP.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";import{randomBytes}from"node:crypto";import{homedir}from"node:os";import{lstat,mkdir,readdir,readFile,realpath,rename,rm,writeFile}from"node:fs/promises";import{basename,dirname,isAbsolute,join,relative,resolve,sep}from"node:path";function readBundledCliSkill(){return{name:"vercel-cli",files:[{path:"command/vercel.md",content:`---
7
+ import{skillsSubcommand}from"./chunk-QOLGACFD.js";import{printError}from"./chunk-CY5KJ42N.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import{AGENT_REASON,buildCommandWithGlobalFlags,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import{printAlignedLabel}from"./chunk-M7FED5YP.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";import{randomBytes}from"node:crypto";import{homedir}from"node:os";import{lstat,mkdir,readdir,readFile,realpath,rename,rm,writeFile}from"node:fs/promises";import{basename,dirname,isAbsolute,join,relative,resolve,sep}from"node:path";function readBundledCliSkill(){return{name:"vercel-cli",files:[{path:"command/vercel.md",content:`---
8
8
  description: Use the Vercel CLI skill for deployment, configuration, and troubleshooting workflows.
9
9
  ---
10
10
 
@@ -281,47 +281,7 @@ Inspect group membership before changing it. Removing a child requires removing
281
281
  Group changes that cross a billing limit can require interactive confirmation. Preserve that handoff rather than trying to force a non-interactive path. Group deletion removes every project from the group.
282
282
 
283
283
  For local development, the proxy needs the default app's configuration. In a polyrepo, fetch it or provide its local path. Run local apps on the ports expected by the proxy; apps not running locally can fall back to production, so confirm where requests are going before treating a test as local-only.
284
- `},{path:"references/monitoring-and-debugging.md",content:`# Monitoring & Debugging
285
-
286
- ## Diagnostic Ladder
287
-
288
- 1. Identify the project, scope, and time window from supplied context and deployment evidence.
289
- 2. Inspect the relevant deployment's status, source, target, timestamps, and aliases.
290
- 3. Query logs and metrics for the affected window; narrow by the observed error, route, or deployment.
291
- 4. If evidence is unavailable, distinguish permission, subscription, retention, and no-data cases. Use other available evidence without treating missing telemetry as healthy behavior.
292
-
293
- For an incident with a supplied deployment URL, inspect that exact identity before deriving a project name. For broader regressions, compare nearby deployments with a meaningful good/bad boundary.
294
-
295
- ## Build Failures
296
-
297
- Start with deployment metadata and build logs before exploring source control. Capture the install command, package manager, build command, monorepo scope, restored cache, and first fatal error. Fix the causal error before chasing incidental warnings.
298
-
299
- If source is implicated, inspect the files named by the trace and relevant package, lockfile, or build configuration. Compare a nearby successful deployment's source and build inputs. Other branches passing does not by itself disprove a dependency, cache, or configuration explanation.
300
-
301
- Separate the proven root cause, likely trigger, and remaining uncertainty. Validate a build hypothesis with the resulting deployment's final state rather than reporting success while it is still building.
302
-
303
- ## Build Performance and Machine Sizing
304
-
305
- Inspect a successful deployment's build logs for current cores/memory, total duration, and slowest phases. An implausible \`0ms\` is missing telemetry, not an instant build. Recommend a larger machine only with evidence of CPU or memory pressure; otherwise address the dominant phase.
306
-
307
- ## Logs and Metrics
308
-
309
- Choose the log source by the question. Runtime logs, the default, are application output: messages, errors, and stack traces from functions, middleware, and other producers. CDN requests (\`logs requests\`) are one record per request with status, method, cache result, and path; use them for traffic, status-code, and caching questions. They exclude background function executions. For one request, filter runtime logs by its request ID to see what it logged, and use its trace for timing.
310
-
311
- Logs return a bounded result and exit. Set \`--since\` and \`--until\` to the affected window rather than relying on the short default. Filter with \`--query\` in the source's KQL-inspired syntax, and read that source's help for its fields and operators. Search runtime messages with unquoted words, grouping several words with \`AND\`, for example \`json AND (parse OR (unexpected AND token))\`; quotes work only in field values such as \`requestId:"\u2026"\`, and quoted bare text is rejected. Older level, source, status-code, request-ID, and search options were removed; express them as query fields. Select a deployment with \`--deployment\`. Without a deployment or environment selector, logs cover every environment of the project, so scope explicitly when the question concerns production or one deployment. Only team-owned projects are supported.
312
-
313
- In JSON Lines output, each record is under \`data\`, and a final \`summary\` reports the window searched, whether more records matched, and excluded intervals. Check \`pagination.hasMore\` and \`excludedIntervals\` before concluding that something did not happen: a full page or a coverage gap is not absence. To read further, pass the summary's \`pagination.next\` to \`--next\` instead of raising the limit or widening the window. The cursor keeps the original target, filter, and window; only the limit may change. Paging is best-effort at page boundaries, so do not present counts summed across pages as exact.
314
-
315
- CDN request history beyond the plan's free window, and filters on fields that need Observability Plus or a Priority project, fail with an access error that names the requirement. Report that as an entitlement limit, not as missing traffic or an outage.
316
-
317
- Discover metric IDs, dimensions, aggregations, and filter syntax from the installed schema/help. Copy their exact names instead of maintaining a parallel list or translating dimensions to a guessed naming convention. Schema discovery is team-scoped; project filtering belongs to the metric query.
318
-
319
- Use bounded windows and group counts for metrics. Aggregate trends, sampled details, and individual request traces support different conclusions; state the evidence behind a diagnosis.
320
-
321
- ## Preview Access
322
-
323
- The CLI's authenticated preview request path handles Deployment Protection. Use it when the execution environment can reach deployment hosts instead of disabling protection or managing bypass secrets unnecessarily. A network or permission limitation is not evidence that the deployment is broken.
324
- `},{path:"references/monorepos.md",content:`# Monorepos on Vercel
284
+ `},{path:"references/monitoring-and-debugging.md",content:"# Monitoring & Debugging\n\n## Diagnostic Ladder\n\n1. Identify the project, scope, and time window from supplied context and deployment evidence.\n2. Inspect the relevant deployment's status, source, target, timestamps, and aliases.\n3. Query logs and metrics for the affected window; narrow by the observed error, route, or deployment.\n4. If evidence is unavailable, distinguish permission, subscription, retention, and no-data cases. Use other available evidence without treating missing telemetry as healthy behavior.\n\nFor an incident with a supplied deployment URL, inspect that exact identity before deriving a project name. For broader regressions, compare nearby deployments with a meaningful good/bad boundary.\n\n## Build Failures\n\nStart with deployment metadata and build logs before exploring source control. Capture the install command, package manager, build command, monorepo scope, restored cache, and first fatal error. Fix the causal error before chasing incidental warnings.\n\nIf source is implicated, inspect the files named by the trace and relevant package, lockfile, or build configuration. Compare a nearby successful deployment's source and build inputs. Other branches passing does not by itself disprove a dependency, cache, or configuration explanation.\n\nSeparate the proven root cause, likely trigger, and remaining uncertainty. Validate a build hypothesis with the resulting deployment's final state rather than reporting success while it is still building.\n\n## Build Performance and Machine Sizing\n\nInspect a successful deployment's build logs for current cores/memory, total duration, and slowest phases. An implausible `0ms` is missing telemetry, not an instant build. Recommend a larger machine only with evidence of CPU or memory pressure; otherwise address the dominant phase.\n\n## Logs and Metrics\n\nChoose the log source by the question. Runtime logs, the default, are application output: messages, errors, and stack traces from functions, middleware, and other producers. CDN requests (`logs requests`) are one record per request with status, method, cache result, and path; use them for traffic, status-code, and caching questions. They exclude background function executions. For one request, filter runtime logs by its request ID to see what it logged, and use its trace for timing.\n\nLogs return a bounded result and exit. Set `--since` and `--until` to the affected window rather than relying on the short default. Filter with `--query` in the source's KQL-inspired syntax, and read that source's help for its fields and operators. Search runtime messages with unquoted words, grouping several words with `AND`, for example `json AND (parse OR (unexpected AND token))`; quotes work only in field values such as `requestId:\"\u2026\"`, and quoted bare text is rejected. Older level, source, status-code, request-ID, and search options were removed; express them as query fields. Select a deployment with `--deployment`. Without a deployment or environment selector, logs cover every environment of the project, so scope explicitly when the question concerns production or one deployment. Only team-owned projects are supported.\n\nIn JSON Lines output, each record is under `data`, and a final `summary` reports the window searched, whether more records matched, and excluded intervals. Check `pagination.hasMore` and `excludedIntervals` before concluding that something did not happen: a full page or a coverage gap is not absence. To read further, pass the summary's `pagination.next` to `--next` instead of raising the limit or widening the window. The cursor keeps the original target, filter, and window; only the limit may change. Paging is best-effort at page boundaries, so do not present counts summed across pages as exact.\n\nCDN request history beyond the plan's free window, and filters on fields that need Observability Plus or a Priority project, fail with an access error that names the requirement. Report that as an entitlement limit, not as missing traffic or an outage.\n\nDiscover metric IDs, dimensions, aggregations, and filter syntax from the installed schema/help. Copy their exact names instead of maintaining a parallel list or translating dimensions to a guessed naming convention. Schema discovery is team-scoped; project filtering belongs to the metric query.\n\nFor a ratio or comparison, such as an error rate, a cache hit rate, or several aggregations side by side, send one query with `vercel metrics --data` (JSON, or `-` for stdin) instead of joining separate queries: it takes several metrics with their own filters plus formulas over them, and `vercel metrics --help` documents the fields. The query replaces the metric argument and query options; `--since`, `--until`, `--project`, and `--all` fill only what it leaves out.\n\nUse bounded windows and group counts for metrics. Aggregate trends, sampled details, and individual request traces support different conclusions; state the evidence behind a diagnosis.\n\n## Preview Access\n\nThe CLI's authenticated preview request path handles Deployment Protection. Use it when the execution environment can reach deployment hosts instead of disabling protection or managing bypass secrets unnecessarily. A network or permission limitation is not evidence that the deployment is broken.\n"},{path:"references/monorepos.md",content:`# Monorepos on Vercel
325
285
 
326
286
  ## Project Boundaries
327
287
 
@@ -329,13 +289,15 @@ Use repository directory mappings when multiple applications have separate Verce
329
289
 
330
290
  The project's Root Directory is a project setting, not a \`vercel.json\` property. Keep each app's framework configuration and dependencies in its configured root.
331
291
 
292
+ Set the Root Directory with \`vercel project update --root-directory <DIR>\`. Use \`--source-files-outside-root-directory\` or \`--no-source-files-outside-root-directory\` to include or exclude source files outside of the Root Directory in the build, and \`--git-branch <BRANCH>\` to set the Production Branch.
293
+
332
294
  Separate projects suit independently deployed applications, such as a Next.js frontend and Python backend. [Vercel Services](https://vercel.com/docs/services) can host multiple frameworks in one project when they need coordinated deployment and routing. Choose based on those requirements rather than mandating one layout.
333
295
 
334
296
  ## Build Orchestration
335
297
 
336
298
  Turborepo and Nx need explicit build tasks/targets and correct dependency ordering. Preserve the repository's existing build graph and framework-specific outputs. Vercel can generate framework-aware build commands; use a manual override only when the default does not express the intended app scope.
337
299
 
338
- An ignored build step can skip deployments when the app's dependencies are unchanged. Include dependency graph and cache inputs in a build investigation before assuming that a missing or different build is a deployment failure.
300
+ An ignored build step can skip deployments when the app's dependencies are unchanged. Set its command with \`vercel project update --ignore-command <COMMAND>\`; the build is ignored when the command exits with code 0. Include dependency graph and cache inputs in a build investigation before assuming that a missing or different build is a deployment failure.
339
301
  `},{path:"references/node-backends.md",content:`# Node Backends on Vercel
340
302
 
341
303
  Vercel supports Node.js backend frameworks as first-class apps. Express and Hono are the most common, but Fastify, Elysia, NestJS, H3, and Koa are also supported. Your app is the entrypoint \u2014 not the \`api/\` folder. No rewrites, no build scripts. Just export your app and deploy.
@@ -549,7 +511,7 @@ description: Guides deployment, configuration, and troubleshooting with the Verc
549
511
 
550
512
  # Vercel CLI Skill
551
513
 
552
- Use the installed CLI's help for command discovery, arguments, flags, defaults, and examples: start with \`vercel --help\`, then narrow to the command or subcommand. Reuse help already read for that version. These references cover decisions, dependencies, and recovery across operations.
514
+ Use the installed CLI's help for command discovery, arguments, flags, defaults, and examples. When you know the task but not the command, run \`vercel help search "<task>" --with-help\`: it lists up to 10 matching commands with their summaries, then prints the help page of the first one. If the first one is a group, its page lists the commands in the group. After the commands, the list has up to 5 API endpoints, each as a \`vercel api\` command with a \`<PLACEHOLDER>\` for each required input. Use one when no command in the list does the task. It works offline and prints JSON with \`--json\`. Otherwise start with \`vercel --help\`, then narrow to the command or subcommand. Reuse help already read for that version. These references cover decisions, dependencies, and recovery across operations.
553
515
 
554
516
  If an older installation lacks a command or needed guidance, retain the workflow caveats and consult the matching documentation. Preserve the project's chosen CLI version; do not upgrade it merely to make a remembered command work.
555
517
 
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-2VBFQZ72.js";import{warnDeprecatedSubcommand}from"./chunk-6GKP6VUF.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";var TAGS_CONFIG={ls:["ls","list"],inspect:["inspect","get"]};async function tags(client,argv,telemetry){let{subcommand,args,subcommandOriginal}=getSubcommand(argv,TAGS_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(TAGS_CONFIG):`Unknown "vcr tag" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr tag --help"),when:"Show valid tag subcommands"}]},2),output_manager_default.error(`${message} Run \`vercel vcr tag --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-IVYLE77U.js")).default(client,args,telemetry);case"inspect":return subcommandOriginal==="get"&&warnDeprecatedSubcommand(client,"vcr tag get","vcr tag inspect"),(await import("./inspect-CRP6NH6E.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled tags subcommand: ${subcommand}`),1}}export{tags as default};
7
+ import{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-2VBFQZ72.js";import{warnDeprecatedSubcommand}from"./chunk-6GKP6VUF.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";var TAGS_CONFIG={ls:["ls","list"],inspect:["inspect","get"]};async function tags(client,argv,telemetry){let{subcommand,args,subcommandOriginal}=getSubcommand(argv,TAGS_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(TAGS_CONFIG):`Unknown "vcr tag" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr tag --help"),when:"Show valid tag subcommands"}]},2),output_manager_default.error(`${message} Run \`vercel vcr tag --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-4DY2PURD.js")).default(client,args,telemetry);case"inspect":return subcommandOriginal==="get"&&warnDeprecatedSubcommand(client,"vcr tag get","vcr tag inspect"),(await import("./inspect-EUK2S5FJ.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled tags subcommand: ${subcommand}`),1}}export{tags as default};
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{table}from"./chunk-CJZE7647.js";import{typesSubcommand}from"./chunk-UDZJCD5W.js";import{printError}from"./chunk-LZ3KMDYM.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatErrorJson(code,message){return`${JSON.stringify({error:{code,message}},null,2)}
7
+ import{table}from"./chunk-CJZE7647.js";import{typesSubcommand}from"./chunk-UDZJCD5W.js";import{printError}from"./chunk-CY5KJ42N.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);function formatErrorJson(code,message){return`${JSON.stringify({error:{code,message}},null,2)}
8
8
  `}async function types(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(typesSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return printError(err),2}let flags=parsedArgs.flags;telemetry.trackCliOptionFormat(flags["--format"]);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;output_manager_default.spinner("Fetching event types...");try{let response=await client.fetch("/v1/events/types"),eventTypes=response.types??[];if(jsonOutput)return client.stdout.write(`${JSON.stringify(response,null,2)}
9
9
  `),0;if(eventTypes.length===0)return output_manager_default.log("No activity event types found."),0;let rows=[[import_chalk.default.bold(import_chalk.default.cyan("Name")),import_chalk.default.bold(import_chalk.default.cyan("Description"))],...eventTypes.map(eventType=>[eventType.name,eventType.deprecated?`${eventType.description??"-"} (Deprecated)`:eventType.description??"-"])],tableOutput=table(rows,{hsep:4}).split(`
10
10
  `).map(line=>line.trimEnd()).join(`
@@ -4,5 +4,5 @@ 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{printRuleMutationReceipt}from"./chunk-AMHVWM5D.js";import"./chunk-GHNHUSVK.js";import{resolveRulesProject,resolveRulesTeam}from"./chunk-QIWCDJY6.js";import"./chunk-FUASV2IR.js";import{emitRulesArgParseError,fetchRule,handleRulesApiError,outputRulesError,readRuleBody,rulesItemPath}from"./chunk-RXEXEY5E.js";import"./chunk-ZJNDLFZ7.js";import"./chunk-GHAY4PSD.js";import"./chunk-D3M2JG5C.js";import"./chunk-TOTTVS5P.js";import"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import"./chunk-CJZE7647.js";import{monitorsUpdateSubcommand}from"./chunk-5ZCSFPWG.js";import{printError}from"./chunk-LZ3KMDYM.js";import"./chunk-2A6NUKKE.js";import"./chunk-N465KVPA.js";import"./chunk-DTUEHPME.js";import"./chunk-54XPSLKL.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";function sameScope(left,right){return JSON.stringify(left)===JSON.stringify(right)}function scopeForRule(client,type,scope,flags,jsonOutput){return flags["--project"]?type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]}:type==="custom"?outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>."):{type:"all"}}async function resolveUpdateScope(client,flags,jsonOutput,ruleId){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,`monitors update ${ruleId}`):resolveRulesTeam(client,jsonOutput)}function writeRuleResult(client,api,jsonOutput,action,rule){jsonOutput?client.stdout.write(`${JSON.stringify({[api.itemKey]:rule},null,2)}
7
+ import{printRuleMutationReceipt}from"./chunk-WOD4NOA2.js";import"./chunk-GHNHUSVK.js";import{resolveRulesProject,resolveRulesTeam}from"./chunk-IIOIVUQV.js";import"./chunk-WEQK6GS2.js";import{emitRulesArgParseError,fetchRule,handleRulesApiError,outputRulesError,readRuleBody,rulesItemPath}from"./chunk-P35EU77P.js";import"./chunk-ZJNDLFZ7.js";import"./chunk-GHAY4PSD.js";import"./chunk-D3M2JG5C.js";import"./chunk-TOTTVS5P.js";import"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import"./chunk-CJZE7647.js";import{monitorsUpdateSubcommand}from"./chunk-5ZCSFPWG.js";import{printError}from"./chunk-CY5KJ42N.js";import"./chunk-3XTN2FNA.js";import"./chunk-PNWRO3XW.js";import"./chunk-DTUEHPME.js";import"./chunk-OYB676KT.js";import"./chunk-M7FED5YP.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-LUX4PBJL.js";import"./chunk-MTZYPCZ7.js";import"./chunk-OPORM35X.js";import"./chunk-D6REP5QQ.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-7HLAWGY2.js";import"./chunk-MXTC4ZAQ.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";function sameScope(left,right){return JSON.stringify(left)===JSON.stringify(right)}function scopeForRule(client,type,scope,flags,jsonOutput){return flags["--project"]?type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]}:type==="custom"?outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>."):{type:"all"}}async function resolveUpdateScope(client,flags,jsonOutput,ruleId){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,`monitors update ${ruleId}`):resolveRulesTeam(client,jsonOutput)}function writeRuleResult(client,api,jsonOutput,action,rule){jsonOutput?client.stdout.write(`${JSON.stringify({[api.itemKey]:rule},null,2)}
8
8
  `):printRuleMutationReceipt(action,rule,client.argv)}async function update(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsUpdateSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors update <monitor-id> --project <name-or-id>"),printError(error),2}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);let ruleId=parsedArgs.args[0];if(!ruleId)return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS",`Missing monitor ID. Example: ${packageName} monitors update <monitor-id> --body <file>`);let hasScopeFlag=!!(flags["--project"]||flags["--all"]);if(!flags["--body"]&&!hasScopeFlag)return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS","Provide --body <PATH>, --project <name-or-id>, or --all.");let body=flags["--body"]?readRuleBody(client,flags["--body"],format.jsonOutput):{};if(typeof body=="number")return body;if(Object.hasOwn(body,"type")&&body.type!=="built-in"&&body.type!=="custom")return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE","When provided, update body type must be a supported monitor type.");if(hasScopeFlag&&Object.hasOwn(body,"ruleScope"))return outputRulesError(client,format.jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both.");let scope=await resolveUpdateScope(client,flags,format.jsonOutput,ruleId);if(typeof scope=="number")return scope;try{let existing;if(hasScopeFlag){output_manager_default.spinner("Fetching monitor\u2026"),existing=await fetchRule(client,api,scope,ruleId);let desiredScope=scopeForRule(client,existing.type,scope,flags,format.jsonOutput);if(typeof desiredScope=="number")return desiredScope;if(!sameScope(existing.ruleScope,desiredScope))body.ruleScope=desiredScope;else if(Object.keys(body).length===0)return output_manager_default.stopSpinner(),writeRuleResult(client,api,format.jsonOutput,"Unchanged",existing),0}output_manager_default.spinner("Updating monitor\u2026");let response=await client.fetch(rulesItemPath(api,scope.teamId,ruleId),{method:"PATCH",body});return writeRuleResult(client,api,format.jsonOutput,"Updated",response[api.itemKey]),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{update as default};