vercel 59.20.0 → 59.22.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 (167) hide show
  1. package/dist/chunks/{add-CC6U36WJ.js → add-4XDHZES6.js} +1 -1
  2. package/dist/chunks/{add-PSEVULRF.js → add-DTHT6FBK.js} +1 -1
  3. package/dist/chunks/{add-UO2IFTKH.js → add-ZQXW2ONT.js} +1 -1
  4. package/dist/chunks/{build-G54Y245T.js → build-JORIG5OD.js} +1 -1
  5. package/dist/chunks/chunk-2EY7NJ5E.js +9 -0
  6. package/dist/chunks/{chunk-IESZKIFF.js → chunk-2U7K4KDF.js} +1 -1
  7. package/dist/chunks/{chunk-GWPIATTW.js → chunk-3GUBYJN6.js} +1 -1
  8. package/dist/chunks/{chunk-YHN4IZVJ.js → chunk-3RLCABDN.js} +1 -1
  9. package/dist/chunks/{chunk-CTO5XEIQ.js → chunk-3VRLKRIC.js} +1 -1
  10. package/dist/chunks/{chunk-IERVS47L.js → chunk-4WSAOLBH.js} +1 -1
  11. package/dist/chunks/{chunk-EHEMFUGQ.js → chunk-5LCQGGTH.js} +1 -1
  12. package/dist/chunks/{chunk-DLKR2CG6.js → chunk-6BZCSVH6.js} +1 -1
  13. package/dist/chunks/{chunk-U6TAKLJ6.js → chunk-6LE3FU2P.js} +1 -1
  14. package/dist/chunks/{chunk-IH2HZFLM.js → chunk-6LE44WCK.js} +1 -1
  15. package/dist/chunks/{chunk-RVJ2E3BM.js → chunk-6OI6SRHZ.js} +1 -1
  16. package/dist/chunks/{chunk-6V3JGAVJ.js → chunk-77GUJ4JC.js} +1 -1
  17. package/dist/chunks/{chunk-PNRWNSM2.js → chunk-7B5NNJ2P.js} +1 -1
  18. package/dist/chunks/{chunk-QPCDEH6H.js → chunk-7JMXZGXY.js} +1 -1
  19. package/dist/chunks/{chunk-QYPQGOSO.js → chunk-7XSHE5SA.js} +1 -1
  20. package/dist/chunks/{chunk-W2XUH2WW.js → chunk-A5VLP25I.js} +1 -1
  21. package/dist/chunks/chunk-AZ6NRDHG.js +7 -0
  22. package/dist/chunks/{chunk-GUSSSCV7.js → chunk-B7FOQCPU.js} +1 -1
  23. package/dist/chunks/{chunk-Q3LIZ6SZ.js → chunk-BSOZ3UP2.js} +1 -1
  24. package/dist/chunks/{chunk-WR5OOWD6.js → chunk-BX5KDMLT.js} +1 -1
  25. package/dist/chunks/{chunk-HOD3FQAX.js → chunk-CGXXEPYI.js} +1 -0
  26. package/dist/chunks/{chunk-YWFECCBH.js → chunk-CKX6OH4B.js} +1 -1
  27. package/dist/chunks/{chunk-4Q2FGJAG.js → chunk-CLKTBUI7.js} +1 -1
  28. package/dist/chunks/{chunk-EGG7SPNM.js → chunk-DQ2KI6FO.js} +1 -1
  29. package/dist/chunks/{chunk-RTRCTYW6.js → chunk-EWWFNMPZ.js} +4 -3
  30. package/dist/chunks/{chunk-XZYKYDQO.js → chunk-EYXFDREA.js} +1 -1
  31. package/dist/chunks/{chunk-ZVFZIWBV.js → chunk-FA6O7FPC.js} +1 -1
  32. package/dist/chunks/{chunk-3XIEKCNF.js → chunk-FYSA677K.js} +4 -4
  33. package/dist/chunks/{chunk-E4CRGS56.js → chunk-GHULCYAR.js} +1 -1
  34. package/dist/chunks/{chunk-LASMHNUP.js → chunk-GJTA7DJO.js} +1 -1
  35. package/dist/chunks/{chunk-X446JLEO.js → chunk-GPX6W4GB.js} +1 -1
  36. package/dist/chunks/{chunk-NPMNS7IG.js → chunk-GQQKAFGS.js} +1 -1
  37. package/dist/chunks/{chunk-HBF4YJR2.js → chunk-GRDPI246.js} +1 -1
  38. package/dist/chunks/{chunk-Q2Z6EXCT.js → chunk-GTJ2OLYI.js} +1 -1
  39. package/dist/chunks/{chunk-7O3KGTQ3.js → chunk-HWWHR7H3.js} +1 -1
  40. package/dist/chunks/{chunk-LKVMIJCF.js → chunk-I5CXJNW4.js} +1 -1
  41. package/dist/chunks/{chunk-5ZIZD5ZG.js → chunk-J5X5YRBH.js} +1 -1
  42. package/dist/chunks/{chunk-NYEPIN3U.js → chunk-JOH6CUOG.js} +1 -1
  43. package/dist/chunks/{chunk-CFY5RS7I.js → chunk-JOV4G2LZ.js} +1 -1
  44. package/dist/chunks/{chunk-J2ONOQCQ.js → chunk-JWC64GEW.js} +1 -1
  45. package/dist/chunks/{chunk-DBBMJTPG.js → chunk-JXHVB5A7.js} +3 -3
  46. package/dist/chunks/{chunk-OXH3RM6U.js → chunk-KBKN7EI7.js} +1 -1
  47. package/dist/chunks/{chunk-JDQP267R.js → chunk-KUVMCIR4.js} +1 -1
  48. package/dist/chunks/{chunk-GI6G3FJJ.js → chunk-LKI6FRNM.js} +1 -1
  49. package/dist/chunks/{chunk-GGZODU6S.js → chunk-LQBC5QPO.js} +1 -1
  50. package/dist/chunks/{chunk-NUVOJI4D.js → chunk-NZGOQUNN.js} +1 -1
  51. package/dist/chunks/{chunk-BQU3N4EK.js → chunk-PQ7YG2JU.js} +1 -1
  52. package/dist/chunks/{chunk-QFFD4LBE.js → chunk-PQTP73R4.js} +1 -1
  53. package/dist/chunks/{chunk-DWSG55I2.js → chunk-Q3OG3SC4.js} +1 -1
  54. package/dist/chunks/{chunk-7NYQ7CTP.js → chunk-R3B67TKQ.js} +1 -1
  55. package/dist/chunks/{chunk-ONOSMF2T.js → chunk-RJOVMJZI.js} +1 -1
  56. package/dist/chunks/{chunk-PIKD5KTH.js → chunk-SOQ5DE44.js} +1 -1
  57. package/dist/chunks/{chunk-WDO3QBQI.js → chunk-T2ECF6MX.js} +1 -1
  58. package/dist/chunks/{chunk-ZRS5X7M2.js → chunk-T4AZ3U7O.js} +1 -1
  59. package/dist/chunks/{chunk-4P66SQRS.js → chunk-TBBU37TD.js} +1 -1
  60. package/dist/chunks/{chunk-XNQR2W4A.js → chunk-TX4PCSTY.js} +1 -1
  61. package/dist/chunks/{chunk-2Q47GHFX.js → chunk-U6N2RNDI.js} +1 -1
  62. package/dist/chunks/{chunk-6ARDCI6T.js → chunk-UB37A37M.js} +4 -4
  63. package/dist/chunks/{chunk-74CMQMYR.js → chunk-UDOFIJ7K.js} +1 -1
  64. package/dist/chunks/{chunk-LZTGSYL3.js → chunk-UXCTETFN.js} +1 -1
  65. package/dist/chunks/{chunk-GTK7TBLW.js → chunk-V5DCSHYJ.js} +1 -1
  66. package/dist/chunks/{chunk-XV6SDZIO.js → chunk-V6IKQCOT.js} +1 -1
  67. package/dist/chunks/{chunk-MNACJRE7.js → chunk-VG2V4NHC.js} +1 -1
  68. package/dist/chunks/{chunk-BW24TEUN.js → chunk-VIR3KDCQ.js} +1 -1
  69. package/dist/chunks/{chunk-QQNFAXDX.js → chunk-W27LUVFI.js} +1 -1
  70. package/dist/chunks/{chunk-KEFIUUAJ.js → chunk-W65SRO53.js} +1 -1
  71. package/dist/chunks/chunk-WBE23KLI.js +31 -0
  72. package/dist/chunks/{chunk-CWTXZPUV.js → chunk-WHYH7DVI.js} +2 -1
  73. package/dist/chunks/{chunk-TKBORMUF.js → chunk-WKZ6JSGZ.js} +1 -1
  74. package/dist/chunks/{chunk-TM3W2CAF.js → chunk-WXT35K53.js} +1 -1
  75. package/dist/chunks/{chunk-JDR2WXM4.js → chunk-XRHDE2NT.js} +1 -1
  76. package/dist/chunks/{chunk-4VGOAPFY.js → chunk-YMM3VY3J.js} +1 -1
  77. package/dist/chunks/{chunk-TCS3FDID.js → chunk-Z4VR6CQ2.js} +1 -1
  78. package/dist/chunks/{chunk-OWEH7BYO.js → chunk-ZDORSGCG.js} +1 -1
  79. package/dist/chunks/{chunk-XKNCIFFB.js → chunk-ZKWM4JBE.js} +1 -1
  80. package/dist/chunks/{clear-TJQM33RO.js → clear-74Z2GBIF.js} +1 -1
  81. package/dist/chunks/{compile-vercel-config-UQGJ4WJF.js → compile-vercel-config-MRWI6INC.js} +1 -1
  82. package/dist/chunks/config-7SVPPW7T.js +7 -0
  83. package/dist/chunks/{config-SRY5IPK6.js → config-UYP3XEDY.js} +1 -1
  84. package/dist/chunks/{connect-git-provider-LSTDI4TC.js → connect-git-provider-P3SGOW6X.js} +1 -1
  85. package/dist/chunks/{constants-NCE2LWSS.js → constants-G4UYVLOF.js} +1 -1
  86. package/dist/chunks/{delete-V45ALBXM.js → delete-E355MKDF.js} +1 -1
  87. package/dist/chunks/{delete-TSYNQ23W.js → delete-QFKW4O7R.js} +1 -1
  88. package/dist/chunks/{detect-projects-64MZJZ6M.js → detect-projects-J3VAJIQD.js} +1 -1
  89. package/dist/chunks/{detect-services-3DFPW53F.js → detect-services-JTGZ7NCQ.js} +1 -1
  90. package/dist/chunks/{disable-WD4S6HSS.js → disable-K4MMQGSO.js} +1 -1
  91. package/dist/chunks/{discard-KFBXLAVB.js → discard-ITZDMBFI.js} +1 -1
  92. package/dist/chunks/{edit-AWY54Q7X.js → edit-3V4C747E.js} +1 -1
  93. package/dist/chunks/{edit-TJ4JLJRE.js → edit-7IGZ4EH7.js} +1 -1
  94. package/dist/chunks/{enable-ANIHAF35.js → enable-4TJRZIE7.js} +1 -1
  95. package/dist/chunks/{exec-ZLT5KH2Z.js → exec-YH5WUJ4C.js} +1 -1
  96. package/dist/chunks/{export-RPFCJCOY.js → export-XJIKF2WX.js} +1 -1
  97. package/dist/chunks/{future-LU77KNDL.js → future-BB7OE645.js} +1 -1
  98. package/dist/chunks/{generate-cert-for-deploy-NVQ43MLT.js → generate-cert-for-deploy-A4TZHE2Y.js} +1 -1
  99. package/dist/chunks/{image-WWX3Q3GG.js → image-4UZ34VE5.js} +1 -1
  100. package/dist/chunks/{import-builders-FUR24WH3.js → import-builders-7BRUAJT2.js} +1 -1
  101. package/dist/chunks/{inspect-QVPDZHUE.js → inspect-2U47TXE3.js} +1 -1
  102. package/dist/chunks/{inspect-WIXPYMMS.js → inspect-FUJCRJTQ.js} +1 -1
  103. package/dist/chunks/{inspect-7LLKIX3Q.js → inspect-H3D3M4TY.js} +1 -1
  104. package/dist/chunks/{inspect-67J25RHR.js → inspect-QLPYWU6F.js} +1 -1
  105. package/dist/chunks/{inspect-YG2GUQH2.js → inspect-YZP2TUXW.js} +1 -1
  106. package/dist/chunks/{list-HKOHGU6B.js → list-AEKIXAC2.js} +1 -1
  107. package/dist/chunks/{list-UGNPHXFH.js → list-AO2NTDVE.js} +1 -1
  108. package/dist/chunks/{list-LY73G263.js → list-UGFJDLK3.js} +1 -1
  109. package/dist/chunks/{login-IMHVC657.js → login-GXL33UOO.js} +1 -1
  110. package/dist/chunks/{login-YQ7QPK4A.js → login-RMAISH4F.js} +1 -1
  111. package/dist/chunks/{logs-4GPA2QJ2.js → logs-HXT43YFY.js} +1 -1
  112. package/dist/chunks/{ls-MO2Y6TNW.js → ls-2GUHQ2QY.js} +1 -1
  113. package/dist/chunks/{ls-PSZDUCI4.js → ls-DLX6OKJD.js} +1 -1
  114. package/dist/chunks/{ls-XZYIM72L.js → ls-IFYHOVHI.js} +1 -1
  115. package/dist/chunks/{ls-IDH4SZXE.js → ls-LDTXN5NC.js} +1 -1
  116. package/dist/chunks/{ls-XZ25NS63.js → ls-MR4IEJXI.js} +1 -1
  117. package/dist/chunks/{ls-GXGGGB3C.js → ls-RYBY45PV.js} +1 -1
  118. package/dist/chunks/{ls-JAD3EACY.js → ls-T6LDBBIZ.js} +1 -1
  119. package/dist/chunks/{mutate-FKH7JHLN.js → mutate-NMAFXSIS.js} +1 -1
  120. package/dist/chunks/{notifications-JI6HIQYR.js → notifications-VDMQJUX4.js} +1 -1
  121. package/dist/chunks/{open-WVYJ6DJS.js → open-OYT4SXL7.js} +1 -1
  122. package/dist/chunks/{openapi-YEDROCHV.js → openapi-DKMCRF2V.js} +1 -1
  123. package/dist/chunks/{permissions-TALTFA2U.js → permissions-RVEIYB2B.js} +1 -1
  124. package/dist/chunks/{prompt-missing-credentials-YVS4S7X2.js → prompt-missing-credentials-QY4MZDT6.js} +1 -1
  125. package/dist/chunks/{publish-ZE5GEK7Q.js → publish-I7FUMJAU.js} +1 -1
  126. package/dist/chunks/pull-XCHJWKNY.js +7 -0
  127. package/dist/chunks/{purchase-domain-if-available-6HLN6HG2.js → purchase-domain-if-available-5HP57BPC.js} +1 -1
  128. package/dist/chunks/{push-ETAA3BQY.js → push-7H2NJAPB.js} +1 -1
  129. package/dist/chunks/{query-2FV3SCH5.js → query-TJ7WEORG.js} +1 -1
  130. package/dist/chunks/{reauthenticate-APC7ZYFC.js → reauthenticate-O6C2AW3J.js} +1 -1
  131. package/dist/chunks/{reorder-GHLKIK3C.js → reorder-JCS5LKA6.js} +1 -1
  132. package/dist/chunks/{reply-2PEJJCP7.js → reply-SFRIWOPK.js} +1 -1
  133. package/dist/chunks/{resolve-APTMIYGJ.js → resolve-WTQUYVKI.js} +1 -1
  134. package/dist/chunks/{restore-N6O2H27S.js → restore-K442WYIM.js} +1 -1
  135. package/dist/chunks/{rm-QJDB2QO6.js → rm-377WPSMT.js} +1 -1
  136. package/dist/chunks/{rm-CWEDAZXF.js → rm-576VOXTN.js} +1 -1
  137. package/dist/chunks/{rm-ZUOJPP33.js → rm-K2SG5TT7.js} +1 -1
  138. package/dist/chunks/{rm-Y3PIBNO3.js → rm-OUXMNCHX.js} +1 -1
  139. package/dist/chunks/{rm-ZWCGOTK3.js → rm-XFZMZILG.js} +1 -1
  140. package/dist/chunks/{routes-ZD7XUKLY.js → routes-IPGKJ2E4.js} +1 -1
  141. package/dist/chunks/{rule-inspect-AHQRHKO3.js → rule-inspect-MK7A5LPA.js} +1 -1
  142. package/dist/chunks/{rules-LFVEAZJ7.js → rules-4T3OHT34.js} +1 -1
  143. package/dist/chunks/{schema-ET4DYRVX.js → schema-PUOL7JUI.js} +1 -1
  144. package/dist/chunks/{schema-OKQUOZEH.js → schema-RIUBZXVC.js} +1 -1
  145. package/dist/chunks/{select-org-5OUQKTNI.js → select-org-F2A5JJFH.js} +1 -1
  146. package/dist/chunks/{set-OQCFBVJB.js → set-HNSMZTBW.js} +1 -1
  147. package/dist/chunks/setup-and-link-X44IODXA.js +7 -0
  148. package/dist/chunks/{tags-23ZFVGUC.js → tags-7CY2YR27.js} +1 -1
  149. package/dist/chunks/{types-BTHJ46LC.js → types-H3B56MH6.js} +1 -1
  150. package/dist/chunks/{update-GUA544N4.js → update-QAGFDMEF.js} +1 -1
  151. package/dist/commands/build/index.js +1 -1
  152. package/dist/commands/deploy/index.js +5 -5
  153. package/dist/commands/dev/index.js +20 -19
  154. package/dist/commands/env/index.js +1 -1
  155. package/dist/commands/link/index.js +1 -1
  156. package/dist/commands/list/index.js +1 -1
  157. package/dist/commands-bulk.js +191 -200
  158. package/dist/help.js +1 -1
  159. package/dist/index.js +2 -2
  160. package/dist/version.mjs +1 -1
  161. package/package.json +24 -23
  162. package/dist/chunks/chunk-DB2P55YY.js +0 -9
  163. package/dist/chunks/chunk-JEIMW3CO.js +0 -7
  164. package/dist/chunks/chunk-XQWBEAKZ.js +0 -9
  165. package/dist/chunks/config-XEI4UIQD.js +0 -7
  166. package/dist/chunks/pull-33THLIV4.js +0 -7
  167. package/dist/chunks/setup-and-link-YCM7WRCA.js +0 -7
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_load_json_file,require_pify}from"./chunk-RCTYVKM5.js";import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_graceful_fs}from"./chunk-F2ZWW2IO.js";import{output_manager_default,require_build_utils,require_signal_exit}from"./chunk-RTRCTYW6.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_dist=__commonJS({"../../internals/constants/dist/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.TITLE=exports.NAME=exports.LOGO=exports.PROJECT_ENV_TARGET=void 0;exports.PROJECT_ENV_TARGET=["production","preview","development"];exports.LOGO="\u25B2";exports.NAME="vercel";exports.TITLE="Vercel"}});var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
7
+ import{require_load_json_file,require_pify}from"./chunk-RCTYVKM5.js";import{isNativeBinaryInstall}from"./chunk-7T6TL3GQ.js";import{require_graceful_fs}from"./chunk-F2ZWW2IO.js";import{output_manager_default,require_build_utils,require_signal_exit}from"./chunk-EWWFNMPZ.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_dist=__commonJS({"../../internals/constants/dist/index.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.TITLE=exports.NAME=exports.LOGO=exports.PROJECT_ENV_TARGET=void 0;exports.PROJECT_ENV_TARGET=["production","preview","development"];exports.LOGO="\u25B2";exports.NAME="vercel";exports.TITLE="Vercel"}});var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
8
8
  `,{mode:opts.mode})}),mainSync=(fp,data,opts)=>{let indent=opts.indent;if(opts.detectIndent)try{let file=fs.readFileSync(fp,"utf8");indent=detectIndent(file).indent}catch(err){if(err.code!=="ENOENT")throw err}let json=JSON.stringify(data,opts.replacer,indent);return writeFileAtomic.sync(fp,`${json}
