vercel 65.0.0 → 65.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/add-6XE2EK66.js +8 -0
- package/dist/chunks/add-WITOGFYA.js +8 -0
- package/dist/chunks/add-YSIECJTJ.js +8 -0
- package/dist/chunks/build-DNYYPGF2.js +7 -0
- package/dist/chunks/{chunk-VO36D4U4.js → chunk-22FDWPWY.js} +1 -1
- package/dist/chunks/chunk-2NABMKFV.js +29 -0
- package/dist/chunks/chunk-2PKEEQ5W.js +25 -0
- package/dist/chunks/{chunk-VAZQS475.js → chunk-3ADDGPEN.js} +1 -1
- package/dist/chunks/{chunk-LJIQZ3LU.js → chunk-3AYYFYZG.js} +1 -1
- package/dist/chunks/{chunk-27QCVNMI.js → chunk-3LIKVGFT.js} +1 -1
- package/dist/chunks/chunk-3XCXKOBR.js +7 -0
- package/dist/chunks/{chunk-RRWEIG6B.js → chunk-3XW7N4W3.js} +1 -1
- package/dist/chunks/{chunk-XD2FF2PZ.js → chunk-4MTD47Y2.js} +1 -1
- package/dist/chunks/{detect-projects-CHMBPFSE.js → chunk-4VFYJU37.js} +1 -1
- package/dist/chunks/chunk-5IASAERQ.js +7 -0
- package/dist/chunks/chunk-5RMIM4S2.js +7 -0
- package/dist/chunks/chunk-65TGOMRK.js +8 -0
- package/dist/chunks/chunk-6IDNVZZR.js +7 -0
- package/dist/chunks/{chunk-DBNQ45J5.js → chunk-6OVX3PWM.js} +1 -1
- package/dist/chunks/chunk-6URZLHEK.js +7 -0
- package/dist/chunks/{chunk-AZ5OUZPP.js → chunk-6VH56CX2.js} +1 -1
- package/dist/chunks/chunk-6Y2ZL5XJ.js +98 -0
- package/dist/chunks/{chunk-KUGFILF5.js → chunk-76KGQU2G.js} +1 -1
- package/dist/chunks/{chunk-F4ZFLPMT.js → chunk-7EC6KLFJ.js} +1 -1
- package/dist/chunks/chunk-7N67TEDX.js +10 -0
- package/dist/chunks/{chunk-43T3YKNH.js → chunk-7SYW5HXA.js} +1 -1
- package/dist/chunks/chunk-7YKFF6CE.js +7 -0
- package/dist/chunks/chunk-7Z3WUAO5.js +10 -0
- package/dist/chunks/chunk-ABZEMNDR.js +7 -0
- package/dist/chunks/{chunk-WDWYKX2I.js → chunk-ADLBLGT3.js} +1 -1
- package/dist/chunks/{chunk-BFJC3UDU.js → chunk-AGBNDJBH.js} +1 -1
- package/dist/chunks/chunk-AJCM43E4.js +7 -0
- package/dist/chunks/chunk-ANMDN3EG.js +9 -0
- package/dist/chunks/chunk-AWMQGOS2.js +7 -0
- package/dist/chunks/{chunk-JDVUKDX3.js → chunk-BBKEP7RO.js} +1 -1
- package/dist/chunks/{chunk-X5J7LOJK.js → chunk-BL3GEBL6.js} +1 -1
- package/dist/chunks/chunk-BLUPZPAS.js +7 -0
- package/dist/chunks/chunk-BNQXEQWO.js +7 -0
- package/dist/chunks/chunk-BTI5TG6Q.js +7 -0
- package/dist/chunks/chunk-BUJITHGZ.js +8 -0
- package/dist/chunks/chunk-BZXSCHI7.js +7 -0
- package/dist/chunks/chunk-C6GY2G73.js +7 -0
- package/dist/chunks/chunk-CEMPU323.js +7 -0
- package/dist/chunks/{chunk-Z6JDXW4A.js → chunk-CF2FOU7X.js} +1 -1
- package/dist/chunks/{chunk-EKMQNUO4.js → chunk-CLFCR4UZ.js} +1 -1
- package/dist/chunks/{chunk-WFSQ3OSN.js → chunk-CVDK3IYT.js} +6 -9
- package/dist/chunks/{chunk-VF2WX27D.js → chunk-DA37HMCW.js} +2 -2
- package/dist/chunks/{chunk-YPX7BXJ6.js → chunk-DGG3YML4.js} +2 -2
- package/dist/chunks/chunk-DGYHWXD2.js +10 -0
- package/dist/chunks/{chunk-RTWGDRYT.js → chunk-DHSOA6LP.js} +1 -1
- package/dist/chunks/chunk-DWZBL4NK.js +7 -0
- package/dist/chunks/chunk-E2SADN6I.js +7 -0
- package/dist/chunks/chunk-ECQIO5K3.js +7 -0
- package/dist/chunks/{chunk-7OMWRRY4.js → chunk-EEEYN6B4.js} +1 -1
- package/dist/chunks/{chunk-T5LBVZWY.js → chunk-F6FTWDLS.js} +1 -1
- package/dist/chunks/chunk-F7AVGV4Y.js +7 -0
- package/dist/chunks/{chunk-FN7TTXXY.js → chunk-FDNYYENK.js} +1 -1
- package/dist/chunks/chunk-FEI6O5QD.js +7 -0
- package/dist/chunks/{chunk-FPC5LINQ.js → chunk-FGFLTLEA.js} +1 -1
- package/dist/chunks/{chunk-JT273F22.js → chunk-FI4SNRSM.js} +1 -1
- package/dist/chunks/chunk-FUX6LKNP.js +7 -0
- package/dist/chunks/{chunk-OVV5MV5M.js → chunk-G4T7VBGN.js} +1 -1
- package/dist/chunks/{chunk-L5ANBZTX.js → chunk-GA277JFB.js} +1 -1
- package/dist/chunks/chunk-GD7AV7BO.js +9 -0
- package/dist/chunks/{chunk-W7J5HTTY.js → chunk-GENZ5QV5.js} +1 -1
- package/dist/chunks/chunk-GG5RME4X.js +7 -0
- package/dist/chunks/{chunk-PXU645V7.js → chunk-GGSM5AHN.js} +1 -1
- package/dist/chunks/{chunk-7G72V52B.js → chunk-GVTXA6HG.js} +1 -1
- package/dist/chunks/{chunk-ZIWS57E4.js → chunk-H2HV2IWG.js} +1 -1
- package/dist/chunks/{chunk-EJINOHL3.js → chunk-HCRD3JFL.js} +1 -1
- package/dist/chunks/chunk-HRR57QNP.js +7 -0
- package/dist/chunks/chunk-IA3MXJRC.js +8 -0
- package/dist/chunks/chunk-IEPW2YRH.js +7 -0
- package/dist/chunks/{chunk-HBPSZHXX.js → chunk-IGDG5CWT.js} +1 -1
- package/dist/chunks/chunk-IKQTP764.js +7 -0
- package/dist/chunks/{chunk-WTBGMDQ7.js → chunk-IQKGQ2Y2.js} +1 -1
- package/dist/chunks/chunk-IUXSJWL3.js +7 -0
- package/dist/chunks/{chunk-6CXHR2ND.js → chunk-JELLVPCM.js} +2 -2
- package/dist/chunks/{chunk-CTKJQTC5.js → chunk-JLEJB6KM.js} +1 -1
- package/dist/chunks/chunk-JNVVIU6L.js +9 -0
- package/dist/chunks/{chunk-SSKMT5SL.js → chunk-JVKIWEPJ.js} +1 -1
- package/dist/chunks/{chunk-WFEEUZ6B.js → chunk-K3FFPKIV.js} +1 -1
- package/dist/chunks/{chunk-66ODHUGV.js → chunk-KECUEAMH.js} +1 -1
- package/dist/chunks/{chunk-PNUH3XXW.js → chunk-KH6565YH.js} +2 -2
- package/dist/chunks/chunk-KRPY5FHJ.js +7 -0
- package/dist/chunks/chunk-KTNBXM43.js +7 -0
- package/dist/chunks/{chunk-YXZGKFF3.js → chunk-KW6GSQXV.js} +1 -1
- package/dist/chunks/{chunk-KDABXEHF.js → chunk-L7AHFYDS.js} +1 -1
- package/dist/chunks/{chunk-HNF2BEOE.js → chunk-LBNOOFB6.js} +1 -1
- package/dist/chunks/chunk-LC6D6S24.js +7 -0
- package/dist/chunks/chunk-LCHECISY.js +7 -0
- package/dist/chunks/{chunk-KXHUMVXD.js → chunk-LH7X2ZJQ.js} +1 -1
- package/dist/chunks/chunk-LJBUJ23M.js +7 -0
- package/dist/chunks/{chunk-IYM5GO57.js → chunk-LKLH6DZP.js} +1 -1
- package/dist/chunks/{chunk-WYJGP5QW.js → chunk-LUBUI5GF.js} +1 -1
- package/dist/chunks/chunk-LZWQBY2I.js +17 -0
- package/dist/chunks/{chunk-IKSZMJKB.js → chunk-MBDXRSHX.js} +2 -2
- package/dist/chunks/{chunk-VO2XAQFF.js → chunk-MX3RY7HH.js} +8 -9
- package/dist/chunks/chunk-N4HJGVRB.js +10 -0
- package/dist/chunks/{chunk-4T22AQTB.js → chunk-NQWGRKF4.js} +1 -1
- package/dist/chunks/{chunk-52JGR5SZ.js → chunk-NTZ5WWYV.js} +1 -1
- package/dist/chunks/chunk-OAM5NJCU.js +9 -0
- package/dist/chunks/chunk-OCR5CRTH.js +10 -0
- package/dist/chunks/chunk-OFDTADPQ.js +7 -0
- package/dist/chunks/chunk-OKEBIUKZ.js +7 -0
- package/dist/chunks/{chunk-X7CLBXWL.js → chunk-OPORM35X.js} +1 -1
- package/dist/chunks/{chunk-MTETAZA4.js → chunk-P6ZHH3HQ.js} +1 -1
- package/dist/chunks/chunk-PFD7LETF.js +7 -0
- package/dist/chunks/chunk-PFNYWWLI.js +7 -0
- package/dist/chunks/chunk-PFPJLIFF.js +33 -0
- package/dist/chunks/chunk-PSOVLGHP.js +7 -0
- package/dist/chunks/{chunk-B6U5434D.js → chunk-Q5ODLDCU.js} +1 -1
- package/dist/chunks/{chunk-2BAAJZBZ.js → chunk-QEAQNRWM.js} +1 -1
- package/dist/chunks/{chunk-DGDNI76L.js → chunk-QMCHGGDX.js} +2 -2
- package/dist/chunks/{chunk-X3VSVBXT.js → chunk-QMGXVTLQ.js} +2 -2
- package/dist/chunks/chunk-QOCZPYRV.js +12 -0
- package/dist/chunks/chunk-QQVGXIFM.js +7 -0
- package/dist/chunks/chunk-QYCGL36Q.js +7 -0
- package/dist/chunks/{chunk-AGDMSAYW.js → chunk-QZX7VG2V.js} +1 -1
- package/dist/chunks/chunk-R5B5ISRX.js +15 -0
- package/dist/chunks/{chunk-CZ2KEML2.js → chunk-R6BEOVTU.js} +1 -1
- package/dist/chunks/chunk-RLKS5G6C.js +12 -0
- package/dist/chunks/chunk-RTQ6ERZF.js +10 -0
- package/dist/chunks/{chunk-JWX2YZVC.js → chunk-RUA6EEAJ.js} +1 -1
- package/dist/chunks/{chunk-NYKEU7DQ.js → chunk-RW3X523R.js} +1 -1
- package/dist/chunks/chunk-S3L2OHPO.js +7 -0
- package/dist/chunks/{chunk-VY63XWWU.js → chunk-S5IWVPYT.js} +1 -1
- package/dist/chunks/{chunk-JETQEZ24.js → chunk-SQE63XFX.js} +2 -2
- package/dist/chunks/{chunk-UDMEPP3K.js → chunk-SXOSF4O6.js} +1 -1
- package/dist/chunks/chunk-TAAWMNNL.js +7 -0
- package/dist/chunks/chunk-TO5PJDEN.js +7 -0
- package/dist/chunks/{chunk-66262IYI.js → chunk-TZFDVQ72.js} +1 -1
- package/dist/chunks/chunk-U4Z2MMOF.js +301 -0
- package/dist/chunks/chunk-UC2SUUL2.js +7 -0
- package/dist/chunks/{chunk-VCV3H73W.js → chunk-UNEGQPD3.js} +1 -1
- package/dist/chunks/chunk-UVHKXCR5.js +11 -0
- package/dist/chunks/{chunk-3XDTQFBL.js → chunk-VBWQRK3O.js} +7 -7
- package/dist/chunks/chunk-VOCZ34ON.js +7 -0
- package/dist/chunks/chunk-VT6RIZJH.js +7 -0
- package/dist/chunks/{chunk-KCVCGYAR.js → chunk-WBF36MYT.js} +2 -2
- package/dist/chunks/{chunk-GRVLQZFQ.js → chunk-WGXKX24Q.js} +1 -1
- package/dist/chunks/chunk-WUORIKOE.js +7 -0
- package/dist/chunks/{chunk-7C5JHTHO.js → chunk-X4762EE4.js} +1 -1
- package/dist/chunks/chunk-XGTKHQTT.js +7 -0
- package/dist/chunks/chunk-XK6SNITB.js +21 -0
- package/dist/chunks/{chunk-UGZ3HFHI.js → chunk-XP3FT56R.js} +3 -3
- package/dist/chunks/chunk-XR6QY7RR.js +7 -0
- package/dist/chunks/{chunk-2UBZCG4F.js → chunk-XSE75NFU.js} +1 -1
- package/dist/chunks/chunk-XXXRTHTP.js +8 -0
- package/dist/chunks/{chunk-ENWROHWX.js → chunk-Y54GKXGG.js} +1 -1
- package/dist/chunks/chunk-YHQ7PPXP.js +7 -0
- package/dist/chunks/chunk-ZF27J6FQ.js +7 -0
- package/dist/chunks/chunk-ZFRNVIHI.js +7 -0
- package/dist/chunks/clear-KLE7JYWS.js +8 -0
- package/dist/chunks/compile-vercel-config-QHWJCKJV.js +7 -0
- package/dist/chunks/{config-XH532PP3.js → config-3ZSKJULZ.js} +1 -1
- package/dist/chunks/config-F5QZ5IGE.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/connect-git-provider-FS5Q2HO4.js +7 -0
- package/dist/chunks/delete-GKUCUSHP.js +9 -0
- package/dist/chunks/delete-TLC65SZD.js +10 -0
- package/dist/chunks/detect-projects-NLAYKNQX.js +7 -0
- package/dist/chunks/detect-services-D6HLLAI4.js +7 -0
- package/dist/chunks/disable-ORTTESHC.js +7 -0
- package/dist/chunks/discard-TGWEOYRT.js +14 -0
- package/dist/chunks/dist-33WTJLVQ.js +7 -0
- package/dist/chunks/dist-RXYNZPEA.js +7 -0
- package/dist/chunks/edit-3XLIA7OG.js +8 -0
- package/dist/chunks/edit-IE2X5ZQD.js +9 -0
- package/dist/chunks/enable-DK3YZA4V.js +7 -0
- package/dist/chunks/{exec-5ZWP5NC6.js → exec-OZSY46V6.js} +1 -1
- package/dist/chunks/{export-3OE2RWU7.js → export-XOMKFSVY.js} +1 -1
- package/dist/chunks/fetch-proxy-45DGILKR.js +67 -0
- package/dist/chunks/future-XGH5EADE.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-RGFAQHRI.js +7 -0
- package/dist/chunks/image-J2SIGGGB.js +7 -0
- package/dist/chunks/import-builders-MBKD4ERV.js +7 -0
- package/dist/chunks/inspect-CPXTLLSJ.js +13 -0
- package/dist/chunks/{inspect-JWDH7C6F.js → inspect-MR3XFJSZ.js} +1 -1
- package/dist/chunks/{inspect-HYJULYCV.js → inspect-MY3WMAQO.js} +1 -1
- package/dist/chunks/inspect-Q7D2TTXV.js +9 -0
- package/dist/chunks/{inspect-GD6JJPWG.js → inspect-SNN4G5IH.js} +1 -1
- package/dist/chunks/{list-4SZS2TB7.js → list-5HYYTOOF.js} +1 -1
- package/dist/chunks/list-6WEW57IO.js +12 -0
- package/dist/chunks/{list-AGS47O5P.js → list-7LMA6KKH.js} +1 -1
- package/dist/chunks/login-PFJ4ZSUI.js +9 -0
- package/dist/chunks/login-TVTT7VFC.js +7 -0
- package/dist/chunks/logs-WAOHH4MP.js +7 -0
- package/dist/chunks/{ls-ZPUNJ7ND.js → ls-6NO2RHSW.js} +1 -1
- package/dist/chunks/{ls-WQX2DS4X.js → ls-BHP75R3B.js} +1 -1
- package/dist/chunks/{ls-Y2JQYSVO.js → ls-NBMLWOON.js} +1 -1
- package/dist/chunks/{ls-KNRG7G5K.js → ls-QPOCM5P2.js} +1 -1
- package/dist/chunks/ls-VDMCJ53V.js +11 -0
- package/dist/chunks/{ls-LGL5ZKEJ.js → ls-WHEKRXAT.js} +1 -1
- package/dist/chunks/ls-ZL4DBDXR.js +8 -0
- package/dist/chunks/mutate-C6FYX2DM.js +9 -0
- package/dist/chunks/{notifications-557GW5KI.js → notifications-F7GGQGPQ.js} +1 -1
- package/dist/chunks/open-EX4PGTAE.js +7 -0
- package/dist/chunks/{openapi-IVXUCJPM.js → openapi-JGYEFJJV.js} +1 -1
- package/dist/chunks/{permissions-2XHSDRNE.js → permissions-KSPXNTFT.js} +1 -1
- package/dist/chunks/plugin-offer-4U77LNYA.js +9 -0
- package/dist/chunks/prompt-missing-credentials-JJP6AV5V.js +7 -0
- package/dist/chunks/publish-UZES2VJC.js +15 -0
- package/dist/chunks/pull-WUTJTCOT.js +7 -0
- package/dist/chunks/purchase-domain-if-available-XMNJGSPL.js +7 -0
- package/dist/chunks/push-ST6KQ2OK.js +7 -0
- package/dist/chunks/{query-JA5OWDSP.js → query-XCRX43SR.js} +1 -1
- package/dist/chunks/reauthenticate-LRJ5APNU.js +7 -0
- package/dist/chunks/reorder-QSZPOIBU.js +10 -0
- package/dist/chunks/reply-CAWLLEJ6.js +9 -0
- package/dist/chunks/resolve-GO4RFRQY.js +12 -0
- package/dist/chunks/resolve-agent-team-OGT4SLRJ.js +7 -0
- package/dist/chunks/{resolve-deployment-framework-preset-JPT2MRPA.js → resolve-deployment-framework-preset-AXXYBFCL.js} +1 -1
- package/dist/chunks/restore-NHHAVT4H.js +16 -0
- package/dist/chunks/rm-5FFPHHK6.js +8 -0
- package/dist/chunks/rm-7WHWMHAY.js +8 -0
- package/dist/chunks/rm-IFTLVW4R.js +8 -0
- package/dist/chunks/rm-TDUKZY7D.js +8 -0
- package/dist/chunks/rm-XIN5CPXB.js +8 -0
- package/dist/chunks/routes-P6LKQCWH.js +7 -0
- package/dist/chunks/rule-inspect-4EIDKQL6.js +8 -0
- package/dist/chunks/{schema-OV4SUO52.js → schema-NSGCBPHF.js} +1 -1
- package/dist/chunks/schema-NYKJCOCR.js +14 -0
- package/dist/chunks/select-org-AZVHP7AQ.js +7 -0
- package/dist/chunks/set-OC6KN3G4.js +7 -0
- package/dist/chunks/setup-and-link-WEXKJDAQ.js +7 -0
- package/dist/chunks/{skills-6EFE7KH7.js → skills-4J2NC2QI.js} +2 -2
- package/dist/chunks/tags-CCM7IGNC.js +7 -0
- package/dist/chunks/token-W6P2KNI5.js +7 -0
- package/dist/chunks/token-util-JDQI37VN.js +7 -0
- package/dist/chunks/{types-2DDQTYAO.js → types-SK6J2HFE.js} +1 -1
- package/dist/chunks/{update-XUMH6CAJ.js → update-TFDQQXYZ.js} +1 -1
- package/dist/chunks/zod-2C2SXNIK.js +7 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +7 -7
- package/dist/commands/dev/index.js +17 -15
- package/dist/commands/env/index.js +8 -8
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +113 -0
- package/dist/commands-account.js +209 -0
- package/dist/commands-ai.js +200 -0
- package/dist/commands-blob.js +107 -0
- package/dist/commands-core.js +222 -0
- package/dist/commands-deployments.js +84 -0
- package/dist/commands-flags.js +377 -0
- package/dist/commands-integrations.js +143 -0
- package/dist/commands-observability.js +93 -0
- package/dist/commands-routing.js +273 -0
- package/dist/index.js +5 -5
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +2 -2
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +61 -59
- package/dist/chunks/add-2HOGPYWC.js +0 -8
- package/dist/chunks/add-2RYLJ442.js +0 -8
- package/dist/chunks/add-PAQE7CT2.js +0 -8
- package/dist/chunks/build-77Q2YPHO.js +0 -7
- package/dist/chunks/chunk-36N6VMW4.js +0 -7
- package/dist/chunks/chunk-3GXZPT7T.js +0 -7
- package/dist/chunks/chunk-3L4MAGRI.js +0 -31
- package/dist/chunks/chunk-732WJANV.js +0 -15
- package/dist/chunks/chunk-AW7DEWIM.js +0 -7
- package/dist/chunks/chunk-BHWEIKSP.js +0 -10
- package/dist/chunks/chunk-BJ5APZ6X.js +0 -7
- package/dist/chunks/chunk-BZQ7YWSB.js +0 -10
- package/dist/chunks/chunk-CLKHGKJA.js +0 -7
- package/dist/chunks/chunk-FRSHC2HN.js +0 -7
- package/dist/chunks/chunk-IMMMID5G.js +0 -7
- package/dist/chunks/chunk-INDGZ3JK.js +0 -30
- package/dist/chunks/chunk-KNTBWMVA.js +0 -7
- package/dist/chunks/chunk-MIKNK3B6.js +0 -7
- package/dist/chunks/chunk-MVCAUS4F.js +0 -36
- package/dist/chunks/chunk-O3AL3QFA.js +0 -7
- package/dist/chunks/chunk-ODB7LEAO.js +0 -7
- package/dist/chunks/chunk-PS3KKHSI.js +0 -7
- package/dist/chunks/chunk-R3MRIQMO.js +0 -7
- package/dist/chunks/chunk-RAN5LUZY.js +0 -7
- package/dist/chunks/chunk-RH2SQQWH.js +0 -10
- package/dist/chunks/chunk-RUOOZ574.js +0 -7
- package/dist/chunks/chunk-UMUPJDWU.js +0 -7
- package/dist/chunks/chunk-VWK26HHN.js +0 -7
- package/dist/chunks/chunk-WKC7S5IW.js +0 -9
- package/dist/chunks/chunk-XBTLXKOI.js +0 -7
- package/dist/chunks/chunk-XDKCDGJF.js +0 -25
- package/dist/chunks/chunk-YNOLLMOG.js +0 -9
- package/dist/chunks/chunk-YTDK6AHS.js +0 -7
- package/dist/chunks/chunk-ZVRKM3UD.js +0 -12
- package/dist/chunks/clear-HPHGW2CD.js +0 -8
- package/dist/chunks/compile-vercel-config-YG2E5LXN.js +0 -7
- package/dist/chunks/config-PZ7HFZQZ.js +0 -8
- package/dist/chunks/connect-git-provider-WEFO2ESM.js +0 -7
- package/dist/chunks/delete-UPHMMYEJ.js +0 -10
- package/dist/chunks/delete-Z7PXYHTL.js +0 -9
- package/dist/chunks/detect-services-ZYHOOBMO.js +0 -7
- package/dist/chunks/disable-34LCZPFL.js +0 -7
- package/dist/chunks/discard-HDUCYAHG.js +0 -14
- package/dist/chunks/edit-4F7DADVN.js +0 -9
- package/dist/chunks/edit-5WKAHKCW.js +0 -8
- package/dist/chunks/enable-YV6I32W6.js +0 -7
- package/dist/chunks/fetch-proxy-OC6B22AW.js +0 -7
- package/dist/chunks/future-N2ZTDYVW.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-ORS7XL64.js +0 -7
- package/dist/chunks/image-WTWQT7A4.js +0 -7
- package/dist/chunks/import-builders-XBGAW4MC.js +0 -7
- package/dist/chunks/inspect-ISRYYL7L.js +0 -13
- package/dist/chunks/inspect-MEYRAEVT.js +0 -9
- package/dist/chunks/list-O7FAMXMT.js +0 -12
- package/dist/chunks/login-KNE2BGUB.js +0 -9
- package/dist/chunks/login-NCAGHBZD.js +0 -7
- package/dist/chunks/logs-7H5XDI44.js +0 -7
- package/dist/chunks/ls-RI6BNJO7.js +0 -8
- package/dist/chunks/ls-UJHETSDA.js +0 -11
- package/dist/chunks/mutate-QHSLJCQU.js +0 -9
- package/dist/chunks/open-IYLA5OZF.js +0 -7
- package/dist/chunks/prompt-missing-credentials-BLT57RIR.js +0 -7
- package/dist/chunks/publish-MQ56IB4K.js +0 -15
- package/dist/chunks/pull-K3JVXGZM.js +0 -7
- package/dist/chunks/purchase-domain-if-available-VDMLT3J2.js +0 -7
- package/dist/chunks/push-YXUJGMP4.js +0 -7
- package/dist/chunks/reauthenticate-YZXHWSEC.js +0 -7
- package/dist/chunks/reorder-UNU63VF3.js +0 -10
- package/dist/chunks/reply-CTLC5KAK.js +0 -9
- package/dist/chunks/resolve-HTKF4MMV.js +0 -12
- package/dist/chunks/resolve-agent-team-DLIROIXX.js +0 -7
- package/dist/chunks/restore-CSZYM5WU.js +0 -16
- package/dist/chunks/rm-BGLDOP4N.js +0 -8
- package/dist/chunks/rm-O2XVUZOW.js +0 -8
- package/dist/chunks/rm-OSMI52XV.js +0 -8
- package/dist/chunks/rm-SZIT75ZY.js +0 -8
- package/dist/chunks/rm-WJERY4WM.js +0 -8
- package/dist/chunks/routes-ZNPZJERJ.js +0 -7
- package/dist/chunks/rule-inspect-NGI6XURL.js +0 -8
- package/dist/chunks/schema-JLQ7SNYR.js +0 -14
- package/dist/chunks/select-org-URO7GRAY.js +0 -7
- package/dist/chunks/set-RU227EQQ.js +0 -7
- package/dist/chunks/setup-and-link-WX6IEZZO.js +0 -7
- package/dist/chunks/tags-KJINDQSV.js +0 -7
- package/dist/commands-bulk.js +0 -1673
|
@@ -0,0 +1,33 @@
|
|
|
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{applyEdits,init_main,modify,parse as parse2,printParseErrorCode}from"./chunk-J24BABG4.js";import{init_dist,parse,stringify}from"./chunk-U4Z2MMOF.js";import{external_exports}from"./chunk-2NABMKFV.js";import{require_execa}from"./chunk-BUJITHGZ.js";import{printAlignedLabel}from"./chunk-ADLBLGT3.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{__toESM}from"./chunk-BZENIQ7N.js";import{join as join2}from"node:path";init_dist();init_main();import{readFile,writeFile,mkdir,copyFile,access,chmod,lstat,stat,link,unlink}from"node:fs/promises";import{isDeepStrictEqual}from"node:util";import{dirname}from"node:path";async function pathExists(path){try{return await access(path),!0}catch{return!1}}async function isFile(path){try{return(await stat(path)).isFile()}catch{return!1}}async function isSymlink(path){try{return(await lstat(path)).isSymbolicLink()}catch{return!1}}async function readFileOrNull(path){try{return await readFile(path,"utf8")}catch(err){if(err.code==="ENOENT")return null;throw err}}function isPlainObject(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)&&Object.getPrototypeOf(value)===Object.prototype}function deepMerge(base,patch){let out={...base};for(let[key,patchValue]of Object.entries(patch)){let baseValue=out[key];isPlainObject(baseValue)&&isPlainObject(patchValue)?out[key]=deepMerge(baseValue,patchValue):out[key]=patchValue}return out}function detectJsonFormatting(text){let eol=text.includes(`\r
|
|
8
|
+
`)?`\r
|
|
9
|
+
`:`
|
|
10
|
+
`,indent=text.match(/^([ \t]+)\S/m)?.[1];return indent?.startsWith(" ")?{eol,insertSpaces:!1,tabSize:1}:{eol,insertSpaces:!0,tabSize:indent?.length||2}}function parseJsonObjectOrNull(current,parse4=JSON.parse){if(!current||!current.trim())return null;let raw;try{raw=parse4(current)}catch(err){throw new Error(`existing file is not valid JSON (${err.message})`)}if(!isPlainObject(raw))throw new Error("existing file is not a JSON object");return raw}function mergeJson(current,patch,parse4=JSON.parse){let raw=parseJsonObjectOrNull(current,parse4);if(!current||raw===null)return`${JSON.stringify(deepMerge({},patch),null,2)}
|
|
11
|
+
`;let merged=deepMerge(raw,patch),modifyOptions=current.trim().includes(`
|
|
12
|
+
`)?{formattingOptions:detectJsonFormatting(current)}:{};try{let text=current,splice=(existing,subPatch,path)=>{for(let[key,patchValue]of Object.entries(subPatch)){let existingValue=existing?.[key];isPlainObject(patchValue)&&isPlainObject(existingValue)?splice(existingValue,patchValue,[...path,key]):isDeepStrictEqual(existingValue,patchValue)||(text=applyEdits(text,modify(text,[...path,key],patchValue,modifyOptions)))}};if(splice(raw,patch,[]),isDeepStrictEqual(parse4(text),merged))return text}catch{}return`${JSON.stringify(merged,null,2)}
|
|
13
|
+
`}function mergeJsonc(current,patch){return mergeJson(current,patch,text=>{let errors=[],value=parse2(text,errors,{allowTrailingComma:!0}),first=errors[0];if(first)throw new Error(`${printParseErrorCode(first.error)} at offset ${first.offset}`);return value})}function patchSatisfied(existing,patch){for(let[key,patchValue]of Object.entries(patch)){let existingValue=isPlainObject(existing)?existing[key]:void 0;if(isPlainObject(patchValue)&&isPlainObject(existingValue)){if(!patchSatisfied(existingValue,patchValue))return!1}else if(!isDeepStrictEqual(existingValue,patchValue))return!1}return!0}function tomlScalar(value){switch(typeof value){case"string":return JSON.stringify(value);case"number":return Number.isFinite(value)?String(value):null;case"boolean":return String(value);default:return null}}var TOML_BARE_KEY=/^[A-Za-z0-9_-]+$/;function flattenTomlPatch(patch,prefix="",out=new Map){for(let[key,value]of Object.entries(patch)){if(!TOML_BARE_KEY.test(key))return null;if(isPlainObject(value)){if(!flattenTomlPatch(value,prefix?`${prefix}.${key}`:key,out))return null}else{let scalar=tomlScalar(value);if(scalar===null)return null;let section=out.get(prefix);section||(section=new Map,out.set(prefix,section)),section.set(key,scalar)}}return out}var TOML_HEADER=/^\s*\[\[?\s*([^\]]*?)\s*\]\]?\s*(?:#.*)?$/;function mergeToml(current,patch){let parsed={};if(current&¤t.trim())try{parsed=parse(current)}catch(err){throw new Error(`existing file is not valid TOML (${err.message})`)}let legacy=()=>`${stringify(deepMerge(parsed,patch))}
|
|
14
|
+
`;if(!current||!current.trim())return legacy();if(patchSatisfied(parsed,patch))return current;let flat=flattenTomlPatch(patch);if(!flat)return legacy();let crlf=current.includes(`\r
|
|
15
|
+
`),lines=current.split(`
|
|
16
|
+
`),content=line=>line.endsWith("\r")?line.slice(0,-1):line,finish=(line,i)=>i<lines.length&&lines[i]?.endsWith("\r")?`${line}\r`:line,headerAt=i=>{let m=content(lines[i]).match(TOML_HEADER);return m?m[1].split(".").map(s=>s.trim()).join("."):null},sectionRange=name=>{let start=name===""?0:-1;for(let i=0;i<lines.length;i++){let header=headerAt(i);if(header!==null){if(start!==-1)return[start,i];if(name==="")return[0,i];header===name&&(start=i+1)}}return start===-1?null:[start,lines.length]},appendSections=[];for(let[name,keys]of flat){let range=sectionRange(name);if(!range){appendSections.push(`[${name}]`,...[...keys].map(([k,v])=>`${k} = ${v}`));continue}let[start,end]=range,inserts=[];for(let[key,value]of keys){let assignment=new RegExp(`^(\\s*)${key}\\s*=`),replaced=!1;for(let i=start;i<end;i++){let m=content(lines[i]).match(assignment);if(m){lines[i]=finish(`${m[1]}${key} = ${value}`,i),replaced=!0;break}}replaced||inserts.push(`${key} = ${value}`)}if(inserts.length>0){let at=start;for(let i=start;i<end;i++)content(lines[i]).trim()!==""&&(at=i+1);lines.splice(at,0,...inserts.map(l=>finish(l,at)))}}if(appendSections.length>0){for(;lines.length>0&&content(lines[lines.length-1]).trim()==="";)lines.pop();let eol=crlf?"\r":"";lines.push(...["",...appendSections,""].map(l=>l===""?l:`${l}${eol}`))}let result=lines.join(`
|
|
17
|
+
`);try{if(isDeepStrictEqual(parse(result),deepMerge(parsed,patch)))return result}catch{}return legacy()}var MANAGED_BLOCK_START="# >>> vercel ai-gateway >>>",MANAGED_BLOCK_END="# <<< vercel ai-gateway <<<";function upsertManagedBlock(current,body){let block=`${MANAGED_BLOCK_START}
|
|
18
|
+
${body}
|
|
19
|
+
${MANAGED_BLOCK_END}`,existing=current??"",start=existing.indexOf(MANAGED_BLOCK_START),end=existing.indexOf(MANAGED_BLOCK_END);if(start!==-1&&end!==-1&&end>start){let before=existing.slice(0,start),after=existing.slice(end+MANAGED_BLOCK_END.length);return`${before}${block}${after}`}if(existing.length===0)return`${block}
|
|
20
|
+
`;let prefix=existing.endsWith(`
|
|
21
|
+
|
|
22
|
+
`)?"":existing.endsWith(`
|
|
23
|
+
`)?`
|
|
24
|
+
`:`
|
|
25
|
+
|
|
26
|
+
`;return`${existing}${prefix}${block}
|
|
27
|
+
`}async function publishNoClobber(temporary,destination){try{return await link(temporary,destination),!0}catch(error){if(error.code==="EEXIST")return!1;throw error}finally{await unlink(temporary).catch(()=>{})}}async function ensureMode(path,mode){try{await chmod(path,mode)}catch{}}async function backupFile(path,mode){let backupPath=`${path}.bak`;return mode===void 0?(await copyFile(path,backupPath),backupPath):(await ensureMode(backupPath,mode),await writeFile(backupPath,await readFile(path,"utf8"),{mode}),backupPath)}async function writeConfigFile(path,content,mode){await mkdir(dirname(path),{recursive:!0}),mode!==void 0&&await ensureMode(path,mode),await writeFile(path,content,mode===void 0?"utf8":{mode})}var GATEWAY_ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh",GATEWAY_CODING_AGENT_BASE_URL="https://ai-gateway.vercel.sh/coding-agent/v1",GATEWAY_CURSOR_BASE_URL="https://ai-gateway.vercel.sh/cursor/v1",GATEWAY_CODEX_BASE_URL="https://ai-gateway.vercel.sh/codex/v1",GATEWAY_CLAUDE_CODE_BASE_URL="https://ai-gateway.vercel.sh/claude-code",GATEWAY_API_KEY_ENV="AI_GATEWAY_API_KEY",GATEWAY_DEFAULT_MODEL="anthropic/claude-fable-5",KEY_PLACEHOLDER="__AI_GATEWAY_API_KEY__";function resolveGatewayBaseUrl(override,agentDefault){let trimmed=override?.trim();return trimmed||agentDefault}function maskSecret(secret){return secret&&(secret===KEY_PLACEHOLDER||secret.length<=8?"\u2022\u2022\u2022\u2022":`${secret.slice(0,4)}\u2022\u2022\u2022\u2022${secret.slice(-4)}`)}import{randomUUID}from"node:crypto";import*as fs from"node:fs/promises";import{dirname as dirname2,join}from"node:path";var MAX_RECORD_BYTES=1024*1024;function codeSpan(value){return`\`${value.replace(/[`\r\n]/g,"")}\``}var RECORD_PATTERN=/\.json$/;function claudeAppSupportRoot(home){return process.platform==="darwin"?join(home,"Library","Application Support"):process.platform==="win32"?process.env.APPDATA||join(home,"AppData","Roaming"):join(home,".config")}function toGatewayModelId(model){return model.includes("/")?model:`anthropic/${model}`}async function listSubdirectories(path){try{return(await fs.readdir(path,{withFileTypes:!0})).filter(e=>e.isDirectory()).map(e=>e.name)}catch{return[]}}async function findDestinationIdentity(root){let best=null;for(let account of await listSubdirectories(root))for(let org of await listSubdirectories(join(root,account))){let path=join(root,account,org);try{let stat4=await fs.stat(path);(!best||stat4.mtimeMs>best.mtime)&&(best={path,mtime:stat4.mtimeMs})}catch{}}return best?.path??null}async function readRecord(path){let stat4;try{stat4=await fs.stat(path)}catch{return null}if(!stat4.isFile()||stat4.size>MAX_RECORD_BYTES)return null;try{let raw=await fs.readFile(path,"utf8"),record=JSON.parse(raw);return typeof record!="object"||record===null||Array.isArray(record)?null:{record,bytes:stat4.size}}catch{return null}}async function writeRecordNoClobber(destination,contents){if(await pathExists(destination))return"skipped";await fs.mkdir(dirname2(destination),{recursive:!0});let temp=join(dirname2(destination),`.migrate-${randomUUID()}.tmp`);return await fs.writeFile(temp,contents,{mode:384}),await publishNoClobber(temp,destination)?"copied":"skipped"}async function planClaudeDesktopSessionMigration(home,appSupportRoot=claudeAppSupportRoot(home)){let subscriptionRoot=join(appSupportRoot,"Claude","claude-code-sessions"),gatewayRoot=join(appSupportRoot,"Claude-3p","claude-code-sessions"),destinationDir=await findDestinationIdentity(gatewayRoot);if(!destinationDir)return null;let copies=[],totalBytes=0;for(let account of await listSubdirectories(subscriptionRoot))for(let org of await listSubdirectories(join(subscriptionRoot,account))){let identityDir=join(subscriptionRoot,account,org),names;try{names=await fs.readdir(identityDir)}catch{continue}for(let name of names){if(!RECORD_PATTERN.test(name))continue;let source=join(identityDir,name),destination=join(destinationDir,name);if(await pathExists(destination))continue;let read=await readRecord(source);read&&(copies.push({source,destination,bytes:read.bytes}),totalBytes+=read.bytes)}}return copies.length===0?null:{label:"Claude Desktop sessions",itemCount:copies.length,totalBytes,sourceRoots:[subscriptionRoot],destinationRoots:[destinationDir],prompt:[`Copy the ${copies.length} Claude Desktop session record${copies.length===1?"":"s"} (per-session \`.json\` files) under ${codeSpan(subscriptionRoot)} into ${codeSpan(destinationDir)}, keeping each filename.`,"In each copy, rewrite the top-level `model` field to its AI Gateway id by prefixing `anthropic/` when the value has no provider prefix (e.g. `claude-opus-4-8` \u2192 `anthropic/claude-opus-4-8`); keep any suffix such as `[1m]` intact. Leave every other field unchanged.","Use atomic, no-clobber writes with mode 0600; skip records whose destination already exists. Never move, edit, delete, or overwrite an original record."],async apply(){let copied=0,skipped=0,errors=[];for(let copy of copies)try{let read=await readRecord(copy.source);if(!read){skipped+=1;continue}let record={...read.record};typeof record.model=="string"&&(record.model=toGatewayModelId(record.model)),await writeRecordNoClobber(copy.destination,`${JSON.stringify(record)}
|
|
28
|
+
`)==="copied"?copied+=1:skipped+=1}catch(error){errors.push(`${copy.source}: ${error instanceof Error?error.message:String(error)}`)}return errors.length>0?{copied,skipped,errors}:{copied,skipped}}}}function claudeDir(home){let dir=process.env.CLAUDE_CONFIG_DIR;return dir&&dir.trim()?dir:join2(home,".claude")}var claudeCode={id:"claude-code",displayName:"Claude Code",sessionMigration:{plan:({home})=>planClaudeDesktopSessionMigration(home)},async detect(home){return pathExists(claudeDir(home))},configPath(ctx){return ctx.overrides?.["claude-code"]??join2(claudeDir(ctx.home),"settings.json")},buildPlan(ctx){let path=this.configPath(ctx),env={ANTHROPIC_BASE_URL:resolveGatewayBaseUrl(ctx.baseUrlOverride,GATEWAY_CLAUDE_CODE_BASE_URL),ANTHROPIC_API_KEY:"",CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:"1",ENABLE_TOOL_SEARCH:"true"},envExports=[];return ctx.useKeychain?envExports.push({name:"ANTHROPIC_AUTH_TOKEN",value:ctx.apiKey}):env.ANTHROPIC_AUTH_TOKEN=ctx.apiKey,{fileChanges:[{path,label:"Claude Code settings",format:"json",...ctx.useKeychain?{}:{mode:384},transform:current=>mergeJson(current,{env})}],envExports,notes:[...ctx.useKeychain?["The Anthropic auth token is read from your shell environment (Keychain-backed).","Open a new terminal so ANTHROPIC_AUTH_TOKEN is loaded, then restart Claude Code."]:["Restart Claude Code to pick up the new settings."],"The Claude Desktop app switches providers in its own settings (Developer \u2192 Configure Third-Party Inference\u2026). After its first gateway launch, re-run this command to copy your existing desktop sessions over."]}}};import{readFile as readFile3,writeFile as writeFile3}from"node:fs/promises";import{access as access2}from"node:fs/promises";import{join as join3}from"node:path";import{homedir}from"node:os";import{spawn}from"node:child_process";var PREFS_FILE="agent-preferences.json",CLAUDE_LEGACY_PLUGIN_ID="vercel-plugin@vercel",CLAUDE_OFFICIAL_MARKETPLACE="claude-plugins-official",CLAUDE_OFFICIAL_MARKETPLACE_SOURCE="anthropics/claude-plugins-official",CLAUDE_OFFICIAL_PLUGIN_ID=`vercel@${CLAUDE_OFFICIAL_MARKETPLACE}`,CLAUDE_DIRECTORY_PLUGIN_ID="vercel@anthropic-plugin-directory",VERCEL_PLUGIN_VERSION_URL="https://raw.githubusercontent.com/vercel/vercel-plugin/main/.claude-plugin/plugin.json",promptedAtSchema=external_exports.codec(external_exports.union([external_exports.iso.date(),external_exports.iso.datetime()]),external_exports.date(),{decode:value=>new Date(value),encode:value=>value.toISOString()}),agentPreferencesSchema=external_exports.object({pluginDeclined:external_exports.boolean().optional(),pluginAutoUpdate:external_exports.boolean().optional(),lastPromptedAt:promptedAtSchema.optional(),lastPluginAutoUpdateAttemptedAt:promptedAtSchema.optional(),lastPluginAutoUpdateAttemptedKey:external_exports.string().optional()});async function fileExists(filePath){try{return await access2(filePath),!0}catch{return!1}}async function readPrefs(client){return await client.maybeReadConfig(PREFS_FILE,agentPreferencesSchema)??{}}async function writePrefs(client,prefs){try{await client.writeConfig(PREFS_FILE,agentPreferencesSchema,prefs)}catch{}}async function getSavedPluginAnswer(client){let{pluginDeclined}=await readPrefs(client);return pluginDeclined===void 0?void 0:!pluginDeclined}async function savePluginAnswer(client,accepted){let prefs=await readPrefs(client);prefs.pluginDeclined=!accepted,prefs.pluginAutoUpdate=accepted,await markPromptedToday(client,prefs)}async function hasClaudeVercelPlugin(home){return(await readClaudeInstalledPluginsFromRegistry(join3(claudeDir(home),"plugins","installed_plugins.json"))).some(plugin=>plugin.id===CLAUDE_OFFICIAL_PLUGIN_ID||plugin.id===CLAUDE_DIRECTORY_PLUGIN_ID)}async function readClaudeInstalledPluginsFromRegistry(registryPath=getClaudeInstalledPluginsRegistryPath()){try{let raw=await readFile3(registryPath,"utf-8"),plugins=JSON.parse(raw)?.plugins??{},entries=[];for(let[id,installs]of Object.entries(plugins))if(Array.isArray(installs))for(let install of installs)!install||typeof install!="object"||entries.push({id,...install,enabled:!0});return entries}catch{return[]}}function getClaudeInstalledPluginsRegistryPath(){return join3(homedir(),".claude","plugins","installed_plugins.json")}async function markStaleClaudePluginInstalls(plugins){return Promise.all(plugins.map(async plugin=>plugin.installPath&&!await fileExists(plugin.installPath)?{...plugin,stale:!0}:plugin))}async function removeClaudePluginFromRegistry(pluginId){try{let registryPath=getClaudeInstalledPluginsRegistryPath(),raw=await readFile3(registryPath,"utf-8"),data=JSON.parse(raw);return!data.plugins||!(pluginId in data.plugins)?!1:(delete data.plugins[pluginId],await writeFile3(registryPath,`${JSON.stringify(data,null,2)}
|
|
29
|
+
`,"utf-8"),!0)}catch(err){return output_manager_default.debug(`Failed to remove Claude plugin registry entry: ${err}`),!1}}async function markPromptedToday(client,prefs){prefs.lastPromptedAt=new Date,await writePrefs(client,prefs)}async function runCommand(command,args){return await new Promise(resolve=>{let child=spawn(command,args,{stdio:"pipe"}),stdout="",stderr="";child.stdout.on("data",chunk=>{stdout+=chunk.toString()}),child.stderr.on("data",chunk=>{stderr+=chunk.toString()}),child.on("close",code=>{resolve({exitCode:code??1,stdout,stderr})}),child.on("error",err=>{resolve({exitCode:1,stdout,stderr:`${stderr}${String(err)}`})})})}async function getClaudeInstalledPlugins(){let result=await runCommand("claude",["plugins","list","--json"]);if(result.exitCode===0)try{let parsed=JSON.parse(result.stdout);if(Array.isArray(parsed))return markStaleClaudePluginInstalls(parsed)}catch(err){output_manager_default.debug(`Failed to parse Claude plugin list JSON: ${err}`)}else result.stderr.trim().length>0&&output_manager_default.debug(`Failed to run 'claude plugins list --json': ${result.stderr}`);return markStaleClaudePluginInstalls(await readClaudeInstalledPluginsFromRegistry())}async function fetchLatestVercelPluginVersion(){try{let response=await fetch(VERCEL_PLUGIN_VERSION_URL);if(!response.ok){output_manager_default.debug(`Failed to fetch latest Vercel plugin version: ${response.status}`);return}let manifest=await response.json();return typeof manifest.version=="string"?manifest.version:void 0}catch(err){output_manager_default.debug(`Failed to fetch latest Vercel plugin version: ${err}`);return}}function comparePluginVersions(a,b){if(!a&&!b)return 0;if(!a)return-1;if(!b)return 1;let parse4=value=>value.split(".").map(part=>Number.parseInt(part,10)||0),left=parse4(a),right=parse4(b),maxLength=Math.max(left.length,right.length);for(let i=0;i<maxLength;i++){let l=left[i]??0,r=right[i]??0;if(l>r)return 1;if(l<r)return-1}return 0}function buildClaudePluginStatus(installedPlugins,latestVersion){let legacy=installedPlugins.find(plugin=>plugin.id===CLAUDE_LEGACY_PLUGIN_ID),official=installedPlugins.find(plugin=>plugin.id===CLAUDE_OFFICIAL_PLUGIN_ID),state="none";return legacy&&official?state="both":legacy?state="legacy-only":official&&(state="official-only"),{state,legacy,official,latestVersion}}function buildClaudePluginMigrationPlan(status){let plan={installOfficial:!1,updateOfficial:!1,removeLegacy:!1,removeLegacyMarketplace:!1};switch(status.state){case"none":plan.installOfficial=!0;break;case"legacy-only":plan.installOfficial=!0,plan.removeLegacy=!0,plan.removeLegacyMarketplace=!0;break;case"both":plan.removeLegacy=!0,plan.removeLegacyMarketplace=!0;break;case"official-only":break}return status.official?.version&&status.latestVersion&&comparePluginVersions(status.official.version,status.latestVersion)<0&&(plan.updateOfficial=!0),plan}function hasClaudeMigrationActions(plan){return plan.installOfficial||plan.updateOfficial||plan.removeLegacy||plan.removeLegacyMarketplace}function buildClaudePromptCopy(status,plan){if(plan.installOfficial&&status.state==="none")return{message:"Vercel Plugin for Claude Code is not installed.",confirm:"Would you like to install it now?"};if(plan.installOfficial&&status.state==="legacy-only")return{message:"Update available for Vercel Plugin for Claude Code (legacy -> official).",confirm:"Would you like to update now?"};if(status.state==="both"&&plan.removeLegacy)return{message:"Vercel Plugin for Claude Code has a legacy install to clean up.",confirm:"Would you like to update now?"};if(plan.updateOfficial){let fromVersion=status.official?.version,toVersion=status.latestVersion;return{message:`Update available for Vercel Plugin for Claude Code${fromVersion&&toVersion?` (v${fromVersion} -> v${toVersion})`:""}.`,confirm:"Would you like to update now?"}}return{message:"The Vercel plugin needs attention in Claude Code before your agent harness is fully up to date.",confirm:"Apply the Vercel plugin changes for Claude Code?"}}async function runClaudeCommand(spinnerMessage,successMessage,failureMessage,args,options){output_manager_default.spinner(spinnerMessage);let result=await runCommand("claude",args);return output_manager_default.stopSpinner(),result.exitCode===0?(options?.quietSuccess||output_manager_default.success(successMessage),!0):(output_manager_default.warn(failureMessage),output_manager_default.debug(`Claude command failed: claude ${args.join(" ")}
|
|
30
|
+
${result.stderr||result.stdout}`),!1)}async function ensureClaudeOfficialMarketplace(){let result=await runCommand("claude",["plugins","marketplace","list","--json"]),marketplaces;try{marketplaces=JSON.parse(result.stdout)}catch{}if(result.exitCode!==0||!Array.isArray(marketplaces))return output_manager_default.debug(`Failed to list Claude plugin marketplaces: ${result.stderr||result.stdout}`),!0;if(marketplaces.some(marketplace=>marketplace?.name===CLAUDE_OFFICIAL_MARKETPLACE))return!0;let added=await runClaudeCommand("Adding the official Claude plugin marketplace...","Added the official Claude plugin marketplace","Failed to add the official Claude plugin marketplace.",["plugins","marketplace","add",CLAUDE_OFFICIAL_MARKETPLACE_SOURCE],{quietSuccess:!0});return added||output_manager_default.log(`Setup command: claude plugins marketplace add ${CLAUDE_OFFICIAL_MARKETPLACE_SOURCE}`),added}async function removeStaleLegacyClaudePlugin(removeMarketplace){output_manager_default.spinner("Removing the stale legacy Vercel Claude plugin...");let removedRegistryEntry=await removeClaudePluginFromRegistry(CLAUDE_LEGACY_PLUGIN_ID);if(output_manager_default.stopSpinner(),!removedRegistryEntry)return output_manager_default.warn("Could not remove the stale legacy Vercel Claude plugin registry entry."),{removedPlugin:!1,complete:!1};if(output_manager_default.success("Removed the stale legacy Vercel Claude plugin"),removeMarketplace){let removedMarketplace=await runClaudeCommand("Removing the legacy Vercel marketplace...","Removed the legacy Vercel marketplace","Removed the stale legacy Vercel plugin, but could not remove the legacy marketplace.",["plugins","marketplace","remove","vercel"],{quietSuccess:!0});return removedMarketplace||output_manager_default.log("Cleanup command: claude plugins marketplace remove vercel"),{removedPlugin:!0,complete:removedMarketplace}}return{removedPlugin:!0,complete:!0}}async function runClaudeMigration(plan){let removedStaleLegacy=!1,complete=!0;if(plan.removeLegacy&&(await getClaudePluginStatus()).legacy?.stale){let cleanup=await removeStaleLegacyClaudePlugin(plan.removeLegacyMarketplace);removedStaleLegacy=cleanup.removedPlugin,complete=cleanup.complete}if(plan.installOfficial){if(!await ensureClaudeOfficialMarketplace()||!await runClaudeCommand("Installing the official Vercel Claude plugin...","Updated the Vercel plugin","Failed to install the official Vercel Claude plugin.",["plugins","install",CLAUDE_OFFICIAL_PLUGIN_ID]))return!1}else if(plan.updateOfficial&&!await runClaudeCommand("Updating the official Vercel Claude plugin...","Updated the Vercel plugin","Failed to update the official Vercel Claude plugin.",["plugins","update",CLAUDE_OFFICIAL_PLUGIN_ID]))return!1;let statusAfterInstall=await getClaudePluginStatus();return statusAfterInstall.official?plan.removeLegacy&&statusAfterInstall.legacy&&!await runClaudeCommand("Removing the legacy Vercel Claude plugin...","Removed the legacy Vercel Claude plugin","Installed the official Vercel Claude plugin, but could not remove the legacy install.",["plugins","uninstall",CLAUDE_LEGACY_PLUGIN_ID],{quietSuccess:!0})?(output_manager_default.log(`Cleanup command: claude plugins uninstall ${CLAUDE_LEGACY_PLUGIN_ID}`),!1):plan.removeLegacyMarketplace&&!removedStaleLegacy&&!(await getClaudePluginStatus()).legacy&&!await runClaudeCommand("Removing the legacy Vercel marketplace...","Removed the legacy Vercel marketplace","Removed the legacy Vercel plugin, but could not remove the legacy marketplace.",["plugins","marketplace","remove","vercel"],{quietSuccess:!0})?(output_manager_default.log("Cleanup command: claude plugins marketplace remove vercel"),!1):complete:(output_manager_default.warn("Skipping Claude cleanup because the official Vercel plugin is not installed."),!1)}async function getClaudePluginStatus(){let[installedPlugins,latestVersion]=await Promise.all([getClaudeInstalledPlugins(),fetchLatestVercelPluginVersion()]);return buildClaudePluginStatus(installedPlugins,latestVersion)}function describeClaudePlan(plan){let actions=[];return plan.installOfficial&&actions.push("install the official plugin"),plan.updateOfficial&&actions.push("update the official plugin"),plan.removeLegacy&&actions.push("remove the legacy plugin"),plan.removeLegacyMarketplace&&actions.push("remove the legacy marketplace"),actions.join(", ")}async function setupVercelPlugin(client,opts){if(!await claudeCode.detect(opts.home))return{status:"not_detected",message:"Claude Code was not detected on this machine."};let status=await getClaudePluginStatus();if(status.official?.stale)return{status:"failed",message:"The installed Vercel plugin files are missing. Run `claude plugins uninstall vercel@claude-plugins-official`, then run `vercel setup plugin --agent claude-code` to reinstall it."};let plan=buildClaudePluginMigrationPlan(status);if(!hasClaudeMigrationActions(plan))return{status:"up_to_date",message:`Vercel plugin for Claude Code is installed${status.official?.version?` (v${status.official.version})`:""}.`};let copy=buildClaudePromptCopy(status,plan);if(opts.dryRun)return{status:"dry_run",message:`${copy.message} Setup would ${describeClaudePlan(plan)}.`,action:plan.installOfficial?"install":"update"};let prefs=await readPrefs(client);if(!opts.yes){if(!opts.canPrompt)return{status:"confirmation_required",message:`${copy.message} Re-run with --yes to apply it.`};output_manager_default.print(` ${copy.message}
|
|
31
|
+
`);let accepted=await client.input.confirm(copy.confirm,!0);if(await markPromptedToday(client,prefs),!accepted)return prefs.pluginDeclined=!0,prefs.pluginAutoUpdate=!1,await writePrefs(client,prefs),{status:"declined",message:"Skipped the Vercel plugin for Claude Code."}}prefs.pluginDeclined=!1,prefs.pluginAutoUpdate=!0,await writePrefs(client,prefs);let migrated=await runClaudeMigration(plan),after=await getClaudePluginStatus();if(!after.official)return{status:"failed",message:"Failed to install the Vercel plugin for Claude Code. Run `claude plugins install vercel@claude-plugins-official` to install it manually."};let remaining=buildClaudePluginMigrationPlan({...after,latestVersion:plan.updateOfficial?status.latestVersion:void 0});if(!migrated||after.official.stale||hasClaudeMigrationActions(remaining))return{status:"failed",message:"Failed to complete Vercel plugin setup for Claude Code. Re-run `vercel setup plugin --agent claude-code --yes` to retry."};let version=after.official.version?` v${after.official.version}`:"";return{status:plan.installOfficial?"installed":"updated",message:`${plan.installOfficial?"Installed":"Updated"} the Vercel plugin for Claude Code${version}.`}}var import_execa=__toESM(require_execa(),1);import{join as join5}from"node:path";import{createHash as createHash2,randomUUID as randomUUID2}from"node:crypto";var regex_default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function validate(uuid){return typeof uuid=="string"&®ex_default.test(uuid)}var validate_default=validate;function parse3(uuid){if(!validate_default(uuid))throw TypeError("Invalid UUID");let v;return Uint8Array.of((v=parseInt(uuid.slice(0,8),16))>>>24,v>>>16&255,v>>>8&255,v&255,(v=parseInt(uuid.slice(9,13),16))>>>8,v&255,(v=parseInt(uuid.slice(14,18),16))>>>8,v&255,(v=parseInt(uuid.slice(19,23),16))>>>8,v&255,(v=parseInt(uuid.slice(24,36),16))/1099511627776&255,v/4294967296&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255)}var parse_default=parse3;var byteToHex=[];for(let i=0;i<256;++i)byteToHex.push((i+256).toString(16).slice(1));function unsafeStringify(arr,offset=0){return(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase()}function stringToBytes(str){str=unescape(encodeURIComponent(str));let bytes=new Uint8Array(str.length);for(let i=0;i<str.length;++i)bytes[i]=str.charCodeAt(i);return bytes}var DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(version,hash,value,namespace,buf,offset){let valueBytes=typeof value=="string"?stringToBytes(value):value,namespaceBytes=typeof namespace=="string"?parse_default(namespace):namespace;if(typeof namespace=="string"&&(namespace=parse_default(namespace)),namespace?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let bytes=new Uint8Array(16+valueBytes.length);if(bytes.set(namespaceBytes),bytes.set(valueBytes,namespaceBytes.length),bytes=hash(bytes),bytes[6]=bytes[6]&15|version,bytes[8]=bytes[8]&63|128,buf){if(offset??=0,offset<0||offset+16>buf.length)throw new RangeError(`UUID byte range ${offset}:${offset+15} is out of buffer bounds`);for(let i=0;i<16;++i)buf[offset+i]=bytes[i];return buf}return unsafeStringify(bytes)}import{createHash}from"node:crypto";function sha1(bytes){return Array.isArray(bytes)?bytes=Buffer.from(bytes):typeof bytes=="string"&&(bytes=Buffer.from(bytes,"utf8")),createHash("sha1").update(bytes).digest()}var sha1_default=sha1;function v5(value,namespace,buf,offset){return v35(80,sha1_default,value,namespace,buf,offset)}v5.DNS=DNS;v5.URL=URL;var v5_default=v5;import{createReadStream,createWriteStream}from"node:fs";import*as fs2 from"node:fs/promises";import{basename,dirname as dirname3,join as join4}from"node:path";import{pipeline}from"node:stream/promises";var ROLLOUT_PATTERN=/^rollout-.*\.jsonl(?:\.zst)?$/,MAX_METADATA_BYTES=1024*1024;function hasCode(error,code){return error.code===code}async function readMeta(path,gateway=!1){let handle=await fs2.open(path,"r"),buffer=new Uint8Array(MAX_METADATA_BYTES+1),length=0,newline=-1;try{for(;length<buffer.length&&newline<0;){let start=length,read=await handle.read(buffer,start,buffer.length-start,start);if(read.bytesRead===0)break;length+=read.bytesRead,newline=buffer.indexOf(10,start)}}finally{await handle.close()}if(newline<0&&length>MAX_METADATA_BYTES)throw new Error(`${basename(path)} metadata exceeds 1 MiB`);let lineEnd=newline<0?length:newline,carriageReturn=buffer[lineEnd-1]===13,record;try{record=JSON.parse(new TextDecoder().decode(buffer.subarray(0,carriageReturn?lineEnd-1:lineEnd)))}catch{return null}let payload=record.payload,id=typeof payload?.id=="string"?payload.id:typeof payload?.session_id=="string"?payload.session_id:"";return record.type!=="session_meta"||!payload||!validate_default(id)||typeof payload.session_id=="string"&&payload.session_id!==id||payload.originator!=="Codex Desktop"&&!(payload.originator==null&&payload.source==="vscode")||(gateway?payload.model_provider!=="vercel":payload.model_provider==="vercel")?null:{record,payload,id,delimiter:newline<0?"":carriageReturn?`\r
|
|
32
|
+
`:`
|
|
33
|
+
`,restOffset:newline<0?length:newline+1}}function codeSpan2(value){return`\`${value.replace(/[`\r\n]/g,"")}\``}async function findRollouts(root){let files=[];async function visit(directory){let entries;try{entries=await fs2.readdir(directory,{withFileTypes:!0})}catch(error){if(hasCode(error,"ENOENT"))return;throw error}for(let entry of entries){let path=join4(directory,entry.name);entry.isDirectory()?await visit(path):entry.isFile()&&ROLLOUT_PATTERN.test(entry.name)&&files.push(path)}}return await visit(root),files}async function planCopy(path,root){let metadata=await readMeta(path),filename=basename(path);if(!metadata||!filename.toLowerCase().includes(metadata.id.toLowerCase()))return null;let destinationId=v5_default(`vercel-ai-gateway/codex/${metadata.id.toLowerCase()}/vercel`,v5_default.URL),destination=join4(dirname3(path),filename.replace(new RegExp(metadata.id,"i"),destinationId)),item={source:path,destination,sourceId:metadata.id,destinationId,bytes:(await fs2.stat(path)).size,root};try{return await fs2.stat(destination),await validateDestination(item),null}catch(error){if(!hasCode(error,"ENOENT"))throw error}return item}async function bodyHash(path,start){let hash=createHash2("sha256");return await pipeline(createReadStream(path,{start}),hash),hash.digest("hex")}async function validateDestination(item){let[source,destination]=await Promise.all([readMeta(item.source),readMeta(item.destination,!0)]),bodies=await Promise.all([bodyHash(item.source,source?.restOffset??0),bodyHash(item.destination,destination?.restOffset??0)]);if(!(source&&destination?.id===item.destinationId&&bodies[0]===bodies[1]))throw new Error(`Existing destination ${basename(item.destination)} is invalid`)}async function copySession(item){let metadata=await readMeta(item.source);if(!metadata)throw new Error("Codex session metadata is no longer valid");if(metadata.id!==item.sourceId)throw new Error("Codex session metadata changed after planning");let updated={...metadata.record,payload:{...metadata.payload,id:item.destinationId,session_id:item.destinationId,model_provider:"vercel"}},temporary=`${item.destination}.tmp-${process.pid}-${randomUUID2()}`;try{return await fs2.writeFile(temporary,`${JSON.stringify(updated)}${metadata.delimiter}`,{flag:"wx",mode:384}),await pipeline(createReadStream(item.source,{start:metadata.restOffset}),createWriteStream(temporary,{flags:"a",mode:384})),await fs2.chmod(temporary,384),await publishNoClobber(temporary,item.destination)?!0:(await validateDestination(item),!1)}finally{await fs2.unlink(temporary).catch(error=>{if(!hasCode(error,"ENOENT"))throw error})}}async function planCodexSessionMigration(home){let codexHome=process.env.CODEX_HOME||join4(home,".codex"),roots=["sessions","archived_sessions"].map(root=>join4(codexHome,root)),files=[];for(let root of roots)files.push(...(await findRollouts(root)).map(path=>({path,root})));if(files.some(file=>file.path.endsWith(".jsonl.zst")))throw new Error("Found compressed Codex sessions; decompress them first, or pass --no-session-migration to leave them unchanged");let copies=[];for(let file of files){let copy=await planCopy(file.path,file.root);copy&&copies.push(copy)}if(copies.length===0)return null;let sourceRoots=[...new Set(copies.map(copy=>copy.root))];return{label:"Codex Desktop sessions",itemCount:copies.length,totalBytes:copies.reduce((total,copy)=>total+copy.bytes,0),sourceRoots,destinationRoots:sourceRoots,prompt:[`Before changing the provider, copy the ${copies.length} top-level Codex Desktop rollout${copies.length===1?"":"s"} with a non-\`vercel\` provider under ${sourceRoots.map(codeSpan2).join(", ")}. Do not copy subagent rollouts whose \`session_id\` differs from \`id\`.`,"For each copy, derive a deterministic UUID v5 using the URL namespace `6ba7b811-9dad-11d1-80b4-00c04fd430c8` and name `vercel-ai-gateway/codex/<source-id>/vercel`. Replace the filename UUID and `session_meta.payload.id`/`session_id`, set `model_provider` to `vercel`, and preserve every later JSONL byte.","Use atomic, no-clobber writes with mode 0600; skip an existing deterministic destination only after validating its metadata and body. Never move, edit, delete, or overwrite an original session file."],async apply(){let copied=0,skipped=0,errors=[];for(let item of copies)try{await copySession(item)?copied++:skipped++}catch(error){errors.push(`${basename(item.source)}: ${error instanceof Error?error.message:String(error)}`)}return{copied,skipped,errors}}}}function codexDir(home){let dir=process.env.CODEX_HOME;return dir&&dir.trim()?dir:join5(home,".codex")}var codex={id:"codex",displayName:"Codex",sessionMigration:{plan:({home})=>planCodexSessionMigration(home)},async detect(home){return pathExists(codexDir(home))},configPath(ctx){return ctx.overrides?.codex??join5(codexDir(ctx.home),"config.toml")},buildPlan(ctx){return{fileChanges:[{path:this.configPath(ctx),label:"Codex config",format:"toml",transform:current=>mergeToml(current,{model_provider:"vercel",model_providers:{vercel:{name:"Vercel AI Gateway",base_url:resolveGatewayBaseUrl(ctx.baseUrlOverride,GATEWAY_CODEX_BASE_URL),env_key:GATEWAY_API_KEY_ENV,wire_api:"responses"}}})}],envExports:[{name:GATEWAY_API_KEY_ENV,value:ctx.apiKey}],notes:["Codex now defaults to the Vercel AI Gateway; pick a model with --model or in config.",`Open a new terminal so ${GATEWAY_API_KEY_ENV} is loaded, or run: export ${GATEWAY_API_KEY_ENV}=<key>`]}}};var MARKETPLACE="openai-curated-remote",PLUGIN_ID=`vercel@${MARKETPLACE}`,INSTALL_COMMAND=`codex plugin add ${PLUGIN_ID}`,SIGN_IN_MESSAGE="Can't install the Vercel plugin for Codex without a ChatGPT sign-in. Run `codex login`, then `vercel setup plugin --agent codex`.",pluginListSchema=external_exports.object({installed:external_exports.array(external_exports.object({pluginId:external_exports.string(),enabled:external_exports.boolean(),version:external_exports.string().nullable().optional()}))});async function runCodex(args){let{stdout}=await(0,import_execa.default)("codex",args,{encoding:"utf8",stdin:"ignore",timeout:6e4,maxBuffer:1048576});return stdout}function needsChatGptSignIn(err){let{message,stderr}=err;return[message,stderr].some(text=>typeof text=="string"&&/chatgpt authentication required/i.test(text))}async function installedPlugin(){let stdout=await runCodex(["plugin","list","--marketplace",MARKETPLACE,"--json"]),{installed}=pluginListSchema.parse(JSON.parse(stdout));return installed.find(plugin=>plugin.pluginId===PLUGIN_ID)}async function setupCodexPlugin(client,opts){if(!await codex.detect(opts.home))return{status:"not_detected",message:"Codex was not detected on this machine."};let before;try{before=await installedPlugin()}catch(err){return{status:"failed",message:needsChatGptSignIn(err)?SIGN_IN_MESSAGE:"Couldn't inspect Codex plugins. Install or update the Codex CLI, sign in with `codex login`, then re-run `vercel setup plugin --agent codex`."}}if(before?.enabled)return{status:"up_to_date",message:`Vercel plugin for Codex is installed${before.version?` (v${before.version})`:""}.`};let action=before?"enable":"install";if(opts.dryRun)return{status:"dry_run",action,message:`Setup would ${action} the Vercel plugin for Codex from the OpenAI marketplace.`};if(!opts.yes){if(!opts.canPrompt)return{status:"confirmation_required",message:`Re-run with --yes to ${action} the Vercel plugin for Codex.`};if(printAlignedLabel("Plugin","Vercel for Codex (OpenAI marketplace)"),!await client.input.confirm(before?"Enable this plugin?":"Install this plugin?",!0))return{status:"declined",message:"Skipped the Vercel plugin for Codex."}}output_manager_default.spinner(`${before?"Enabling":"Installing"} the Vercel plugin for Codex\u2026`);try{let stdout=await runCodex(["plugin","add",PLUGIN_ID,"--json"]),install=external_exports.object({appsNeedingAuth:external_exports.array(external_exports.unknown()).optional()}).parse(JSON.parse(stdout)),after=await installedPlugin();if(!after?.enabled)return{status:"failed",message:"The Vercel plugin is not enabled in Codex. Open Codex's /plugins browser, enable Vercel, then re-run `vercel setup plugin --agent codex`."};let version=after.version?` v${after.version}`:"",connection=install.appsNeedingAuth?.length?" Connect Vercel in Codex's /plugins browser to use its connected tools.":" Start a new Codex session to load the plugin.";return{status:before?"enabled":"installed",message:`${before?"Enabled":"Installed"} the Vercel plugin for Codex${version}.${connection}`}}catch(err){return{status:"failed",message:needsChatGptSignIn(err)?SIGN_IN_MESSAGE:`Failed to set up the Vercel plugin for Codex. Run \`${INSTALL_COMMAND}\` to finish setup in Codex.`}}finally{output_manager_default.stopSpinner()}}export{pathExists,isFile,isSymlink,readFileOrNull,parseJsonObjectOrNull,mergeJson,mergeJsonc,mergeToml,MANAGED_BLOCK_START,MANAGED_BLOCK_END,upsertManagedBlock,ensureMode,backupFile,writeConfigFile,GATEWAY_ANTHROPIC_BASE_URL,GATEWAY_CODING_AGENT_BASE_URL,GATEWAY_CURSOR_BASE_URL,GATEWAY_API_KEY_ENV,GATEWAY_DEFAULT_MODEL,KEY_PLACEHOLDER,resolveGatewayBaseUrl,maskSecret,claudeCode,codex,getSavedPluginAnswer,savePluginAnswer,hasClaudeVercelPlugin,setupVercelPlugin,setupCodexPlugin};
|
|
@@ -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_raw_body}from"./chunk-XOETL6DB.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_raw_body=__toESM(require_raw_body(),1);async function readStdinText(stdin,limit){return stdin.isTTY?"":(await(0,import_raw_body.default)(stdin,{limit,encoding:"utf8"})).replace(/\r?\n$/,"")}async function readStandardInput(stdin){return new Promise(resolve=>{setTimeout(()=>resolve(""),500),stdin.isTTY?resolve(""):(stdin.setEncoding("utf8"),stdin.once("data",resolve))})}export{readStdinText,readStandardInput};
|
|
@@ -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{outputError}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-RW3X523R.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{readFileSync}from"node:fs";function readAllStandardInput(stdin){return stdin.isTTY?Promise.resolve(""):new Promise(resolve=>{let chunks=[],timer=setTimeout(()=>{chunks.length===0&&(cleanup(),resolve(""))},500),onData=chunk=>{chunks.push(String(chunk))},onEnd=()=>{cleanup(),resolve(chunks.join(""))};function cleanup(){clearTimeout(timer),stdin.off("data",onData),stdin.off("end",onEnd)}stdin.setEncoding("utf8"),stdin.on("data",onData),stdin.on("end",onEnd)})}async function resolveMessageContent(client,flags,jsonOutput){if(flags.message!==void 0&&flags.file!==void 0)return outputError(client,jsonOutput,"CONFLICTING_CONTENT","Use either --message or --file, not both.");if(flags.message!==void 0)return flags.message;if(flags.file!==void 0){if(flags.file==="-"){let piped2=await readAllStandardInput(client.stdin);return piped2||outputError(client,jsonOutput,"MISSING_CONTENT","No content received on stdin for `--file -`.")}try{return readFileSync(flags.file,"utf8")}catch(err){return outputError(client,jsonOutput,"FILE_READ_ERROR",`Could not read ${flags.file}: ${err instanceof Error?err.message:String(err)}`)}}let piped=await readAllStandardInput(client.stdin);if(piped)return piped;if(!flags.hasAttachments){if(canPrompt(client)&&!jsonOutput){let text=await client.input.text({message:"Comment message:"});if(text)return text}return outputError(client,jsonOutput,"MISSING_CONTENT",'No content provided. Pass --message <text>, --file <path>, or pipe stdin (e.g. `echo "LGTM" | vercel comments reply <thread>`).')}}export{resolveMessageContent};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{getScope}from"./chunk-
|
|
7
|
+
import{getScope}from"./chunk-F6FTWDLS.js";import{AGENT_REASON,AGENT_STATUS,buildCommandWithGlobalFlags,outputAgentError,shouldEmitNonInteractiveCommandError}from"./chunk-DGYHWXD2.js";import{getOrgById}from"./chunk-VBWQRK3O.js";import{suggestCorrection}from"./chunk-VOCZ34ON.js";import{output_manager_default}from"./chunk-XP3FT56R.js";async function findSimilarProjectName(client,name,orgId){try{let{projects}=await client.fetch("/v9/projects?limit=100",{accountId:orgId});return suggestCorrection(name,projects.map(project=>project.name).filter(projectName=>/^[a-z0-9._-]+$/i.test(projectName)))}catch(err){output_manager_default.debug(`Project suggestion lookup failed: ${err}`);return}}async function printProjectNotFoundError(client,projectNameOrId,commandName,orgId,{createCommand}={}){let contextName;try{orgId?contextName=(await getOrgById(client,orgId))?.slug??orgId:contextName=(await getScope(client)).contextName}catch(err){contextName=orgId,output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`)}let scopeClause=contextName?` (${contextName})`:"",headline=`Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`,suggestion=createCommand?await findSimilarProjectName(client,projectNameOrId,orgId):void 0,suggestionLine=suggestion?` Did you mean ${suggestion}?`:"",createNote=createCommand?.note;if(output_manager_default.error(`${headline}${suggestionLine}
|
|
8
8
|
|
|
9
9
|
`+(createCommand?`To create it${createNote?`, ${createNote}`:""}:
|
|
10
10
|
${createCommand.command}
|
|
@@ -4,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{normalizeFlagName,stripSensitiveAuthArgs}from"./chunk-
|
|
7
|
+
import{normalizeFlagName,stripSensitiveAuthArgs}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var DEFAULT_LIST_LIMIT=20,MAX_LIST_LIMIT=100;function parseListLimit(value,{defaultLimit=DEFAULT_LIST_LIMIT,maxLimit=MAX_LIST_LIMIT}={}){if(value===void 0)return defaultLimit;if(!Number.isInteger(value)||value<1||value>maxLimit)throw new Error(`The --limit option must be an integer from 1 to ${maxLimit}.`);return value}var PaginationError=class extends Error{constructor(message){super(message),this.name="PaginationError"}};async function fetchAllPages(fetchPage,{maxPages=1e3}={}){let items=[],seen=new Set,next;for(let pages=0;pages<maxPages;pages++){let page=await fetchPage(next);if(items.push(...page.items),!page.next)return items;if(seen.has(page.next))throw new PaginationError("Pagination returned a cursor it already returned. The list is incomplete.");seen.add(page.next),next=page.next}throw new PaginationError(`Stopped after ${maxPages} pages. The list is incomplete. Use --limit and --next to page through it manually.`)}var CURSOR_FLAGS=new Set(["--next","-N"]);function quoteShellArg(value){return/^[A-Za-z0-9_./@:,=+-]+$/.test(value)?value:`'${value.replace(/'/g,"'\\''")}'`}function getNextPageCommand(argv,next,dropFlags=[]){let args=stripSensitiveAuthArgs(argv.slice(2)),delimiter=args.indexOf("--"),own=delimiter===-1?args:args.slice(0,delimiter),passthrough=delimiter===-1?[]:args.slice(delimiter),kept=[];for(let i=0;i<own.length;i++){let arg=own[i],name=normalizeFlagName(arg);if(CURSOR_FLAGS.has(name)||dropFlags.includes(name)){!arg.includes("=")&&i+1<own.length&&i++;continue}if(/^-[A-Za-z]{2,}$/.test(arg)&&arg.includes("N")){kept.push(arg.replace(/N/g,"")),i+1<own.length&&i++;continue}kept.push(arg)}return kept.push(`--next=${next}`,...passthrough),`${packageName} ${kept.map(quoteShellArg).join(" ")}`}function printNextPageCommand(command,label="Next page"){output_manager_default.print(` ${label}:
|
|
8
8
|
${import_chalk.default.cyan(command)}
|
|
9
9
|
`)}function printNextPageHint(client,next,dropFlags=[]){next&&(output_manager_default.print(`
|
|
10
|
-
`),printNextPageCommand(getNextPageCommand(client.argv,next,dropFlags)))}export{DEFAULT_LIST_LIMIT,parseListLimit,PaginationError,fetchAllPages,getNextPageCommand,printNextPageCommand,printNextPageHint};
|
|
10
|
+
`),printNextPageCommand(getNextPageCommand(client.argv,next,dropFlags)))}export{DEFAULT_LIST_LIMIT,MAX_LIST_LIMIT,parseListLimit,PaginationError,fetchAllPages,getNextPageCommand,printNextPageCommand,printNextPageHint};
|
|
@@ -4,11 +4,11 @@ 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 as require_dist2,validateConfig}from"./chunk-
|
|
7
|
+
import{require_dist as require_dist2,validateConfig}from"./chunk-QYCGL36Q.js";import{compileVercelConfig,findSourceVercelConfigFile}from"./chunk-DA37HMCW.js";import{applyEdits,findNodeAtLocation,init_main,modify,parse,parseTree}from"./chunk-J24BABG4.js";import{init_dist,stringify}from"./chunk-U4Z2MMOF.js";import{require_dist2 as require_dist}from"./chunk-CVDK3IYT.js";import{printAlignedLabel}from"./chunk-ADLBLGT3.js";import{code}from"./chunk-6VH56CX2.js";import{link_default,output_manager_default,require_build_utils}from"./chunk-XP3FT56R.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);init_main();init_dist();var import_build_utils=__toESM(require_build_utils(),1),import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename}from"path";var EXPERIMENTAL_SERVICES_DOCS_URL="https://vercel.com/docs/services/experimental";async function prepareExperimentalServicesMigration(cwd,detectServicesResult){let compileResult=await compileVercelConfig(cwd);if(!compileResult.configPath)return null;let rawConfig=await readFile(compileResult.configPath,"utf8"),config=parse(rawConfig);if(!config||!(0,import_service_topology.hasLegacyServicesConfig)(config))return null;let resolvedServices=detectServicesResult?.resolved?.source==="configured"?detectServicesResult.services.filter(s=>(0,import_build_utils.isExperimentalService)(s)):void 0,plan=await(0,import_service_topology.migrateExperimentalServices)({fs:new import_fs_detectors.LocalFileSystemDetector(cwd),config,resolvedServices:resolvedServices&&resolvedServices.length>0?resolvedServices:void 0}),sourceFile=compileResult.sourceFile??basename(compileResult.configPath),preparation={plan,sourceFile,snippet:renderSnippet(sourceFile,plan)};if(plan.errors.length>0)return preparation;if(compileResult.wasCompiled)return preparation.writeBlocker=`${sourceFile} can't be updated automatically.`,preparation;let content=applyPlanToJson(rawConfig,config,plan),parseErrors=[],nextConfig=parse(content,parseErrors);if(parseErrors.length>0)return preparation.writeBlocker=`Couldn't produce a valid ${sourceFile}.`,preparation;let validationError=validateConfig(nextConfig);return validationError?(preparation.writeBlocker=validationError.message,preparation):(preparation.write={configPath:compileResult.configPath,content},preparation)}function applyPlanToJson(rawConfig,config,plan){let eol=rawConfig.includes(`\r
|
|
8
8
|
`)?`\r
|
|
9
9
|
`:`
|
|
10
10
|
`,indent2=/^([ \t]+)\S/m.exec(rawConfig)?.[1]??" ",formattingOptions={eol,insertSpaces:!indent2.startsWith(" "),tabSize:indent2.startsWith(" ")?1:indent2.length},legacyKey=config.experimentalServices?"experimentalServices":"experimentalServicesV2",key=findNodeAtLocation(parseTree(rawConfig),[legacyKey]).parent.children[0],text=applyEdits(rawConfig,[{offset:key.offset,length:key.length,content:'"services"'}]);text=applyEdits(text,modify(text,["services"],plan.patch.services,{formattingOptions}));for(let key2 of plan.removeKeys)key2!==legacyKey&&(text=applyEdits(text,modify(text,[key2],void 0,{formattingOptions})));for(let[key2,value]of Object.entries(plan.patch.build?.env??{}))text=applyEdits(text,modify(text,["build","env",key2],value,{formattingOptions}));if(plan.patch.rewrites.length>0)if(Array.isArray(config.rewrites))for(let rewrite of plan.patch.rewrites)text=applyEdits(text,modify(text,["rewrites",-1],rewrite,{formattingOptions}));else text=applyEdits(text,modify(text,["rewrites"],plan.patch.rewrites,{formattingOptions,getInsertionIndex:keys=>keys.indexOf("services")+1}));return text.endsWith(`
|
|
11
|
-
`)?text:`${text}${eol}`}function renderSnippet(sourceFile,plan){let patch={services:plan.patch.services};return plan.patch.rewrites.length>0&&(patch.rewrites=plan.patch.rewrites),plan.patch.build&&(patch.build=plan.patch.build),sourceFile==="vercel.toml"?
|
|
11
|
+
`)?text:`${text}${eol}`}function renderSnippet(sourceFile,plan){let patch={services:plan.patch.services};return plan.patch.rewrites.length>0&&(patch.rewrites=plan.patch.rewrites),plan.patch.build&&(patch.build=plan.patch.build),sourceFile==="vercel.toml"?stringify(patch).trimEnd():JSON.stringify(patch,null,2)}function displayExperimentalServicesMigration(preparation){let{plan,sourceFile,snippet}=preparation,legacyKey=plan.removeKeys.includes("experimentalServices")?"experimentalServices":"experimentalServicesV2";if(output_manager_default.print(`${import_chalk.default.yellow("!")} ${sourceFile} uses ${code(legacyKey)}, which is replaced by ${code("services")}. ${link_default(EXPERIMENTAL_SERVICES_DOCS_URL)}
|
|
12
12
|
`),plan.errors.length>0){output_manager_default.print(` ${import_chalk.default.bold(`Can't migrate ${sourceFile} automatically:`)}
|
|
13
13
|
`);for(let error of plan.errors)output_manager_default.print(` ${import_chalk.default.red("\u2717")} ${error.message}
|
|
14
14
|
`);return}output_manager_default.print(`
|
|
@@ -0,0 +1,12 @@
|
|
|
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,validateConfig}from"./chunk-QYCGL36Q.js";import{readJSONFile}from"./chunk-7SYW5HXA.js";import{compileVercelConfig}from"./chunk-DA37HMCW.js";import{init_dist,parse,stringify}from"./chunk-U4Z2MMOF.js";import{require_dist2 as require_dist}from"./chunk-CVDK3IYT.js";import{CantParseJSONFile}from"./chunk-6VH56CX2.js";import{require_build_utils}from"./chunk-XP3FT56R.js";import{__toESM}from"./chunk-BZENIQ7N.js";init_dist();var import_fs_detectors=__toESM(require_dist(),1),import_service_topology=__toESM(require_dist2(),1);import{readFile,writeFile}from"fs/promises";import{basename,join as join2}from"path";var import_build_utils=__toESM(require_build_utils(),1);import{join}from"path";function createDetectEntrypoint(projectRoot){return async({workPath,framework})=>{let absWorkPath=(0,import_build_utils.normalizePath)(join(projectRoot,workPath)),builderName;if((0,import_build_utils.isPythonFramework)(framework))builderName="@vercel/python";else if((0,import_build_utils.isNodeBackendFramework)(framework))builderName="@vercel/backends";else if(framework==="go")builderName="@vercel/go";else if(framework==="rust")builderName="@vercel/rust";else return null;let detectEntrypoint=await loadBuilderDetectEntrypoint(builderName,projectRoot);return detectEntrypoint?detectEntrypoint(builderName==="@vercel/python"?{workPath:absWorkPath,framework}:{workPath:absWorkPath}):null}}async function loadBuilderDetectEntrypoint(name,projectRoot){let{importBuilders}=await import("./import-builders-MBKD4ERV.js"),loaded=(await importBuilders(new Set([name]),projectRoot)).get(name);if(!loaded)return;let detect=loaded.builder.detectEntrypoint;return typeof detect=="function"?detect:void 0}function getServicesConfiguration(config){let configuredServices=config?.services??config?.experimentalServicesV2??config?.experimentalServices,configuredServicesType=config?.services?"services":config?.experimentalServicesV2?"experimentalServicesV2":config?.experimentalServices?"experimentalServices":void 0;return{configuredServices,configuredServicesType}}async function loadVercelConfig(cwd){try{let{configPath}=await compileVercelConfig(cwd);if(!configPath)return null;let config=await readJSONFile(configPath);return config instanceof Error?null:config}catch{return null}}function isServicesEnvEnabled(){let value=process.env.VERCEL_USE_EXPERIMENTAL_SERVICES;return value==="1"||value?.toLowerCase()==="true"}async function isExperimentalServicesEnabled(cwd){let{configuredServices}=getServicesConfiguration(await loadVercelConfig(cwd));return isServicesEnvEnabled()||configuredServices!==void 0}async function tryDetectServices(cwd,config){config===void 0&&(config=await loadVercelConfig(cwd));let configuration=getServicesConfiguration(config);if(!isServicesEnvEnabled()&&!configuration.configuredServices)return null;let fs=new import_fs_detectors.LocalFileSystemDetector(cwd),result=await(0,import_service_topology.detectServices)({fs,configuredServices:configuration.configuredServices,configuredServicesType:configuration.configuredServicesType,detectEntrypoint:createDetectEntrypoint(cwd)});return result.errors.some(e=>e.code==="NO_SERVICES_CONFIGURED")?null:result}async function writeServicesConfig(cwd,config){let prepared=await prepareServicesConfigWrite(cwd,config);return await writeFile(prepared.configPath,prepared.content,"utf8"),{configFileName:basename(prepared.configPath)}}async function getServicesConfigWriteBlocker(cwd,config){try{return await prepareServicesConfigWrite(cwd,config),null}catch(error){return getServicesConfigWriteBlockerFromError(error)}}function toProjectServicesConfigPatch(config){let services={};for(let[name,svc]of Object.entries(config)){let buildCommand=svc.preDeployCommand&&svc.buildCommand?`${svc.buildCommand} && ${svc.preDeployCommand}`:svc.preDeployCommand||svc.buildCommand;services[name]={root:svc.root,...svc.framework?{framework:svc.framework}:{},...svc.entrypoint?{entrypoint:svc.entrypoint}:{},...buildCommand?{buildCommand}:{}}}let rewrites=(0,import_service_topology.generateServiceRewrites)(config);return{services,...rewrites.length>0?{rewrites}:{}}}async function prepareServicesConfigWrite(cwd,config){let compileResult=await compileVercelConfig(cwd),configPath=join2(cwd,"vercel.json");if(compileResult.sourceFile==="vercel.toml")return prepareTomlServicesConfigWrite(join2(cwd,"vercel.toml"),config);if(compileResult.wasCompiled)throw new Error(`Cannot automatically update ${compileResult.sourceFile??"the current Vercel config"}.`);let existingConfig={};if(compileResult.configPath&&basename(compileResult.configPath)==="vercel.json"){let result=await readJSONFile(configPath);if(result instanceof CantParseJSONFile)throw result;existingConfig=result??{}}let patch=toProjectServicesConfigPatch(config),nextConfig={...existingConfig,...patch,...patch.rewrites?{rewrites:[...existingConfig.rewrites??[],...patch.rewrites]}:{}},validationError=validateConfig(nextConfig);if(validationError)throw validationError;return{configPath,content:JSON.stringify(nextConfig,null,2)+`
|
|
8
|
+
`}}async function prepareTomlServicesConfigWrite(configPath,config){let patch=toProjectServicesConfigPatch(config),patchKeys=Object.keys(patch),existingContent;try{existingContent=await readFile(configPath,"utf8")}catch{existingContent=""}if(existingContent.trim()){let existingParsed=parse(existingContent),overlapping=patchKeys.filter(key=>key in existingParsed);if(overlapping.length>0){let plural=overlapping.length>1,keyList=overlapping.map(k=>`"${k}"`).join(", ");throw new Error(`Cannot automatically update vercel.toml: key${plural?"s":""} ${keyList} already exist${plural?"":"s"}.`)}}let patchToml=stringify(patch),content=existingContent.trim()?existingContent.trimEnd()+`
|
|
9
|
+
|
|
10
|
+
`+patchToml+`
|
|
11
|
+
`:patchToml+`
|
|
12
|
+
`;return{configPath,content}}function getServicesConfigWriteBlockerFromError(error){switch(error?.code){case"EXPERIMENTAL_SERVICES_AND_BUILDS":case"SERVICES_AND_BUILDS":return"builds";case"EXPERIMENTAL_SERVICES_AND_FUNCTIONS":case"SERVICES_AND_FUNCTIONS":return"functions";default:return null}}export{createDetectEntrypoint,loadVercelConfig,isExperimentalServicesEnabled,tryDetectServices,writeServicesConfig,getServicesConfigWriteBlocker};
|
|
@@ -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{resolveProjectContext}from"./chunk-BL3GEBL6.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-DGYHWXD2.js";import{parseArguments}from"./chunk-VOCZ34ON.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-AWMQGOS2.js";import{getCommandName,getCommandNamePlain}from"./chunk-JESNVRVR.js";import{output_manager_default}from"./chunk-XP3FT56R.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}export{requireProjectContext,parseSubcommandArguments,validateRequiredArguments};
|
|
@@ -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,require_dist2}from"./chunk-CVDK3IYT.js";import{require_types}from"./chunk-VBWQRK3O.js";import{require_build_utils}from"./chunk-XP3FT56R.js";import{__commonJS,__toESM}from"./chunk-BZENIQ7N.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,detectDaemons:()=>import_fs_detectors2.detectDaemons,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,hasLegacyServicesConfig:()=>import_fs_detectors2.hasLegacyServicesConfig,isExperimentalService:()=>import_fs_detectors2.isExperimentalService,isExperimentalServiceV2:()=>import_fs_detectors2.isExperimentalServiceV2,isRouteOwningBuilder:()=>import_fs_detectors2.isRouteOwningBuilder,isStaticBuild:()=>import_fs_detectors2.isStaticBuild,migrateExperimentalServices:()=>import_fs_detectors2.migrateExperimentalServices,planExperimentalServicesMigration:()=>import_fs_detectors2.planExperimentalServicesMigration,resolveAllConfiguredServices:()=>import_fs_detectors2.resolveAllConfiguredServices,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}}}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,required:["schedule"],properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},command:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs `command`. `entrypoint` is relative to it. Only valid with `command`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512}},dependencies:{requestMethod:["path"],service:["function"],command:["entrypoint","root"],root:["command"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=100,schedulesSchema={if:{type:"array"},then:{type:"array",maxItems:maxSchedules,items:{...scheduleDefinitionSchema,required:["name","schedule"],properties:{name:scheduleNameSchema,...scheduleDefinitionSchema.properties}}},else:{type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema}},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,required:["root"],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,command:{oneOf:[{type:"string"},{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}}),daemonConfigSchema={type:"object",additionalProperties:!1,required:["root","entrypoint"],anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:{...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}}}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=path=>/(docker|container)file/i.test(path.split(/[\\/]/).pop()??"");function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let schedules=Array.isArray(config.schedules)?config.schedules.map((schedule,index)=>[`schedules[${index}]`,schedule.name,schedule]):Object.entries(config.schedules??{}).map(([name,schedule])=>[`schedules.${name}`,name,schedule]),serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),invalidCommand=message=>new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_COMMAND",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`});for(let[path,name,schedule]of schedules){if("command"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.command\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidCommand(`\`${path}\` runs a command, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidCommand(`\`${path}\` runs a command as service "${name}", which is already the name of a service or daemon.`)}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"} - \`${path}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy);if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}if(servicesConfig){let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons))if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let envs=new Set;for(let binding of daemon.bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return invalid(`Daemon "${name}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`Daemon "${name}" declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}}let destinations=[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].map(entry=>"destination"in entry?entry.destination:void 0);for(let destination of destinations)if(typeof destination=="object"&&destination!==null&&isDaemonTarget(destination.service))return invalid(`Rewrites and routes cannot target daemon "${destination.service}" because daemons do not receive traffic.`);return null}export{require_dist3 as require_dist,validateConfig};
|
|
@@ -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{formatOption,jsonOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-AWMQGOS2.js";import{packageName}from"./chunk-JESNVRVR.js";var builtInBody={type:"built-in",name:"Production server errors",triggers:{mode:"selected",items:[{type:"error_anomaly",filter:"statusGroup:5xx AND route:/api/*"}]},matchMinimumSeverityLevel:"high"},patchBody={name:"Critical production errors",matchMinimumSeverityLevel:"critical"},authoringReference={title:"Authoring reference",body:["vercel monitors schema --type built-in"]},monitorsAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope flag, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",body:[...JSON.stringify(builtInBody,null,2).split(`
|
|
8
8
|
`),"","vercel monitors add --project my-app --body ./rule.json"]},authoringReference],monitorsUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored monitor.","Use --project or --all to change scope with or without --body.","Do not combine a ruleScope field in the body with --project or --all.","--all moves the monitor to team-wide scope."]},{title:"Partial body (patch.json)",body:[...JSON.stringify(patchBody,null,2).split(`
|
|
9
9
|
`),"","vercel monitors update ar_abc123 --body ./patch.json","vercel monitors update ar_abc123 --project my-app"]},authoringReference];var projectScopeOption={...projectOption,shorthand:"p",description:"Use a project by name or ID"},listAllOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List all accessible monitors in the selected team"},mutationAllOption={...listAllOption,description:"Apply the monitor to all projects in the selected team"},deprecatedItemScopeOptions=[{...projectScopeOption,deprecated:!0},{...listAllOption,deprecated:!0}],bodyOption={name:"body",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read the monitor body from a JSON file"},monitorsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List monitors for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by monitor type"},formatOption,jsonOption],examples:[{name:"List monitors affecting the linked project",value:`${packageName} monitors ls`},{name:"List all monitors in the selected team",value:`${packageName} monitors ls --all`},{name:"Write JSON output",value:`${packageName} monitors ls --all --json`}]},monitorsSchemaSubcommand={name:"schema",aliases:[],description:"Show monitor request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Monitor type to describe"},formatOption,jsonOption],examples:[{name:"List supported monitor types",value:`${packageName} monitors schema`},{name:"Show the built-in monitor schema",value:`${packageName} monitors schema --type built-in`}]},monitorsAddSubcommand={name:"add",aliases:["create"],description:"Create a monitor from a JSON body",helpSections:monitorsAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Create a team-wide built-in monitor",value:`${packageName} monitors add --all --body ./rule.json`}]},monitorsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one monitor by ID",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors inspect ar_abc123 --json`}]},monitorsRmSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove a monitor",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Remove with confirmation",value:`${packageName} monitors remove ar_abc123`},{name:"Remove without a prompt",value:`${packageName} monitors remove ar_abc123 --yes`}]},monitorsUpdateSubcommand={name:"update",aliases:["patch"],description:"Patch a monitor or change its scope",helpSections:monitorsUpdateHelpSections,arguments:[{name:"monitorId",required:!0}],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,{...bodyOption,description:"Read the partial update body from a JSON file"}],examples:[{name:"Update fields from a file",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Move a monitor to a project",value:`${packageName} monitors update ar_abc123 --project my-app`}]},notificationTargetOptions=[{name:"webhook",shorthand:null,type:String,argument:"WEBHOOK_ID",deprecated:!1,description:"Select an account webhook by ID"},{name:"slack-channel",shorthand:null,type:String,argument:"CHANNEL_ID",deprecated:!1,description:"Select a Slack channel by ID"},{name:"slack-installation-id",shorthand:null,type:String,argument:"INSTALLATION_ID",deprecated:!1,description:"Slack installation ID. Optional only when the team has exactly one completed Slack installation."}],criticalOnlyOption={name:"critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Notify only when Vercel Agent escalates an alert to Critical"},noCriticalOnlyOption={name:"no-critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Deliver every alert matched by the monitor"},monitorsNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable monitors or one monitor",arguments:[{name:"monitorId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable monitors",value:`${packageName} monitors notifications ls`},{name:"List notification destinations for one monitor",value:`${packageName} monitors notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors notifications ar_abc123 --json`}]},monitorsNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to a monitor",arguments:[{name:"<monitorId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},monitorsNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"<monitorId>",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} monitors notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the monitor",value:`${packageName} monitors notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},monitorsNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from a monitor",arguments:[{name:"<monitorId>",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} monitors notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} monitors notifications unlink ar_abc123 --webhook wh_abc123`}]},monitorsNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for monitors",arguments:[],subcommands:[monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable monitors",value:`${packageName} monitors notifications`},{name:"List destinations for one monitor",value:`${packageName} monitors notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`}]},monitorsCommand={name:"monitors",aliases:[],description:"Create, inspect, list, update, and delete monitors and manage their notification destinations",arguments:[],subcommands:[monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsAggregateCommand],options:monitorsLsSubcommand.options,examples:[{name:"List monitors for the linked project",value:`${packageName} monitors ls`},{name:"Add a monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Update a monitor",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Remove a monitor",value:`${packageName} monitors remove ar_abc123`},{name:"List notification destinations for a monitor",value:`${packageName} monitors notifications ar_abc123`}]};export{monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand,monitorsNotificationsAggregateCommand,monitorsCommand};
|