@vercel/cli-support 66.1.0 → 66.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/chunks/{add-6NUHCAMT.js → add-3P4HAZZZ.js} +1 -1
  2. package/dist/chunks/{add-KYJZONXY.js → add-ECNHL7CN.js} +1 -1
  3. package/dist/chunks/{add-GP25D55V.js → add-U6KDXZT2.js} +1 -1
  4. package/dist/chunks/{alerts-MQ6Y3UFA.js → alerts-NLLCERTK.js} +1 -1
  5. package/dist/chunks/{build-4VEEWVS5.js → build-HM5K3QD7.js} +1 -1
  6. package/dist/chunks/{chunk-CMFG6TYZ.js → chunk-2ANPVGOC.js} +1 -1
  7. package/dist/chunks/{chunk-OY53XE4Y.js → chunk-2HW7KKB5.js} +1 -1
  8. package/dist/chunks/{chunk-J5IDU6YN.js → chunk-2WQCAJBU.js} +1 -1
  9. package/dist/chunks/{chunk-46GQTOCP.js → chunk-3FMDKPIO.js} +1 -1
  10. package/dist/chunks/{chunk-2OI7RMPJ.js → chunk-3HCRJO4D.js} +1 -1
  11. package/dist/chunks/{chunk-ZL3UMJMJ.js → chunk-56QPAEAW.js} +1 -1
  12. package/dist/chunks/{chunk-WLALGPNL.js → chunk-5O77DSX4.js} +1 -1
  13. package/dist/chunks/{chunk-PSJQBMDE.js → chunk-5VGAD2ZS.js} +1 -1
  14. package/dist/chunks/{chunk-3SRUG2XR.js → chunk-6FDTVIJM.js} +1 -1
  15. package/dist/chunks/{chunk-KCKZGL4X.js → chunk-6QEQI5SY.js} +1 -1
  16. package/dist/chunks/chunk-6U7TRWBO.js +12 -0
  17. package/dist/chunks/{chunk-EMV6ASJU.js → chunk-76VUFE3K.js} +1 -1
  18. package/dist/chunks/{chunk-ILPBSKOR.js → chunk-7KPAYK2N.js} +1 -1
  19. package/dist/chunks/{chunk-O2UBBZTC.js → chunk-7OMVAZSA.js} +1 -1
  20. package/dist/chunks/{chunk-XP5QV6EX.js → chunk-A3MC5BEZ.js} +1 -1
  21. package/dist/chunks/{chunk-C64AK7SW.js → chunk-A5FPKXEK.js} +1 -1
  22. package/dist/chunks/{chunk-VC4TEOSY.js → chunk-A72AM25W.js} +1 -1
  23. package/dist/chunks/chunk-A7E3EGDM.js +7 -0
  24. package/dist/chunks/{chunk-5T7OTGUG.js → chunk-AMOI3EAW.js} +1 -1
  25. package/dist/chunks/{chunk-A4CEVPNX.js → chunk-BLLDEVSD.js} +1 -1
  26. package/dist/chunks/{chunk-7EDTU7GV.js → chunk-CRX7RINU.js} +1 -1
  27. package/dist/chunks/{chunk-PLRVNB34.js → chunk-DMZLFZBX.js} +1 -1
  28. package/dist/chunks/{chunk-5PQVVJMD.js → chunk-EIBQNIN7.js} +1 -1
  29. package/dist/chunks/{chunk-REKWV3XW.js → chunk-F52YOIDM.js} +1 -1
  30. package/dist/chunks/{chunk-AL34A6JM.js → chunk-FDVLR2HV.js} +1 -1
  31. package/dist/chunks/{chunk-LBH6HTF5.js → chunk-G56HLQLB.js} +1 -1
  32. package/dist/chunks/{chunk-J5JLWWYJ.js → chunk-HIV3C763.js} +1 -1
  33. package/dist/chunks/{chunk-W45TAELJ.js → chunk-IF644EL7.js} +1 -1
  34. package/dist/chunks/{chunk-F6XCERYP.js → chunk-IWIXET6Q.js} +1 -1
  35. package/dist/chunks/{chunk-AIA52XVI.js → chunk-JGUMBEQH.js} +1 -1
  36. package/dist/chunks/{chunk-KKJY4HB3.js → chunk-K4KP5UR3.js} +1 -1
  37. package/dist/chunks/{chunk-E6C6UHGI.js → chunk-KBJNREND.js} +1 -1
  38. package/dist/chunks/{chunk-6BN7Y3GF.js → chunk-KKO6DF57.js} +1 -1
  39. package/dist/chunks/{chunk-MTNNSFL7.js → chunk-KLETLUS6.js} +1 -1
  40. package/dist/chunks/{chunk-XSZ463Z3.js → chunk-M23GYM4J.js} +1 -1
  41. package/dist/chunks/{chunk-HW54BXJL.js → chunk-MU3DV4IW.js} +1 -1
  42. package/dist/chunks/{chunk-OTFYFJVZ.js → chunk-NGHAU23V.js} +1 -1
  43. package/dist/chunks/{chunk-XS36NEJQ.js → chunk-O2HDXF5B.js} +1 -1
  44. package/dist/chunks/{chunk-4CBYOZ7M.js → chunk-O3IQMUYI.js} +1 -1
  45. package/dist/chunks/{chunk-B46RWOXX.js → chunk-O4WJDJIL.js} +2 -2
  46. package/dist/chunks/{chunk-HFWVGTJT.js → chunk-PB7GGE3Q.js} +1 -1
  47. package/dist/chunks/{chunk-L3L26DLH.js → chunk-POFKUONR.js} +1 -1
  48. package/dist/chunks/{chunk-IRRSTHQA.js → chunk-POKRDE5J.js} +1 -1
  49. package/dist/chunks/{chunk-QJY3QFK6.js → chunk-QQNN5X7M.js} +1 -1
  50. package/dist/chunks/{chunk-J2KVSCWW.js → chunk-QZMBBLOQ.js} +1 -1
  51. package/dist/chunks/{chunk-UPV6QB2B.js → chunk-R5U4P7WK.js} +1 -1
  52. package/dist/chunks/{chunk-QSYFRLA3.js → chunk-RX5HH3T6.js} +1 -1
  53. package/dist/chunks/{chunk-6E754HMC.js → chunk-TSLAMIUI.js} +1 -1
  54. package/dist/chunks/{chunk-56UCXPGB.js → chunk-TT4PL5J2.js} +1 -1
  55. package/dist/chunks/{chunk-IOEFVPTI.js → chunk-TVELM5HH.js} +1 -1
  56. package/dist/chunks/{chunk-Q6ACGTJN.js → chunk-UMGQUJYO.js} +1 -1
  57. package/dist/chunks/{chunk-4IWNDTTL.js → chunk-UWISBHZI.js} +1 -1
  58. package/dist/chunks/{chunk-ZEYMERXT.js → chunk-WCCKCQ43.js} +1 -1
  59. package/dist/chunks/{chunk-3TIWB2MI.js → chunk-X26PXKHC.js} +1 -1
  60. package/dist/chunks/{chunk-EUU3FHCX.js → chunk-XL2PHD4X.js} +5 -5
  61. package/dist/chunks/{chunk-KUPNU64U.js → chunk-Y4D7IX3M.js} +1 -1
  62. package/dist/chunks/{chunk-LBN6L62Y.js → chunk-YALFS5SH.js} +2 -2
  63. package/dist/chunks/{chunk-CT77BGSW.js → chunk-YJP25FL6.js} +1 -1
  64. package/dist/chunks/{chunk-TR4ENDFQ.js → chunk-YON6DNQB.js} +1 -1
  65. package/dist/chunks/{chunk-AGRNLZMT.js → chunk-ZPXTTQJT.js} +1 -1
  66. package/dist/chunks/{chunk-ISMUINRX.js → chunk-ZXNR7CNU.js} +1 -1
  67. package/dist/chunks/{clear-PLSWE5JH.js → clear-YJRG7CEK.js} +1 -1
  68. package/dist/chunks/{compile-vercel-config-TPNGPYJK.js → compile-vercel-config-GB4X7U3B.js} +1 -1
  69. package/dist/chunks/{config-3LXTEKBJ.js → config-BYHUSTMY.js} +1 -1
  70. package/dist/chunks/{config-ORDPO5PD.js → config-L6EQFXGH.js} +1 -1
  71. package/dist/chunks/config-validator.mjs +1 -1
  72. package/dist/chunks/{contract-CZXP7RPX.js → contract-UAIZFVBK.js} +1 -1
  73. package/dist/chunks/{delete-UEWNNK7C.js → delete-CBLBTPK2.js} +1 -1
  74. package/dist/chunks/{delete-KJ7CLFZQ.js → delete-SY56OAFL.js} +1 -1
  75. package/dist/chunks/describe-Z6RRPRGF.js +25 -0
  76. package/dist/chunks/{detect-projects-WY4EZGJR.js → detect-projects-WO6GTQRY.js} +1 -1
  77. package/dist/chunks/{detect-services-U5TKJEZQ.js → detect-services-PFR6C4LZ.js} +1 -1
  78. package/dist/chunks/{disable-E2PLVAMG.js → disable-E6GTV4NN.js} +1 -1
  79. package/dist/chunks/{discard-7K3RIVQD.js → discard-NW6RI3KK.js} +1 -1
  80. package/dist/chunks/{edit-JEZLR66F.js → edit-E4SQL4UK.js} +1 -1
  81. package/dist/chunks/{edit-7M4DWDE3.js → edit-K7NN4KRI.js} +1 -1
  82. package/dist/chunks/{enable-2OTTYO2D.js → enable-AY4NQ65W.js} +1 -1
  83. package/dist/chunks/{export-LZYSWZSI.js → export-CW5Q5MDC.js} +1 -1
  84. package/dist/chunks/{future-JFSLQCY6.js → future-3QDT3U5W.js} +1 -1
  85. package/dist/chunks/{generate-cert-for-deploy-RVWMMSU5.js → generate-cert-for-deploy-FQQZEMTU.js} +1 -1
  86. package/dist/chunks/{image-N5UWUO57.js → image-H4HIURNR.js} +1 -1
  87. package/dist/chunks/{import-builders-ZQPVTQQ2.js → import-builders-K6D5OFHY.js} +1 -1
  88. package/dist/chunks/{inspect-GUVBQAGQ.js → inspect-73R4TFWK.js} +1 -1
  89. package/dist/chunks/{inspect-IVCRI5DD.js → inspect-DO5J2KGE.js} +1 -1
  90. package/dist/chunks/{inspect-24Z5WVGT.js → inspect-K23UNJUJ.js} +1 -1
  91. package/dist/chunks/{inspect-3TBVD5FW.js → inspect-QXRA3OU5.js} +1 -1
  92. package/dist/chunks/{inspect-33TQGRQI.js → inspect-WHGJZAK3.js} +1 -1
  93. package/dist/chunks/{list-33O4PH2I.js → list-ARMBYZH7.js} +1 -1
  94. package/dist/chunks/{list-EZZOK7IM.js → list-EUJMPCD6.js} +1 -1
  95. package/dist/chunks/{list-3ESADOVD.js → list-G6GK67GL.js} +1 -1
  96. package/dist/chunks/{login-W4JXYJ23.js → login-JSDPVUSB.js} +1 -1
  97. package/dist/chunks/{login-2P4WOXB7.js → login-UIKDCM7X.js} +1 -1
  98. package/dist/chunks/{logs-O63LK26L.js → logs-NICAAFXU.js} +1 -1
  99. package/dist/chunks/{ls-KWYUFBK6.js → ls-5STG344U.js} +1 -1
  100. package/dist/chunks/{ls-HEJYAEEP.js → ls-5ULLIYRA.js} +1 -1
  101. package/dist/chunks/{ls-76ADTPOK.js → ls-E4Q4XPAI.js} +1 -1
  102. package/dist/chunks/{ls-H3VWUODQ.js → ls-H7YD27XH.js} +1 -1
  103. package/dist/chunks/{ls-3VWIGXMW.js → ls-HJVYRGQ3.js} +1 -1
  104. package/dist/chunks/{ls-PCSUAESE.js → ls-JDKTIVX6.js} +1 -1
  105. package/dist/chunks/{ls-XBDD2PTU.js → ls-ZW2V7TME.js} +1 -1
  106. package/dist/chunks/{migrate-experimental-services-KLE3GFQP.js → migrate-experimental-services-XEKA373Q.js} +1 -1
  107. package/dist/chunks/{mutate-Y2EYEJJH.js → mutate-2GXUWHWY.js} +1 -1
  108. package/dist/chunks/{notifications-7R3WPEAA.js → notifications-YG44KHCP.js} +1 -1
  109. package/dist/chunks/{open-F7WEBT7F.js → open-GGWBQAKT.js} +1 -1
  110. package/dist/chunks/{permissions-KNTBYUW6.js → permissions-SJVEJGPH.js} +1 -1
  111. package/dist/chunks/{plugin-offer-BLSGVXGC.js → plugin-offer-VNXKPNBY.js} +1 -1
  112. package/dist/chunks/{prompt-missing-credentials-3BYXOPF6.js → prompt-missing-credentials-RJS5U5IJ.js} +1 -1
  113. package/dist/chunks/{publish-PZZVEXQX.js → publish-GGFL7JVW.js} +1 -1
  114. package/dist/chunks/{pull-NTASY5FX.js → pull-36Z6T5C7.js} +1 -1
  115. package/dist/chunks/{purchase-domain-if-available-LD33O4FB.js → purchase-domain-if-available-IS62APPK.js} +1 -1
  116. package/dist/chunks/{push-PWMJ4P2K.js → push-I37EBJMR.js} +1 -1
  117. package/dist/chunks/{query-JNPBVPKH.js → query-UEIQYCYU.js} +1 -1
  118. package/dist/chunks/{raw-query-K2TZPPTU.js → raw-query-AY5G6GUK.js} +1 -1
  119. package/dist/chunks/{reauthenticate-ETNE4G4R.js → reauthenticate-U3XWAOMM.js} +1 -1
  120. package/dist/chunks/{reorder-3RXPWZ7P.js → reorder-JC3L7CJO.js} +1 -1
  121. package/dist/chunks/{reply-AP2J72NZ.js → reply-5KJBWMPI.js} +1 -1
  122. package/dist/chunks/{resolve-6CU2VKM6.js → resolve-3ZU3DHFZ.js} +1 -1
  123. package/dist/chunks/{resolve-agent-team-TPNHXGAG.js → resolve-agent-team-XPLMABIA.js} +1 -1
  124. package/dist/chunks/{restore-ID6E666C.js → restore-S4AWLRK7.js} +1 -1
  125. package/dist/chunks/{rm-CE52BWMX.js → rm-FXS5DZLW.js} +1 -1
  126. package/dist/chunks/{rm-F2RNFFYF.js → rm-PO6GFUKD.js} +1 -1
  127. package/dist/chunks/{rm-E52J2HHP.js → rm-QFQTQKZL.js} +1 -1
  128. package/dist/chunks/{rm-BYAPI3BU.js → rm-X47BKCHC.js} +1 -1
  129. package/dist/chunks/{rm-EFOCCDJP.js → rm-YAKU3AIF.js} +1 -1
  130. package/dist/chunks/{rule-inspect-BETOJVBA.js → rule-inspect-DTHMNVKJ.js} +1 -1
  131. package/dist/chunks/{schema-MQATDMAH.js → schema-DB45ARBN.js} +1 -1
  132. package/dist/chunks/{schema-WXLPOMLR.js → schema-NMGD2R2B.js} +1 -1
  133. package/dist/chunks/{select-org-GPHGJT4L.js → select-org-MUG3UCJA.js} +1 -1
  134. package/dist/chunks/{set-6F6G2E7V.js → set-MMOLNY72.js} +1 -1
  135. package/dist/chunks/{setup-and-link-ELQIKRXV.js → setup-and-link-5OA6HGVD.js} +1 -1
  136. package/dist/chunks/{tags-OMGWOZHO.js → tags-GBA56ZTZ.js} +1 -1
  137. package/dist/chunks/{update-5TDDKIDK.js → update-7H2XLOJU.js} +1 -1
  138. package/dist/chunks/{usage-KV2NOTX3.js → usage-V2GS5NFF.js} +1 -1
  139. package/dist/chunks/{validate-config-TK6LTRGY.js → validate-config-DODT2AQL.js} +1 -1
  140. package/dist/commands/build/index.js +1 -1
  141. package/dist/commands/deploy/index.js +4 -4
  142. package/dist/commands/dev/index.js +2 -2
  143. package/dist/commands/env/index.js +1 -1
  144. package/dist/commands/link/index.js +1 -1
  145. package/dist/commands/list/index.js +1 -1
  146. package/dist/commands/project/index.js +1 -1
  147. package/dist/commands/tunnel/index.js +1 -1
  148. package/dist/commands-account.js +2 -2
  149. package/dist/commands-ai.js +1 -1
  150. package/dist/commands-blob.js +1 -1
  151. package/dist/commands-core.js +6 -6
  152. package/dist/commands-deployments.js +1 -1
  153. package/dist/commands-flags.js +1 -1
  154. package/dist/commands-integrations.js +1 -1
  155. package/dist/commands-observability.js +2 -2
  156. package/dist/commands-routing.js +13 -13
  157. package/dist/index.js +3 -3
  158. package/dist/internal-build.js +1 -1
  159. package/dist/package.json +40 -40
  160. package/dist/version.mjs +1 -1
  161. package/package.json +42 -42
  162. package/dist/chunks/chunk-QH6W55RZ.js +0 -7
  163. package/dist/chunks/chunk-XI7556MQ.js +0 -12
  164. package/dist/chunks/describe-FM3U4YEC.js +0 -25
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{parseSubcommandArguments}from"./chunk-6E754HMC.js";import{printError}from"./chunk-CY5KJ42N.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-PNWRO3XW.js";import{getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{getGlobalFlagsFromArgs}from"./chunk-CFJBDBYH.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var ROUTE_TYPE_LABELS={rewrite:"Rewrite",redirect:"Redirect",set_status:"Set Status",transform:"Transform"};function getRouteTypeLabel(rule){return rule.routeType?ROUTE_TYPE_LABELS[rule.routeType]??"-":"-"}var SRC_SYNTAX_LABELS={equals:"Exact Match","path-to-regexp":"Pattern",regex:"Regex"};function getSrcSyntaxLabel(rule){let syntax=rule.srcSyntax??"regex";return SRC_SYNTAX_LABELS[syntax]}function isTargetTransform(transform){return"target"in transform}var import_chalk=__toESM(require_source(),1);function withGlobalFlags2(client,commandTemplate){return withGlobalFlags(client,commandTemplate,{preserveProject:!0})}function shellQuoteRouteIdentifierForSuggestion(identifier){return identifier.includes(" ")?identifier.includes("'")?identifier.includes('"')?`"${identifier.replace(/"/g,'\\"')}"`:`"${identifier}"`:`'${identifier}'`:identifier}async function parseSubcommandArgs(argv,command,client){let parsedArgs;try{parsedArgs=parseSubcommandArguments(argv,command)}catch(err){if(client?.nonInteractive){let rawMessage=err instanceof Error?err.message:String(err),flags=getGlobalFlagsFromArgs(client.argv.slice(2),{preserveProject:!0}),message=rawMessage,next=[{command:getCommandNamePlain(`routes ${command.name} ${flags.join(" ")}`.trim()),when:"fix options and retry"}],aiIdx=argv.indexOf("--ai");return(aiIdx!==-1&&(aiIdx===argv.length-1||argv[aiIdx+1]!==void 0&&argv[aiIdx+1].startsWith("-"))||/option requires argument.*--ai|--ai.*requires argument/i.test(rawMessage))&&(command.name==="add"||command.name==="update")&&(message=command.name==="add"?'--ai requires a description. Example: routes add --ai <description> --yes --non-interactive. Replace <description> with your text; use shell quotes if it contains spaces (e.g. --ai "Redirect /old to /new").':"--ai requires a description. Example: routes update <name-or-id> --ai <description> --yes --non-interactive. Replace placeholders; use shell quotes for <description> if it contains spaces.",next=[{command:withGlobalFlags2(client,command.name==="add"?"routes add --ai <description> --yes":"routes update <name-or-id> --ai <description> --yes"),when:"replace <description> with your text (quote it in the shell if it contains spaces), then run"},{command:getCommandNamePlain(`routes ${command.name} --help ${flags.join(" ")}`.trim()),when:"see all options"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},2),2}return printError(err),2}return parsedArgs}async function confirmAction(client,skipConfirmation,message,details){return skipConfirmation?!0:client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:`${message} Re-run with --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"re-run with --yes to confirm"}]}),process.exit(1),!1):(details&&output_manager_default.print(` ${details}
7
+ import{parseSubcommandArguments}from"./chunk-TSLAMIUI.js";import{printError}from"./chunk-CY5KJ42N.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-PNWRO3XW.js";import{getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{getGlobalFlagsFromArgs}from"./chunk-CFJBDBYH.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var ROUTE_TYPE_LABELS={rewrite:"Rewrite",redirect:"Redirect",set_status:"Set Status",transform:"Transform"};function getRouteTypeLabel(rule){return rule.routeType?ROUTE_TYPE_LABELS[rule.routeType]??"-":"-"}var SRC_SYNTAX_LABELS={equals:"Exact Match","path-to-regexp":"Pattern",regex:"Regex"};function getSrcSyntaxLabel(rule){let syntax=rule.srcSyntax??"regex";return SRC_SYNTAX_LABELS[syntax]}function isTargetTransform(transform){return"target"in transform}var import_chalk=__toESM(require_source(),1);function withGlobalFlags2(client,commandTemplate){return withGlobalFlags(client,commandTemplate,{preserveProject:!0})}function shellQuoteRouteIdentifierForSuggestion(identifier){return identifier.includes(" ")?identifier.includes("'")?identifier.includes('"')?`"${identifier.replace(/"/g,'\\"')}"`:`"${identifier}"`:`'${identifier}'`:identifier}async function parseSubcommandArgs(argv,command,client){let parsedArgs;try{parsedArgs=parseSubcommandArguments(argv,command)}catch(err){if(client?.nonInteractive){let rawMessage=err instanceof Error?err.message:String(err),flags=getGlobalFlagsFromArgs(client.argv.slice(2),{preserveProject:!0}),message=rawMessage,next=[{command:getCommandNamePlain(`routes ${command.name} ${flags.join(" ")}`.trim()),when:"fix options and retry"}],aiIdx=argv.indexOf("--ai");return(aiIdx!==-1&&(aiIdx===argv.length-1||argv[aiIdx+1]!==void 0&&argv[aiIdx+1].startsWith("-"))||/option requires argument.*--ai|--ai.*requires argument/i.test(rawMessage))&&(command.name==="add"||command.name==="update")&&(message=command.name==="add"?'--ai requires a description. Example: routes add --ai <description> --yes --non-interactive. Replace <description> with your text; use shell quotes if it contains spaces (e.g. --ai "Redirect /old to /new").':"--ai requires a description. Example: routes update <name-or-id> --ai <description> --yes --non-interactive. Replace placeholders; use shell quotes for <description> if it contains spaces.",next=[{command:withGlobalFlags2(client,command.name==="add"?"routes add --ai <description> --yes":"routes update <name-or-id> --ai <description> --yes"),when:"replace <description> with your text (quote it in the shell if it contains spaces), then run"},{command:getCommandNamePlain(`routes ${command.name} --help ${flags.join(" ")}`.trim()),when:"see all options"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},2),2}return printError(err),2}return parsedArgs}async function confirmAction(client,skipConfirmation,message,details){return skipConfirmation?!0:client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:`${message} Re-run with --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"re-run with --yes to confirm"}]}),process.exit(1),!1):(details&&output_manager_default.print(` ${details}
8
8
  `),await client.input.confirm(message,!1))}function formatCondition(condition){let parts=[import_chalk.default.gray(`[${condition.type}]`)];if(condition.key&&parts.push(import_chalk.default.cyan(condition.key)),condition.value!==void 0){let formatted=typeof condition.value=="string"?condition.value:JSON.stringify(condition.value);parts.push(condition.key?`= ${formatted}`:formatted)}return parts.join(" ")}var TRANSFORM_TYPE_LABELS={"request.headers":"Request Header","request.query":"Request Query","response.headers":"Response Header","request.path":"Request Path"},TRANSFORM_OP_LABELS={set:"set",append:"append",delete:"delete"};function formatTransform(transform,includeType=!0){let opLabel=TRANSFORM_OP_LABELS[transform.op]??transform.op,key=isTargetTransform(transform)?typeof transform.target.key=="string"?transform.target.key:JSON.stringify(transform.target.key):"path",parts=[];if(includeType){let typeLabel=TRANSFORM_TYPE_LABELS[transform.type]??transform.type;parts.push(import_chalk.default.gray(`[${typeLabel}]`))}if(parts.push(import_chalk.default.yellow(opLabel),import_chalk.default.cyan(key)),transform.args!==void 0&&transform.op!=="delete"){let argsStr=Array.isArray(transform.args)?transform.args.join(", "):transform.args;parts.push(`= ${argsStr}`)}return parts.join(" ")}function parsePosition(position){if(position==="start")return{placement:"start"};if(position==="end")return{placement:"end"};if(position.startsWith("after:")){let referenceId=position.slice(6);if(!referenceId)throw new Error('Position "after:" requires a route ID');return{placement:"after",referenceId}}if(position.startsWith("before:")){let referenceId=position.slice(7);if(!referenceId)throw new Error('Position "before:" requires a route ID');return{placement:"before",referenceId}}throw new Error(`Invalid position: "${position}". Use: start, end, after:<id>, or before:<id>`)}async function offerAutoPromote(client,projectId,version,hadExistingStagingVersion,opts){let{default:updateRouteVersion}=await import("./update-route-version-KWK5S4UW.js"),{default:stamp}=await import("./stamp-TKONNIJ5.js");if(output_manager_default.print(`
9
9
  ${import_chalk.default.gray(`This change is staged. Run ${import_chalk.default.cyan(withGlobalFlags2(client,"routes publish"))} to make it live, or ${import_chalk.default.cyan(withGlobalFlags2(client,"routes discard-staging"))} to undo.`)}
10
10
  `),!hadExistingStagingVersion&&!opts.skipPrompts){if(output_manager_default.print(`
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{ensureLink}from"./chunk-B46RWOXX.js";import{argvHasNonInteractive}from"./chunk-PNWRO3XW.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-EUU3FHCX.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{LinkRequiredError,ProjectNotFound}from"./chunk-GOI2VVI7.js";async function getProjectByCwdOrLink({autoConfirm,nonInteractive,client,commandName,cwd,projectNameOrId,forReadOnlyCommand,skipOwnerLookup}){if(projectNameOrId){let project=await getProjectByNameOrId(client,projectNameOrId);if(project instanceof ProjectNotFound)throw project;return project}let effectiveNonInteractive=nonInteractive??client.nonInteractive??argvHasNonInteractive(client.argv);if(forReadOnlyCommand&&effectiveNonInteractive){let resolvedCwd=await resolveProjectCwd(cwd??client.cwd),link=await getLinkedProject(client,{cwd:resolvedCwd,skipOwnerLookup});if(link.status==="linked"&&link.project)return link.project;if(link.status==="error"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}throw new LinkRequiredError}let linkedProject=await ensureLink(commandName,client,cwd??client.cwd,{autoConfirm,nonInteractive,skipOwnerLookup});if(typeof linkedProject=="number"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}return linkedProject.project}export{getProjectByCwdOrLink};
7
+ import{ensureLink}from"./chunk-O4WJDJIL.js";import{argvHasNonInteractive}from"./chunk-PNWRO3XW.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-XL2PHD4X.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{LinkRequiredError,ProjectNotFound}from"./chunk-GOI2VVI7.js";async function getProjectByCwdOrLink({autoConfirm,nonInteractive,client,commandName,cwd,projectNameOrId,forReadOnlyCommand,skipOwnerLookup}){if(projectNameOrId){let project=await getProjectByNameOrId(client,projectNameOrId);if(project instanceof ProjectNotFound)throw project;return project}let effectiveNonInteractive=nonInteractive??client.nonInteractive??argvHasNonInteractive(client.argv);if(forReadOnlyCommand&&effectiveNonInteractive){let resolvedCwd=await resolveProjectCwd(cwd??client.cwd),link=await getLinkedProject(client,{cwd:resolvedCwd,skipOwnerLookup});if(link.status==="linked"&&link.project)return link.project;if(link.status==="error"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}throw new LinkRequiredError}let linkedProject=await ensureLink(commandName,client,cwd??client.cwd,{autoConfirm,nonInteractive,skipOwnerLookup});if(typeof linkedProject=="number"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}return linkedProject.project}export{getProjectByCwdOrLink};
@@ -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{getNativePackageName}from"./chunk-T7GKQYWA.js";import{HOMEBREW_UPGRADE_COMMAND,execPackageManager,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,packageManagerInvocation,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-F6XCERYP.js";import{require_semver}from"./chunk-BPUANOGW.js";import{withDirectoryLock}from"./chunk-TABMJZVW.js";import{progress}from"./chunk-U56NHYAH.js";import{require_ci_info}from"./chunk-KDCODXVL.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{getCachedUsername,require_lib}from"./chunk-EUU3FHCX.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_fetch_dist_tags=__commonJS({"src/util/get-latest-version/fetch-dist-tags.cjs"(exports,module){"use strict";var https=__require("https");function fetchDistTags(name,options){let timeout=options&&options.timeout||3e3,agent=new https.Agent({keepAlive:!0,maxSockets:15}),headers={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},url=`https://registry.npmjs.org/-/package/${name}/dist-tags`;return new Promise(resolve2=>{let timer=setTimeout(()=>{req.destroy(),resolve2(void 0)},timeout),req=https.get(url,{agent,headers},res=>{let buf="";res.on("data",chunk=>{buf+=chunk}),res.on("end",()=>{clearTimeout(timer);try{if(res.statusCode&&res.statusCode>=400){resolve2(void 0);return}resolve2(JSON.parse(buf))}catch{resolve2(void 0)}})});req.on("error",()=>{clearTimeout(timer),resolve2(void 0)})})}module.exports={fetchDistTags}}});function getWhoamiCachedAnswer(args,authConfig){return args.includes("--cached")?getCachedUsername(authConfig):void 0}var import_semver=__toESM(require_semver(),1);import{spawn}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return execPackageManager(command,args,{cwd,env,timeout:15e3})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
7
+ import{getNativePackageName}from"./chunk-T7GKQYWA.js";import{HOMEBREW_UPGRADE_COMMAND,execPackageManager,getUpdateCommandInfo,getUpgradePackageManager,isGlobal,packageManagerInvocation,trustedUpgradeDirectory,trustedUpgradeEnvironment}from"./chunk-IWIXET6Q.js";import{require_semver}from"./chunk-BPUANOGW.js";import{withDirectoryLock}from"./chunk-TABMJZVW.js";import{progress}from"./chunk-U56NHYAH.js";import{require_ci_info}from"./chunk-KDCODXVL.js";import{getInstallRoot,isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{getCachedUsername,require_lib}from"./chunk-XL2PHD4X.js";import{pkg_default}from"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_lib2=__commonJS({"../../node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js"(exports,module){"use strict";var os=__require("os"),paths=__require("path"),isWinOS=/^win/i.test(process.platform);function normalize_path(path){return paths.normalize(paths.join(path,"."))}var base=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TMPDIR||env.TEMP||env.TMP),object},windows=()=>{let{env}=process,object={};return object.home=()=>normalize_path(os.homedir?os.homedir():env.USERPROFILE||paths.join(env.HOMEDRIVE,env.HOMEPATH)||env.HOME),object.temp=()=>normalize_path(os.tmpdir?os.tmpdir():env.TEMP||env.TMP||paths.join(env.LOCALAPPDATA||env.SystemRoot||env.windir,"Temp")),object},_OSPaths=class __OSPaths{constructor(){let OSPaths=function(){return new __OSPaths};this._fn=OSPaths;let extension=isWinOS?windows():base();return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _OSPaths}});var require_lib3=__commonJS({"../../node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js"(exports,module){"use strict";var path=__require("path"),osPaths=require_lib2(),linux=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(osPaths.home()||osPaths.temp(),".cache"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(osPaths.home()||osPaths.temp(),".config"),object.data=()=>process.env.XDG_DATA_HOME||path.join(osPaths.home()||osPaths.temp(),".local","share"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(osPaths.home()||osPaths.temp(),".local","state"),object},macos=()=>{let object={};return object.cache=()=>process.env.XDG_CACHE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Caches"),object.config=()=>process.env.XDG_CONFIG_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Preferences"),object.data=()=>process.env.XDG_DATA_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"Application Support"),object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>process.env.XDG_STATE_HOME||path.join(path.join(osPaths.home()||osPaths.temp(),"Library"),"State"),object},windows=()=>{let object={};return object.cache=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_CACHE_HOME||path.join(localAppData,"xdg.cache")},object.config=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_CONFIG_HOME||path.join(appData,"xdg.config")},object.data=()=>{let appData=process.env.APPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Roaming");return process.env.XDG_DATA_HOME||path.join(appData,"xdg.data")},object.runtime=()=>process.env.XDG_RUNTIME_DIR||void 0,object.state=()=>{let localAppData=process.env.LOCALAPPDATA||path.join(osPaths.home()||osPaths.temp(),"AppData","Local");return process.env.XDG_STATE_HOME||path.join(localAppData,"xdg.state")},object},_XDGPortable=()=>{let XDGPortable=function(){return _XDGPortable()},extension={};return/^darwin$/i.test(process.platform)?extension=macos():/^win/i.test(process.platform)?extension=windows():extension=linux(),extension.configDirs=()=>{let dirs=[];return dirs.push(extension.config()),process.env.XDG_CONFIG_DIRS&&dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter)),dirs},extension.dataDirs=()=>{let dirs=[];return dirs.push(extension.data()),process.env.XDG_DATA_DIRS&&dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter)),dirs},Object.keys(extension).forEach(key=>{XDGPortable[key]=extension[key]}),XDGPortable};module.exports=_XDGPortable()}});var require_xdg_app_paths=__commonJS({"../../node_modules/.pnpm/xdg-app-paths@5.1.0/node_modules/xdg-app-paths/index.js"(exports,module){"use strict";var path=__require("path"),os=__require("os"),xdg=require_lib3(),isWinOS=/^win/i.test(process.platform);function _normalizeOptions(options,isolated){if(options=options||{},typeof options!="object"&&(options={isolated:options}),options.isolated=options.isolated===void 0||options.isolated===null?isolated:options.isolated,typeof options.isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof options.isolated}`);return options}var base=(name,isolated)=>{let object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.cache(),options.isolated?name:"")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.config(),options.isolated?name:"")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.data(),options.isolated?name:"")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),path.join(xdg.state(),options.isolated?name:"")),object.configDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.configDirs().map(s=>path.join(s,options.isolated?name:""))),object.dataDirs=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.dataDirs().map(s=>path.join(s,options.isolated?name:""))),object},windows=(name,isolated)=>{let{env}=process,homedir=os.homedir(),tmpdir=os.tmpdir(),appData=env.APPDATA||path.join(homedir||tmpdir,"AppData","Roaming"),localAppData=env.LOCALAPPDATA||path.join(homedir||tmpdir,"AppData","Local"),object={};return object.cache=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CACHE_HOME?path.join(xdg.cache(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","Cache")),object.config=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_CONFIG_HOME?path.join(xdg.config(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Config")),object.data=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_DATA_HOME?path.join(xdg.data(),options.isolated?name:""):path.join(appData,options.isolated?name:"","Data")),object.runtime=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),xdg.runtime()?path.join(xdg.runtime(),options.isolated?name:""):void 0),object.state=(options={isolated:null})=>(options=_normalizeOptions(options,isolated),!options.isolated||env.XDG_STATE_HOME?path.join(xdg.state(),options.isolated?name:""):path.join(localAppData,options.isolated?name:"","State")),object.configDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.config(options)];return env.XDG_CONFIG_DIRS&&dirs.push(...env.XDG_CONFIG_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object.dataDirs=(options={isolated:null})=>{options=_normalizeOptions(options,isolated);let dirs=[object.data(options)];return env.XDG_DATA_DIRS&&dirs.push(...env.XDG_DATA_DIRS.split(path.delimiter).map(s=>path.join(s,options.isolated?name:""))),dirs},object},_XDGAppPaths=class __XDGAppPaths{constructor(options={name:null,suffix:null,isolated:!0}){let XDGAppPaths2=function(options2={name:null,suffix:null,isolated:!0}){return new __XDGAppPaths(options2)};this._fn=XDGAppPaths2,options=options||{},typeof options!="object"&&(options={name:options});let name=options.name||"";if(typeof name!="string")throw new TypeError(`Expected string for "name" argument, got ${typeof name}`);let suffix=options.suffix||"";if(typeof suffix!="string")throw new TypeError(`Expected string for "suffix" argument, got ${typeof suffix}`);let isolated=options.isolated===void 0||options.isolated===null?!0:options.isolated;if(typeof isolated!="boolean")throw new TypeError(`Expected boolean for "isolated" argument, got ${typeof isolated}`);name||(name=path.parse(process.pkg?process.execPath:__require.main?__require.main.filename:process.argv[0]).name),suffix&&(name+=suffix),this._fn.$name=()=>name,this._fn.$isolated=()=>isolated;let extension=isWinOS?windows(name,isolated):base(name,isolated);return Object.keys(extension).forEach(key=>{this._fn[key]=extension[key]}),this._fn}};module.exports=new _XDGAppPaths}});var require_fetch_dist_tags=__commonJS({"src/util/get-latest-version/fetch-dist-tags.cjs"(exports,module){"use strict";var https=__require("https");function fetchDistTags(name,options){let timeout=options&&options.timeout||3e3,agent=new https.Agent({keepAlive:!0,maxSockets:15}),headers={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},url=`https://registry.npmjs.org/-/package/${name}/dist-tags`;return new Promise(resolve2=>{let timer=setTimeout(()=>{req.destroy(),resolve2(void 0)},timeout),req=https.get(url,{agent,headers},res=>{let buf="";res.on("data",chunk=>{buf+=chunk}),res.on("end",()=>{clearTimeout(timer);try{if(res.statusCode&&res.statusCode>=400){resolve2(void 0);return}resolve2(JSON.parse(buf))}catch{resolve2(void 0)}})});req.on("error",()=>{clearTimeout(timer),resolve2(void 0)})})}module.exports={fetchDistTags}}});function getWhoamiCachedAnswer(args,authConfig){return args.includes("--cached")?getCachedUsername(authConfig):void 0}var import_semver=__toESM(require_semver(),1);import{spawn}from"child_process";function renderUpgradeProgress(current,total,phase){let bar=progress(current,total);output_manager_default.spinner(bar?`Upgrading Vercel CLI [${bar}] (${current}/${total})${phase?` ${phase}`:""}`:phase||"Upgrading Vercel CLI\u2026",0)}function execFileStdout(command,args,cwd,env=trustedUpgradeEnvironment){return execPackageManager(command,args,{cwd,env,timeout:15e3})}function parseVersionOutput(stdout){for(let line of[stdout.trim(),...stdout.trim().split(`
8
8
  `).reverse()])try{let value=JSON.parse(line),parsed=Array.isArray(value)&&value.length===1?value[0]:value,version=typeof parsed=="string"?parsed:typeof parsed?.data=="string"?parsed.data:void 0;if(version&&import_semver.default.valid(version))return version}catch{let version=line.trim();if(import_semver.default.valid(version))return version}}async function getLatestPackageVersion(packageManager,installArgs,cwd,global,env,bypassMinReleaseAge=!0){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let manager=getUpgradePackageManager(packageManager),queryArgs=[...manager.metadataArgs(packageSpecifier),...bypassMinReleaseAge?manager.releaseAgeBypassArgs:[]];try{let stdout=await execFileStdout(packageManager,queryArgs,cwd,env);return parseVersionOutput(stdout)}catch(error){output_manager_default.debug(`Failed to resolve the latest Vercel CLI version: ${error instanceof Error?error.message:String(error)}`);return}}async function getInstalledPackageVersion(packageManager,installArgs,cwd,global){let packageSpecifier=installArgs.find(arg=>arg.endsWith("@latest"));if(!packageSpecifier)return;let packageName=packageSpecifier.slice(0,-7);try{let stdout=await execFileStdout(packageManager,["list",packageName,"--depth=0","--json",...global?["--global"]:[]],cwd),parsed=JSON.parse(stdout),projects=Array.isArray(parsed)?parsed:[parsed];for(let project of projects){let version=project?.dependencies?.[packageName]?.version??project?.devDependencies?.[packageName]?.version??project?.optionalDependencies?.[packageName]?.version;if(typeof version=="string"&&import_semver.default.valid(version))return version}}catch(error){output_manager_default.debug(`Failed to read the installed Vercel CLI version: ${error instanceof Error?error.message:String(error)}`)}}function isVersionCurrent(current,latest){return import_semver.default.valid(current)&&import_semver.default.valid(latest)?import_semver.default.gte(current,latest):current===latest}function pinPackageVersion(args,version){return args.map(arg=>arg.endsWith("@latest")?`${arg.slice(0,-6)}${version}`:arg)}async function getMinReleaseAgeContext(packageManager,cwd,global){let setting=packageManager==="pnpm"?"minimumReleaseAge":"min-release-age";try{let raw=(await execFileStdout(packageManager,["config","get",setting,"--json",...global?["--global"]:[]],cwd)).trim(),value=raw===""||raw==="undefined"?void 0:JSON.parse(raw);if(!(value==null||value===""||value==="undefined")){let age=typeof value=="number"||typeof value=="string"&&value.trim()!==""?Number(value):NaN;if(!Number.isFinite(age)||age<0)return`Could not determine ${packageManager}'s configured minimum release age.`;let minutes=packageManager==="pnpm"?age:age*1440,duration=minutes>0&&minutes%60===0?`${minutes/60} ${minutes===60?"hour":"hours"}`:`${minutes} ${minutes===1?"minute":"minutes"}`;return`${packageManager} ${setting} is configured to ${duration}.`}if(packageManager==="pnpm"){let version=parseVersionOutput(await execFileStdout(packageManager,["--version"],cwd));if(version&&!import_semver.default.prerelease(version)&&import_semver.default.gte(version,"11.0.0"))return`pnpm ${version} defaults to a minimum release age of 24 hours (1440 minutes); no explicit minimumReleaseAge setting was reported.`}return`${packageManager} did not report a configured minimum release age.`}catch{return`Could not determine ${packageManager}'s configured minimum release age.`}}function isMinReleaseAgeError(packageManager,stdout,stderr){let installerOutput=`${stdout}
9
9
  ${stderr}`;return packageManager==="pnpm"?installerOutput.includes("ERR_PNPM_NO_MATURE_MATCHING_VERSION")||installerOutput.includes("ERR_PNPM_NO_MATCHING_VERSION")&&installerOutput.includes("satisfies the specs but was released at"):packageManager==="npm"?/\bETARGET\b/.test(installerOutput)&&installerOutput.includes("with a date before")||/min-release-age cannot be provided/i.test(installerOutput):!1}function setMinReleaseAgeBypass(client,enabled){client.config={...client.config,updates:{...client.config.updates,bypassMinReleaseAge:enabled}},client.writeToConfigFile()}async function executeHomebrewUpgrade(env=trustedUpgradeEnvironment){let[brew,...args]=HOMEBREW_UPGRADE_COMMAND.split(" ");output_manager_default.debug(`Executing: ${HOMEBREW_UPGRADE_COMMAND}`);let result=await new Promise(resolve2=>{let settled=!1,brewProcess=spawn(brew,args,{cwd:trustedUpgradeDirectory,env:{...env},stdio:"inherit",shell:!1});brewProcess.on("error",spawnError=>{settled||(settled=!0,resolve2({code:1,spawnError}))}),brewProcess.on("close",code=>{settled||(settled=!0,resolve2({code:code??1}))})});return result.spawnError?(output_manager_default.error(`Failed to run Homebrew: ${result.spawnError.message}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`),1):(result.code!==0&&(output_manager_default.error(`Homebrew upgrade failed with exit code ${result.code}`),output_manager_default.log(`You can try running the command manually: ${HOMEBREW_UPGRADE_COMMAND}`)),result.code)}function executeAutomaticUpgrade(client,env=trustedUpgradeEnvironment){return executeUpgrade("latest",client,!1,!0,env,"package-manager")}async function executeUpgrade(targetVersion,client,bypassMinReleaseAge=!1,explicitTarget=!1,env=trustedUpgradeEnvironment,releaseAgePolicy="newest",outcome){let totalSteps=targetVersion?2:3;renderUpgradeProgress(0,totalSteps,"Resolving installer\u2026");let{command:updateCommand,global,packageManager}=await getUpdateCommandInfo(env).catch(error=>{throw output_manager_default.stopSpinner(),error}),[command,...args]=updateCommand.split(" "),cwd=global?trustedUpgradeDirectory:process.cwd(),bypassArgs=getUpgradePackageManager(packageManager).releaseAgeBypassArgs;if(bypassMinReleaseAge&&bypassArgs.length===0)return output_manager_default.stopSpinner(),output_manager_default.error(`Minimum release-age bypass is not supported for ${packageManager}. Run the upgrade without --bypass-min-release-age, or configure release-age settings in ${packageManager} directly.`),1;bypassMinReleaseAge&&client&&client.config.updates?.bypassMinReleaseAge!==!0&&setMinReleaseAgeBypass(client,!0);let versionBefore=pkg_default.version,installLatestTag=explicitTarget&&targetVersion==="latest",resolvedTargetVersion=installLatestTag?void 0:targetVersion;if(targetVersion||(renderUpgradeProgress(1,totalSteps,"Checking for updates\u2026"),resolvedTargetVersion=await getLatestPackageVersion(packageManager,args,cwd,global,env,releaseAgePolicy==="newest")),!resolvedTargetVersion&&!installLatestTag)return output_manager_default.stopSpinner(),output_manager_default.error("Failed to resolve the latest Vercel CLI version."),1;if(!explicitTarget&&resolvedTargetVersion&&isVersionCurrent(versionBefore,resolvedTargetVersion))return renderUpgradeProgress(totalSteps,totalSteps),output_manager_default.stopSpinner(),output_manager_default.log(`No upgrade available. Vercel CLI is already up to date (v${versionBefore}).`),0;let installArgs=resolvedTargetVersion?pinPackageVersion(args,resolvedTargetVersion):args,shouldBypass=releaseAgePolicy==="newest"&&bypassArgs.length>0&&(bypassMinReleaseAge||client?.config.updates?.bypassMinReleaseAge===!0);shouldBypass&&(installArgs=[...installArgs,...bypassArgs]);let runInstall=currentArgs=>{let installCommand=[command,...currentArgs].join(" ");return output_manager_default.debug(`Executing: ${installCommand} (cwd: ${cwd})`),new Promise(resolve2=>{let stdout=[],stderr=[],invocation;try{invocation=packageManagerInvocation(command,currentArgs,env)}catch(spawnError){resolve2({code:1,stdout:"",stderr:"",spawnError});return}let upgradeProcess=spawn(invocation.file,invocation.args,{cwd,env:{...env},stdio:["inherit","pipe","pipe"],shell:!1,windowsVerbatimArguments:invocation.windowsVerbatimArguments});upgradeProcess.stdout?.on("data",data=>{stdout.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stdout] ${data.toString().trimEnd()}`)}),upgradeProcess.stderr?.on("data",data=>{stderr.push(Uint8Array.from(data)),output_manager_default.debug(`[upgrade stderr] ${data.toString().trimEnd()}`)});let settled=!1;upgradeProcess.on("error",spawnError=>{settled||(settled=!0,resolve2({code:1,stdout:"",stderr:"",spawnError}))}),upgradeProcess.on("close",code=>{settled||(settled=!0,resolve2({code:code??1,stdout:Buffer.concat(stdout).toString(),stderr:Buffer.concat(stderr).toString()}))})})};renderUpgradeProgress(targetVersion?1:2,totalSteps,"Installing\u2026");let result=await runInstall(installArgs),usedAllowedRelease=!1;if(result.code!==0&&!result.spawnError&&releaseAgePolicy==="newest"&&!shouldBypass&&bypassArgs.length>0&&isMinReleaseAgeError(packageManager,result.stdout,result.stderr)){let context=await getMinReleaseAgeContext(packageManager,cwd,global);output_manager_default.stopSpinner();let blockedMessage=`The package manager blocked this Vercel CLI release because of its minimum release-age setting. ${context}`;if(!client||client.nonInteractive||!client.stdin.isTTY)return output_manager_default.error(`${blockedMessage}
10
10
  To install the newest release allowed by your settings:
@@ -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{indent_default}from"./chunk-GZNDA6SV.js";import{pull}from"./chunk-LBH6HTF5.js";import{getLinkedProject}from"./chunk-EUU3FHCX.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";async function createBlobStore(client,input,accountId,requestOptions){let result=await client.fetch("/v1/storage/stores/blob",{...requestOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(input),accountId});if(!result.store?.id)throw new Error("Blob creation returned no store ID.");return{id:result.store.id,region:result.store.region}}async function connectResourceToProject(client,projectId,storeId,environments,options){let path=`/v1/storage/stores/${encodeURIComponent(storeId)}/connections`;return client.fetch(path,{retry:options?.retry,bailOn429:options?.bailOn429,signal:options?.signal,json:!0,method:"POST",body:{envVarEnvironments:environments,projectId,type:"integration",...options?.envVarPrefix!==void 0?{envVarPrefix:options.envVarPrefix}:{}},accountId:options?.accountId})}var import_chalk=__toESM(require_source(),1);var VALID_ENVIRONMENTS=["production","preview","development"],ENV_PULL_FAILED_MESSAGE="Failed to pull environment variables. You can run `vercel env pull` manually.";function validateEnvironments(environments){let invalid=environments.filter(env=>!VALID_ENVIRONMENTS.includes(env));return invalid.length>0?{valid:!1,invalid}:{valid:!0}}async function postProvisionSetup(client,resourceName,resourceId,contextName,options={}){let dashboardUrl=options.integrationSlug&&options.installationId?`https://vercel.com/d/dashboard/integrations/${options.integrationSlug}/${options.installationId}/resources/${resourceId}`:`https://vercel.com/${contextName}/~/stores/integration/${resourceId}`;output_manager_default.log(indent_default(`Dashboard: ${output_manager_default.link(dashboardUrl,dashboardUrl,{fallback:!1})}`,4));let baseResult={exitCode:0,dashboardUrl,connected:!1,environments:[],envPulled:!1};if(options.noConnect)return baseResult;let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return{...baseResult,exitCode:linkedProject.exitCode};if(linkedProject.status==="not_linked")return baseResult;let{project}=linkedProject,environments=[...new Set(options.environments&&options.environments.length>0?options.environments:[...VALID_ENVIRONMENTS])];output_manager_default.debug(`Selected environments: ${JSON.stringify(environments)}`),output_manager_default.spinner(`Connecting ${import_chalk.default.bold(resourceName)} to ${import_chalk.default.bold(project.name)}...`),output_manager_default.debug(`Connecting resource ${resourceId} to project ${project.id}`);try{await connectResourceToProject(client,project.id,resourceId,environments,options.prefix?{envVarPrefix:options.prefix}:void 0)}catch(error){return output_manager_default.stopSpinner(),options.onProjectConnectFailed?.(project.id,error),output_manager_default.error(`Failed to connect: ${error.message}`),{...baseResult,exitCode:1,project:{id:project.id,name:project.name},environments,connectError:error.message}}output_manager_default.stopSpinner(),output_manager_default.log(`${import_chalk.default.bold(resourceName)} successfully connected to ${import_chalk.default.bold(project.name)}`),options.onProjectConnected?.(project.id);let envPulled=!1;return options.noEnvPull||(await pull(client,["--yes"],"vercel-cli:integration:add")!==0?output_manager_default.warn(ENV_PULL_FAILED_MESSAGE):envPulled=!0),{...baseResult,project:{id:project.id,name:project.name},connected:!0,environments,envPulled}}async function getLinkedProjectField(client,noConnect,field="name"){if(noConnect)return{value:void 0};let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?{value:void 0,exitCode:linkedProject.exitCode}:linkedProject.status==="linked"?{value:linkedProject.project[field]}:{value:void 0}}export{createBlobStore,connectResourceToProject,VALID_ENVIRONMENTS,ENV_PULL_FAILED_MESSAGE,validateEnvironments,postProvisionSetup,getLinkedProjectField};
7
+ import{indent_default}from"./chunk-GZNDA6SV.js";import{pull}from"./chunk-G56HLQLB.js";import{getLinkedProject}from"./chunk-XL2PHD4X.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";async function createBlobStore(client,input,accountId,requestOptions){let result=await client.fetch("/v1/storage/stores/blob",{...requestOptions,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(input),accountId});if(!result.store?.id)throw new Error("Blob creation returned no store ID.");return{id:result.store.id,region:result.store.region}}async function connectResourceToProject(client,projectId,storeId,environments,options){let path=`/v1/storage/stores/${encodeURIComponent(storeId)}/connections`;return client.fetch(path,{retry:options?.retry,bailOn429:options?.bailOn429,signal:options?.signal,json:!0,method:"POST",body:{envVarEnvironments:environments,projectId,type:"integration",...options?.envVarPrefix!==void 0?{envVarPrefix:options.envVarPrefix}:{}},accountId:options?.accountId})}var import_chalk=__toESM(require_source(),1);var VALID_ENVIRONMENTS=["production","preview","development"],ENV_PULL_FAILED_MESSAGE="Failed to pull environment variables. You can run `vercel env pull` manually.";function validateEnvironments(environments){let invalid=environments.filter(env=>!VALID_ENVIRONMENTS.includes(env));return invalid.length>0?{valid:!1,invalid}:{valid:!0}}async function postProvisionSetup(client,resourceName,resourceId,contextName,options={}){let dashboardUrl=options.integrationSlug&&options.installationId?`https://vercel.com/d/dashboard/integrations/${options.integrationSlug}/${options.installationId}/resources/${resourceId}`:`https://vercel.com/${contextName}/~/stores/integration/${resourceId}`;output_manager_default.log(indent_default(`Dashboard: ${output_manager_default.link(dashboardUrl,dashboardUrl,{fallback:!1})}`,4));let baseResult={exitCode:0,dashboardUrl,connected:!1,environments:[],envPulled:!1};if(options.noConnect)return baseResult;let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return{...baseResult,exitCode:linkedProject.exitCode};if(linkedProject.status==="not_linked")return baseResult;let{project}=linkedProject,environments=[...new Set(options.environments&&options.environments.length>0?options.environments:[...VALID_ENVIRONMENTS])];output_manager_default.debug(`Selected environments: ${JSON.stringify(environments)}`),output_manager_default.spinner(`Connecting ${import_chalk.default.bold(resourceName)} to ${import_chalk.default.bold(project.name)}...`),output_manager_default.debug(`Connecting resource ${resourceId} to project ${project.id}`);try{await connectResourceToProject(client,project.id,resourceId,environments,options.prefix?{envVarPrefix:options.prefix}:void 0)}catch(error){return output_manager_default.stopSpinner(),options.onProjectConnectFailed?.(project.id,error),output_manager_default.error(`Failed to connect: ${error.message}`),{...baseResult,exitCode:1,project:{id:project.id,name:project.name},environments,connectError:error.message}}output_manager_default.stopSpinner(),output_manager_default.log(`${import_chalk.default.bold(resourceName)} successfully connected to ${import_chalk.default.bold(project.name)}`),options.onProjectConnected?.(project.id);let envPulled=!1;return options.noEnvPull||(await pull(client,["--yes"],"vercel-cli:integration:add")!==0?output_manager_default.warn(ENV_PULL_FAILED_MESSAGE):envPulled=!0),{...baseResult,project:{id:project.id,name:project.name},connected:!0,environments,envPulled}}async function getLinkedProjectField(client,noConnect,field="name"){if(noConnect)return{value:void 0};let linkedProject=await getLinkedProject(client);return linkedProject.status==="error"?{value:void 0,exitCode:linkedProject.exitCode}:linkedProject.status==="linked"?{value:linkedProject.project[field]}:{value:void 0}}export{createBlobStore,connectResourceToProject,VALID_ENVIRONMENTS,ENV_PULL_FAILED_MESSAGE,validateEnvironments,postProvisionSetup,getLinkedProjectField};
@@ -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{getScope}from"./chunk-CT77BGSW.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-PNWRO3XW.js";import{getOrgById}from"./chunk-EUU3FHCX.js";import{suggestCorrection}from"./chunk-LYL26S3N.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";async function findSimilarProjectName(client,name,orgId){try{let{projects}=await client.fetch("/v9/projects?limit=100",{accountId:orgId});return suggestCorrection(name,projects.map(project=>project.name).filter(projectName=>/^[a-z0-9._-]+$/i.test(projectName)))}catch(err){output_manager_default.debug(`Project suggestion lookup failed: ${err}`);return}}async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId,{createCommand}={}){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`,suggestion=createCommand?await findSimilarProjectName(client,projectNameOrId,orgId):void 0,suggestionLine=suggestion?` Did you mean ${suggestion}?`:"",createNote=createCommand?.note;if(output_manager_default.error(`${headline}${suggestionLine}
7
+ import{getScope}from"./chunk-YJP25FL6.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-PNWRO3XW.js";import{getOrgById}from"./chunk-XL2PHD4X.js";import{suggestCorrection}from"./chunk-LYL26S3N.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";async function findSimilarProjectName(client,name,orgId){try{let{projects}=await client.fetch("/v9/projects?limit=100",{accountId:orgId});return suggestCorrection(name,projects.map(project=>project.name).filter(projectName=>/^[a-z0-9._-]+$/i.test(projectName)))}catch(err){output_manager_default.debug(`Project suggestion lookup failed: ${err}`);return}}async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId,{createCommand}={}){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`,suggestion=createCommand?await findSimilarProjectName(client,projectNameOrId,orgId):void 0,suggestionLine=suggestion?` Did you mean ${suggestion}?`:"",createNote=createCommand?.note;if(output_manager_default.error(`${headline}${suggestionLine}
8
8
 
9
9
  `+(createCommand?`To create it${createNote?`, ${createNote}`:""}:
10
10
  ${createCommand.command}
@@ -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{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-EUU3FHCX.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,vercelFlags:project.vercelFlags,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{writeProjectSettings,readProjectSettings,pickOverrides};
7
+ import{VERCEL_DIR,VERCEL_DIR_PROJECT,require_lib}from"./chunk-XL2PHD4X.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);import{join}from"path";var import_error_utils=__toESM(require_dist(),1);async function writeProjectSettings(cwd,project,org,isRepoLinked){let analyticsId;project.analytics?.id&&(!project.analytics.disabledAt||project.analytics.enabledAt&&project.analytics.enabledAt>project.analytics.disabledAt)&&(analyticsId=project.analytics.id);let projectLinkAndSettings={projectId:isRepoLinked?void 0:project.id,orgId:isRepoLinked?void 0:org.id,projectName:isRepoLinked?void 0:project.name,settings:{createdAt:project.createdAt,framework:project.framework,devCommand:project.devCommand,installCommand:project.installCommand,buildCommand:project.buildCommand,outputDirectory:project.outputDirectory,rootDirectory:project.rootDirectory,directoryListing:project.directoryListing,nodeVersion:project.nodeVersion,vercelFlags:project.vercelFlags,analyticsId}},path=join(cwd,VERCEL_DIR,VERCEL_DIR_PROJECT);return await(0,import_fs_extra.outputJSON)(path,projectLinkAndSettings,{spaces:2})}async function readProjectSettings(vercelDir){try{return JSON.parse(await(0,import_fs_extra.readFile)(join(vercelDir,VERCEL_DIR_PROJECT),"utf8"))}catch(err){if((0,import_error_utils.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code)||(0,import_error_utils.isError)(err)&&err.name==="SyntaxError")return null;throw err}}function pickOverrides(vercelConfig){let overrides={};for(let prop of["buildCommand","devCommand","framework","ignoreCommand","installCommand","outputDirectory"])typeof vercelConfig[prop]<"u"&&(prop==="ignoreCommand"?overrides.commandForIgnoringBuildStep=vercelConfig[prop]:overrides[prop]=vercelConfig[prop]);return overrides}export{writeProjectSettings,readProjectSettings,pickOverrides};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{require_dist as require_dist2}from"./chunk-AMOI3EAW.js";import{require_dist}from"./chunk-ISSNEDG5.js";import{require_types}from"./chunk-AW33SRYY.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_constants=__commonJS({"../runtimes/dist/constants.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),constants_exports={};__export(constants_exports,{BUILDER_RUNTIMES:()=>BUILDER_RUNTIMES,CONTAINER_ENTRYPOINT_CANDIDATES:()=>CONTAINER_ENTRYPOINT_CANDIDATES,ENTRYPOINT_EXTENSIONS:()=>ENTRYPOINT_EXTENSIONS,ROUTE_OWNING_BUILDERS:()=>ROUTE_OWNING_BUILDERS,RUNTIME_BUILDERS:()=>RUNTIME_BUILDERS,RUNTIME_MANIFESTS:()=>RUNTIME_MANIFESTS,STATIC_BUILDERS:()=>STATIC_BUILDERS});module.exports=__toCommonJS(constants_exports);var RUNTIME_BUILDERS={node:"@vercel/backends",python:"@vercel/python",go:"@vercel/go",rust:"@vercel/rust",ruby:"@vercel/ruby",container:"@vercel/container"},RUNTIME_MANIFESTS={node:["package.json"],python:["pyproject.toml","requirements.txt","Pipfile","pylock.yml","uv.lock","setup.py"],go:["go.mod"],ruby:["Gemfile"],rust:["Cargo.toml"]},ENTRYPOINT_EXTENSIONS={".ts":"node",".mts":"node",".js":"node",".mjs":"node",".cjs":"node",".py":"python",".go":"go",".rs":"rust",".rb":"ruby",".ru":"ruby"},BUILDER_RUNTIMES={...Object.fromEntries(Object.entries(RUNTIME_BUILDERS).map(([runtime,builder])=>[builder,runtime])),"@vercel/node":"node","@vercel/next":"node","@vercel/remix-builder":"node","@vercel/redwood":"node","@vercel/hydrogen":"node","@vercel/express":"node","@vercel/hono":"node","@vercel/h3":"node","@vercel/koa":"node","@vercel/nestjs":"node","@vercel/fastify":"node","@vercel/elysia":"node"},STATIC_BUILDERS=new Set(["@vercel/static-build","@vercel/static"]),ROUTE_OWNING_BUILDERS=new Set(["@vercel/next","@vercel/backends"]),CONTAINER_ENTRYPOINT_CANDIDATES=["Dockerfile.vercel","Containerfile.vercel","Dockerfile","Containerfile"]}});var require_entrypoint=__commonJS({"../runtimes/dist/entrypoint.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),entrypoint_exports={};__export(entrypoint_exports,{isDockerfileEntrypoint:()=>isDockerfileEntrypoint,isNodeScheduleEntrypoint:()=>isNodeScheduleEntrypoint2,parsePyModuleAttrEntrypoint:()=>parsePyModuleAttrEntrypoint,parsePythonScheduleModule:()=>parsePythonScheduleModule2,stripTrailingSlash:()=>stripTrailingSlash});module.exports=__toCommonJS(entrypoint_exports);var import_path=__require("path"),import_constants=require_constants(),PYTHON_MODULE_ATTR_RE=/^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/,PYTHON_MODULE_RE=/^[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*$/,SOURCE_FILE_RE=/\.(?:py|[cm]?[jt]s)$/,NODE_SOURCE_FILE_RE=/\.(?:m?js|[cm]?ts)$/;function parsePyModuleAttrEntrypoint(entrypoint){let match=PYTHON_MODULE_ATTR_RE.exec(entrypoint);if(!match)return null;let[,modulePart,attrName]=match;return!modulePart||!attrName?null:{attrName,filePath:modulePart.replace(/\./g,"/")+".py",moduleName:modulePart}}function parsePythonScheduleModule2(entrypoint){if(!PYTHON_MODULE_RE.test(entrypoint)||SOURCE_FILE_RE.test(entrypoint))return null;let path=entrypoint.replace(/\./g,"/");return{moduleName:entrypoint,sourceFiles:[`${path}/__init__.py`,`${path}.py`]}}function isNodeScheduleEntrypoint2(entrypoint){return NODE_SOURCE_FILE_RE.test(entrypoint)}var CONTAINER_ENTRYPOINT_BASENAMES=new Set(import_constants.CONTAINER_ENTRYPOINT_CANDIDATES.map(name=>name.toLowerCase()));function isDockerfileEntrypoint(entrypoint){return CONTAINER_ENTRYPOINT_BASENAMES.has(import_path.posix.basename(entrypoint).toLowerCase())}function stripTrailingSlash(p){let stripped=p.replace(/\/+$/,"");return stripped===""?".":stripped}}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1),import_entrypoint=__toESM(require_entrypoint(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},run:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs the schedule's `entrypoint`, which is relative to it. Required with `entrypoint`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512},runtime:{description:"Runtime of an `entrypoint` without `run`: `python` for a module path like `jobs.tasks`, or `node` for a JavaScript or TypeScript file.",enum:["python","node"]}},dependencies:{requestMethod:["path"],service:["function"],run:["entrypoint"],entrypoint:["root"],root:["entrypoint"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=500,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string",minLength:1,maxLength:4096},{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=entrypoint=>/(docker|container)file/i.test((0,import_build_utils.splitDockerfileEntrypoint)(entrypoint).path.split(/[\\/]/).pop()??""),toPythonModulePath=entrypoint=>entrypoint.replace(/\.py$/,"").replace(/[\\/]+/g,".").replace(/(^|\.)__init__$/,""),hasInvalidDockerfileStage=entrypoint=>{let{buildTarget}=(0,import_build_utils.splitDockerfileEntrypoint)(entrypoint);return buildTarget!==void 0&&!(0,import_build_utils.isValidDockerfileStage)(buildTarget)};function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),scheduleServices=getScheduleServiceNames(config),destinationServices=new Set(getDestinationServices(config)),invalidSchedule=(code,message)=>new import_build_utils.NowBuildError({code,message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`}),invalidCommand=message=>invalidSchedule("INVALID_SCHEDULE_COMMAND",message),invalidEntrypoint=message=>invalidSchedule("INVALID_SCHEDULE_ENTRYPOINT",message);for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("runtime"in schedule&&("run"in schedule||!("entrypoint"in schedule)))return invalidEntrypoint(`\`${path}.runtime\` is only valid with an \`entrypoint\` and without \`run\`.`);if("entrypoint"in schedule&&!("run"in schedule)){let{entrypoint,runtime}=schedule;if(!runtime)return isDockerfilePath(entrypoint)?invalidEntrypoint(`\`${path}.entrypoint\` names a Dockerfile, so \`${path}\` must set \`run\`.`):invalidEntrypoint(`\`${path}\` must set \`runtime\` to run its \`entrypoint\`: "python" for a module path like "jobs.tasks", or "node" for a .js, .mjs, .ts, .mts or .cts file.`);if(runtime==="python"&&!(0,import_entrypoint.parsePythonScheduleModule)(entrypoint)){let suggestion=entrypoint.endsWith(".py")?toPythonModulePath(entrypoint):"";return invalidEntrypoint(`\`${path}.entrypoint\` "${entrypoint}" must be a Python module path like "${(0,import_entrypoint.parsePythonScheduleModule)(suggestion)?suggestion:"jobs.tasks"}", since \`${path}.runtime\` is "python".`)}if(runtime==="node"&&!(0,import_entrypoint.isNodeScheduleEntrypoint)(entrypoint))return invalidEntrypoint(`\`${path}.entrypoint\` "${entrypoint}" must be a .js, .mjs, .ts, .mts or .cts file, since \`${path}.runtime\` is "node".`);let configured=["schedule","timezone","jitter"].find(key=>key in schedule);if(configured)return invalidEntrypoint(runtime==="node"?`\`${path}\` runs "${entrypoint}", whose \`export const config\` sets its cron, timezone and jitter. Remove \`${path}.${configured}\`.`:`\`${path}\` runs the Python module "${entrypoint}", whose \`@schedule\` handlers set their own cron, timezone and jitter. Remove \`${path}.${configured}\`.`)}else if(!("schedule"in schedule))return invalidSchedule("INVALID_SCHEDULE_EXPRESSION",`\`${path}\` is missing required property \`schedule\`.`);if("run"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.run\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(hasInvalidDockerfileStage(schedule.entrypoint))return invalidCommand(`\`${path}.entrypoint\` "${schedule.entrypoint}" is invalid. ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}if(scheduleServices.has(name)){if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidScheduleService(config,`\`${path}\` runs as a service, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidScheduleService(config,`\`${path}\` runs as service "${name}", which is already the name of a service or daemon.`);if(destinationServices.has(name))return invalidScheduleService(config,`Rewrites and routes cannot target schedule "${name}" because schedules do not receive traffic.`)}if(!(!("timezone"in schedule)||schedule.timezone===void 0))try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Service "${serviceName}"`,binding.service):new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons)),scheduleServices=getScheduleServiceNames(config);for(let[name,daemon]of Object.entries(daemons)){if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);if(hasInvalidDockerfileStage(daemon.entrypoint))return invalid(`Daemon "${name}" has invalid \`entrypoint\` "${daemon.entrypoint}". ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Daemon "${name}"`,binding.service):invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let daemonTarget=getDestinationServices(config).find(isDaemonTarget);return daemonTarget?invalid(`Rewrites and routes cannot target daemon "${daemonTarget}" because daemons do not receive traffic.`):null}function getScheduleServiceNames(config){return new Set(Object.entries(config.schedules??{}).filter(([,schedule])=>"entrypoint"in schedule||"run"in schedule).map(([name])=>name))}function invalidScheduleService(config,message){return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_SERVICE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`})}function scheduleBindingError(config,binder,schedule){return invalidScheduleService(config,`${binder} cannot bind to schedule "${schedule}" because schedules do not receive traffic.`)}function getDestinationServices(config){let services={...config.experimentalServicesV2,...config.services};return[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].flatMap(entry=>{let destination="destination"in entry?entry.destination:void 0;return typeof destination=="object"&&destination!==null?[destination.service]:[]})}export{require_constants,require_entrypoint,buildVercelConfigSchema,validateConfig};