vercel 64.5.0 → 64.7.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 (250) hide show
  1. package/dist/chunks/{add-KBBLLPHW.js → add-J6YV6RJ7.js} +1 -1
  2. package/dist/chunks/{add-CG73LA5A.js → add-LN5C4Y2G.js} +1 -1
  3. package/dist/chunks/add-UBG7IGYE.js +8 -0
  4. package/dist/chunks/{build-7EWHBKAN.js → build-7QUO5T72.js} +1 -1
  5. package/dist/chunks/chunk-2B2Z447M.js +10 -0
  6. package/dist/chunks/{chunk-XEBMH33W.js → chunk-2EYJFHEL.js} +1 -1
  7. package/dist/chunks/chunk-2IRZ2C5L.js +9 -0
  8. package/dist/chunks/{chunk-UGMTKOTN.js → chunk-2LMIOQID.js} +1 -1
  9. package/dist/chunks/{chunk-TCQZFIBR.js → chunk-2PSLXHNT.js} +1 -1
  10. package/dist/chunks/chunk-3BTEMYLT.js +7 -0
  11. package/dist/chunks/chunk-4ITTBUCW.js +7 -0
  12. package/dist/chunks/chunk-4KYSK2MS.js +7 -0
  13. package/dist/chunks/{chunk-XXCWQPAH.js → chunk-4XKEOH4J.js} +1 -1
  14. package/dist/chunks/{chunk-VS7O22ED.js → chunk-54KLVDB5.js} +1 -1
  15. package/dist/chunks/{chunk-MPZFMEVK.js → chunk-7ENWK2AH.js} +1 -1
  16. package/dist/chunks/{chunk-QOFK5PKB.js → chunk-A4NHFQVX.js} +2 -2
  17. package/dist/chunks/{chunk-QEXSF4NA.js → chunk-AAFST44A.js} +1 -1
  18. package/dist/chunks/chunk-AGH2CMUM.js +7 -0
  19. package/dist/chunks/chunk-ANUSL4ES.js +7 -0
  20. package/dist/chunks/chunk-AOYNYH5D.js +7 -0
  21. package/dist/chunks/chunk-BMQREWR6.js +10 -0
  22. package/dist/chunks/chunk-BXHADCSX.js +7 -0
  23. package/dist/chunks/{chunk-Q5ZGA2RO.js → chunk-CFEJIJGS.js} +1 -1
  24. package/dist/chunks/{chunk-7GFRZWLE.js → chunk-CQQQSUQX.js} +1 -1
  25. package/dist/chunks/{chunk-JH257EDL.js → chunk-D7X7W4F4.js} +1 -1
  26. package/dist/chunks/{chunk-UQIVF4Q2.js → chunk-DD5XIW5T.js} +1 -1
  27. package/dist/chunks/{chunk-ZQKDO5PL.js → chunk-DQLWDDNU.js} +1 -1
  28. package/dist/chunks/{chunk-PAOR4MQZ.js → chunk-DX6PPIY7.js} +1 -1
  29. package/dist/chunks/chunk-EU2FGSLR.js +15 -0
  30. package/dist/chunks/{chunk-6UCSM3CZ.js → chunk-EVEH3L3V.js} +1 -1
  31. package/dist/chunks/{chunk-TPVAPVQC.js → chunk-EVXOSCYR.js} +1 -1
  32. package/dist/chunks/chunk-EWK3VAME.js +9 -0
  33. package/dist/chunks/{chunk-DRXOTZSJ.js → chunk-EWUSBHX5.js} +1 -1
  34. package/dist/chunks/chunk-F2TLISI5.js +7 -0
  35. package/dist/chunks/chunk-FOGLMAZE.js +7 -0
  36. package/dist/chunks/{chunk-3DP66SQ4.js → chunk-FZUNGPGO.js} +1 -1
  37. package/dist/chunks/{chunk-GVUB6QGX.js → chunk-GH6O7YJ3.js} +1 -1
  38. package/dist/chunks/{chunk-6QRT6USI.js → chunk-GOVZY7W2.js} +1 -1
  39. package/dist/chunks/{chunk-LD5U73LA.js → chunk-HGTMU34S.js} +1 -1
  40. package/dist/chunks/{chunk-ZZ3LJ22B.js → chunk-HJV7CTD4.js} +2 -2
  41. package/dist/chunks/{chunk-OHVPJNGY.js → chunk-I7KMJTOY.js} +1 -1
  42. package/dist/chunks/{chunk-PTI3TP7P.js → chunk-IULNLFPX.js} +1 -1
  43. package/dist/chunks/{chunk-JZ7FDBS4.js → chunk-JHB3TYKZ.js} +1 -1
  44. package/dist/chunks/{chunk-H3KYG32S.js → chunk-JJSDTLBW.js} +1 -1
  45. package/dist/chunks/{chunk-V3RDOM3U.js → chunk-JSCK6WWR.js} +3 -3
  46. package/dist/chunks/chunk-JXKKJ5OI.js +7 -0
  47. package/dist/chunks/{chunk-DXLLC7ZM.js → chunk-KJKM2UNP.js} +1 -1
  48. package/dist/chunks/chunk-KJWOXBZV.js +7 -0
  49. package/dist/chunks/chunk-KYMABVTF.js +25 -0
  50. package/dist/chunks/{chunk-2UPVIVAA.js → chunk-M2NKATEC.js} +1 -1
  51. package/dist/chunks/{chunk-TE2EE7DR.js → chunk-MGOPTP7N.js} +1 -1
  52. package/dist/chunks/{chunk-5S2NK6K6.js → chunk-MP27ZZFO.js} +1 -1
  53. package/dist/chunks/{chunk-3GUO6F6P.js → chunk-N5SAC4AS.js} +1 -1
  54. package/dist/chunks/{chunk-LUJL3KFT.js → chunk-N7YVHGLM.js} +1 -1
  55. package/dist/chunks/{chunk-GWB27IAS.js → chunk-NBNZYZFM.js} +1 -1
  56. package/dist/chunks/chunk-O3AL3QFA.js +7 -0
  57. package/dist/chunks/chunk-O5ZJ5YJP.js +10 -0
  58. package/dist/chunks/{chunk-3NNH2U5M.js → chunk-OGH32TS2.js} +1 -1
  59. package/dist/chunks/chunk-OS62YRSW.js +7 -0
  60. package/dist/chunks/{chunk-VRAMXFRB.js → chunk-P4U47GXI.js} +4 -3
  61. package/dist/chunks/{chunk-5NXYYFRL.js → chunk-PA5N7YTJ.js} +1 -1
  62. package/dist/chunks/{chunk-TKBORMUF.js → chunk-PADL3C6Z.js} +1 -1
  63. package/dist/chunks/chunk-PE5BSEYV.js +7 -0
  64. package/dist/chunks/{chunk-CITTRAYH.js → chunk-PNR5J6ZW.js} +1 -1
  65. package/dist/chunks/chunk-PPWMHBWP.js +9 -0
  66. package/dist/chunks/chunk-PUKYAALC.js +7 -0
  67. package/dist/chunks/{chunk-5AYB3JRL.js → chunk-QQ6IA4O5.js} +1 -1
  68. package/dist/chunks/{chunk-BJXMXDBM.js → chunk-QRCJKCMF.js} +1 -1
  69. package/dist/chunks/{chunk-SI7FQJIE.js → chunk-QW4W2UB6.js} +1 -1
  70. package/dist/chunks/{chunk-LYU4MVL5.js → chunk-R5QHLEAJ.js} +4 -4
  71. package/dist/chunks/chunk-R6Y4Z5VL.js +7 -0
  72. package/dist/chunks/{chunk-JIGCN5QS.js → chunk-RD7VCVW5.js} +3 -3
  73. package/dist/chunks/chunk-S76ILVQO.js +7 -0
  74. package/dist/chunks/chunk-SADXKDBI.js +7 -0
  75. package/dist/chunks/{chunk-HARXQZV3.js → chunk-SCJH3KSQ.js} +1 -1
  76. package/dist/chunks/{chunk-7QQIWMAT.js → chunk-SQXVQT2O.js} +5 -5
  77. package/dist/chunks/{chunk-CMEEAXVV.js → chunk-TD7MFXUO.js} +1 -1
  78. package/dist/chunks/{chunk-2UMWTCY7.js → chunk-TVHFWIH4.js} +1 -1
  79. package/dist/chunks/{chunk-GLH4PVMY.js → chunk-UI53O6MW.js} +1 -1
  80. package/dist/chunks/chunk-VO6FF6DY.js +7 -0
  81. package/dist/chunks/chunk-WFJEWVTE.js +12 -0
  82. package/dist/chunks/{chunk-OUHPDA7Q.js → chunk-WKZ6JSGZ.js} +1 -1
  83. package/dist/chunks/{chunk-OYMFOCD5.js → chunk-WX2KXEZV.js} +1 -1
  84. package/dist/chunks/{chunk-YQKURZ5W.js → chunk-X44OEPBR.js} +1 -1
  85. package/dist/chunks/{chunk-P5BNAP5T.js → chunk-X5HOJBDL.js} +7 -7
  86. package/dist/chunks/{chunk-ACVDKHVS.js → chunk-XGO6AXX5.js} +2 -2
  87. package/dist/chunks/chunk-Y4GLHDBA.js +9 -0
  88. package/dist/chunks/{chunk-WN7EJWN4.js → chunk-YE6WQYJH.js} +2 -2
  89. package/dist/chunks/chunk-Z5NJL63U.js +7 -0
  90. package/dist/chunks/chunk-ZOYMKZOR.js +7 -0
  91. package/dist/chunks/{chunk-TLEBLYBS.js → chunk-ZT2HVX54.js} +1 -1
  92. package/dist/chunks/{clear-35NUHHDI.js → clear-HKGEIG6F.js} +1 -1
  93. package/dist/chunks/{compile-vercel-config-UQIYIVA6.js → compile-vercel-config-ZY34MDLE.js} +1 -1
  94. package/dist/chunks/{config-FZD3R5VT.js → config-33ZMAOLB.js} +1 -1
  95. package/dist/chunks/config-VWDIXJZA.js +7 -0
  96. package/dist/chunks/config-validator.mjs +1 -1
  97. package/dist/chunks/{constants-ICJL2EO5.js → constants-JAB7MRSK.js} +1 -1
  98. package/dist/chunks/delete-OMER3AX3.js +10 -0
  99. package/dist/chunks/{delete-6LSSOF4X.js → delete-ZHGL7GGN.js} +1 -1
  100. package/dist/chunks/{detect-projects-THLTMO7V.js → detect-projects-PNODS4M7.js} +1 -1
  101. package/dist/chunks/{detect-services-GFVD2C3W.js → detect-services-ABFXK5B7.js} +1 -1
  102. package/dist/chunks/disable-OIGHKAMI.js +7 -0
  103. package/dist/chunks/discard-XUMTJVVB.js +14 -0
  104. package/dist/chunks/edit-3DIEWIVC.js +8 -0
  105. package/dist/chunks/{edit-R2RUDKC4.js → edit-IQ74VVWW.js} +1 -1
  106. package/dist/chunks/enable-AVCTKWMV.js +7 -0
  107. package/dist/chunks/{export-KTLACTAJ.js → export-LS4WTCAJ.js} +1 -1
  108. package/dist/chunks/future-BSDI3CNY.js +7 -0
  109. package/dist/chunks/generate-cert-for-deploy-FEZT4VSA.js +7 -0
  110. package/dist/chunks/image-BIOIWB4M.js +7 -0
  111. package/dist/chunks/{import-builders-JONKAYLL.js → import-builders-5TVTITKF.js} +1 -1
  112. package/dist/chunks/inspect-2OWYT5HO.js +13 -0
  113. package/dist/chunks/{inspect-JDSFHP6X.js → inspect-4OQTNJ46.js} +1 -1
  114. package/dist/chunks/{inspect-7IZ7M2TX.js → inspect-FR333BCC.js} +1 -1
  115. package/dist/chunks/{inspect-PQNECP2Z.js → inspect-VEBZWYJL.js} +1 -1
  116. package/dist/chunks/{inspect-PWLUWUGV.js → inspect-WPYSJNEK.js} +1 -1
  117. package/dist/chunks/list-LZCBVTIL.js +12 -0
  118. package/dist/chunks/{list-3N2CBVOG.js → list-Z43SODYP.js} +1 -1
  119. package/dist/chunks/{list-2G2BWD4T.js → list-ZK7VDRVT.js} +2 -2
  120. package/dist/chunks/{login-LLM3Q6GJ.js → login-36BXMMDQ.js} +1 -1
  121. package/dist/chunks/login-HAND2C3L.js +7 -0
  122. package/dist/chunks/logs-JYROMZI7.js +7 -0
  123. package/dist/chunks/{ls-5YLXAARZ.js → ls-H3ICVEYT.js} +1 -1
  124. package/dist/chunks/ls-IMAHWKOH.js +8 -0
  125. package/dist/chunks/ls-LYVIYO4J.js +12 -0
  126. package/dist/chunks/ls-M7YO74RP.js +12 -0
  127. package/dist/chunks/ls-QND7WBWE.js +12 -0
  128. package/dist/chunks/ls-VWA57ZVD.js +12 -0
  129. package/dist/chunks/ls-YWZLCIGC.js +11 -0
  130. package/dist/chunks/mutate-JQF3GLZP.js +9 -0
  131. package/dist/chunks/notifications-2SS4R53X.js +7 -0
  132. package/dist/chunks/open-RF3GYOHD.js +7 -0
  133. package/dist/chunks/openapi-GTAWN7OT.js +7 -0
  134. package/dist/chunks/permissions-G4F4PLFB.js +7 -0
  135. package/dist/chunks/prompt-missing-credentials-CV5NLAYI.js +7 -0
  136. package/dist/chunks/publish-KXUGNXEK.js +15 -0
  137. package/dist/chunks/pull-ELQ3GVJJ.js +7 -0
  138. package/dist/chunks/purchase-domain-if-available-QDQJOGOX.js +7 -0
  139. package/dist/chunks/{push-6LE54BCC.js → push-WSYAQQKI.js} +1 -1
  140. package/dist/chunks/query-ESQIFSJ6.js +12 -0
  141. package/dist/chunks/reauthenticate-H7ZY6BVA.js +7 -0
  142. package/dist/chunks/reorder-SADHAXS4.js +10 -0
  143. package/dist/chunks/{reply-6HUIX4AX.js → reply-UFH3BEMN.js} +1 -1
  144. package/dist/chunks/{resolve-TNBNGA3G.js → resolve-5THDM4PN.js} +1 -1
  145. package/dist/chunks/resolve-agent-team-MCTKBED5.js +7 -0
  146. package/dist/chunks/restore-3ZTRYEOV.js +16 -0
  147. package/dist/chunks/rm-GUSBRP6P.js +8 -0
  148. package/dist/chunks/rm-HUQFQOP2.js +8 -0
  149. package/dist/chunks/rm-WVA4E2BL.js +8 -0
  150. package/dist/chunks/rm-ZL4VR3BA.js +8 -0
  151. package/dist/chunks/rm-ZQWP6MUB.js +8 -0
  152. package/dist/chunks/routes-ZOLO53UC.js +7 -0
  153. package/dist/chunks/rule-inspect-WJ6ENOME.js +8 -0
  154. package/dist/chunks/{schema-HIKNWMV2.js → schema-7ACGW22H.js} +1 -1
  155. package/dist/chunks/{schema-QHZO72DB.js → schema-D2CWSXZU.js} +7 -7
  156. package/dist/chunks/{select-org-CK5CWC3A.js → select-org-3BWXFGPH.js} +1 -1
  157. package/dist/chunks/set-5I5CPDY3.js +7 -0
  158. package/dist/chunks/setup-and-link-HJSR6ANM.js +7 -0
  159. package/dist/chunks/skills-C2WOCF5Q.js +590 -0
  160. package/dist/chunks/{tags-35DFWGDC.js → tags-HTY22QMH.js} +1 -1
  161. package/dist/chunks/{types-77UW6BI4.js → types-6PREOZWK.js} +1 -1
  162. package/dist/chunks/update-6TDKMDKO.js +8 -0
  163. package/dist/commands/build/index.js +3 -3
  164. package/dist/commands/deploy/index.js +12 -9
  165. package/dist/commands/dev/index.js +3 -3
  166. package/dist/commands/env/index.js +13 -13
  167. package/dist/commands/link/index.js +1 -1
  168. package/dist/commands/list/index.js +2 -2
  169. package/dist/commands-bulk.js +315 -275
  170. package/dist/help.js +1 -1
  171. package/dist/index.js +2 -2
  172. package/dist/internal-build.js +1 -1
  173. package/dist/root-help-commands.mjs +1 -1
  174. package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
  175. package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
  176. package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
  177. package/dist/version.mjs +1 -1
  178. package/package.json +63 -57
  179. package/dist/chunks/add-U5U56FJR.js +0 -8
  180. package/dist/chunks/chunk-2B3A3MOX.js +0 -7
  181. package/dist/chunks/chunk-74QCXPNW.js +0 -7
  182. package/dist/chunks/chunk-7NNENHGN.js +0 -7
  183. package/dist/chunks/chunk-BFRDBBSO.js +0 -7
  184. package/dist/chunks/chunk-CMKLX4DC.js +0 -7
  185. package/dist/chunks/chunk-D4MW3RDW.js +0 -7
  186. package/dist/chunks/chunk-DDLM6CIQ.js +0 -10
  187. package/dist/chunks/chunk-GVVIFYQE.js +0 -7
  188. package/dist/chunks/chunk-HJRAWEA2.js +0 -7
  189. package/dist/chunks/chunk-ILFUNCJZ.js +0 -7
  190. package/dist/chunks/chunk-ITKS32PG.js +0 -7
  191. package/dist/chunks/chunk-J6O6JW2K.js +0 -7
  192. package/dist/chunks/chunk-KUGXOLL7.js +0 -25
  193. package/dist/chunks/chunk-MI7W4QMV.js +0 -7
  194. package/dist/chunks/chunk-MYHJNSCW.js +0 -15
  195. package/dist/chunks/chunk-N2TNA2FE.js +0 -9
  196. package/dist/chunks/chunk-U73RXMGU.js +0 -7
  197. package/dist/chunks/chunk-UCAE5Z5L.js +0 -7
  198. package/dist/chunks/chunk-VEMJINMZ.js +0 -13
  199. package/dist/chunks/chunk-VLDU2MDL.js +0 -7
  200. package/dist/chunks/chunk-VRWLNWNE.js +0 -7
  201. package/dist/chunks/chunk-W3TGCMRW.js +0 -9
  202. package/dist/chunks/chunk-WCBNKVVG.js +0 -9
  203. package/dist/chunks/chunk-Y24OSBXP.js +0 -7
  204. package/dist/chunks/chunk-ZBDLYNUF.js +0 -7
  205. package/dist/chunks/chunk-ZDKSDWSO.js +0 -9
  206. package/dist/chunks/chunk-ZMY3GQBK.js +0 -7
  207. package/dist/chunks/config-IQE5C7PZ.js +0 -7
  208. package/dist/chunks/delete-IBRCB3S3.js +0 -10
  209. package/dist/chunks/disable-4TODXYTB.js +0 -7
  210. package/dist/chunks/discard-WHC5FKWF.js +0 -14
  211. package/dist/chunks/edit-3DXOWQMF.js +0 -8
  212. package/dist/chunks/enable-2OAHPKCN.js +0 -7
  213. package/dist/chunks/future-JZ3RVO4B.js +0 -7
  214. package/dist/chunks/generate-cert-for-deploy-D4IHTKQS.js +0 -7
  215. package/dist/chunks/image-UW5U6CRJ.js +0 -7
  216. package/dist/chunks/inspect-2FS4PYBH.js +0 -13
  217. package/dist/chunks/list-Y3OA4KFK.js +0 -11
  218. package/dist/chunks/login-VQN3F7JU.js +0 -7
  219. package/dist/chunks/logs-XEJPLFXM.js +0 -7
  220. package/dist/chunks/ls-2DACOWSU.js +0 -12
  221. package/dist/chunks/ls-2M7QSW2F.js +0 -12
  222. package/dist/chunks/ls-7DJWHOK4.js +0 -12
  223. package/dist/chunks/ls-GY2YLYMD.js +0 -12
  224. package/dist/chunks/ls-NJEJSYSO.js +0 -11
  225. package/dist/chunks/ls-OAJKYQEL.js +0 -8
  226. package/dist/chunks/mutate-G2I4ISF4.js +0 -9
  227. package/dist/chunks/notifications-6MXYY2V6.js +0 -7
  228. package/dist/chunks/open-YKOYB7PH.js +0 -7
  229. package/dist/chunks/openapi-36GMGEXR.js +0 -7
  230. package/dist/chunks/permissions-RRP6IEHS.js +0 -7
  231. package/dist/chunks/prompt-missing-credentials-WQUF6X6K.js +0 -7
  232. package/dist/chunks/publish-AQ3FYC3J.js +0 -15
  233. package/dist/chunks/pull-HT2MQ3ML.js +0 -7
  234. package/dist/chunks/purchase-domain-if-available-NDEUZYHK.js +0 -7
  235. package/dist/chunks/query-SNY42BTX.js +0 -12
  236. package/dist/chunks/reauthenticate-4SGT475I.js +0 -7
  237. package/dist/chunks/reorder-SRF3NE5U.js +0 -10
  238. package/dist/chunks/resolve-agent-team-XSXRT42F.js +0 -7
  239. package/dist/chunks/restore-HK4SWMZP.js +0 -16
  240. package/dist/chunks/rm-4VXZ3AIX.js +0 -8
  241. package/dist/chunks/rm-ESSU4MS4.js +0 -8
  242. package/dist/chunks/rm-EWPYZXTX.js +0 -8
  243. package/dist/chunks/rm-GNDGYUKQ.js +0 -8
  244. package/dist/chunks/rm-SKCAZTYN.js +0 -8
  245. package/dist/chunks/routes-LK2HUGAK.js +0 -7
  246. package/dist/chunks/rule-inspect-RHHD5UIR.js +0 -8
  247. package/dist/chunks/rules-FF5FU7BV.js +0 -7
  248. package/dist/chunks/set-5P44OPZP.js +0 -7
  249. package/dist/chunks/setup-and-link-OLSKD2HE.js +0 -7
  250. package/dist/chunks/update-WHBFIV22.js +0 -8