9
9
  `,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});import{randomUUID as randomUUID2}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){return!value||typeof value!="object"?!1:typeof value.id=="string"}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
10
10
  `,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing)return existing;let device={id:randomUUID()};return writePersistedCliDevice(opts.filePath,device),device}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID2(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID2()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}},TelemetryEventStore=class{constructor(opts){this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID2(),this.deviceId=randomUUID2(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID2()}add(event){event.sessionId=this.sessionId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[]}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}async save(){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));return}if(this.enabled){let sessionId=this.events[0].sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{delete event.sessionId,delete event.teamId,delete event.userId,delete event.projectId;let{eventTime,...rest}=event;return{event_time:eventTime,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}}),payload={headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events};await this.sendToSubprocess(payload,output_manager_default.debugEnabled)}}async sendToSubprocess(payload,outputDebugEnabled){let flushArgs=["telemetry","flush",JSON.stringify(payload)],nodeBinaryPath,script;if(isNativeBinaryInstall())nodeBinaryPath=process.execPath,script=flushArgs;else{let args=[process.execPath,process.argv[0],process.argv[1]];args[0]===args[1]&&args.shift(),nodeBinaryPath=args[0],script=[...args.slice(1),...flushArgs]}let env=(0,import_build_utils.cloneEnv)(process.env,{VERCEL_TELEMETRY_DISABLED:"1"});if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{env,stdio:["ignore","pipe","pipe"]});childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d)});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),timeout.unref(),resolve()})});spawn(nodeBinaryPath,script,{stdio:"ignore",env,windowsHide:!0,detached:!0}).unref()}};export{require_dist,TelemetryClient,TelemetryEventStore};
@@ -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-FAW6NBLQ.js";import{confirmOption,projectOption,yesOption}from"./chunk-JAJW3P42.js";import{packageName}from"./chunk-FI772UVH.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__toESM}from"./chunk-6L236MNA.js";var import_async_listen=__toESM(require_dist2(),1),import_error_utils=__toESM(require_dist(),1),DEV_QUEUE_API_PREFIX="/api/v3/topic/",DEV_QUEUE_PROXY_PREFIX="/_svc/_queues",DEV_QUEUE_DEFAULT_PORT=4782,DEV_RUNTIME_CACHE_DEFAULT_PORT=4783,DEV_RESOURCE_TOKEN="vc-dev-token";function isValidDevResourceHost(origin,host){let port=new URL(origin).port,suffix=port?`:${port}`:"",normalizedHost=host?.toLowerCase();return normalizedHost===`127.0.0.1${suffix}`||normalizedHost===`localhost${suffix}`}async function listenOnDevResourcePort(server,options){let isPinned=options.port!==void 0,reservedPorts=new Set(options.reservedPorts),port=options.port??options.defaultPort;for(;;){if(!isPinned&&reservedPorts.has(port)){if(port>=65535)throw new Error(`${options.name} could not find an available port at or above 127.0.0.1:${options.defaultPort}. Choose another port with ${options.flag}.`);port++;continue}try{let address=await(0,import_async_listen.listen)(server,port,"127.0.0.1"),url=new URL(address.toString()),serverAddress=server.address(),actualPort=serverAddress&&typeof serverAddress!="string"?serverAddress.port:Number(url.port);return{origin:url.origin,port:actualPort,...port!==options.defaultPort&&!isPinned?{defaultPort:options.defaultPort}:{}}}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EADDRINUSE")throw err;if(isPinned||port>=65535)throw new Error(`${options.name} could not listen on 127.0.0.1:${port} because the port is already in use. Choose another port with ${options.flag}.`);port++}}}function getDevQueueEnv(baseUrl,hasWorkerServices=!0){return{...hasWorkerServices?{VERCEL_HAS_WORKER_SERVICES:"1"}:{},VERCEL_QUEUE_BASE_URL:baseUrl,VERCEL_QUEUE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_REGION:"dev1"}}var devCommand={name:"dev",aliases:["develop"],description:`Starts the \`${packageName} dev\` server.`,arguments:[{name:"dir",required:!1}],options:[{name:"listen",description:"Specify a URI endpoint on which to listen [0.0.0.0:3000]",argument:"URI",shorthand:"l",type:String,deprecated:!1},{name:"local",shorthand:"L",type:Boolean,deprecated:!1,description:"Start the dev server without linking to a Vercel project"},{name:"queue-port",description:`Specify the local Vercel Queues server port [${DEV_QUEUE_DEFAULT_PORT}]`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"runtime-cache-port",description:`Specify the local Runtime Cache server port [${DEV_RUNTIME_CACHE_DEFAULT_PORT}]`,argument:"PORT",shorthand:null,type:String,deprecated:!1},yesOption,{name:"port",shorthand:"p",type:String,deprecated:!0},confirmOption,projectOption],examples:[{name:`Start the \`${packageName} dev\` server on port 8080`,value:`${packageName} dev --listen 8080`},{name:"Make the `vercel dev` server bind to localhost on port 5000",value:`${packageName} dev --listen 127.0.0.1:5000 `},{name:"Pin local resource server ports",value:`${packageName} dev --queue-port 5782 --runtime-cache-port 5783`}]};export{DEV_QUEUE_API_PREFIX,DEV_QUEUE_PROXY_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_RUNTIME_CACHE_DEFAULT_PORT,DEV_RESOURCE_TOKEN,isValidDevResourceHost,listenOnDevResourcePort,getDevQueueEnv,devCommand};
@@ -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{resolveProjectContext}from"./chunk-X446JLEO.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-EQP3SW72.js";import{printError}from"./chunk-4P66SQRS.js";import{parseArguments}from"./chunk-ZRS5X7M2.js";import{buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-WR5OOWD6.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-JAJW3P42.js";import{getCommandName,getCommandNamePlain}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-RTRCTYW6.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}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 flags 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==="edit")&&(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 edit <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 edit <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 flags"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},1),1}return printError(err),1}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{resolveProjectContext}from"./chunk-GPX6W4GB.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-EQP3SW72.js";import{printError}from"./chunk-TBBU37TD.js";import{parseArguments}from"./chunk-T4AZ3U7O.js";import{buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-BX5KDMLT.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-JAJW3P42.js";import{getCommandName,getCommandNamePlain}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}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 flags 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==="edit")&&(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 edit <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 edit <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 flags"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},1),1}return printError(err),1}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-XZAFPQJC.js"),{default:stamp}=await import("./stamp-OX4YO3KY.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{require_json_parse_better_errors}from"./chunk-N6CNMMSZ.js";import{require_lib}from"./chunk-6ARDCI6T.js";import{CantParseJSONFile}from"./chunk-GI6G3FJJ.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_error_utils=__toESM(require_dist(),1);async function readJSONFile(file){let content=await readFileSafe(file);if(content===null)return content;try{return(0,import_json_parse_better_errors.default)(content)}catch(error){return new CantParseJSONFile(file,(0,import_error_utils.errorToString)(error))}}async function readFileSafe(file){try{return await import_fs_extra.default.readFile(file,"utf8")}catch{return null}}export{readJSONFile};
7
+ import{require_json_parse_better_errors}from"./chunk-N6CNMMSZ.js";import{require_lib}from"./chunk-UB37A37M.js";import{CantParseJSONFile}from"./chunk-LKI6FRNM.js";import{require_dist}from"./chunk-QGIQK47P.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_error_utils=__toESM(require_dist(),1);async function readJSONFile(file){let content=await readFileSafe(file);if(content===null)return content;try{return(0,import_json_parse_better_errors.default)(content)}catch(error){return new CantParseJSONFile(file,(0,import_error_utils.errorToString)(error))}}async function readFileSafe(file){try{return await import_fs_extra.default.readFile(file,"utf8")}catch{return null}}export{readJSONFile};
@@ -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{getGlobalFlagsFromArgs,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-JAJW3P42.js";import{teamCache}from"./chunk-VOZEB6PD.js";import{LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-GI6G3FJJ.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-FI772UVH.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_cli_config}from"./chunk-BRK4OB4B.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{__toESM}from"./chunk-6L236MNA.js";function quoteArg(value){return/^[A-Za-z0-9_./@:-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let args=client.argv.slice(2),separator=args.indexOf("--"),help=args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h");client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}var import_error_utils=__toESM(require_dist(),1);var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function observabilityPlusRecovery(message){if(mentionsObservabilityPlus(message))return/(?:disabled|switched off|re-enable)/i.test(message)?{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."}:/(?:quota|usage limit|query limit)/i.test(message)?{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."}:{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}var import_cli_config=__toESM(require_cli_config(),1);function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||error.code==="NOT_AUTHORIZED"||reason==="not_authorized"||reason==="login_required"){let tokenSource=client?.authConfig.tokenSource??error.tokenSource;if(tokenSource)return{hint:tokenSource==="env"?"Ask the user to replace VERCEL_TOKEN, or unset it to use a saved login. Running login does not replace VERCEL_TOKEN. Retry only after the credentials change.":"Ask the user to replace the token supplied via --token. Retry only after the credentials change.",credentialSource:tokenSource,retryable:!1,userActionRequired:!0};let globalConfig=client?.getGlobalPathConfig();return{hint:"Ask the user to complete login in an interactive terminal, or provide credentials through VERCEL_TOKEN. Retry only after authentication completes.",credentialSource:"saved_login",retryable:!1,userActionRequired:!0,next:[{command:getCommandNamePlain("login")+(globalConfig&&globalConfig!==(0,import_cli_config.getGlobalPathConfig)()?` --global-config ${quoteArg(globalConfig)}`:""),when:"The user runs this in an interactive terminal to complete browser authentication"}]}}if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlusRecovery(message)?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){preserved.push(arg),!arg.includes("=")&&suggestionFlagTakesSeparateValue(arg)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(!payload.choices?.length)return payload;let next=[],linkArgv=[...argv.slice(0,2),"link",...argv.slice(3)];for(let choice of payload.choices){let slug=choice.name;next.push({command:buildCommandWithScope(linkArgv,slug),when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=1){if(!shouldEmitNonInteractiveCommandError(client))return;let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),client.stdout.write(`${JSON.stringify(enriched,null,2)}
7
+ import{getGlobalFlagsFromArgs,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-JAJW3P42.js";import{teamCache}from"./chunk-VOZEB6PD.js";import{LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-LKI6FRNM.js";import{getCommandName,getCommandNamePlain,packageName}from"./chunk-FI772UVH.js";import{require_dist}from"./chunk-QGIQK47P.js";import{require_cli_config}from"./chunk-BRK4OB4B.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{__toESM}from"./chunk-6L236MNA.js";function quoteArg(value){return/^[A-Za-z0-9_./@:-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let args=client.argv.slice(2),separator=args.indexOf("--"),help=args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h");client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}var import_error_utils=__toESM(require_dist(),1);var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function observabilityPlusRecovery(message){if(mentionsObservabilityPlus(message))return/(?:disabled|switched off|re-enable)/i.test(message)?{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."}:/(?:quota|usage limit|query limit)/i.test(message)?{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."}:{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}var import_cli_config=__toESM(require_cli_config(),1);function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||error.code==="NOT_AUTHORIZED"||reason==="not_authorized"||reason==="login_required"){let tokenSource=client?.authConfig.tokenSource??error.tokenSource;if(tokenSource)return{hint:tokenSource==="env"?"Ask the user to replace VERCEL_TOKEN, or unset it to use a saved login. Running login does not replace VERCEL_TOKEN. Retry only after the credentials change.":"Ask the user to replace the token supplied via --token. Retry only after the credentials change.",credentialSource:tokenSource,retryable:!1,userActionRequired:!0};let globalConfig=client?.getGlobalPathConfig();return{hint:"Ask the user to complete login in an interactive terminal, or provide credentials through VERCEL_TOKEN. Retry only after authentication completes.",credentialSource:"saved_login",retryable:!1,userActionRequired:!0,next:[{command:getCommandNamePlain("login")+(globalConfig&&globalConfig!==(0,import_cli_config.getGlobalPathConfig)()?` --global-config ${quoteArg(globalConfig)}`:""),when:"The user runs this in an interactive terminal to complete browser authentication"}]}}if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlusRecovery(message)?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){preserved.push(arg),!arg.includes("=")&&suggestionFlagTakesSeparateValue(arg)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkArgv=[...argv.slice(0,2),"link",...argv.slice(3)];for(let choice of payload.choices){let slug=choice.name;next.push({command:buildCommandWithScope(linkArgv,slug),when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=1){if(!shouldEmitNonInteractiveCommandError(client))return;let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),client.stdout.write(`${JSON.stringify(enriched,null,2)}
8
8
  `),process.exit(exitCode)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function outputAgentError(client,payload,exitCode=1){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client)};trackAgentError(client,enriched),client.stdout.write(`${JSON.stringify(enriched,null,2)}
9
9
  `)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
10
10
  `),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --filter ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --filter <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{quoteArg,mentionsObservabilityPlus,observabilityPlusPurchaseFix,observabilityPlusRecovery,getErrorRecovery,agentErrorMetadata,trackAgentError,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,outputAgentError,writeAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
@@ -73,6 +73,7 @@ import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L23
73
73
  rr | rolling-release [cmd] Manage rolling releases for gradual traffic shifting
74
74
  sandbox Interact with Vercel Sandbox
75
75
  schedules [cmd] Manage schedules for the current project [beta]
76
+ setup Set up the Vercel plugin and AI Gateway for coding agents
76
77
  skills [query] Discover agent skills relevant to your project
77
78
  storage [cmd] Connect and manage storage resources for your Projects
78
79
  target [cmd] Manage custom environments for your Project
@@ -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{AGENT_REASON,AGENT_STATUS}from"./chunk-EQP3SW72.js";import{getScope}from"./chunk-6V3JGAVJ.js";import{getOrgById}from"./chunk-6ARDCI6T.js";import{buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-WR5OOWD6.js";import{output_manager_default}from"./chunk-RTRCTYW6.js";async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId){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}.`;if(output_manager_default.error(`${headline}
7
+ import{AGENT_REASON,AGENT_STATUS}from"./chunk-EQP3SW72.js";import{getScope}from"./chunk-77GUJ4JC.js";import{getOrgById}from"./chunk-UB37A37M.js";import{buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-BX5KDMLT.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId){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}.`;if(output_manager_default.error(`${headline}
8
8
 
9
9
  If it lives in a different team or account:
10
10
  \u2022 Retry with \`--scope <team-slug|your-username>\`, or
@@ -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{VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import{VERCEL_DIR}from"./chunk-6ARDCI6T.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-GI6G3FJJ.js";import{output_manager_default,require_build_utils}from"./chunk-RTRCTYW6.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
7
+ import{VERCEL_CONFIG_EXTENSIONS}from"./chunk-QR7QPUFN.js";import{VERCEL_DIR}from"./chunk-UB37A37M.js";import{ConflictingConfigFiles,DeprecatedNowJson}from"./chunk-LKI6FRNM.js";import{output_manager_default,require_build_utils}from"./chunk-EWWFNMPZ.js";import{__commonJS,__require,__toESM}from"./chunk-6L236MNA.js";var require_main=__commonJS({"../../node_modules/.pnpm/dotenv@4.0.0/node_modules/dotenv/lib/main.js"(exports,module){"use strict";var fs=__require("fs");function parse(src){var obj={};return src.toString().split(`
8
8
  `).forEach(function(line){var keyValueArr=line.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);if(keyValueArr!=null){var key=keyValueArr[1],value=keyValueArr[2]?keyValueArr[2]:"",len=value?value.length:0;len>0&&value.charAt(0)==='"'&&value.charAt(len-1)==='"'&&(value=value.replace(/\\n/gm,`
9
9
  `)),value=value.replace(/(^['"]|['"]$)/g,"").trim(),obj[key]=value}}),obj}function config(options){var path=".env",encoding="utf8";options&&(options.path&&(path=options.path),options.encoding&&(encoding=options.encoding));try{var parsedObj=parse(fs.readFileSync(path,{encoding}));return Object.keys(parsedObj).forEach(function(key){process.env[key]=process.env[key]||parsedObj[key]}),{parsed:parsedObj}}catch(e){return{error:e}}}module.exports.config=config;module.exports.load=config;module.exports.parse=parse}});var import_dotenv=__toESM(require_main(),1);import{mkdir,readFile,writeFile,unlink,access}from"fs/promises";import{join,basename}from"path";import{fork}from"child_process";async function loadEsbuild(){let nativeLoader=Reflect.get(globalThis,Symbol.for("vercel.cli.loadEsbuild"));return typeof nativeLoader=="function"?nativeLoader():import("esbuild")}var import_build_utils=__toESM(require_build_utils(),1);function toRouteFormat(item){if("src"in item)return item;let{source,destination,headers,statusCode,permanent,...rest}=item,route={src:source,...rest};return destination&&(route.dest=destination),headers&&(route.headers=Object.fromEntries(headers.map(h=>[h.key,h.value]))),statusCode!==void 0?route.status=statusCode:permanent!==void 0&&(route.status=permanent?308:307),route}function normalizeConfig(config){let normalized={...config},{rewrites,redirects,headers}=normalized,allRoutes=normalized.routes||[],hasRoutes=allRoutes.length>0,hasRewrites=(rewrites?.length??0)>0,hasRedirects=(redirects?.length??0)>0,hasHeaders=(headers?.length??0)>0;function hasRouteFormat(items){return items?.some(item=>"src"in item)??!1}if(hasRoutes&&(hasRewrites||hasRedirects||hasHeaders))return normalized;let shouldConvertRewrites=hasRewrites&&hasRouteFormat(rewrites),shouldConvertRedirects=hasRedirects&&hasRouteFormat(redirects),shouldConvertHeaders=hasHeaders&&hasRouteFormat(headers);if((shouldConvertRewrites||shouldConvertRedirects||shouldConvertHeaders)&&(hasRewrites&&!shouldConvertRewrites||hasRedirects&&!shouldConvertRedirects||hasHeaders&&!shouldConvertHeaders))throw new import_build_utils.NowBuildError({code:"INVALID_VERCEL_CONFIG",message:"Transforms (e.g., requestHeaders) require the `routes` format, which cannot be used alongside `rewrites`, `redirects`, or `headers`. Move everything into the `routes` array instead.",link:"https://vercel.com/docs/projects/project-configuration#routes"});return rewrites&&shouldConvertRewrites&&(allRoutes=[...allRoutes,...rewrites.map(toRouteFormat)],delete normalized.rewrites),redirects&&shouldConvertRedirects&&(allRoutes=[...allRoutes,...redirects.map(toRouteFormat)],delete normalized.redirects),headers&&shouldConvertHeaders&&(allRoutes=[...allRoutes,...headers.map(toRouteFormat)],delete normalized.headers),allRoutes.length>0&&(normalized.routes=allRoutes.map(toRouteFormat)),normalized}async function fileExists(filePath){try{return await access(filePath),!0}catch{return!1}}async function findAllVercelConfigFiles(workPath){let foundFiles=[];for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);await fileExists(configPath)&&foundFiles.push(configPath)}return foundFiles}async function findSourceVercelConfigFile(workPath){for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join(workPath,`vercel.${ext}`);if(await fileExists(configPath))return basename(configPath)}let tomlPath=join(workPath,"vercel.toml");return await fileExists(tomlPath)?"vercel.toml":null}async function findVercelConfigFile(workPath){let foundFiles=await findAllVercelConfigFiles(workPath);if(foundFiles.length>1)throw new ConflictingConfigFiles(foundFiles,"Multiple vercel config files found. Please use only one configuration file.","https://vercel.com/docs/projects/project-configuration");return foundFiles[0]||null}function parseConfigLoaderError(stderr){if(!stderr.trim())return"";let moduleNotFoundMatch=stderr.match(/Error \[ERR_MODULE_NOT_FOUND\]: Cannot find package '([^']+)'/);if(moduleNotFoundMatch)return`Cannot find package '${moduleNotFoundMatch[1]}'. Make sure it's installed in your project dependencies.`;let syntaxErrorMatch=stderr.match(/SyntaxError: (.+?)(?:\n|$)/);if(syntaxErrorMatch)return`Syntax error: ${syntaxErrorMatch[1]}`;let errorMatch=stderr.match(/^(?:Error|TypeError|ReferenceError): (.+?)(?:\n|$)/m);return errorMatch?errorMatch[1]:stderr.trim()}async function compileVercelConfig(workPath){let vercelJsonPath=join(workPath,"vercel.json"),nowJsonPath=join(workPath,"now.json"),vercelTomlPath=join(workPath,"vercel.toml"),hasVercelJson=await fileExists(vercelJsonPath),hasNowJson=await fileExists(nowJsonPath),hasVercelToml=await fileExists(vercelTomlPath),vercelConfigPath=await findVercelConfigFile(workPath),vercelDir=join(workPath,VERCEL_DIR),compiledConfigPath=join(vercelDir,"vercel.json");if(hasNowJson)throw new DeprecatedNowJson(nowJsonPath);let foundConfigs=[];if(hasVercelJson&&foundConfigs.push(vercelJsonPath),hasVercelToml&&foundConfigs.push(vercelTomlPath),vercelConfigPath&&foundConfigs.push(vercelConfigPath),foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs,`Multiple config files found: ${foundConfigs.map(f=>basename(f)).join(", ")}. Please use only one configuration method.`,"https://vercel.com/docs/projects/project-configuration");if(!vercelConfigPath&&!hasVercelToml)return hasVercelJson?{configPath:vercelJsonPath,wasCompiled:!1}:await fileExists(compiledConfigPath)?{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:await findSourceVercelConfigFile(workPath)??void 0}:{configPath:null,wasCompiled:!1};if(hasVercelToml)try{let{parse:tomlParse}=await import("smol-toml"),tomlContent=await readFile(vercelTomlPath,"utf8"),config=tomlParse(tomlContent),normalizedConfig=normalizeConfig(config);return await mkdir(vercelDir,{recursive:!0}),await writeFile(compiledConfigPath,JSON.stringify(normalizedConfig,null,2),"utf-8"),output_manager_default.debug(`Compiled ${vercelTomlPath} -> ${compiledConfigPath}`),{configPath:compiledConfigPath,wasCompiled:!0,sourceFile:"vercel.toml"}}catch(error){throw new import_build_utils.NowBuildError({code:error.code??"vercel_toml_parse_failed",message:`Failed to parse vercel.toml: ${error.message}`,link:error.link??"https://vercel.com/docs/projects/project-configuration"})}let sourceConfigPath=vercelConfigPath;(0,import_dotenv.config)({path:join(workPath,".env")}),(0,import_dotenv.config)({path:join(workPath,".env.local")});let tempOutPath=join(vercelDir,"vercel-temp.mjs"),loaderPath=join(vercelDir,"vercel-loader.mjs");try{let{build}=await loadEsbuild();await mkdir(vercelDir,{recursive:!0}),await build({entryPoints:[sourceConfigPath],bundle:!0,platform:"node",format:"esm",outfile:tempOutPath,packages:"external",target:"node20",sourcemap:"inline"}),await writeFile(loaderPath,`
10
10
  import { pathToFileURL } from 'url';
@@ -4,6 +4,6 @@ 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{output_manager_default}from"./chunk-RTRCTYW6.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";function isGuidanceEnabled(client,explicit,defaultValue){return explicit!==void 0?explicit:process.env.VERCEL_GUIDANCE_DISABLED?!1:client.config.guidance?.enabled??defaultValue}var import_chalk=__toESM(require_source(),1);function suggestNextCommands(commands){output_manager_default.print(import_chalk.default.dim(["Next steps:",...commands.flatMap(({command,description})=>[`- ${description}:`,` ${command}`])].join(`
7
+ import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";function isGuidanceEnabled(client,explicit,defaultValue){return explicit!==void 0?explicit:process.env.VERCEL_GUIDANCE_DISABLED?!1:client.config.guidance?.enabled??defaultValue}var import_chalk=__toESM(require_source(),1);function suggestNextCommands(commands){output_manager_default.print(import_chalk.default.dim(["Next steps:",...commands.flatMap(({command,description})=>[`- ${description}:`,` ${command}`])].join(`
8
8
  `))),output_manager_default.print(`
9
9
  `)}export{suggestNextCommands,isGuidanceEnabled};
@@ -8,7 +8,7 @@ import{require_dist}from"./chunk-QGIQK47P.js";import{require_escape_string_regex
8
8
  `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function unescape(c){return c[0]==="u"&&c.length===5||c[0]==="x"&&c.length===3?String.fromCharCode(parseInt(c.slice(1),16)):ESCAPES.get(c)||c}function parseArguments(name,args){let results=[],chunks=args.trim().split(/\s*,\s*/g),matches;for(let chunk of chunks)if(!isNaN(chunk))results.push(Number(chunk));else if(matches=chunk.match(STRING_REGEX))results.push(matches[2].replace(ESCAPE_REGEX,(m,escape,chr)=>escape?unescape(escape):chr));else throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);return results}function parseStyle(style){STYLE_REGEX.lastIndex=0;let results=[],matches;for(;(matches=STYLE_REGEX.exec(style))!==null;){let name=matches[1];if(matches[2]){let args=parseArguments(name,matches[2]);results.push([name].concat(args))}else results.push([name])}return results}function buildStyle(chalk4,styles){let enabled={};for(let layer of styles)for(let style of layer.styles)enabled[style[0]]=layer.inverse?null:style.slice(1);let current=chalk4;for(let styleName of Object.keys(enabled))if(Array.isArray(enabled[styleName])){if(!(styleName in current))throw new Error(`Unknown Chalk style: ${styleName}`);enabled[styleName].length>0?current=current[styleName].apply(current,enabled[styleName]):current=current[styleName]}return current}module.exports=(chalk4,tmp)=>{let styles=[],chunks=[],chunk=[];if(tmp.replace(TEMPLATE_REGEX,(m,escapeChar,inverse,style,close,chr)=>{if(escapeChar)chunk.push(unescape(escapeChar));else if(style){let str=chunk.join("");chunk=[],chunks.push(styles.length===0?str:buildStyle(chalk4,styles)(str)),styles.push({inverse,styles:parseStyle(style)})}else if(close){if(styles.length===0)throw new Error("Found extraneous } in Chalk template literal");chunks.push(buildStyle(chalk4,styles)(chunk.join(""))),chunk=[],styles.pop()}else chunk.push(chr)}),chunks.push(chunk.join("")),styles.length>0){let errMsg=`Chalk template literal is missing ${styles.length} closing bracket${styles.length===1?"":"s"} (\`}\`)`;throw new Error(errMsg)}return chunks.join("")}}});var require_chalk=__commonJS({"../../node_modules/.pnpm/chalk@2.4.2/node_modules/chalk/index.js"(exports,module){"use strict";var escapeStringRegexp=require_escape_string_regexp(),ansiStyles=require_ansi_styles(),stdoutColor=require_supports_color2().stdout,template=require_templates(),isSimpleWindowsTerm=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),levelMapping=["ansi","ansi","ansi256","ansi16m"],skipModels=new Set(["gray"]),styles=Object.create(null);function applyOptions(obj,options){options=options||{};let scLevel=stdoutColor?stdoutColor.level:0;obj.level=options.level===void 0?scLevel:options.level,obj.enabled="enabled"in options?options.enabled:obj.level>0}function Chalk(options){if(!this||!(this instanceof Chalk)||this.template){let chalk4={};return applyOptions(chalk4,options),chalk4.template=function(){let args=[].slice.call(arguments);return chalkTag.apply(null,[chalk4.template].concat(args))},Object.setPrototypeOf(chalk4,Chalk.prototype),Object.setPrototypeOf(chalk4.template,chalk4),chalk4.template.constructor=Chalk,chalk4.template}applyOptions(this,options)}isSimpleWindowsTerm&&(ansiStyles.blue.open="\x1B[94m");for(let key of Object.keys(ansiStyles))ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g"),styles[key]={get(){let codes=ansiStyles[key];return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,key)}};styles.visible={get(){return build.call(this,this._styles||[],!0,"visible")}};ansiStyles.color.closeRe=new RegExp(escapeStringRegexp(ansiStyles.color.close),"g");for(let model of Object.keys(ansiStyles.color.ansi))skipModels.has(model)||(styles[model]={get(){let level=this.level;return function(){let codes={open:ansiStyles.color[levelMapping[level]][model].apply(null,arguments),close:ansiStyles.color.close,closeRe:ansiStyles.color.closeRe};return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,model)}}});ansiStyles.bgColor.closeRe=new RegExp(escapeStringRegexp(ansiStyles.bgColor.close),"g");for(let model of Object.keys(ansiStyles.bgColor.ansi)){if(skipModels.has(model))continue;let bgModel="bg"+model[0].toUpperCase()+model.slice(1);styles[bgModel]={get(){let level=this.level;return function(){let codes={open:ansiStyles.bgColor[levelMapping[level]][model].apply(null,arguments),close:ansiStyles.bgColor.close,closeRe:ansiStyles.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,model)}}}}var proto=Object.defineProperties(()=>{},styles);function build(_styles,_empty,key){let builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=_styles,builder._empty=_empty;let self=this;return Object.defineProperty(builder,"level",{enumerable:!0,get(){return self.level},set(level){self.level=level}}),Object.defineProperty(builder,"enabled",{enumerable:!0,get(){return self.enabled},set(enabled){self.enabled=enabled}}),builder.hasGrey=this.hasGrey||key==="gray"||key==="grey",builder.__proto__=proto,builder}function applyStyle(){let args=arguments,argsLen=args.length,str=String(arguments[0]);if(argsLen===0)return"";if(argsLen>1)for(let a=1;a<argsLen;a++)str+=" "+args[a];if(!this.enabled||this.level<=0||!str)return this._empty?"":str;let originalDim=ansiStyles.dim.open;isSimpleWindowsTerm&&this.hasGrey&&(ansiStyles.dim.open="");for(let code of this._styles.slice().reverse())str=code.open+str.replace(code.closeRe,code.open)+code.close,str=str.replace(/\r?\n/g,`${code.close}$&${code.open}`);return ansiStyles.dim.open=originalDim,str}function chalkTag(chalk4,strings){if(!Array.isArray(strings))return[].slice.call(arguments,1).join(" ");let args=[].slice.call(arguments,2),parts=[strings.raw[0]];for(let i=1;i<strings.length;i++)parts.push(String(args[i-1]).replace(/[{}\\]/g,"\\$&")),parts.push(String(strings.raw[i]));return template(chalk4,parts.join(""))}Object.defineProperties(Chalk.prototype,styles);module.exports=Chalk();module.exports.supportsColor=stdoutColor;module.exports.default=module.exports}});var require_mimic_fn=__commonJS({"../../node_modules/.pnpm/mimic-fn@1.2.0/node_modules/mimic-fn/index.js"(exports,module){"use strict";module.exports=(to,from)=>{for(let prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from)))Object.defineProperty(to,prop,Object.getOwnPropertyDescriptor(from,prop));return to}}});var require_onetime=__commonJS({"../../node_modules/.pnpm/onetime@2.0.1/node_modules/onetime/index.js"(exports,module){"use strict";var mimicFn=require_mimic_fn();module.exports=(fn,opts)=>{if(opts===!0)throw new TypeError("The second argument is now an options object");if(typeof fn!="function")throw new TypeError("Expected a function");opts=opts||{};let ret,called=!1,fnName=fn.displayName||fn.name||"<anonymous>",onetime=function(){if(called){if(opts.throw===!0)throw new Error(`Function \`${fnName}\` can only be called once`);return ret}return called=!0,ret=fn.apply(this,arguments),fn=null,ret};return mimicFn(onetime,fn),onetime}}});var require_signals=__commonJS({"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports,module){module.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&module.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&module.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}});var require_signal_exit=__commonJS({"../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports,module){var process2=global.process,processOk=function(process3){return process3&&typeof process3=="object"&&typeof process3.removeListener=="function"&&typeof process3.emit=="function"&&typeof process3.reallyExit=="function"&&typeof process3.listeners=="function"&&typeof process3.kill=="function"&&typeof process3.pid=="number"&&typeof process3.on=="function"};processOk(process2)?(assert=__require("assert"),signals=require_signals(),isWin=/^win/i.test(process2.platform),EE=__require("events"),typeof EE!="function"&&(EE=EE.EventEmitter),process2.__signal_exit_emitter__?emitter=process2.__signal_exit_emitter__:(emitter=process2.__signal_exit_emitter__=new EE,emitter.count=0,emitter.emitted={}),emitter.infinite||(emitter.setMaxListeners(1/0),emitter.infinite=!0),module.exports=function(cb,opts){if(!processOk(global.process))return function(){};assert.equal(typeof cb,"function","a callback must be provided for exit handler"),loaded===!1&&load();var ev="exit";opts&&opts.alwaysLast&&(ev="afterexit");var remove=function(){emitter.removeListener(ev,cb),emitter.listeners("exit").length===0&&emitter.listeners("afterexit").length===0&&unload()};return emitter.on(ev,cb),remove},unload=function(){!loaded||!processOk(global.process)||(loaded=!1,signals.forEach(function(sig){try{process2.removeListener(sig,sigListeners[sig])}catch{}}),process2.emit=originalProcessEmit,process2.reallyExit=originalProcessReallyExit,emitter.count-=1)},module.exports.unload=unload,emit=function(event,code,signal){emitter.emitted[event]||(emitter.emitted[event]=!0,emitter.emit(event,code,signal))},sigListeners={},signals.forEach(function(sig){sigListeners[sig]=function(){if(processOk(global.process)){var listeners=process2.listeners(sig);listeners.length===emitter.count&&(unload(),emit("exit",null,sig),emit("afterexit",null,sig),isWin&&sig==="SIGHUP"&&(sig="SIGINT"),process2.kill(process2.pid,sig))}}}),module.exports.signals=function(){return signals},loaded=!1,load=function(){loaded||!processOk(global.process)||(loaded=!0,emitter.count+=1,signals=signals.filter(function(sig){try{return process2.on(sig,sigListeners[sig]),!0}catch{return!1}}),process2.emit=processEmit,process2.reallyExit=processReallyExit)},module.exports.load=load,originalProcessReallyExit=process2.reallyExit,processReallyExit=function(code){processOk(global.process)&&(process2.exitCode=code||0,emit("exit",process2.exitCode,null),emit("afterexit",process2.exitCode,null),originalProcessReallyExit.call(process2,process2.exitCode))},originalProcessEmit=process2.emit,processEmit=function(ev,arg){if(ev==="exit"&&processOk(global.process)){arg!==void 0&&(process2.exitCode=arg);var ret=originalProcessEmit.apply(this,arguments);return emit("exit",process2.exitCode,null),emit("afterexit",process2.exitCode,null),ret}else return originalProcessEmit.apply(this,arguments)}):module.exports=function(){return function(){}};var assert,signals,isWin,EE,emitter,unload,emit,sigListeners,loaded,load,originalProcessReallyExit,processReallyExit,originalProcessEmit,processEmit}});var require_restore_cursor=__commonJS({"../../node_modules/.pnpm/restore-cursor@2.0.0/node_modules/restore-cursor/index.js"(exports,module){"use strict";var onetime=require_onetime(),signalExit=require_signal_exit();module.exports=onetime(()=>{signalExit(()=>{process.stderr.write("\x1B[?25h")},{alwaysLast:!0})})}});var require_cli_cursor=__commonJS({"../../node_modules/.pnpm/cli-cursor@2.1.0/node_modules/cli-cursor/index.js"(exports){"use strict";var restoreCursor=require_restore_cursor(),hidden=!1;exports.show=stream=>{let s=stream||process.stderr;s.isTTY&&(hidden=!1,s.write("\x1B[?25h"))};exports.hide=stream=>{let s=stream||process.stderr;s.isTTY&&(restoreCursor(),hidden=!0,s.write("\x1B[?25l"))};exports.toggle=(force,stream)=>{force!==void 0&&(hidden=force),hidden?exports.show(stream):exports.hide(stream)}}});var require_log_symbols=__commonJS({"../../node_modules/.pnpm/log-symbols@2.2.0/node_modules/log-symbols/index.js"(exports,module){"use strict";var chalk4=require_chalk(),isSupported=process.platform!=="win32"||process.env.CI||process.env.TERM==="xterm-256color",main={info:chalk4.blue("\u2139"),success:chalk4.green("\u2714"),warning:chalk4.yellow("\u26A0"),error:chalk4.red("\u2716")},fallbacks={info:chalk4.blue("i"),success:chalk4.green("\u221A"),warning:chalk4.yellow("\u203C"),error:chalk4.red("\xD7")};module.exports=isSupported?main:fallbacks}});var require_ansi_regex=__commonJS({"../../node_modules/.pnpm/ansi-regex@4.1.1/node_modules/ansi-regex/index.js"(exports,module){"use strict";module.exports=options=>{options=Object.assign({onlyFirst:!1},options);let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,options.onlyFirst?void 0:"g")}}});var require_strip_ansi=__commonJS({"../../node_modules/.pnpm/strip-ansi@5.2.0/node_modules/strip-ansi/index.js"(exports,module){"use strict";var ansiRegex=require_ansi_regex(),stripAnsi=string=>typeof string=="string"?string.replace(ansiRegex(),""):string;module.exports=stripAnsi;module.exports.default=stripAnsi}});var require_clone=__commonJS({"../../node_modules/.pnpm/clone@1.0.4/node_modules/clone/clone.js"(exports,module){var clone=function(){"use strict";function clone2(parent,circular,depth,prototype){var filter;typeof circular=="object"&&(depth=circular.depth,prototype=circular.prototype,filter=circular.filter,circular=circular.circular);var allParents=[],allChildren=[],useBuffer=typeof Buffer<"u";typeof circular>"u"&&(circular=!0),typeof depth>"u"&&(depth=1/0);function _clone(parent2,depth2){if(parent2===null)return null;if(depth2==0)return parent2;var child,proto;if(typeof parent2!="object")return parent2;if(clone2.__isArray(parent2))child=[];else if(clone2.__isRegExp(parent2))child=new RegExp(parent2.source,__getRegExpFlags(parent2)),parent2.lastIndex&&(child.lastIndex=parent2.lastIndex);else if(clone2.__isDate(parent2))child=new Date(parent2.getTime());else{if(useBuffer&&Buffer.isBuffer(parent2))return Buffer.allocUnsafe?child=Buffer.allocUnsafe(parent2.length):child=new Buffer(parent2.length),parent2.copy(child),child;typeof prototype>"u"?(proto=Object.getPrototypeOf(parent2),child=Object.create(proto)):(child=Object.create(prototype),proto=prototype)}if(circular){var index=allParents.indexOf(parent2);if(index!=-1)return allChildren[index];allParents.push(parent2),allChildren.push(child)}for(var i in parent2){var attrs;proto&&(attrs=Object.getOwnPropertyDescriptor(proto,i)),!(attrs&&attrs.set==null)&&(child[i]=_clone(parent2[i],depth2-1))}return child}return _clone(parent,depth)}clone2.clonePrototype=function(parent){if(parent===null)return null;var c=function(){};return c.prototype=parent,new c};function __objToStr(o){return Object.prototype.toString.call(o)}clone2.__objToStr=__objToStr;function __isDate(o){return typeof o=="object"&&__objToStr(o)==="[object Date]"}clone2.__isDate=__isDate;function __isArray(o){return typeof o=="object"&&__objToStr(o)==="[object Array]"}clone2.__isArray=__isArray;function __isRegExp(o){return typeof o=="object"&&__objToStr(o)==="[object RegExp]"}clone2.__isRegExp=__isRegExp;function __getRegExpFlags(re){var flags="";return re.global&&(flags+="g"),re.ignoreCase&&(flags+="i"),re.multiline&&(flags+="m"),flags}return clone2.__getRegExpFlags=__getRegExpFlags,clone2}();typeof module=="object"&&module.exports&&(module.exports=clone)}});var require_defaults=__commonJS({"../../node_modules/.pnpm/defaults@1.0.4/node_modules/defaults/index.js"(exports,module){var clone=require_clone();module.exports=function(options,defaults){return options=options||{},Object.keys(defaults).forEach(function(key){typeof options[key]>"u"&&(options[key]=clone(defaults[key]))}),options}}});var require_combining=__commonJS({"../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/combining.js"(exports,module){module.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]}});var require_wcwidth=__commonJS({"../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/index.js"(exports,module){"use strict";var defaults=require_defaults(),combining=require_combining(),DEFAULTS={nul:0,control:0};module.exports=function(str){return wcswidth(str,DEFAULTS)};module.exports.config=function(opts){return opts=defaults(opts||{},DEFAULTS),function(str){return wcswidth(str,opts)}};function wcswidth(str,opts){if(typeof str!="string")return wcwidth(str,opts);for(var s=0,i=0;i<str.length;i++){var n=wcwidth(str.charCodeAt(i),opts);if(n<0)return-1;s+=n}return s}function wcwidth(ucs,opts){return ucs===0?opts.nul:ucs<32||ucs>=127&&ucs<160?opts.control:bisearch(ucs)?0:1+(ucs>=4352&&(ucs<=4447||ucs==9001||ucs==9002||ucs>=11904&&ucs<=42191&&ucs!=12351||ucs>=44032&&ucs<=55203||ucs>=63744&&ucs<=64255||ucs>=65040&&ucs<=65049||ucs>=65072&&ucs<=65135||ucs>=65280&&ucs<=65376||ucs>=65504&&ucs<=65510||ucs>=131072&&ucs<=196605||ucs>=196608&&ucs<=262141))}function bisearch(ucs){var min=0,max=combining.length-1,mid;if(ucs<combining[0][0]||ucs>combining[max][1])return!1;for(;max>=min;)if(mid=Math.floor((min+max)/2),ucs>combining[mid][1])min=mid+1;else if(ucs<combining[mid][0])max=mid-1;else return!0;return!1}}});var require_ora=__commonJS({"../../node_modules/.pnpm/ora@3.4.0/node_modules/ora/index.js"(exports,module){"use strict";var chalk4=require_chalk(),cliCursor=require_cli_cursor(),cliSpinners=require_cli_spinners(),logSymbols=require_log_symbols(),stripAnsi=require_strip_ansi(),wcwidth=require_wcwidth(),TEXT=Symbol("text"),PREFIX_TEXT=Symbol("prefixText"),Ora=class{constructor(options){typeof options=="string"&&(options={text:options}),this.options=Object.assign({text:"",color:"cyan",stream:process.stderr},options),this.spinner=this.options.spinner,this.color=this.options.color,this.hideCursor=this.options.hideCursor!==!1,this.interval=this.options.interval||this.spinner.interval||100,this.stream=this.options.stream,this.id=null,this.isEnabled=typeof this.options.isEnabled=="boolean"?this.options.isEnabled:this.stream&&this.stream.isTTY&&!process.env.CI,this.text=this.options.text,this.prefixText=this.options.prefixText,this.linesToClear=0,this.indent=this.options.indent}get indent(){return this._indent}set indent(indent=0){if(!(indent>=0&&Number.isInteger(indent)))throw new Error("The `indent` option must be an integer from 0 and up");this._indent=indent}get spinner(){return this._spinner}set spinner(spinner){if(this.frameIndex=0,typeof spinner=="object"){if(spinner.frames===void 0)throw new Error("The given spinner must have a `frames` property");this._spinner=spinner}else if(process.platform==="win32")this._spinner=cliSpinners.line;else if(spinner===void 0)this._spinner=cliSpinners.dots;else if(cliSpinners[spinner])this._spinner=cliSpinners[spinner];else throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json for a full list.`)}get text(){return this[TEXT]}get prefixText(){return this[PREFIX_TEXT]}get isSpinning(){return this.id!==null}updateLineCount(){let columns=this.stream.columns||80,fullPrefixText=typeof this[PREFIX_TEXT]=="string"?this[PREFIX_TEXT]+"-":"";this.lineCount=stripAnsi(fullPrefixText+"--"+this[TEXT]).split(`
9
9
  `).reduce((count,line)=>count+Math.max(1,Math.ceil(wcwidth(line)/columns)),0)}set text(value){this[TEXT]=value,this.updateLineCount()}set prefixText(value){this[PREFIX_TEXT]=value,this.updateLineCount()}frame(){let{frames}=this.spinner,frame=frames[this.frameIndex];this.color&&(frame=chalk4[this.color](frame)),this.frameIndex=++this.frameIndex%frames.length;let fullPrefixText=typeof this.prefixText=="string"?this.prefixText+" ":"",fullText=typeof this.text=="string"?" "+this.text:"";return fullPrefixText+frame+fullText}clear(){if(!this.isEnabled||!this.stream.isTTY)return this;for(let i=0;i<this.linesToClear;i++)i>0&&this.stream.moveCursor(0,-1),this.stream.clearLine(),this.stream.cursorTo(this.indent);return this.linesToClear=0,this}render(){return this.clear(),this.stream.write(this.frame()),this.linesToClear=this.lineCount,this}start(text){return text&&(this.text=text),this.isEnabled?this.isSpinning?this:(this.hideCursor&&cliCursor.hide(this.stream),this.render(),this.id=setInterval(this.render.bind(this),this.interval),this):(this.stream.write(`- ${this.text}
10
10
  `),this)}stop(){return this.isEnabled?(clearInterval(this.id),this.id=null,this.frameIndex=0,this.clear(),this.hideCursor&&cliCursor.show(this.stream),this):this}succeed(text){return this.stopAndPersist({symbol:logSymbols.success,text})}fail(text){return this.stopAndPersist({symbol:logSymbols.error,text})}warn(text){return this.stopAndPersist({symbol:logSymbols.warning,text})}info(text){return this.stopAndPersist({symbol:logSymbols.info,text})}stopAndPersist(options={}){let prefixText=options.prefixText||this.prefixText,fullPrefixText=typeof prefixText=="string"?prefixText+" ":"",text=options.text||this.text,fullText=typeof text=="string"?" "+text:"";return this.stop(),this.stream.write(`${fullPrefixText}${options.symbol||" "}${fullText}
11
- `),this}},oraFactory=function(opts){return new Ora(opts)};module.exports=oraFactory;module.exports.default=oraFactory;module.exports.promise=(action,options)=>{if(typeof action.then!="function")throw new TypeError("Parameter `action` must be a Promise");let spinner=new Ora(options);return spinner.start(),action.then(()=>{spinner.succeed()},()=>{spinner.fail()}),spinner}}});var require_build_utils=__commonJS({"cjs-dependency:@vercel/build-utils"(exports,module){module.exports=__require("@vercel/build-utils")}});var import_chalk=__toESM(require_source(),1),link=import_chalk.default.cyan.underline,link_default=link;var import_ansi_escapes=__toESM(require_ansi_escapes(),1);function eraseLines(numberOfLines){return import_ansi_escapes.default.eraseLines(numberOfLines)}var emojiLabels={notice:"\u{1F4DD}",tip:"\u{1F4A1}",warning:"\u2757\uFE0F",link:"\u{1F517}",inspect:"\u{1F50D}",success:"\u2705",locked:"\u{1F512}",loading:"\u23F3"},stripEmojiRegex=new RegExp(Object.values(emojiLabels).join("|"),"gi");function emoji(label){return emojiLabels[label]}function prependEmoji(message,emoji2){return emoji2&&process.stdout.isTTY?`${emoji2} ${message}`:message}function removeEmoji(message){let result=message.replace(stripEmojiRegex,"");return result.startsWith(`
11
+ `),this}},oraFactory=function(opts){return new Ora(opts)};module.exports=oraFactory;module.exports.default=oraFactory;module.exports.promise=(action,options)=>{if(typeof action.then!="function")throw new TypeError("Parameter `action` must be a Promise");let spinner=new Ora(options);return spinner.start(),action.then(()=>{spinner.succeed()},()=>{spinner.fail()}),spinner}}});var require_build_utils=__commonJS({"cjs-dependency:@vercel/build-utils"(exports,module){module.exports=__require("@vercel/build-utils")}});var import_chalk=__toESM(require_source(),1),link=import_chalk.default.cyan.underline,link_default=link;var import_ansi_escapes=__toESM(require_ansi_escapes(),1);function eraseLines(numberOfLines){return import_ansi_escapes.default.eraseLines(numberOfLines)}function toValueWithArgs(valFn,...args){return typeof valFn=="function"?valFn(...args):valFn}var captureStackTrace=Error.captureStackTrace,Diagnostic=class Diagnostic2 extends Error{name="Diagnostic";docs;fix;sources;get why(){return this.message}constructor(init,captureFrom=Diagnostic2){super(init.why,{cause:init.cause}),this.fix=init.fix,this.docs=init.docs,this.sources=init.sources,captureStackTrace?.(this,captureFrom)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function deriveDocs(docsBase,code){return typeof docsBase=="string"?`${docsBase}/${code.toLowerCase()}`:docsBase?.(code)}function defineDiagnostics(options){let reporters=options.reporters??[],result={},{docsBase}=options;for(let code of Object.keys(options.codes)){let def=options.codes[code],docs=def.docs===!1?void 0:def.docs||deriveDocs(docsBase,code),handle=(params={},reporterOptions={})=>{let diagnostic=new Diagnostic({why:toValueWithArgs(def.why,params),fix:toValueWithArgs(def.fix,params),docs,cause:params.cause,sources:params.sources},handle);diagnostic.name=code;for(let reporter of reporters)reporter(diagnostic,reporterOptions);return diagnostic};result[code]=handle}return result}var emojiLabels={notice:"\u{1F4DD}",tip:"\u{1F4A1}",warning:"\u2757\uFE0F",link:"\u{1F517}",inspect:"\u{1F50D}",success:"\u2705",locked:"\u{1F512}",loading:"\u23F3"},stripEmojiRegex=new RegExp(Object.values(emojiLabels).join("|"),"gi");function emoji(label){return emojiLabels[label]}function prependEmoji(message,emoji2){return emoji2&&process.stdout.isTTY?`${emoji2} ${message}`:message}function removeEmoji(message){let result=message.replace(stripEmojiRegex,"");return result.startsWith(`
12
12
  `)?result:result.trimStart()}var import_chalk3=__toESM(require_source(),1),ansiEscapes2=__toESM(require_ansi_escapes(),1),import_supports_hyperlinks=__toESM(require_supports_hyperlinks(),1);var import_ora=__toESM(require_ora(),1),import_chalk2=__toESM(require_source(),1);function wait(opts,delay=300){let text=opts.text,spinner=null;if(typeof text!="string")throw new Error('"text" is required for Ora spinner');let timeout=setTimeout(()=>{spinner=(0,import_ora.default)(opts),spinner.text=import_chalk2.default.gray(text),spinner.color="gray",spinner.start()},delay),stop=()=>{clearTimeout(timeout),spinner&&(spinner.stop(),spinner=null,process.stderr.write(eraseLines(1)))};return stop.text=text,Object.defineProperty(stop,"text",{get(){return text},set(v){text=v,spinner&&(spinner.text=import_chalk2.default.gray(v))}}),stop}var import_error_utils=__toESM(require_dist(),1);import{inspect}from"util";var chars={tick:process.platform==="win32"?"\u221A":"\u2714",cross:process.platform==="win32"?"\u2613":"\u2718",fatal:process.platform==="win32"?"x":"\u2717"},chars_default=chars;var IS_TEST=process.env.NODE_ENV==="test",defaultChalkColorLevel=0,Output=class{constructor(stream,options={}){this.isDebugEnabled=()=>this.debugEnabled;this.print=str=>{this.colorDisabled&&(str=removeEmoji(str)),this.stopSpinner(),this.stream.write(str)};this.log=(str,color=import_chalk3.default.grey)=>{this.print(`${color(">")} ${str}
13
13
  `)};this.dim=(str,color=import_chalk3.default.grey)=>{this.print(`${color(`> ${str}`)}
14
14
  `)};this.warn=(str,slug=null,link3=null,action="Learn More")=>{let details=slug?`https://err.sh/vercel/${slug}`:link3;this.print(import_chalk3.default.yellow(import_chalk3.default.bold("WARNING! ")+str+(details?`
@@ -17,7 +17,8 @@ ${action}: ${link_default(details)}`:""))),this.print(`
17
17
  `);let details=slug?`https://err.sh/vercel/${slug}`:link3;details&&this.print(`${import_chalk3.default.bold(action)}: ${link_default(details)}
18
18
  `)};this.fatal=str=>{this.print(`${import_chalk3.default.red(chars_default.fatal)} ${str.replace(/\n/g,`
19
19
  `)}
20
- `)};this.prettyError=err=>this.error((0,import_error_utils.errorToString)(err),void 0,err.link,err.action);this.ready=str=>{this.print(`${import_chalk3.default.cyan("> Ready!")} ${str}
20
+ `)};this.prettyError=err=>{if(err instanceof Diagnostic){let code=err.name&&err.name!=="Diagnostic"?err.name:void 0,str=code?`${import_chalk3.default.dim(`[${code}]`)} ${(0,import_error_utils.errorToString)(err)}`:(0,import_error_utils.errorToString)(err);err.fix&&(str+=`
21
+ ${import_chalk3.default.bold("Fix:")} ${err.fix}`);let action=err.action;return this.error(str,void 0,err.docs,action??"Learn More")}return this.error((0,import_error_utils.errorToString)(err),void 0,err.link,err.action)};this.ready=str=>{this.print(`${import_chalk3.default.cyan("> Ready!")} ${str}
21
22
  `)};this.success=str=>{this.print(`${import_chalk3.default.cyan("> Success!")} ${str}
22
23
  `)};this.debug=debug=>{this.debugEnabled&&this.log(`${import_chalk3.default.bold("[debug]")} ${import_chalk3.default.gray(`[${new Date().toISOString()}]`)} ${debugToString(debug)}`)};this.spinner=(message,delay=300)=>{if(this.debugEnabled){this.debug(`Spinner invoked (${message}) with a ${delay}ms delay`);return}IS_TEST||!this.stream.isTTY?this.print(`${message}
23
- `):(this.spinnerMessage=message,this._spinner?this._spinner.text=message:this._spinner=wait({text:message,stream:this.stream},delay))};this.stopSpinner=()=>{if(this.debugEnabled&&this.spinnerMessage){let msg=`Spinner stopped (${this.spinnerMessage})`;this.spinnerMessage="",this.debug(msg)}this._spinner&&(this._spinner(),this._spinner=null,this.spinnerMessage="")};this.time=async(label,fn)=>{let promise=typeof fn=="function"?fn():fn;if(this.debugEnabled){let startLabel=typeof label=="function"?label():label;this.debug(startLabel);let start=Date.now(),r=await promise,endLabel=typeof label=="function"?label(r):label,duration=Date.now()-start,durationPretty=duration<1e3?`${duration}ms`:`${(duration/1e3).toFixed(2)}s`;return this.debug(`${endLabel} ${import_chalk3.default.gray(`[${durationPretty}]`)}`),r}return promise};this.link=(text,url,{fallback,color=import_chalk3.default.cyan}={})=>this.supportsHyperlink?ansiEscapes2.link(color?color(text):text,url):fallback===!1?link_default(text):typeof fallback=="function"?fallback():`${text} (${link_default(url)})`;this.spinnerMessage="",this._spinner=null,this.initialize({...options,stream})}initialize({stream,debug:debugEnabled,supportsHyperlink,noColor}={}){stream!==void 0&&(this.stream=stream),debugEnabled!==void 0&&(this.debugEnabled=debugEnabled),supportsHyperlink===void 0?this.supportsHyperlink=(0,import_supports_hyperlinks.supportsHyperlink)(this.stream):this.supportsHyperlink=supportsHyperlink,noColor!==void 0&&(this.colorDisabled=getNoColor(noColor),this.colorDisabled?(defaultChalkColorLevel=import_chalk3.default.level,import_chalk3.default.level=0):import_chalk3.default.level=defaultChalkColorLevel)}};function getNoColor(noColorArg){return!!(process.env.FORCE_COLOR==="0"||process.env.NO_COLOR==="1"||noColorArg)}function debugToString(debug){return typeof debug=="string"?debug:inspect(debug)}var output=new Output(process.stderr,{debug:!1}),output_manager_default=output;export{link_default,require_signal_exit,eraseLines,emoji,prependEmoji,chars_default,output_manager_default,require_build_utils};
24
+ `):(this.spinnerMessage=message,this._spinner?this._spinner.text=message:this._spinner=wait({text:message,stream:this.stream},delay))};this.stopSpinner=()=>{if(this.debugEnabled&&this.spinnerMessage){let msg=`Spinner stopped (${this.spinnerMessage})`;this.spinnerMessage="",this.debug(msg)}this._spinner&&(this._spinner(),this._spinner=null,this.spinnerMessage="")};this.time=async(label,fn)=>{let promise=typeof fn=="function"?fn():fn;if(this.debugEnabled){let startLabel=typeof label=="function"?label():label;this.debug(startLabel);let start=Date.now(),r=await promise,endLabel=typeof label=="function"?label(r):label,duration=Date.now()-start,durationPretty=duration<1e3?`${duration}ms`:`${(duration/1e3).toFixed(2)}s`;return this.debug(`${endLabel} ${import_chalk3.default.gray(`[${durationPretty}]`)}`),r}return promise};this.link=(text,url,{fallback,color=import_chalk3.default.cyan}={})=>this.supportsHyperlink?ansiEscapes2.link(color?color(text):text,url):fallback===!1?link_default(text):typeof fallback=="function"?fallback():`${text} (${link_default(url)})`;this.spinnerMessage="",this._spinner=null,this.initialize({...options,stream})}initialize({stream,debug:debugEnabled,supportsHyperlink,noColor}={}){stream!==void 0&&(this.stream=stream),debugEnabled!==void 0&&(this.debugEnabled=debugEnabled),supportsHyperlink===void 0?this.supportsHyperlink=(0,import_supports_hyperlinks.supportsHyperlink)(this.stream):this.supportsHyperlink=supportsHyperlink,noColor!==void 0&&(this.colorDisabled=getNoColor(noColor),this.colorDisabled?(defaultChalkColorLevel=import_chalk3.default.level,import_chalk3.default.level=0):import_chalk3.default.level=defaultChalkColorLevel)}};function getNoColor(noColorArg){return!!(process.env.FORCE_COLOR==="0"||process.env.NO_COLOR==="1"||noColorArg)}function debugToString(debug){return typeof debug=="string"?debug:inspect(debug)}var output=new Output(process.stderr,{debug:!1}),output_manager_default=output;export{link_default,require_signal_exit,eraseLines,Diagnostic,defineDiagnostics,emoji,prependEmoji,chars_default,output_manager_default,require_build_utils};
@@ -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{require_dist,require_dist2}from"./chunk-LASMHNUP.js";import{require_types}from"./chunk-GHM7V3GG.js";import{require_build_utils}from"./chunk-RTRCTYW6.js";import{__commonJS,__toESM}from"./chunk-6L236MNA.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.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),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});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{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}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["expression","target","name"],properties:{expression:{type:"object",additionalProperties:!1,required:["cron"],properties:{cron:{type:"string"},jitter:{type:"integer",minimum:1,maximum:15}}},target:{oneOf:[{type:"object",additionalProperties:!1,required:["function"],properties:{function:{type:"string",minLength:1}}},{type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256}}}]},name:{type:"string",minLength:1,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},payload:{}}}},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},servicesServiceNamePattern="^[a-z]([a-z_-]*[a-z])?$",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:servicesServiceNamePattern},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"},{type:"array",items:{type:"string"}}]},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}}),getServicesSchema=()=>({type:"object",propertyNames:{pattern:servicesServiceNamePattern,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),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()}}}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}for(let[index,schedule]of(config.schedules??[]).entries())if(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[${index}].timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}for(let[pattern,fn]of Object.entries(config.functions??{}))if(fn.affinity!==void 0)return new import_build_utils.NowBuildError({code:"FUNCTION_AFFINITY_REQUIRES_SERVICE",message:`Function affinity can only be configured under a service. Move functions[${JSON.stringify(pattern)}].affinity into the relevant service's functions configuration.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"});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(servicesConfig){let serviceNames=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames.has(binding.service))return 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}export{require_dist3 as require_dist,validateConfig};
7
+ import{require_dist,require_dist2}from"./chunk-GJTA7DJO.js";import{require_types}from"./chunk-GHM7V3GG.js";import{require_build_utils}from"./chunk-EWWFNMPZ.js";import{__commonJS,__toESM}from"./chunk-6L236MNA.js";var require_dist3=__commonJS({"../../internals/service-topology/dist/index.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),src_exports={};__export(src_exports,{INTERNAL_SERVICE_PREFIX:()=>import_fs_detectors2.INTERNAL_SERVICE_PREFIX,autoDetectServices:()=>import_fs_detectors2.autoDetectServices,detectServices:()=>import_fs_detectors2.detectServices,generateServiceRewrites:()=>import_fs_detectors2.generateServiceRewrites,generateServicesRoutes:()=>import_fs_detectors2.generateServicesRoutes,getInternalServiceCronPath:()=>import_fs_detectors2.getInternalServiceCronPath,getInternalServiceCronPathPrefix:()=>import_fs_detectors2.getInternalServiceCronPathPrefix,getInternalServiceFunctionPath:()=>import_fs_detectors2.getInternalServiceFunctionPath,getInternalServiceWorkerPath:()=>import_fs_detectors2.getInternalServiceWorkerPath,getInternalServiceWorkerPathPrefix:()=>import_fs_detectors2.getInternalServiceWorkerPathPrefix,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,resolveAllConfiguredServicesV2:()=>import_fs_detectors2.resolveAllConfiguredServicesV2,resolveConfiguredServiceV2:()=>import_fs_detectors2.resolveConfiguredServiceV2,validateServiceConfigV2:()=>import_fs_detectors2.validateServiceConfigV2});module.exports=__toCommonJS(src_exports);var import_fs_detectors2=require_dist2()}});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{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}}}},schedulesSchema={type:"array",minItems:0,maxItems:100,items:{type:"object",additionalProperties:!1,required:["expression","target","name"],properties:{expression:{type:"object",additionalProperties:!1,required:["cron"],properties:{cron:{type:"string"},jitter:{type:"integer",minimum:1,maximum:15}}},target:{oneOf:[{type:"object",additionalProperties:!1,required:["function"],properties:{function:{type:"string",minLength:1}}},{type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256}}}]},name:{type:"string",minLength:1,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},payload:{}}}},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},servicesServiceNamePattern="^[a-z]([a-z_-]*[a-z])?$",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:servicesServiceNamePattern},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"},{type:"array",items:{type:"string"}}]},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}}),getServicesSchema=()=>({type:"object",propertyNames:{pattern:servicesServiceNamePattern,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),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()}}}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}for(let[index,schedule]of(config.schedules??[]).entries())if(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[${index}].timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}for(let[pattern,fn]of Object.entries(config.functions??{}))if(fn.affinity!==void 0)return new import_build_utils.NowBuildError({code:"FUNCTION_AFFINITY_REQUIRES_SERVICE",message:`Function affinity can only be configured under a service. Move functions[${JSON.stringify(pattern)}].affinity into the relevant service's functions configuration.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"});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(servicesConfig){let serviceNames=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames.has(binding.service))return 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}export{require_dist3 as require_dist,validateConfig};
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{require_ms}from"./chunk-QTKJC2O5.js";import{output_manager_default}from"./chunk-RTRCTYW6.js";import{__toESM}from"./chunk-6L236MNA.js";var import_ms=__toESM(require_ms(),1);function parseTimeFlag(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds!==void 0)return new Date(Date.now()-milliseconds);let date=new Date(input);if(isNaN(date.getTime()))throw new Error(`Invalid time format "${input}". Use relative (1h, 30m, 2d, 1w) or ISO 8601 datetime.`);return date}function resolveTimeRange(since="1h",until){let startTime=parseTimeFlag(since),endTime=until?parseTimeFlag(until):new Date;return{startTime,endTime}}function validateAllProjectMutualExclusivity(all,project){return all&&project?{valid:!1,code:"MUTUAL_EXCLUSIVITY",message:"Cannot specify both --all and --project. Use one or the other."}:{valid:!0}}function validateTimeBound(input){if(!input)return{valid:!0,value:void 0};try{return{valid:!0,value:parseTimeFlag(input)}}catch(err){return{valid:!1,code:"INVALID_TIME",message:err.message}}}function validateTimeOrder(since,until){return since&&until&&since.getTime()>until.getTime()?{valid:!1,code:"INVALID_TIME_RANGE",message:"`--since` must be earlier than `--until`."}:{valid:!0}}function normalizeRepeatableStringFilters(filters){if(!filters||filters.length===0)return[];let normalized=filters.flatMap(filter=>filter.split(",")).map(filter=>filter.trim()).filter(Boolean);return[...new Set(normalized)]}function validateIntegerRangeWithDefault(value,opts){return value===void 0?{valid:!0,value:opts.defaultValue}:Number.isNaN(value)?{valid:!1,code:"INVALID_LIMIT",message:`Please provide a number for flag \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function validateOptionalIntegerRange(value,opts){return value===void 0?{valid:!0,value:void 0}:Number.isNaN(value)?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`Please provide a number for flag \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function formatJsonError(code,message){return`${JSON.stringify({error:{code,message}},null,2)}
7
+ import{require_ms}from"./chunk-QTKJC2O5.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{__toESM}from"./chunk-6L236MNA.js";var import_ms=__toESM(require_ms(),1);function parseTimeFlag(input){let milliseconds=(0,import_ms.default)(input);if(milliseconds!==void 0)return new Date(Date.now()-milliseconds);let date=new Date(input);if(isNaN(date.getTime()))throw new Error(`Invalid time format "${input}". Use relative (1h, 30m, 2d, 1w) or ISO 8601 datetime.`);return date}function resolveTimeRange(since="1h",until){let startTime=parseTimeFlag(since),endTime=until?parseTimeFlag(until):new Date;return{startTime,endTime}}function validateAllProjectMutualExclusivity(all,project){return all&&project?{valid:!1,code:"MUTUAL_EXCLUSIVITY",message:"Cannot specify both --all and --project. Use one or the other."}:{valid:!0}}function validateTimeBound(input){if(!input)return{valid:!0,value:void 0};try{return{valid:!0,value:parseTimeFlag(input)}}catch(err){return{valid:!1,code:"INVALID_TIME",message:err.message}}}function validateTimeOrder(since,until){return since&&until&&since.getTime()>until.getTime()?{valid:!1,code:"INVALID_TIME_RANGE",message:"`--since` must be earlier than `--until`."}:{valid:!0}}function normalizeRepeatableStringFilters(filters){if(!filters||filters.length===0)return[];let normalized=filters.flatMap(filter=>filter.split(",")).map(filter=>filter.trim()).filter(Boolean);return[...new Set(normalized)]}function validateIntegerRangeWithDefault(value,opts){return value===void 0?{valid:!0,value:opts.defaultValue}:Number.isNaN(value)?{valid:!1,code:"INVALID_LIMIT",message:`Please provide a number for flag \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function validateOptionalIntegerRange(value,opts){return value===void 0?{valid:!0,value:void 0}:Number.isNaN(value)?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`Please provide a number for flag \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function formatJsonError(code,message){return`${JSON.stringify({error:{code,message}},null,2)}
8
8
  `}function writeJsonError(client,code,message){client.stdout.write(formatJsonError(code,message))}function outputError(client,jsonOutput,code,message){return jsonOutput?writeJsonError(client,code,message):output_manager_default.error(message),1}function handleValidationError(result,jsonOutput,client){return outputError(client,jsonOutput,result.code,result.message)}export{parseTimeFlag,resolveTimeRange,validateAllProjectMutualExclusivity,validateTimeBound,validateTimeOrder,normalizeRepeatableStringFilters,validateIntegerRangeWithDefault,validateOptionalIntegerRange,writeJsonError,outputError,handleValidationError};