@@ -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{getCommandName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";var OUTPUT_FORMATS=["json"];function parseOutputFormat(value){let normalized=value.toLowerCase();if(OUTPUT_FORMATS.includes(normalized))return normalized;throw new Error(`Invalid output format: "${value}". Valid formats: ${OUTPUT_FORMATS.join(", ")}`)}function getOutputFormat(flags){let formatFlag=flags["--format"],jsonFlag=flags["--json"];if(formatFlag)return parseOutputFormat(formatFlag);if(jsonFlag)return"json"}function isJsonOutput(flags){return getOutputFormat(flags)==="json"}function validateJsonOutput(flags){try{return{valid:!0,jsonOutput:isJsonOutput(flags)}}catch(err){return{valid:!1,error:err.message}}}function wantsMachineReadableOutput(subcommand,argv){if(argv.includes("--help")||argv.includes("-h"))return!1;if(subcommand==="api"||argv.includes("--json"))return!0;for(let arg of argv)if(arg.toLowerCase()==="--format=json")return!0;let formatIdx=argv.indexOf("--format");return formatIdx!==-1&&argv[formatIdx+1]?.toLowerCase()==="json"}function shouldPrintVersionBanner(subcommand,argv){return!wantsMachineReadableOutput(subcommand,argv)}function warnDeprecatedSubcommand(client,deprecated,replacement){wantsMachineReadableOutput(void 0,client.argv)||output_manager_default.warning(`${getCommandName(deprecated)} is deprecated. Use ${getCommandName(replacement)}.`)}function warnDeprecatedOption(argv,deprecated,replacement){wantsMachineReadableOutput(void 0,argv)||output_manager_default.warning(`${deprecated} is deprecated. Use ${replacement}.`)}function warnDeprecatedInput(client,deprecated,replacement){wantsMachineReadableOutput(void 0,client.argv)||output_manager_default.warning(`${deprecated} is deprecated. Use ${replacement}.`)}export{validateJsonOutput,wantsMachineReadableOutput,shouldPrintVersionBanner,warnDeprecatedSubcommand,warnDeprecatedOption,warnDeprecatedInput};
@@ -0,0 +1,25 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import{require_dist}from"./chunk-PUKYAALC.js";import{require_load_json_file,require_pify}from"./chunk-VKXEOL4K.js";import{isNativeBinaryInstall}from"./chunk-NWGBDBZI.js";import{require_graceful_fs}from"./chunk-VKPZP4LC.js";import{output_manager_default,require_build_utils,require_signal_exit}from"./chunk-M774HRX5.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
8
+ `,{mode:opts.mode})}),mainSync=(fp,data,opts)=>{let indent=opts.indent;if(opts.detectIndent)try{let file=fs.readFileSync(fp,"utf8");indent=detectIndent(file).indent}catch(err){if(err.code!=="ENOENT")throw err}let json=JSON.stringify(data,opts.replacer,indent);return writeFileAtomic.sync(fp,`${json}
9
+ `,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});import{randomUUID as randomUUID2}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";import{readdirSync}from"node:fs";function isLibc(value){return value==="glibc"||value==="musl"}function hasMuslLoader(){try{return readdirSync("/lib").some(name=>name.startsWith("ld-musl-")&&name.endsWith(".so.1"))}catch{return!1}}function detectLibcFromReport(){let report=process.report;if(!report||typeof report.getReport!="function")return;let originalExcludeNetwork=report.excludeNetwork;try{report.excludeNetwork=!0;let{header}=report.getReport();return header?.glibcVersionRuntime?"glibc":"musl"}catch{return}finally{report.excludeNetwork=originalExcludeNetwork}}function detectLibc(){if(process.platform==="linux")return detectLibcFromReport()??(hasMuslLoader()?"musl":"glibc")}var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){if(!value||typeof value!="object")return!1;let device=value;return typeof device.id=="string"&&(device.libc===void 0||isLibc(device.libc))}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
10
+ `,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing?.libc)return existing;let libc=(opts.detectLibc??detectLibc)(),device={id:existing?.id??randomUUID(),...libc?{libc}:{}};return(!existing||libc)&&writePersistedCliDevice(opts.filePath,device),device}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID2(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackRedactedCliOption(option,value){value&&this.trackCliOption({option,value:this.redactedValue})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackLibc(libc){libc&&this.track({key:"libc",value:libc})}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID2()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}},TelemetryEventStore=class{constructor(opts){this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID2(),this.deviceId=randomUUID2(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID2()}add(event){event.sessionId=this.sessionId,event.invocationId=this.invocationId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentLibc(){return this.cliDevice?.libc}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[]}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}async save({detach=!1}={}){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));return}if(this.enabled){let sessionId=this.events[0]?.sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{let{eventTime,invocationId,...rest}=event;return delete rest.sessionId,delete rest.teamId,delete rest.userId,delete rest.projectId,{event_time:eventTime,invocation_id:invocationId,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}}),payload={invocationId:this.invocationId,headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events};await this.sendToSubprocess(payload,output_manager_default.debugEnabled&&!detach)}}async sendToSubprocess(payload,outputDebugEnabled){let flushArgs=["telemetry","flush",JSON.stringify(payload)],nodeBinaryPath,script;if(isNativeBinaryInstall())nodeBinaryPath=process.execPath,script=flushArgs;else{let args=[process.execPath,process.argv[0],process.argv[1]];args[0]===args[1]&&args.shift(),nodeBinaryPath=args[0],script=[...args.slice(1),...flushArgs]}let env=(0,import_build_utils.cloneEnv)(process.env,{VERCEL_TELEMETRY_DISABLED:"1"});if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{env,stdio:["ignore","pipe","pipe"]});childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d)});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),timeout.unref(),resolve()})});spawn(nodeBinaryPath,script,{stdio:"ignore",env,windowsHide:!0,detached:!0}).unref()}};export{TelemetryClient,TelemetryEventStore};
11
+ /*! Bundled license information:
12
+
13
+ imurmurhash/imurmurhash.js:
14
+ (**
15
+ * @preserve
16
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
17
+ *
18
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
19
+ * @see http://github.com/homebrewing/brauhaus-diff
20
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
21
+ * @see http://github.com/garycourt/murmurhash-js
22
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
23
+ * @see http://sites.google.com/site/murmurhash/
24
+ *)
25
+ */
@@ -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-DRXOTZSJ.js";import{printError}from"./chunk-HARXQZV3.js";import{parseArguments}from"./chunk-VLDU2MDL.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-DDLM6CIQ.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-MI7W4QMV.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.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==="update")&&(message=command.name==="add"?'--ai requires a description. Example: routes add --ai <description> --yes --non-interactive. Replace <description> with your text; use shell quotes if it contains spaces (e.g. --ai "Redirect /old to /new").':"--ai requires a description. Example: routes update <name-or-id> --ai <description> --yes --non-interactive. Replace placeholders; use shell quotes for <description> if it contains spaces.",next=[{command:withGlobalFlags2(client,command.name==="add"?"routes add --ai <description> --yes":"routes update <name-or-id> --ai <description> --yes"),when:"replace <description> with your text (quote it in the shell if it contains spaces), then run"},{command:getCommandNamePlain(`routes ${command.name} --help ${flags.join(" ")}`.trim()),when:"see all flags"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},2),2}return printError(err),2}return parsedArgs}async function confirmAction(client,skipConfirmation,message,details){return skipConfirmation?!0:client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:`${message} Re-run with --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"re-run with --yes to confirm"}]}),process.exit(1),!1):(details&&output_manager_default.print(` ${details}
7
+ import{resolveProjectContext}from"./chunk-EWUSBHX5.js";import{printError}from"./chunk-SCJH3KSQ.js";import{parseArguments}from"./chunk-ZOYMKZOR.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithYes,outputAgentError,withGlobalFlags}from"./chunk-2B2Z447M.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-4KYSK2MS.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.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==="update")&&(message=command.name==="add"?'--ai requires a description. Example: routes add --ai <description> --yes --non-interactive. Replace <description> with your text; use shell quotes if it contains spaces (e.g. --ai "Redirect /old to /new").':"--ai requires a description. Example: routes update <name-or-id> --ai <description> --yes --non-interactive. Replace placeholders; use shell quotes for <description> if it contains spaces.",next=[{command:withGlobalFlags2(client,command.name==="add"?"routes add --ai <description> --yes":"routes update <name-or-id> --ai <description> --yes"),when:"replace <description> with your text (quote it in the shell if it contains spaces), then run"},{command:getCommandNamePlain(`routes ${command.name} --help ${flags.join(" ")}`.trim()),when:"see all flags"}]),outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message,next},2),2}return printError(err),2}return parsedArgs}async function confirmAction(client,skipConfirmation,message,details){return skipConfirmation?!0:client.nonInteractive?(outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:`${message} Re-run with --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"re-run with --yes to confirm"}]}),process.exit(1),!1):(details&&output_manager_default.print(` ${details}
8
8
  `),await client.input.confirm(message,!1))}function formatCondition(condition){let parts=[import_chalk.default.gray(`[${condition.type}]`)];if(condition.key&&parts.push(import_chalk.default.cyan(condition.key)),condition.value!==void 0){let formatted=typeof condition.value=="string"?condition.value:JSON.stringify(condition.value);parts.push(condition.key?`= ${formatted}`:formatted)}return parts.join(" ")}var TRANSFORM_TYPE_LABELS={"request.headers":"Request Header","request.query":"Request Query","response.headers":"Response Header","request.path":"Request Path"},TRANSFORM_OP_LABELS={set:"set",append:"append",delete:"delete"};function formatTransform(transform,includeType=!0){let opLabel=TRANSFORM_OP_LABELS[transform.op]??transform.op,key=isTargetTransform(transform)?typeof transform.target.key=="string"?transform.target.key:JSON.stringify(transform.target.key):"path",parts=[];if(includeType){let typeLabel=TRANSFORM_TYPE_LABELS[transform.type]??transform.type;parts.push(import_chalk.default.gray(`[${typeLabel}]`))}if(parts.push(import_chalk.default.yellow(opLabel),import_chalk.default.cyan(key)),transform.args!==void 0&&transform.op!=="delete"){let argsStr=Array.isArray(transform.args)?transform.args.join(", "):transform.args;parts.push(`= ${argsStr}`)}return parts.join(" ")}function parsePosition(position){if(position==="start")return{placement:"start"};if(position==="end")return{placement:"end"};if(position.startsWith("after:")){let referenceId=position.slice(6);if(!referenceId)throw new Error('Position "after:" requires a route ID');return{placement:"after",referenceId}}if(position.startsWith("before:")){let referenceId=position.slice(7);if(!referenceId)throw new Error('Position "before:" requires a route ID');return{placement:"before",referenceId}}throw new Error(`Invalid position: "${position}". Use: start, end, after:<id>, or before:<id>`)}async function offerAutoPromote(client,projectId,version,hadExistingStagingVersion,opts){let{default:updateRouteVersion}=await import("./update-route-version-KWK5S4UW.js"),{default:stamp}=await import("./stamp-TKONNIJ5.js");if(output_manager_default.print(`
9
9
  ${import_chalk.default.gray(`This change is staged. Run ${import_chalk.default.cyan(withGlobalFlags2(client,"routes publish"))} to make it live, or ${import_chalk.default.cyan(withGlobalFlags2(client,"routes discard-staging"))} to undo.`)}
10
10
  `),!hadExistingStagingVersion&&!opts.skipPrompts){if(output_manager_default.print(`
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-5S2NK6K6.js";import{pullEnvRecords}from"./chunk-ZMY3GQBK.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{__toESM}from"./chunk-BZENIQ7N.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}import{existsSync,readFileSync}from"node:fs";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir));if(linkLocation==="")return{repoRoot,resolvedRootDirectory:""};let setting=normalizeRelative(rootDirectorySetting??"");return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join(anchorDir,setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot};
7
+ import{js_yaml_default}from"./chunk-V6Y6UK6B.js";import{require_minimatch}from"./chunk-MP27ZZFO.js";import{pullEnvRecords}from"./chunk-BMQREWR6.js";import{output_manager_default}from"./chunk-M774HRX5.js";import{__toESM}from"./chunk-BZENIQ7N.js";var INTEGRATIONS_POLL_INTERVAL_MS=5e3,INTEGRATIONS_POLL_TIMEOUT_MS=3*60*1e3;async function fetchDeploymentBuildEnv(client,deploymentId,{quiet=!1}={}){let deadline=Date.now()+INTEGRATIONS_POLL_TIMEOUT_MS,isPolling=!1;for(;Date.now()<deadline;)try{return await pullEnvRecords(client,deploymentId,"vercel-cli:pull")}catch(err){if(err&&typeof err=="object"&&"integrationsStatus"in err&&err.integrationsStatus==="pending"){!isPolling&&!quiet&&(output_manager_default.spinner("Waiting for deployment integrations to finish provisioning..."),isPolling=!0),await new Promise(resolve=>setTimeout(resolve,INTEGRATIONS_POLL_INTERVAL_MS));continue}throw err}throw new Error("Timed out waiting for deployment integrations to complete provisioning.")}import{existsSync,readFileSync}from"node:fs";import{dirname,join,parse,relative}from"node:path";var import_minimatch=__toESM(require_minimatch(),1);function findWorkspaceRootCandidates(startDir){let{root}=parse(startDir),candidates=[],dir=startDir;for(let i=0;i<64;i++){let type=workspaceTypeOf(dir);if(type&&candidates.unshift({dir,type}),dir===root)break;let parent=dirname(dir);if(parent===dir)break;dir=parent}return candidates}function workspaceTypeOf(dir){if(existsSync(join(dir,"pnpm-workspace.yaml")))return"pnpm";let pkgPath=join(dir,"package.json");if(existsSync(pkgPath))try{let pkg=JSON.parse(readFileSync(pkgPath,"utf8")),{workspaces}=pkg;if(Array.isArray(workspaces)&&workspaces.length>0||workspaces&&typeof workspaces=="object"&&Array.isArray(workspaces.packages)&&workspaces.packages.length>0)return"npm"}catch{}return null}function readWorkspacePatterns(candidate){try{if(candidate.type==="pnpm"){let packages2=js_yaml_default.load(readFileSync(join(candidate.dir,"pnpm-workspace.yaml"),"utf8"))?.packages;return Array.isArray(packages2)?packages2.filter(p=>typeof p=="string"):null}let pkg=JSON.parse(readFileSync(join(candidate.dir,"package.json"),"utf8")),{workspaces}=pkg,packages=Array.isArray(workspaces)?workspaces:workspaces?.packages;return Array.isArray(packages)?packages.filter(p=>typeof p=="string"):null}catch{return null}}function workspaceClaims(candidate,memberDir){let rel=normalizeRelative(relative(candidate.dir,memberDir));if(rel==="")return!1;let patterns=readWorkspacePatterns(candidate);if(!patterns||patterns.length===0)return!1;let positives=[],negatives=[];for(let pattern of patterns)pattern.startsWith("!")?negatives.push(normalizeRelative(pattern.slice(1))):positives.push(normalizeRelative(pattern));let matches=pattern=>(0,import_minimatch.default)(rel,pattern,{dot:!1});return!positives.some(matches)||negatives.some(matches)?!1:existsSync(join(memberDir,"package.json"))}function resolvePerDirectoryLinkRoot(anchorDir,rootDirectorySetting){let repoRoot=anchorDir;for(let candidate of findWorkspaceRootCandidates(anchorDir))if(workspaceClaims(candidate,anchorDir)){repoRoot=candidate.dir;break}let linkLocation=normalizeRelative(relative(repoRoot,anchorDir));if(linkLocation==="")return{repoRoot,resolvedRootDirectory:""};let setting=normalizeRelative(rootDirectorySetting??"");return setting===""?{repoRoot,resolvedRootDirectory:linkLocation}:existsSync(join(anchorDir,setting))?{repoRoot,resolvedRootDirectory:normalizeRelative(relative(repoRoot,join(anchorDir,setting)))}:{repoRoot,resolvedRootDirectory:linkLocation,advisory:`Ignoring "rootDirectory" setting "${setting}" for the project linked in "${anchorDir}": "${join(anchorDir,setting)}" does not exist, so the build will use the linked directory "${linkLocation}" instead. Remove the "rootDirectory" setting, or configure it at the repository root.`}}function normalizeRelative(p){let normalized=p.replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"");return normalized==="."?"":normalized}export{fetchDeploymentBuildEnv,resolvePerDirectoryLinkRoot};