vercel 64.5.0 → 65.0.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-2HOGPYWC.js +8 -0
- package/dist/chunks/add-2RYLJ442.js +8 -0
- package/dist/chunks/add-PAQE7CT2.js +8 -0
- package/dist/chunks/build-77Q2YPHO.js +7 -0
- package/dist/chunks/{chunk-OJKZ7EV3.js → chunk-27QCVNMI.js} +1 -1
- package/dist/chunks/chunk-2BAAJZBZ.js +12 -0
- package/dist/chunks/{chunk-CITTRAYH.js → chunk-2UBZCG4F.js} +1 -1
- package/dist/chunks/chunk-36N6VMW4.js +7 -0
- package/dist/chunks/chunk-3GXZPT7T.js +7 -0
- package/dist/chunks/{chunk-ZZ3LJ22B.js → chunk-3L4MAGRI.js} +3 -3
- package/dist/chunks/chunk-3XDTQFBL.js +57 -0
- package/dist/chunks/{chunk-3DP66SQ4.js → chunk-43T3YKNH.js} +1 -1
- package/dist/chunks/{chunk-VKXEOL4K.js → chunk-4NTBYNFR.js} +3 -2
- package/dist/chunks/chunk-4T22AQTB.js +7 -0
- package/dist/chunks/{chunk-TPVAPVQC.js → chunk-52JGR5SZ.js} +1 -1
- package/dist/chunks/{chunk-7QQIWMAT.js → chunk-66262IYI.js} +5 -5
- package/dist/chunks/{chunk-JH257EDL.js → chunk-66ODHUGV.js} +1 -1
- package/dist/chunks/chunk-732WJANV.js +15 -0
- package/dist/chunks/chunk-7C5JHTHO.js +7 -0
- package/dist/chunks/chunk-7G72V52B.js +7 -0
- package/dist/chunks/chunk-7OMWRRY4.js +9 -0
- package/dist/chunks/chunk-AGDMSAYW.js +9 -0
- package/dist/chunks/chunk-AW7DEWIM.js +7 -0
- package/dist/chunks/{chunk-XSDAUM4F.js → chunk-AZ5OUZPP.js} +1 -1
- package/dist/chunks/{chunk-7GFRZWLE.js → chunk-B6U5434D.js} +1 -1
- package/dist/chunks/{chunk-3NNH2U5M.js → chunk-BFJC3UDU.js} +1 -1
- package/dist/chunks/{chunk-KKCBFBJK.js → chunk-BHWEIKSP.js} +1 -1
- package/dist/chunks/chunk-BJ5APZ6X.js +7 -0
- package/dist/chunks/chunk-BZQ7YWSB.js +10 -0
- package/dist/chunks/chunk-CLKHGKJA.js +7 -0
- package/dist/chunks/{chunk-CYV3X62I.js → chunk-CTKJQTC5.js} +1 -1
- package/dist/chunks/{chunk-IVIZLWZQ.js → chunk-CZ2KEML2.js} +1 -1
- package/dist/chunks/{chunk-WYI4VNXT.js → chunk-DBNQ45J5.js} +1 -1
- package/dist/chunks/chunk-DGDNI76L.js +10 -0
- package/dist/chunks/{chunk-HVUJNVPS.js → chunk-EJINOHL3.js} +1 -1
- package/dist/chunks/chunk-EKMQNUO4.js +9 -0
- package/dist/chunks/chunk-ENWROHWX.js +7 -0
- package/dist/chunks/{chunk-OYMFOCD5.js → chunk-F4ZFLPMT.js} +1 -1
- package/dist/chunks/chunk-F53OKXYI.js +7 -0
- package/dist/chunks/{chunk-6UCSM3CZ.js → chunk-FN7TTXXY.js} +1 -1
- package/dist/chunks/{chunk-EVQJ7SCV.js → chunk-FPC5LINQ.js} +1 -1
- package/dist/chunks/chunk-FRSHC2HN.js +7 -0
- package/dist/chunks/chunk-GRVLQZFQ.js +7 -0
- package/dist/chunks/chunk-HBPSZHXX.js +7 -0
- package/dist/chunks/{chunk-PAOR4MQZ.js → chunk-HNF2BEOE.js} +1 -1
- package/dist/chunks/{chunk-VRAMXFRB.js → chunk-IKSZMJKB.js} +4 -3
- package/dist/chunks/chunk-IMMMID5G.js +7 -0
- package/dist/chunks/{chunk-LYU4MVL5.js → chunk-INDGZ3JK.js} +5 -5
- package/dist/chunks/chunk-IYM5GO57.js +9 -0
- package/dist/chunks/{chunk-XEBMH33W.js → chunk-JDVUKDX3.js} +1 -1
- package/dist/chunks/{chunk-2UPVIVAA.js → chunk-JETQEZ24.js} +1 -1
- package/dist/chunks/{chunk-CMEEAXVV.js → chunk-JT273F22.js} +1 -1
- package/dist/chunks/{chunk-TE2EE7DR.js → chunk-JWX2YZVC.js} +1 -1
- package/dist/chunks/{chunk-ACVDKHVS.js → chunk-KCVCGYAR.js} +2 -2
- package/dist/chunks/chunk-KDABXEHF.js +7 -0
- package/dist/chunks/chunk-KNTBWMVA.js +7 -0
- package/dist/chunks/chunk-KUGFILF5.js +7 -0
- package/dist/chunks/{chunk-PTI3TP7P.js → chunk-KXHUMVXD.js} +1 -1
- package/dist/chunks/{chunk-GNV6PG6W.js → chunk-L5ANBZTX.js} +1 -1
- package/dist/chunks/chunk-LJIQZ3LU.js +7 -0
- package/dist/chunks/chunk-MIKNK3B6.js +7 -0
- package/dist/chunks/{chunk-VS7O22ED.js → chunk-MTETAZA4.js} +1 -1
- package/dist/chunks/{chunk-ZQKDO5PL.js → chunk-NYKEU7DQ.js} +2 -2
- package/dist/chunks/chunk-O3AL3QFA.js +7 -0
- package/dist/chunks/chunk-ODB7LEAO.js +7 -0
- package/dist/chunks/{chunk-HARXQZV3.js → chunk-OVV5MV5M.js} +1 -1
- package/dist/chunks/{chunk-T3GQAMBJ.js → chunk-PADL3C6Z.js} +1 -1
- package/dist/chunks/{chunk-H3KYG32S.js → chunk-PNUH3XXW.js} +1 -1
- package/dist/chunks/{chunk-LUJL3KFT.js → chunk-PS3KKHSI.js} +1 -1
- package/dist/chunks/chunk-PUKYAALC.js +7 -0
- package/dist/chunks/chunk-PXU645V7.js +8 -0
- package/dist/chunks/chunk-R3MRIQMO.js +7 -0
- package/dist/chunks/chunk-RAN5LUZY.js +7 -0
- package/dist/chunks/chunk-RH2SQQWH.js +10 -0
- package/dist/chunks/{chunk-SI7FQJIE.js → chunk-RTWGDRYT.js} +3 -3
- package/dist/chunks/{chunk-XXCWQPAH.js → chunk-RUOOZ574.js} +1 -1
- package/dist/chunks/{chunk-GWB27IAS.js → chunk-SLI2O5X7.js} +4 -4
- package/dist/chunks/chunk-SSKMT5SL.js +7 -0
- package/dist/chunks/chunk-T5LBVZWY.js +7 -0
- package/dist/chunks/chunk-UDMEPP3K.js +39 -0
- package/dist/chunks/{chunk-M774HRX5.js → chunk-UGZ3HFHI.js} +2 -2
- package/dist/chunks/chunk-UMUPJDWU.js +7 -0
- package/dist/chunks/chunk-VAZQS475.js +7 -0
- package/dist/chunks/chunk-VCV3H73W.js +7 -0
- package/dist/chunks/{chunk-JZ7FDBS4.js → chunk-VF2WX27D.js} +1 -1
- package/dist/chunks/chunk-VO2XAQFF.js +22 -0
- package/dist/chunks/{chunk-TLEBLYBS.js → chunk-VO36D4U4.js} +1 -1
- package/dist/chunks/chunk-VWK26HHN.js +7 -0
- package/dist/chunks/{chunk-TCQZFIBR.js → chunk-VY63XWWU.js} +1 -1
- package/dist/chunks/{chunk-BJXMXDBM.js → chunk-W7J5HTTY.js} +1 -1
- package/dist/chunks/{chunk-IJCCFLCQ.js → chunk-WDWYKX2I.js} +1 -1
- package/dist/chunks/{chunk-GVUB6QGX.js → chunk-WFEEUZ6B.js} +1 -1
- package/dist/chunks/{chunk-5S2NK6K6.js → chunk-WFSQ3OSN.js} +1 -1
- package/dist/chunks/{chunk-YROIQRYI.js → chunk-WKC7S5IW.js} +1 -1
- package/dist/chunks/{chunk-MZ3QGJH3.js → chunk-WTBGMDQ7.js} +1 -1
- package/dist/chunks/chunk-WYJGP5QW.js +7 -0
- package/dist/chunks/{chunk-MPZFMEVK.js → chunk-X3VSVBXT.js} +1 -1
- package/dist/chunks/{chunk-DRXOTZSJ.js → chunk-X5J7LOJK.js} +1 -1
- package/dist/chunks/{chunk-ROPQIBWJ.js → chunk-X7CLBXWL.js} +1 -1
- package/dist/chunks/chunk-XBTLXKOI.js +7 -0
- package/dist/chunks/{chunk-YQKURZ5W.js → chunk-XD2FF2PZ.js} +1 -1
- package/dist/chunks/chunk-XDKCDGJF.js +25 -0
- package/dist/chunks/chunk-YNOLLMOG.js +9 -0
- package/dist/chunks/{chunk-WN7EJWN4.js → chunk-YPX7BXJ6.js} +2 -2
- package/dist/chunks/{chunk-DNDBPLLI.js → chunk-YXZGKFF3.js} +1 -1
- package/dist/chunks/{chunk-6QRT6USI.js → chunk-Z6JDXW4A.js} +1 -1
- package/dist/chunks/{chunk-3GUO6F6P.js → chunk-ZIWS57E4.js} +1 -1
- package/dist/chunks/{chunk-5NXYYFRL.js → chunk-ZVRKM3UD.js} +1 -1
- package/dist/chunks/clear-HPHGW2CD.js +8 -0
- package/dist/chunks/compile-vercel-config-YG2E5LXN.js +7 -0
- package/dist/chunks/config-PZ7HFZQZ.js +8 -0
- package/dist/chunks/config-XH532PP3.js +7 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{connect-git-provider-2JIBL3ST.js → connect-git-provider-WEFO2ESM.js} +1 -1
- package/dist/chunks/delete-UPHMMYEJ.js +10 -0
- package/dist/chunks/delete-Z7PXYHTL.js +9 -0
- package/dist/chunks/{detect-projects-THLTMO7V.js → detect-projects-CHMBPFSE.js} +1 -1
- package/dist/chunks/detect-services-ZYHOOBMO.js +7 -0
- package/dist/chunks/disable-34LCZPFL.js +7 -0
- package/dist/chunks/discard-HDUCYAHG.js +14 -0
- package/dist/chunks/edit-4F7DADVN.js +9 -0
- package/dist/chunks/edit-5WKAHKCW.js +8 -0
- package/dist/chunks/enable-YV6I32W6.js +7 -0
- package/dist/chunks/{exec-NMRO6DIZ.js → exec-5ZWP5NC6.js} +1 -1
- package/dist/chunks/{export-KTLACTAJ.js → export-3OE2RWU7.js} +1 -1
- package/dist/chunks/future-N2ZTDYVW.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-ORS7XL64.js +7 -0
- package/dist/chunks/image-WTWQT7A4.js +7 -0
- package/dist/chunks/import-builders-XBGAW4MC.js +7 -0
- package/dist/chunks/{inspect-7IZ7M2TX.js → inspect-GD6JJPWG.js} +1 -1
- package/dist/chunks/{inspect-JDSFHP6X.js → inspect-HYJULYCV.js} +1 -1
- package/dist/chunks/inspect-ISRYYL7L.js +13 -0
- package/dist/chunks/{inspect-PQNECP2Z.js → inspect-JWDH7C6F.js} +1 -1
- package/dist/chunks/inspect-MEYRAEVT.js +9 -0
- package/dist/chunks/{list-3N2CBVOG.js → list-4SZS2TB7.js} +1 -1
- package/dist/chunks/{list-2G2BWD4T.js → list-AGS47O5P.js} +2 -2
- package/dist/chunks/list-O7FAMXMT.js +12 -0
- package/dist/chunks/login-KNE2BGUB.js +9 -0
- package/dist/chunks/login-NCAGHBZD.js +7 -0
- package/dist/chunks/logs-7H5XDI44.js +7 -0
- package/dist/chunks/ls-KNRG7G5K.js +12 -0
- package/dist/chunks/ls-LGL5ZKEJ.js +12 -0
- package/dist/chunks/ls-RI6BNJO7.js +8 -0
- package/dist/chunks/ls-UJHETSDA.js +11 -0
- package/dist/chunks/ls-WQX2DS4X.js +12 -0
- package/dist/chunks/ls-Y2JQYSVO.js +12 -0
- package/dist/chunks/{ls-5YLXAARZ.js → ls-ZPUNJ7ND.js} +1 -1
- package/dist/chunks/mutate-QHSLJCQU.js +9 -0
- package/dist/chunks/notifications-557GW5KI.js +7 -0
- package/dist/chunks/open-IYLA5OZF.js +7 -0
- package/dist/chunks/openapi-IVXUCJPM.js +7 -0
- package/dist/chunks/permissions-2XHSDRNE.js +7 -0
- package/dist/chunks/prompt-missing-credentials-BLT57RIR.js +7 -0
- package/dist/chunks/publish-MQ56IB4K.js +15 -0
- package/dist/chunks/pull-K3JVXGZM.js +7 -0
- package/dist/chunks/purchase-domain-if-available-VDMLT3J2.js +7 -0
- package/dist/chunks/push-YXUJGMP4.js +7 -0
- package/dist/chunks/query-JA5OWDSP.js +12 -0
- package/dist/chunks/reauthenticate-YZXHWSEC.js +7 -0
- package/dist/chunks/reorder-UNU63VF3.js +10 -0
- package/dist/chunks/reply-CTLC5KAK.js +9 -0
- package/dist/chunks/resolve-HTKF4MMV.js +12 -0
- package/dist/chunks/resolve-agent-team-DLIROIXX.js +7 -0
- package/dist/chunks/restore-CSZYM5WU.js +16 -0
- package/dist/chunks/rm-BGLDOP4N.js +8 -0
- package/dist/chunks/rm-O2XVUZOW.js +8 -0
- package/dist/chunks/rm-OSMI52XV.js +8 -0
- package/dist/chunks/rm-SZIT75ZY.js +8 -0
- package/dist/chunks/rm-WJERY4WM.js +8 -0
- package/dist/chunks/{routes-LK2HUGAK.js → routes-ZNPZJERJ.js} +1 -1
- package/dist/chunks/rule-inspect-NGI6XURL.js +8 -0
- package/dist/chunks/schema-JLQ7SNYR.js +14 -0
- package/dist/chunks/{schema-QHZO72DB.js → schema-OV4SUO52.js} +7 -7
- package/dist/chunks/select-org-URO7GRAY.js +7 -0
- package/dist/chunks/set-RU227EQQ.js +7 -0
- package/dist/chunks/setup-and-link-WX6IEZZO.js +7 -0
- package/dist/chunks/skills-6EFE7KH7.js +590 -0
- package/dist/chunks/tags-KJINDQSV.js +7 -0
- package/dist/chunks/{types-77UW6BI4.js → types-2DDQTYAO.js} +1 -1
- package/dist/chunks/update-XUMH6CAJ.js +8 -0
- package/dist/commands/build/index.js +4 -4
- package/dist/commands/deploy/index.js +17 -13
- package/dist/commands/dev/index.js +26 -16
- package/dist/commands/env/index.js +13 -13
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +725 -683
- package/dist/help.js +1 -1
- package/dist/index.js +2 -2
- package/dist/internal-build.js +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/runtime-assets/dev-tunnel/api/tunnel.ts +443 -0
- package/dist/runtime-assets/dev-tunnel/lib/env.ts +25 -0
- package/dist/runtime-assets/dev-tunnel/lib/tunnel_pb.ts +505 -0
- package/dist/version.mjs +1 -1
- package/package.json +65 -59
- package/dist/chunks/add-CG73LA5A.js +0 -8
- package/dist/chunks/add-KBBLLPHW.js +0 -8
- package/dist/chunks/add-U5U56FJR.js +0 -8
- package/dist/chunks/build-7EWHBKAN.js +0 -7
- package/dist/chunks/chunk-2B3A3MOX.js +0 -7
- package/dist/chunks/chunk-2UMWTCY7.js +0 -7
- package/dist/chunks/chunk-2VBFQZ72.js +0 -7
- package/dist/chunks/chunk-5AYB3JRL.js +0 -9
- package/dist/chunks/chunk-74QCXPNW.js +0 -7
- package/dist/chunks/chunk-7NNENHGN.js +0 -7
- package/dist/chunks/chunk-AOWWC6WZ.js +0 -7
- package/dist/chunks/chunk-BFRDBBSO.js +0 -7
- package/dist/chunks/chunk-CMKLX4DC.js +0 -7
- package/dist/chunks/chunk-D4MW3RDW.js +0 -7
- package/dist/chunks/chunk-DDLM6CIQ.js +0 -10
- package/dist/chunks/chunk-DXLLC7ZM.js +0 -7
- package/dist/chunks/chunk-GLH4PVMY.js +0 -7
- package/dist/chunks/chunk-GVVIFYQE.js +0 -7
- package/dist/chunks/chunk-HJRAWEA2.js +0 -7
- package/dist/chunks/chunk-ILFUNCJZ.js +0 -7
- package/dist/chunks/chunk-ITKS32PG.js +0 -7
- package/dist/chunks/chunk-J6O6JW2K.js +0 -7
- package/dist/chunks/chunk-JIGCN5QS.js +0 -44
- package/dist/chunks/chunk-KUGXOLL7.js +0 -25
- package/dist/chunks/chunk-LD5U73LA.js +0 -7
- package/dist/chunks/chunk-MI7W4QMV.js +0 -7
- package/dist/chunks/chunk-MY4MONOH.js +0 -7
- package/dist/chunks/chunk-MYHJNSCW.js +0 -15
- package/dist/chunks/chunk-N2TNA2FE.js +0 -9
- package/dist/chunks/chunk-O4FDRZ22.js +0 -7
- package/dist/chunks/chunk-OHVPJNGY.js +0 -8
- package/dist/chunks/chunk-OUHPDA7Q.js +0 -7
- package/dist/chunks/chunk-P2O5DOYE.js +0 -7
- package/dist/chunks/chunk-P5BNAP5T.js +0 -39
- package/dist/chunks/chunk-PPCFQQSU.js +0 -7
- package/dist/chunks/chunk-Q5ZGA2RO.js +0 -7
- package/dist/chunks/chunk-QEXSF4NA.js +0 -7
- package/dist/chunks/chunk-QOFK5PKB.js +0 -20
- package/dist/chunks/chunk-U73RXMGU.js +0 -7
- package/dist/chunks/chunk-UCAE5Z5L.js +0 -7
- package/dist/chunks/chunk-UGMTKOTN.js +0 -7
- package/dist/chunks/chunk-UQIVF4Q2.js +0 -7
- package/dist/chunks/chunk-V3RDOM3U.js +0 -20
- package/dist/chunks/chunk-VEMJINMZ.js +0 -13
- package/dist/chunks/chunk-VKPZP4LC.js +0 -8
- package/dist/chunks/chunk-VLDU2MDL.js +0 -7
- package/dist/chunks/chunk-VRWLNWNE.js +0 -7
- package/dist/chunks/chunk-W3TGCMRW.js +0 -9
- package/dist/chunks/chunk-WCBNKVVG.js +0 -9
- package/dist/chunks/chunk-Y24OSBXP.js +0 -7
- package/dist/chunks/chunk-ZBDLYNUF.js +0 -7
- package/dist/chunks/chunk-ZDKSDWSO.js +0 -9
- package/dist/chunks/chunk-ZMY3GQBK.js +0 -7
- package/dist/chunks/chunk-ZQME5XUJ.js +0 -7
- package/dist/chunks/chunk-ZS2WS4AM.js +0 -7
- package/dist/chunks/clear-35NUHHDI.js +0 -8
- package/dist/chunks/compile-vercel-config-UQIYIVA6.js +0 -7
- package/dist/chunks/config-FZD3R5VT.js +0 -8
- package/dist/chunks/config-IQE5C7PZ.js +0 -7
- package/dist/chunks/delete-6LSSOF4X.js +0 -9
- package/dist/chunks/delete-IBRCB3S3.js +0 -10
- package/dist/chunks/detect-services-GFVD2C3W.js +0 -7
- package/dist/chunks/disable-4TODXYTB.js +0 -7
- package/dist/chunks/discard-WHC5FKWF.js +0 -14
- package/dist/chunks/edit-3DXOWQMF.js +0 -8
- package/dist/chunks/edit-R2RUDKC4.js +0 -9
- package/dist/chunks/enable-2OAHPKCN.js +0 -7
- package/dist/chunks/future-JZ3RVO4B.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-D4IHTKQS.js +0 -7
- package/dist/chunks/image-UW5U6CRJ.js +0 -7
- package/dist/chunks/import-builders-JONKAYLL.js +0 -7
- package/dist/chunks/inspect-2FS4PYBH.js +0 -13
- package/dist/chunks/inspect-PWLUWUGV.js +0 -9
- package/dist/chunks/list-Y3OA4KFK.js +0 -11
- package/dist/chunks/login-LLM3Q6GJ.js +0 -9
- package/dist/chunks/login-VQN3F7JU.js +0 -7
- package/dist/chunks/logs-XEJPLFXM.js +0 -7
- package/dist/chunks/ls-2DACOWSU.js +0 -12
- package/dist/chunks/ls-2M7QSW2F.js +0 -12
- package/dist/chunks/ls-7DJWHOK4.js +0 -12
- package/dist/chunks/ls-GY2YLYMD.js +0 -12
- package/dist/chunks/ls-NJEJSYSO.js +0 -11
- package/dist/chunks/ls-OAJKYQEL.js +0 -8
- package/dist/chunks/mutate-G2I4ISF4.js +0 -9
- package/dist/chunks/notifications-6MXYY2V6.js +0 -7
- package/dist/chunks/open-YKOYB7PH.js +0 -7
- package/dist/chunks/openapi-36GMGEXR.js +0 -7
- package/dist/chunks/permissions-RRP6IEHS.js +0 -7
- package/dist/chunks/prompt-missing-credentials-WQUF6X6K.js +0 -7
- package/dist/chunks/publish-AQ3FYC3J.js +0 -15
- package/dist/chunks/pull-HT2MQ3ML.js +0 -7
- package/dist/chunks/purchase-domain-if-available-NDEUZYHK.js +0 -7
- package/dist/chunks/push-6LE54BCC.js +0 -7
- package/dist/chunks/query-SNY42BTX.js +0 -12
- package/dist/chunks/reauthenticate-4SGT475I.js +0 -7
- package/dist/chunks/reorder-SRF3NE5U.js +0 -10
- package/dist/chunks/reply-6HUIX4AX.js +0 -9
- package/dist/chunks/resolve-TNBNGA3G.js +0 -12
- package/dist/chunks/resolve-agent-team-XSXRT42F.js +0 -7
- package/dist/chunks/restore-HK4SWMZP.js +0 -16
- package/dist/chunks/rm-4VXZ3AIX.js +0 -8
- package/dist/chunks/rm-ESSU4MS4.js +0 -8
- package/dist/chunks/rm-EWPYZXTX.js +0 -8
- package/dist/chunks/rm-GNDGYUKQ.js +0 -8
- package/dist/chunks/rm-SKCAZTYN.js +0 -8
- package/dist/chunks/rule-inspect-RHHD5UIR.js +0 -8
- package/dist/chunks/rules-FF5FU7BV.js +0 -7
- package/dist/chunks/schema-HIKNWMV2.js +0 -14
- package/dist/chunks/select-org-CK5CWC3A.js +0 -7
- package/dist/chunks/set-5P44OPZP.js +0 -7
- package/dist/chunks/setup-and-link-OLSKD2HE.js +0 -7
- package/dist/chunks/tags-35DFWGDC.js +0 -7
- package/dist/chunks/update-WHBFIV22.js +0 -8
|
@@ -0,0 +1,57 @@
|
|
|
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{printAlignedLabel}from"./chunk-WDWYKX2I.js";import{fetch,require_lib}from"./chunk-X7CLBXWL.js";import{getGlobalPathConfig}from"./chunk-JDVUKDX3.js";import{require_graceful_fs,require_load_json_file}from"./chunk-4NTBYNFR.js";import{parseArguments}from"./chunk-XBTLXKOI.js";import{getTeamByIdOrSlug}from"./chunk-F53OKXYI.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{APIError,ConflictingConfigFiles,DeprecatedNowJson,InvalidLocalConfig,InvalidToken,MissingUser,NowError,ProjectNotFound,code,isAPIError}from"./chunk-AZ5OUZPP.js";import{emoji,link_default,output_manager_default,prependEmoji,require_build_utils}from"./chunk-UGZ3HFHI.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{pkg_default}from"./chunk-OO572JUC.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_universalify=__commonJS({"../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports){"use strict";exports.fromCallback=function(fn){return Object.defineProperty(function(...args){if(typeof args[args.length-1]=="function")fn.apply(this,args);else return new Promise((resolve6,reject)=>{args.push((err,res)=>err!=null?reject(err):resolve6(res)),fn.apply(this,args)})},"name",{value:fn.name})};exports.fromPromise=function(fn){return Object.defineProperty(function(...args){let cb=args[args.length-1];if(typeof cb!="function")return fn.apply(this,args);args.pop(),fn.apply(this,args).then(r=>cb(null,r),cb)},"name",{value:fn.name})}}});var require_fs=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/fs/index.js"(exports){"use strict";var u=require_universalify().fromCallback,fs4=require_graceful_fs(),api=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(key=>typeof fs4[key]=="function");Object.assign(exports,fs4);api.forEach(method=>{exports[method]=u(fs4[method])});exports.realpath.native=u(fs4.realpath.native);exports.exists=function(filename,callback){return typeof callback=="function"?fs4.exists(filename,callback):new Promise(resolve6=>fs4.exists(filename,resolve6))};exports.read=function(fd,buffer,offset,length,position,callback){return typeof callback=="function"?fs4.read(fd,buffer,offset,length,position,callback):new Promise((resolve6,reject)=>{fs4.read(fd,buffer,offset,length,position,(err,bytesRead,buffer2)=>{if(err)return reject(err);resolve6({bytesRead,buffer:buffer2})})})};exports.write=function(fd,buffer,...args){return typeof args[args.length-1]=="function"?fs4.write(fd,buffer,...args):new Promise((resolve6,reject)=>{fs4.write(fd,buffer,...args,(err,bytesWritten,buffer2)=>{if(err)return reject(err);resolve6({bytesWritten,buffer:buffer2})})})};typeof fs4.writev=="function"&&(exports.writev=function(fd,buffers,...args){return typeof args[args.length-1]=="function"?fs4.writev(fd,buffers,...args):new Promise((resolve6,reject)=>{fs4.writev(fd,buffers,...args,(err,bytesWritten,buffers2)=>{if(err)return reject(err);resolve6({bytesWritten,buffers:buffers2})})})})}});var require_utils=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports,module){"use strict";var path2=__require("path");module.exports.checkPath=function(pth){if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path2.parse(pth).root,""))){let error=new Error(`Path contains invalid characters: ${pth}`);throw error.code="EINVAL",error}}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports,module){"use strict";var fs4=require_fs(),{checkPath}=require_utils(),getMode=options=>{let defaults={mode:511};return typeof options=="number"?options:{...defaults,...options}.mode};module.exports.makeDir=async(dir,options)=>(checkPath(dir),fs4.mkdir(dir,{mode:getMode(options),recursive:!0}));module.exports.makeDirSync=(dir,options)=>(checkPath(dir),fs4.mkdirSync(dir,{mode:getMode(options),recursive:!0}))}});var require_mkdirs=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,{makeDir:_makeDir,makeDirSync}=require_make_dir(),makeDir=u(_makeDir);module.exports={mkdirs:makeDir,mkdirsSync:makeDirSync,mkdirp:makeDir,mkdirpSync:makeDirSync,ensureDir:makeDir,ensureDirSync:makeDirSync}}});var require_utimes=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/utimes.js"(exports,module){"use strict";var fs4=require_graceful_fs();function utimesMillis(path2,atime,mtime,callback){fs4.open(path2,"r+",(err,fd)=>{if(err)return callback(err);fs4.futimes(fd,atime,mtime,futimesErr=>{fs4.close(fd,closeErr=>{callback&&callback(futimesErr||closeErr)})})})}function utimesMillisSync(path2,atime,mtime){let fd=fs4.openSync(path2,"r+");return fs4.futimesSync(fd,atime,mtime),fs4.closeSync(fd)}module.exports={utimesMillis,utimesMillisSync}}});var require_stat=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/stat.js"(exports,module){"use strict";var fs4=require_fs(),path2=__require("path"),util=__require("util");function getStats(src,dest,opts){let statFunc=opts.dereference?file=>fs4.stat(file,{bigint:!0}):file=>fs4.lstat(file,{bigint:!0});return Promise.all([statFunc(src),statFunc(dest).catch(err=>{if(err.code==="ENOENT")return null;throw err})]).then(([srcStat,destStat])=>({srcStat,destStat}))}function getStatsSync(src,dest,opts){let destStat,statFunc=opts.dereference?file=>fs4.statSync(file,{bigint:!0}):file=>fs4.lstatSync(file,{bigint:!0}),srcStat=statFunc(src);try{destStat=statFunc(dest)}catch(err){if(err.code==="ENOENT")return{srcStat,destStat:null};throw err}return{srcStat,destStat}}function checkPaths(src,dest,funcName,opts,cb){util.callbackify(getStats)(src,dest,opts,(err,stats)=>{if(err)return cb(err);let{srcStat,destStat}=stats;if(destStat){if(areIdentical(srcStat,destStat)){let srcBaseName=path2.basename(src),destBaseName=path2.basename(dest);return funcName==="move"&&srcBaseName!==destBaseName&&srcBaseName.toLowerCase()===destBaseName.toLowerCase()?cb(null,{srcStat,destStat,isChangingCase:!0}):cb(new Error("Source and destination must not be the same."))}if(srcStat.isDirectory()&&!destStat.isDirectory())return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));if(!srcStat.isDirectory()&&destStat.isDirectory())return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))}return srcStat.isDirectory()&&isSrcSubdir(src,dest)?cb(new Error(errMsg(src,dest,funcName))):cb(null,{srcStat,destStat})})}function checkPathsSync(src,dest,funcName,opts){let{srcStat,destStat}=getStatsSync(src,dest,opts);if(destStat){if(areIdentical(srcStat,destStat)){let srcBaseName=path2.basename(src),destBaseName=path2.basename(dest);if(funcName==="move"&&srcBaseName!==destBaseName&&srcBaseName.toLowerCase()===destBaseName.toLowerCase())return{srcStat,destStat,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(srcStat.isDirectory()&&!destStat.isDirectory())throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);if(!srcStat.isDirectory()&&destStat.isDirectory())throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)}if(srcStat.isDirectory()&&isSrcSubdir(src,dest))throw new Error(errMsg(src,dest,funcName));return{srcStat,destStat}}function checkParentPaths(src,srcStat,dest,funcName,cb){let srcParent=path2.resolve(path2.dirname(src)),destParent=path2.resolve(path2.dirname(dest));if(destParent===srcParent||destParent===path2.parse(destParent).root)return cb();fs4.stat(destParent,{bigint:!0},(err,destStat)=>err?err.code==="ENOENT"?cb():cb(err):areIdentical(srcStat,destStat)?cb(new Error(errMsg(src,dest,funcName))):checkParentPaths(src,srcStat,destParent,funcName,cb))}function checkParentPathsSync(src,srcStat,dest,funcName){let srcParent=path2.resolve(path2.dirname(src)),destParent=path2.resolve(path2.dirname(dest));if(destParent===srcParent||destParent===path2.parse(destParent).root)return;let destStat;try{destStat=fs4.statSync(destParent,{bigint:!0})}catch(err){if(err.code==="ENOENT")return;throw err}if(areIdentical(srcStat,destStat))throw new Error(errMsg(src,dest,funcName));return checkParentPathsSync(src,srcStat,destParent,funcName)}function areIdentical(srcStat,destStat){return destStat.ino&&destStat.dev&&destStat.ino===srcStat.ino&&destStat.dev===srcStat.dev}function isSrcSubdir(src,dest){let srcArr=path2.resolve(src).split(path2.sep).filter(i=>i),destArr=path2.resolve(dest).split(path2.sep).filter(i=>i);return srcArr.reduce((acc,cur,i)=>acc&&destArr[i]===cur,!0)}function errMsg(src,dest,funcName){return`Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`}module.exports={checkPaths,checkPathsSync,checkParentPaths,checkParentPathsSync,isSrcSubdir,areIdentical}}});var require_copy_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),mkdirsSync=require_mkdirs().mkdirsSync,utimesMillisSync=require_utimes().utimesMillisSync,stat2=require_stat();function copySync(src,dest,opts){typeof opts=="function"&&(opts={filter:opts}),opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
8
|
+
|
|
9
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat,destStat}=stat2.checkPathsSync(src,dest,"copy",opts);return stat2.checkParentPathsSync(src,srcStat,dest,"copy"),handleFilterAndCopy(destStat,src,dest,opts)}function handleFilterAndCopy(destStat,src,dest,opts){if(opts.filter&&!opts.filter(src,dest))return;let destParent=path2.dirname(dest);return fs4.existsSync(destParent)||mkdirsSync(destParent),getStats(destStat,src,dest,opts)}function startCopy(destStat,src,dest,opts){if(!(opts.filter&&!opts.filter(src,dest)))return getStats(destStat,src,dest,opts)}function getStats(destStat,src,dest,opts){let srcStat=(opts.dereference?fs4.statSync:fs4.lstatSync)(src);if(srcStat.isDirectory())return onDir(srcStat,destStat,src,dest,opts);if(srcStat.isFile()||srcStat.isCharacterDevice()||srcStat.isBlockDevice())return onFile(srcStat,destStat,src,dest,opts);if(srcStat.isSymbolicLink())return onLink(destStat,src,dest,opts);throw srcStat.isSocket()?new Error(`Cannot copy a socket file: ${src}`):srcStat.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${src}`):new Error(`Unknown file: ${src}`)}function onFile(srcStat,destStat,src,dest,opts){return destStat?mayCopyFile(srcStat,src,dest,opts):copyFile(srcStat,src,dest,opts)}function mayCopyFile(srcStat,src,dest,opts){if(opts.overwrite)return fs4.unlinkSync(dest),copyFile(srcStat,src,dest,opts);if(opts.errorOnExist)throw new Error(`'${dest}' already exists`)}function copyFile(srcStat,src,dest,opts){return fs4.copyFileSync(src,dest),opts.preserveTimestamps&&handleTimestamps(srcStat.mode,src,dest),setDestMode(dest,srcStat.mode)}function handleTimestamps(srcMode,src,dest){return fileIsNotWritable(srcMode)&&makeFileWritable(dest,srcMode),setDestTimestamps(src,dest)}function fileIsNotWritable(srcMode){return(srcMode&128)===0}function makeFileWritable(dest,srcMode){return setDestMode(dest,srcMode|128)}function setDestMode(dest,srcMode){return fs4.chmodSync(dest,srcMode)}function setDestTimestamps(src,dest){let updatedSrcStat=fs4.statSync(src);return utimesMillisSync(dest,updatedSrcStat.atime,updatedSrcStat.mtime)}function onDir(srcStat,destStat,src,dest,opts){return destStat?copyDir(src,dest,opts):mkDirAndCopy(srcStat.mode,src,dest,opts)}function mkDirAndCopy(srcMode,src,dest,opts){return fs4.mkdirSync(dest),copyDir(src,dest,opts),setDestMode(dest,srcMode)}function copyDir(src,dest,opts){fs4.readdirSync(src).forEach(item=>copyDirItem(item,src,dest,opts))}function copyDirItem(item,src,dest,opts){let srcItem=path2.join(src,item),destItem=path2.join(dest,item),{destStat}=stat2.checkPathsSync(srcItem,destItem,"copy",opts);return startCopy(destStat,srcItem,destItem,opts)}function onLink(destStat,src,dest,opts){let resolvedSrc=fs4.readlinkSync(src);if(opts.dereference&&(resolvedSrc=path2.resolve(process.cwd(),resolvedSrc)),destStat){let resolvedDest;try{resolvedDest=fs4.readlinkSync(dest)}catch(err){if(err.code==="EINVAL"||err.code==="UNKNOWN")return fs4.symlinkSync(resolvedSrc,dest);throw err}if(opts.dereference&&(resolvedDest=path2.resolve(process.cwd(),resolvedDest)),stat2.isSrcSubdir(resolvedSrc,resolvedDest))throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);if(fs4.statSync(dest).isDirectory()&&stat2.isSrcSubdir(resolvedDest,resolvedSrc))throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);return copyLink(resolvedSrc,dest)}else return fs4.symlinkSync(resolvedSrc,dest)}function copyLink(resolvedSrc,dest){return fs4.unlinkSync(dest),fs4.symlinkSync(resolvedSrc,dest)}module.exports=copySync}});var require_copy_sync2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy-sync/index.js"(exports,module){"use strict";module.exports={copySync:require_copy_sync()}}});var require_path_exists=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/path-exists/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,fs4=require_fs();function pathExists2(path2){return fs4.access(path2).then(()=>!0).catch(()=>!1)}module.exports={pathExists:u(pathExists2),pathExistsSync:fs4.existsSync}}});var require_copy=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy/copy.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),mkdirs=require_mkdirs().mkdirs,pathExists2=require_path_exists().pathExists,utimesMillis=require_utimes().utimesMillis,stat2=require_stat();function copy(src,dest,opts,cb){typeof opts=="function"&&!cb?(cb=opts,opts={}):typeof opts=="function"&&(opts={filter:opts}),cb=cb||function(){},opts=opts||{},opts.clobber="clobber"in opts?!!opts.clobber:!0,opts.overwrite="overwrite"in opts?!!opts.overwrite:opts.clobber,opts.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
10
|
+
|
|
11
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`),stat2.checkPaths(src,dest,"copy",opts,(err,stats)=>{if(err)return cb(err);let{srcStat,destStat}=stats;stat2.checkParentPaths(src,srcStat,dest,"copy",err2=>err2?cb(err2):opts.filter?handleFilter(checkParentDir,destStat,src,dest,opts,cb):checkParentDir(destStat,src,dest,opts,cb))})}function checkParentDir(destStat,src,dest,opts,cb){let destParent=path2.dirname(dest);pathExists2(destParent,(err,dirExists)=>{if(err)return cb(err);if(dirExists)return getStats(destStat,src,dest,opts,cb);mkdirs(destParent,err2=>err2?cb(err2):getStats(destStat,src,dest,opts,cb))})}function handleFilter(onInclude,destStat,src,dest,opts,cb){Promise.resolve(opts.filter(src,dest)).then(include=>include?onInclude(destStat,src,dest,opts,cb):cb(),error=>cb(error))}function startCopy(destStat,src,dest,opts,cb){return opts.filter?handleFilter(getStats,destStat,src,dest,opts,cb):getStats(destStat,src,dest,opts,cb)}function getStats(destStat,src,dest,opts,cb){(opts.dereference?fs4.stat:fs4.lstat)(src,(err,srcStat)=>err?cb(err):srcStat.isDirectory()?onDir(srcStat,destStat,src,dest,opts,cb):srcStat.isFile()||srcStat.isCharacterDevice()||srcStat.isBlockDevice()?onFile(srcStat,destStat,src,dest,opts,cb):srcStat.isSymbolicLink()?onLink(destStat,src,dest,opts,cb):srcStat.isSocket()?cb(new Error(`Cannot copy a socket file: ${src}`)):srcStat.isFIFO()?cb(new Error(`Cannot copy a FIFO pipe: ${src}`)):cb(new Error(`Unknown file: ${src}`)))}function onFile(srcStat,destStat,src,dest,opts,cb){return destStat?mayCopyFile(srcStat,src,dest,opts,cb):copyFile(srcStat,src,dest,opts,cb)}function mayCopyFile(srcStat,src,dest,opts,cb){if(opts.overwrite)fs4.unlink(dest,err=>err?cb(err):copyFile(srcStat,src,dest,opts,cb));else return opts.errorOnExist?cb(new Error(`'${dest}' already exists`)):cb()}function copyFile(srcStat,src,dest,opts,cb){fs4.copyFile(src,dest,err=>err?cb(err):opts.preserveTimestamps?handleTimestampsAndMode(srcStat.mode,src,dest,cb):setDestMode(dest,srcStat.mode,cb))}function handleTimestampsAndMode(srcMode,src,dest,cb){return fileIsNotWritable(srcMode)?makeFileWritable(dest,srcMode,err=>err?cb(err):setDestTimestampsAndMode(srcMode,src,dest,cb)):setDestTimestampsAndMode(srcMode,src,dest,cb)}function fileIsNotWritable(srcMode){return(srcMode&128)===0}function makeFileWritable(dest,srcMode,cb){return setDestMode(dest,srcMode|128,cb)}function setDestTimestampsAndMode(srcMode,src,dest,cb){setDestTimestamps(src,dest,err=>err?cb(err):setDestMode(dest,srcMode,cb))}function setDestMode(dest,srcMode,cb){return fs4.chmod(dest,srcMode,cb)}function setDestTimestamps(src,dest,cb){fs4.stat(src,(err,updatedSrcStat)=>err?cb(err):utimesMillis(dest,updatedSrcStat.atime,updatedSrcStat.mtime,cb))}function onDir(srcStat,destStat,src,dest,opts,cb){return destStat?copyDir(src,dest,opts,cb):mkDirAndCopy(srcStat.mode,src,dest,opts,cb)}function mkDirAndCopy(srcMode,src,dest,opts,cb){fs4.mkdir(dest,err=>{if(err)return cb(err);copyDir(src,dest,opts,err2=>err2?cb(err2):setDestMode(dest,srcMode,cb))})}function copyDir(src,dest,opts,cb){fs4.readdir(src,(err,items)=>err?cb(err):copyDirItems(items,src,dest,opts,cb))}function copyDirItems(items,src,dest,opts,cb){let item=items.pop();return item?copyDirItem(items,item,src,dest,opts,cb):cb()}function copyDirItem(items,item,src,dest,opts,cb){let srcItem=path2.join(src,item),destItem=path2.join(dest,item);stat2.checkPaths(srcItem,destItem,"copy",opts,(err,stats)=>{if(err)return cb(err);let{destStat}=stats;startCopy(destStat,srcItem,destItem,opts,err2=>err2?cb(err2):copyDirItems(items,src,dest,opts,cb))})}function onLink(destStat,src,dest,opts,cb){fs4.readlink(src,(err,resolvedSrc)=>{if(err)return cb(err);if(opts.dereference&&(resolvedSrc=path2.resolve(process.cwd(),resolvedSrc)),destStat)fs4.readlink(dest,(err2,resolvedDest)=>err2?err2.code==="EINVAL"||err2.code==="UNKNOWN"?fs4.symlink(resolvedSrc,dest,cb):cb(err2):(opts.dereference&&(resolvedDest=path2.resolve(process.cwd(),resolvedDest)),stat2.isSrcSubdir(resolvedSrc,resolvedDest)?cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)):destStat.isDirectory()&&stat2.isSrcSubdir(resolvedDest,resolvedSrc)?cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)):copyLink(resolvedSrc,dest,cb)));else return fs4.symlink(resolvedSrc,dest,cb)})}function copyLink(resolvedSrc,dest,cb){fs4.unlink(dest,err=>err?cb(err):fs4.symlink(resolvedSrc,dest,cb))}module.exports=copy}});var require_copy2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback;module.exports={copy:u(require_copy())}}});var require_rimraf=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/remove/rimraf.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),assert=__require("assert"),isWindows=process.platform==="win32";function defaults(options){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(m=>{options[m]=options[m]||fs4[m],m=m+"Sync",options[m]=options[m]||fs4[m]}),options.maxBusyTries=options.maxBusyTries||3}function rimraf(p,options,cb){let busyTries=0;typeof options=="function"&&(cb=options,options={}),assert(p,"rimraf: missing path"),assert.strictEqual(typeof p,"string","rimraf: path should be a string"),assert.strictEqual(typeof cb,"function","rimraf: callback function required"),assert(options,"rimraf: invalid options argument provided"),assert.strictEqual(typeof options,"object","rimraf: options should be object"),defaults(options),rimraf_(p,options,function CB(er){if(er){if((er.code==="EBUSY"||er.code==="ENOTEMPTY"||er.code==="EPERM")&&busyTries<options.maxBusyTries){busyTries++;let time=busyTries*100;return setTimeout(()=>rimraf_(p,options,CB),time)}er.code==="ENOENT"&&(er=null)}cb(er)})}function rimraf_(p,options,cb){assert(p),assert(options),assert(typeof cb=="function"),options.lstat(p,(er,st)=>{if(er&&er.code==="ENOENT")return cb(null);if(er&&er.code==="EPERM"&&isWindows)return fixWinEPERM(p,options,er,cb);if(st&&st.isDirectory())return rmdir(p,options,er,cb);options.unlink(p,er2=>{if(er2){if(er2.code==="ENOENT")return cb(null);if(er2.code==="EPERM")return isWindows?fixWinEPERM(p,options,er2,cb):rmdir(p,options,er2,cb);if(er2.code==="EISDIR")return rmdir(p,options,er2,cb)}return cb(er2)})})}function fixWinEPERM(p,options,er,cb){assert(p),assert(options),assert(typeof cb=="function"),options.chmod(p,438,er2=>{er2?cb(er2.code==="ENOENT"?null:er):options.stat(p,(er3,stats)=>{er3?cb(er3.code==="ENOENT"?null:er):stats.isDirectory()?rmdir(p,options,er,cb):options.unlink(p,cb)})})}function fixWinEPERMSync(p,options,er){let stats;assert(p),assert(options);try{options.chmodSync(p,438)}catch(er2){if(er2.code==="ENOENT")return;throw er}try{stats=options.statSync(p)}catch(er3){if(er3.code==="ENOENT")return;throw er}stats.isDirectory()?rmdirSync(p,options,er):options.unlinkSync(p)}function rmdir(p,options,originalEr,cb){assert(p),assert(options),assert(typeof cb=="function"),options.rmdir(p,er=>{er&&(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")?rmkids(p,options,cb):er&&er.code==="ENOTDIR"?cb(originalEr):cb(er)})}function rmkids(p,options,cb){assert(p),assert(options),assert(typeof cb=="function"),options.readdir(p,(er,files)=>{if(er)return cb(er);let n=files.length,errState;if(n===0)return options.rmdir(p,cb);files.forEach(f=>{rimraf(path2.join(p,f),options,er2=>{if(!errState){if(er2)return cb(errState=er2);--n===0&&options.rmdir(p,cb)}})})})}function rimrafSync(p,options){let st;options=options||{},defaults(options),assert(p,"rimraf: missing path"),assert.strictEqual(typeof p,"string","rimraf: path should be a string"),assert(options,"rimraf: missing options"),assert.strictEqual(typeof options,"object","rimraf: options should be object");try{st=options.lstatSync(p)}catch(er){if(er.code==="ENOENT")return;er.code==="EPERM"&&isWindows&&fixWinEPERMSync(p,options,er)}try{st&&st.isDirectory()?rmdirSync(p,options,null):options.unlinkSync(p)}catch(er){if(er.code==="ENOENT")return;if(er.code==="EPERM")return isWindows?fixWinEPERMSync(p,options,er):rmdirSync(p,options,er);if(er.code!=="EISDIR")throw er;rmdirSync(p,options,er)}}function rmdirSync(p,options,originalEr){assert(p),assert(options);try{options.rmdirSync(p)}catch(er){if(er.code==="ENOTDIR")throw originalEr;if(er.code==="ENOTEMPTY"||er.code==="EEXIST"||er.code==="EPERM")rmkidsSync(p,options);else if(er.code!=="ENOENT")throw er}}function rmkidsSync(p,options){if(assert(p),assert(options),options.readdirSync(p).forEach(f=>rimrafSync(path2.join(p,f),options)),isWindows){let startTime=Date.now();do try{return options.rmdirSync(p,options)}catch{}while(Date.now()-startTime<500)}else return options.rmdirSync(p,options)}module.exports=rimraf;rimraf.sync=rimrafSync}});var require_remove=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/remove/index.js"(exports,module){"use strict";var fs4=require_graceful_fs(),u=require_universalify().fromCallback,rimraf=require_rimraf();function remove(path2,callback){if(fs4.rm)return fs4.rm(path2,{recursive:!0,force:!0},callback);rimraf(path2,callback)}function removeSync(path2){if(fs4.rmSync)return fs4.rmSync(path2,{recursive:!0,force:!0});rimraf.sync(path2)}module.exports={remove:u(remove),removeSync}}});var require_empty=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/empty/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,fs4=require_fs(),path2=__require("path"),mkdir=require_mkdirs(),remove=require_remove(),emptyDir=u(async function(dir){let items;try{items=await fs4.readdir(dir)}catch{return mkdir.mkdirs(dir)}return Promise.all(items.map(item=>remove.remove(path2.join(dir,item))))});function emptyDirSync(dir){let items;try{items=fs4.readdirSync(dir)}catch{return mkdir.mkdirsSync(dir)}items.forEach(item=>{item=path2.join(dir,item),remove.removeSync(item)})}module.exports={emptyDirSync,emptydirSync:emptyDirSync,emptyDir,emptydir:emptyDir}}});var require_file=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/file.js"(exports,module){"use strict";var u=require_universalify().fromCallback,path2=__require("path"),fs4=require_graceful_fs(),mkdir=require_mkdirs();function createFile(file,callback){function makeFile(){fs4.writeFile(file,"",err=>{if(err)return callback(err);callback()})}fs4.stat(file,(err,stats)=>{if(!err&&stats.isFile())return callback();let dir=path2.dirname(file);fs4.stat(dir,(err2,stats2)=>{if(err2)return err2.code==="ENOENT"?mkdir.mkdirs(dir,err3=>{if(err3)return callback(err3);makeFile()}):callback(err2);stats2.isDirectory()?makeFile():fs4.readdir(dir,err3=>{if(err3)return callback(err3)})})})}function createFileSync(file){let stats;try{stats=fs4.statSync(file)}catch{}if(stats&&stats.isFile())return;let dir=path2.dirname(file);try{fs4.statSync(dir).isDirectory()||fs4.readdirSync(dir)}catch(err){if(err&&err.code==="ENOENT")mkdir.mkdirsSync(dir);else throw err}fs4.writeFileSync(file,"")}module.exports={createFile:u(createFile),createFileSync}}});var require_link=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/link.js"(exports,module){"use strict";var u=require_universalify().fromCallback,path2=__require("path"),fs4=require_graceful_fs(),mkdir=require_mkdirs(),pathExists2=require_path_exists().pathExists,{areIdentical}=require_stat();function createLink(srcpath,dstpath,callback){function makeLink(srcpath2,dstpath2){fs4.link(srcpath2,dstpath2,err=>{if(err)return callback(err);callback(null)})}fs4.lstat(dstpath,(_,dstStat)=>{fs4.lstat(srcpath,(err,srcStat)=>{if(err)return err.message=err.message.replace("lstat","ensureLink"),callback(err);if(dstStat&&areIdentical(srcStat,dstStat))return callback(null);let dir=path2.dirname(dstpath);pathExists2(dir,(err2,dirExists)=>{if(err2)return callback(err2);if(dirExists)return makeLink(srcpath,dstpath);mkdir.mkdirs(dir,err3=>{if(err3)return callback(err3);makeLink(srcpath,dstpath)})})})})}function createLinkSync(srcpath,dstpath){let dstStat;try{dstStat=fs4.lstatSync(dstpath)}catch{}try{let srcStat=fs4.lstatSync(srcpath);if(dstStat&&areIdentical(srcStat,dstStat))return}catch(err){throw err.message=err.message.replace("lstat","ensureLink"),err}let dir=path2.dirname(dstpath);return fs4.existsSync(dir)||mkdir.mkdirsSync(dir),fs4.linkSync(srcpath,dstpath)}module.exports={createLink:u(createLink),createLinkSync}}});var require_symlink_paths=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports,module){"use strict";var path2=__require("path"),fs4=require_graceful_fs(),pathExists2=require_path_exists().pathExists;function symlinkPaths(srcpath,dstpath,callback){if(path2.isAbsolute(srcpath))return fs4.lstat(srcpath,err=>err?(err.message=err.message.replace("lstat","ensureSymlink"),callback(err)):callback(null,{toCwd:srcpath,toDst:srcpath}));{let dstdir=path2.dirname(dstpath),relativeToDst=path2.join(dstdir,srcpath);return pathExists2(relativeToDst,(err,exists)=>err?callback(err):exists?callback(null,{toCwd:relativeToDst,toDst:srcpath}):fs4.lstat(srcpath,err2=>err2?(err2.message=err2.message.replace("lstat","ensureSymlink"),callback(err2)):callback(null,{toCwd:srcpath,toDst:path2.relative(dstdir,srcpath)})))}}function symlinkPathsSync(srcpath,dstpath){let exists;if(path2.isAbsolute(srcpath)){if(exists=fs4.existsSync(srcpath),!exists)throw new Error("absolute srcpath does not exist");return{toCwd:srcpath,toDst:srcpath}}else{let dstdir=path2.dirname(dstpath),relativeToDst=path2.join(dstdir,srcpath);if(exists=fs4.existsSync(relativeToDst),exists)return{toCwd:relativeToDst,toDst:srcpath};if(exists=fs4.existsSync(srcpath),!exists)throw new Error("relative srcpath does not exist");return{toCwd:srcpath,toDst:path2.relative(dstdir,srcpath)}}}module.exports={symlinkPaths,symlinkPathsSync}}});var require_symlink_type=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports,module){"use strict";var fs4=require_graceful_fs();function symlinkType(srcpath,type,callback){if(callback=typeof type=="function"?type:callback,type=typeof type=="function"?!1:type,type)return callback(null,type);fs4.lstat(srcpath,(err,stats)=>{if(err)return callback(null,"file");type=stats&&stats.isDirectory()?"dir":"file",callback(null,type)})}function symlinkTypeSync(srcpath,type){let stats;if(type)return type;try{stats=fs4.lstatSync(srcpath)}catch{return"file"}return stats&&stats.isDirectory()?"dir":"file"}module.exports={symlinkType,symlinkTypeSync}}});var require_symlink=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports,module){"use strict";var u=require_universalify().fromCallback,path2=__require("path"),fs4=require_fs(),_mkdirs=require_mkdirs(),mkdirs=_mkdirs.mkdirs,mkdirsSync=_mkdirs.mkdirsSync,_symlinkPaths=require_symlink_paths(),symlinkPaths=_symlinkPaths.symlinkPaths,symlinkPathsSync=_symlinkPaths.symlinkPathsSync,_symlinkType=require_symlink_type(),symlinkType=_symlinkType.symlinkType,symlinkTypeSync=_symlinkType.symlinkTypeSync,pathExists2=require_path_exists().pathExists,{areIdentical}=require_stat();function createSymlink(srcpath,dstpath,type,callback){callback=typeof type=="function"?type:callback,type=typeof type=="function"?!1:type,fs4.lstat(dstpath,(err,stats)=>{!err&&stats.isSymbolicLink()?Promise.all([fs4.stat(srcpath),fs4.stat(dstpath)]).then(([srcStat,dstStat])=>{if(areIdentical(srcStat,dstStat))return callback(null);_createSymlink(srcpath,dstpath,type,callback)}):_createSymlink(srcpath,dstpath,type,callback)})}function _createSymlink(srcpath,dstpath,type,callback){symlinkPaths(srcpath,dstpath,(err,relative3)=>{if(err)return callback(err);srcpath=relative3.toDst,symlinkType(relative3.toCwd,type,(err2,type2)=>{if(err2)return callback(err2);let dir=path2.dirname(dstpath);pathExists2(dir,(err3,dirExists)=>{if(err3)return callback(err3);if(dirExists)return fs4.symlink(srcpath,dstpath,type2,callback);mkdirs(dir,err4=>{if(err4)return callback(err4);fs4.symlink(srcpath,dstpath,type2,callback)})})})})}function createSymlinkSync(srcpath,dstpath,type){let stats;try{stats=fs4.lstatSync(dstpath)}catch{}if(stats&&stats.isSymbolicLink()){let srcStat=fs4.statSync(srcpath),dstStat=fs4.statSync(dstpath);if(areIdentical(srcStat,dstStat))return}let relative3=symlinkPathsSync(srcpath,dstpath);srcpath=relative3.toDst,type=symlinkTypeSync(relative3.toCwd,type);let dir=path2.dirname(dstpath);return fs4.existsSync(dir)||mkdirsSync(dir),fs4.symlinkSync(srcpath,dstpath,type)}module.exports={createSymlink:u(createSymlink),createSymlinkSync}}});var require_ensure=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/index.js"(exports,module){"use strict";var file=require_file(),link=require_link(),symlink=require_symlink();module.exports={createFile:file.createFile,createFileSync:file.createFileSync,ensureFile:file.createFile,ensureFileSync:file.createFileSync,createLink:link.createLink,createLinkSync:link.createLinkSync,ensureLink:link.createLink,ensureLinkSync:link.createLinkSync,createSymlink:symlink.createSymlink,createSymlinkSync:symlink.createSymlinkSync,ensureSymlink:symlink.createSymlink,ensureSymlinkSync:symlink.createSymlinkSync}}});var require_utils2=__commonJS({"../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/utils.js"(exports,module){function stringify(obj,{EOL=`
|
|
12
|
+
`,finalEOL=!0,replacer=null,spaces}={}){let EOF=finalEOL?EOL:"",str=JSON.stringify(obj,replacer,spaces);if(str===void 0)throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`);return str.replace(/\n/g,EOL)+EOF}function stripBom(content){return Buffer.isBuffer(content)&&(content=content.toString("utf8")),content.replace(/^\uFEFF/,"")}module.exports={stringify,stripBom}}});var require_jsonfile=__commonJS({"../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/index.js"(exports,module){var _fs;try{_fs=require_graceful_fs()}catch{_fs=__require("fs")}var universalify=require_universalify(),{stringify,stripBom}=require_utils2();async function _readFile(file,options={}){typeof options=="string"&&(options={encoding:options});let fs4=options.fs||_fs,shouldThrow="throws"in options?options.throws:!0,data=await universalify.fromCallback(fs4.readFile)(file,options);data=stripBom(data);let obj;try{obj=JSON.parse(data,options?options.reviver:null)}catch(err){if(shouldThrow)throw err.message=`${file}: ${err.message}`,err;return null}return obj}var readFile3=universalify.fromPromise(_readFile);function readFileSync(file,options={}){typeof options=="string"&&(options={encoding:options});let fs4=options.fs||_fs,shouldThrow="throws"in options?options.throws:!0;try{let content=fs4.readFileSync(file,options);return content=stripBom(content),JSON.parse(content,options.reviver)}catch(err){if(shouldThrow)throw err.message=`${file}: ${err.message}`,err;return null}}async function _writeFile(file,obj,options={}){let fs4=options.fs||_fs,str=stringify(obj,options);await universalify.fromCallback(fs4.writeFile)(file,str,options)}var writeFile3=universalify.fromPromise(_writeFile);function writeFileSync(file,obj,options={}){let fs4=options.fs||_fs,str=stringify(obj,options);return fs4.writeFileSync(file,str,options)}module.exports={readFile:readFile3,readFileSync,writeFile:writeFile3,writeFileSync}}});var require_jsonfile2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports,module){"use strict";var jsonFile=require_jsonfile();module.exports={readJson:jsonFile.readFile,readJsonSync:jsonFile.readFileSync,writeJson:jsonFile.writeFile,writeJsonSync:jsonFile.writeFileSync}}});var require_output=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/output/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback,fs4=require_graceful_fs(),path2=__require("path"),mkdir=require_mkdirs(),pathExists2=require_path_exists().pathExists;function outputFile(file,data,encoding,callback){typeof encoding=="function"&&(callback=encoding,encoding="utf8");let dir=path2.dirname(file);pathExists2(dir,(err,itDoes)=>{if(err)return callback(err);if(itDoes)return fs4.writeFile(file,data,encoding,callback);mkdir.mkdirs(dir,err2=>{if(err2)return callback(err2);fs4.writeFile(file,data,encoding,callback)})})}function outputFileSync(file,...args){let dir=path2.dirname(file);if(fs4.existsSync(dir))return fs4.writeFileSync(file,...args);mkdir.mkdirsSync(dir),fs4.writeFileSync(file,...args)}module.exports={outputFile:u(outputFile),outputFileSync}}});var require_output_json=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/json/output-json.js"(exports,module){"use strict";var{stringify}=require_utils2(),{outputFile}=require_output();async function outputJson(file,data,options={}){let str=stringify(data,options);await outputFile(file,str,options)}module.exports=outputJson}});var require_output_json_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports,module){"use strict";var{stringify}=require_utils2(),{outputFileSync}=require_output();function outputJsonSync(file,data,options){let str=stringify(data,options);outputFileSync(file,str,options)}module.exports=outputJsonSync}});var require_json=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/json/index.js"(exports,module){"use strict";var u=require_universalify().fromPromise,jsonFile=require_jsonfile2();jsonFile.outputJson=u(require_output_json());jsonFile.outputJsonSync=require_output_json_sync();jsonFile.outputJSON=jsonFile.outputJson;jsonFile.outputJSONSync=jsonFile.outputJsonSync;jsonFile.writeJSON=jsonFile.writeJson;jsonFile.writeJSONSync=jsonFile.writeJsonSync;jsonFile.readJSON=jsonFile.readJson;jsonFile.readJSONSync=jsonFile.readJsonSync;module.exports=jsonFile}});var require_move_sync=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/move-sync/move-sync.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),copySync=require_copy_sync2().copySync,removeSync=require_remove().removeSync,mkdirpSync=require_mkdirs().mkdirpSync,stat2=require_stat();function moveSync(src,dest,opts){opts=opts||{};let overwrite=opts.overwrite||opts.clobber||!1,{srcStat,isChangingCase=!1}=stat2.checkPathsSync(src,dest,"move",opts);return stat2.checkParentPathsSync(src,srcStat,dest,"move"),isParentRoot(dest)||mkdirpSync(path2.dirname(dest)),doRename(src,dest,overwrite,isChangingCase)}function isParentRoot(dest){let parent=path2.dirname(dest);return path2.parse(parent).root===parent}function doRename(src,dest,overwrite,isChangingCase){if(isChangingCase)return rename(src,dest,overwrite);if(overwrite)return removeSync(dest),rename(src,dest,overwrite);if(fs4.existsSync(dest))throw new Error("dest already exists.");return rename(src,dest,overwrite)}function rename(src,dest,overwrite){try{fs4.renameSync(src,dest)}catch(err){if(err.code!=="EXDEV")throw err;return moveAcrossDevice(src,dest,overwrite)}}function moveAcrossDevice(src,dest,overwrite){return copySync(src,dest,{overwrite,errorOnExist:!0}),removeSync(src)}module.exports=moveSync}});var require_move_sync2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/move-sync/index.js"(exports,module){"use strict";module.exports={moveSync:require_move_sync()}}});var require_move=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/move/move.js"(exports,module){"use strict";var fs4=require_graceful_fs(),path2=__require("path"),copy=require_copy2().copy,remove=require_remove().remove,mkdirp=require_mkdirs().mkdirp,pathExists2=require_path_exists().pathExists,stat2=require_stat();function move(src,dest,opts,cb){typeof opts=="function"&&(cb=opts,opts={});let overwrite=opts.overwrite||opts.clobber||!1;stat2.checkPaths(src,dest,"move",opts,(err,stats)=>{if(err)return cb(err);let{srcStat,isChangingCase=!1}=stats;stat2.checkParentPaths(src,srcStat,dest,"move",err2=>{if(err2)return cb(err2);if(isParentRoot(dest))return doRename(src,dest,overwrite,isChangingCase,cb);mkdirp(path2.dirname(dest),err3=>err3?cb(err3):doRename(src,dest,overwrite,isChangingCase,cb))})})}function isParentRoot(dest){let parent=path2.dirname(dest);return path2.parse(parent).root===parent}function doRename(src,dest,overwrite,isChangingCase,cb){if(isChangingCase)return rename(src,dest,overwrite,cb);if(overwrite)return remove(dest,err=>err?cb(err):rename(src,dest,overwrite,cb));pathExists2(dest,(err,destExists)=>err?cb(err):destExists?cb(new Error("dest already exists.")):rename(src,dest,overwrite,cb))}function rename(src,dest,overwrite,cb){fs4.rename(src,dest,err=>err?err.code!=="EXDEV"?cb(err):moveAcrossDevice(src,dest,overwrite,cb):cb())}function moveAcrossDevice(src,dest,overwrite,cb){copy(src,dest,{overwrite,errorOnExist:!0},err=>err?cb(err):remove(src,cb))}module.exports=move}});var require_move2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/move/index.js"(exports,module){"use strict";var u=require_universalify().fromCallback;module.exports={move:u(require_move())}}});var require_lib2=__commonJS({"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/index.js"(exports,module){"use strict";module.exports={...require_fs(),...require_copy_sync2(),...require_copy2(),...require_empty(),...require_ensure(),...require_json(),...require_mkdirs(),...require_move_sync2(),...require_move2(),...require_output(),...require_path_exists(),...require_remove()}}});var require_pluralize=__commonJS({"../../node_modules/.pnpm/pluralize@7.0.0/node_modules/pluralize/pluralize.js"(exports,module){(function(root,pluralize2){typeof __require=="function"&&typeof exports=="object"&&typeof module=="object"?module.exports=pluralize2():typeof define=="function"&&define.amd?define(function(){return pluralize2()}):root.pluralize=pluralize2()})(exports,function(){var pluralRules=[],singularRules=[],uncountables={},irregularPlurals={},irregularSingles={};function sanitizeRule(rule){return typeof rule=="string"?new RegExp("^"+rule+"$","i"):rule}function restoreCase(word,token){return word===token?token:word===word.toUpperCase()?token.toUpperCase():word[0]===word[0].toUpperCase()?token.charAt(0).toUpperCase()+token.substr(1).toLowerCase():token.toLowerCase()}function interpolate(str,args){return str.replace(/\$(\d{1,2})/g,function(match,index){return args[index]||""})}function replace(word,rule){return word.replace(rule[0],function(match,index){var result=interpolate(rule[1],arguments);return restoreCase(match===""?word[index-1]:match,result)})}function sanitizeWord(token,word,rules){if(!token.length||uncountables.hasOwnProperty(token))return word;for(var len=rules.length;len--;){var rule=rules[len];if(rule[0].test(word))return replace(word,rule)}return word}function replaceWord(replaceMap,keepMap,rules){return function(word){var token=word.toLowerCase();return keepMap.hasOwnProperty(token)?restoreCase(word,token):replaceMap.hasOwnProperty(token)?restoreCase(word,replaceMap[token]):sanitizeWord(token,word,rules)}}function checkWord(replaceMap,keepMap,rules,bool){return function(word){var token=word.toLowerCase();return keepMap.hasOwnProperty(token)?!0:replaceMap.hasOwnProperty(token)?!1:sanitizeWord(token,token,rules)===token}}function pluralize2(word,count,inclusive){var pluralized=count===1?pluralize2.singular(word):pluralize2.plural(word);return(inclusive?count+" ":"")+pluralized}return pluralize2.plural=replaceWord(irregularSingles,irregularPlurals,pluralRules),pluralize2.isPlural=checkWord(irregularSingles,irregularPlurals,pluralRules),pluralize2.singular=replaceWord(irregularPlurals,irregularSingles,singularRules),pluralize2.isSingular=checkWord(irregularPlurals,irregularSingles,singularRules),pluralize2.addPluralRule=function(rule,replacement){pluralRules.push([sanitizeRule(rule),replacement])},pluralize2.addSingularRule=function(rule,replacement){singularRules.push([sanitizeRule(rule),replacement])},pluralize2.addUncountableRule=function(word){if(typeof word=="string"){uncountables[word.toLowerCase()]=!0;return}pluralize2.addPluralRule(word,"$0"),pluralize2.addSingularRule(word,"$0")},pluralize2.addIrregularRule=function(single,plural){plural=plural.toLowerCase(),single=single.toLowerCase(),irregularSingles[single]=plural,irregularPlurals[plural]=single},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["whiskey","whiskies"]].forEach(function(rule){return pluralize2.addIrregularRule(rule[0],rule[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|tlas|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/(m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(rule){return pluralize2.addPluralRule(rule[0],rule[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/(m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i,"$1"],[/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(rule){return pluralize2.addSingularRule(rule[0],rule[1])}),["adulthood","advice","agenda","aid","alcohol","ammo","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","flounder","fun","gallows","garbage","graffiti","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","manga","news","pike","plankton","pliers","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","species","staff","swine","tennis","traffic","transporation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(pluralize2.addUncountableRule),pluralize2})}});var require_ini=__commonJS({"../../node_modules/.pnpm/ini@3.0.0/node_modules/ini/lib/ini.js"(exports,module){var{hasOwnProperty}=Object.prototype,eol=typeof process<"u"&&process.platform==="win32"?`\r
|
|
13
|
+
`:`
|
|
14
|
+
`,encode=(obj,opt)=>{let children=[],out="";typeof opt=="string"?opt={section:opt,whitespace:!1}:(opt=opt||Object.create(null),opt.whitespace=opt.whitespace===!0);let separator=opt.whitespace?" = ":"=";for(let k of Object.keys(obj)){let val=obj[k];if(val&&Array.isArray(val))for(let item of val)out+=safe(k+"[]")+separator+safe(item)+eol;else val&&typeof val=="object"?children.push(k):out+=safe(k)+separator+safe(val)+eol}opt.section&&out.length&&(out="["+safe(opt.section)+"]"+eol+out);for(let k of children){let nk=dotSplit(k).join("\\."),section=(opt.section?opt.section+".":"")+nk,{whitespace}=opt,child=encode(obj[k],{section,whitespace});out.length&&child.length&&(out+=eol),out+=child}return out},dotSplit=str=>str.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(part=>part.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),decode=str=>{let out=Object.create(null),p=out,section=null,re=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,lines=str.split(/[\r\n]+/g);for(let line of lines){if(!line||line.match(/^\s*[;#]/))continue;let match=line.match(re);if(!match)continue;if(match[1]!==void 0){if(section=unsafe(match[1]),section==="__proto__"){p=Object.create(null);continue}p=out[section]=out[section]||Object.create(null);continue}let keyRaw=unsafe(match[2]),isArray=keyRaw.length>2&&keyRaw.slice(-2)==="[]",key=isArray?keyRaw.slice(0,-2):keyRaw;if(key==="__proto__")continue;let valueRaw=match[3]?unsafe(match[4]):!0,value=valueRaw==="true"||valueRaw==="false"||valueRaw==="null"?JSON.parse(valueRaw):valueRaw;isArray&&(hasOwnProperty.call(p,key)?Array.isArray(p[key])||(p[key]=[p[key]]):p[key]=[]),Array.isArray(p[key])?p[key].push(value):p[key]=value}let remove=[];for(let k of Object.keys(out)){if(!hasOwnProperty.call(out,k)||typeof out[k]!="object"||Array.isArray(out[k]))continue;let parts=dotSplit(k);p=out;let l=parts.pop(),nl=l.replace(/\\\./g,".");for(let part of parts)part!=="__proto__"&&((!hasOwnProperty.call(p,part)||typeof p[part]!="object")&&(p[part]=Object.create(null)),p=p[part]);p===out&&nl===l||(p[nl]=out[k],remove.push(k))}for(let del of remove)delete out[del];return out},isQuoted=val=>val.startsWith('"')&&val.endsWith('"')||val.startsWith("'")&&val.endsWith("'"),safe=val=>typeof val!="string"||val.match(/[=\r\n]/)||val.match(/^\[/)||val.length>1&&isQuoted(val)||val!==val.trim()?JSON.stringify(val):val.split(";").join("\\;").split("#").join("\\#"),unsafe=(val,doUnesc)=>{if(val=(val||"").trim(),isQuoted(val)){val.charAt(0)==="'"&&(val=val.slice(1,-1));try{val=JSON.parse(val)}catch{}}else{let esc=!1,unesc="";for(let i=0,l=val.length;i<l;i++){let c=val.charAt(i);if(esc)"\\;#".indexOf(c)!==-1?unesc+=c:unesc+="\\"+c,esc=!1;else{if(";#".indexOf(c)!==-1)break;c==="\\"?esc=!0:unesc+=c}}return esc&&(unesc+="\\"),unesc.trim()}return val};module.exports={parse:decode,decode,stringify:encode,encode,safe,unsafe}}});var require_retry_operation=__commonJS({"../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry_operation.js"(exports,module){function RetryOperation(timeouts,options){typeof options=="boolean"&&(options={forever:options}),this._timeouts=timeouts,this._options=options||{},this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}module.exports=RetryOperation;RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(err){if(this._timeout&&clearTimeout(this._timeout),!err)return!1;this._errors.push(err);var timeout=this._timeouts.shift();if(timeout===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),timeout=this._timeouts.shift();else return!1;var self=this,timer=setTimeout(function(){self._attempts++,self._operationTimeoutCb&&(self._timeout=setTimeout(function(){self._operationTimeoutCb(self._attempts)},self._operationTimeout),this._options.unref&&self._timeout.unref()),self._fn(self._attempts)},timeout);return this._options.unref&&timer.unref(),!0};RetryOperation.prototype.attempt=function(fn,timeoutOps){this._fn=fn,timeoutOps&&(timeoutOps.timeout&&(this._operationTimeout=timeoutOps.timeout),timeoutOps.cb&&(this._operationTimeoutCb=timeoutOps.cb));var self=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){self._operationTimeoutCb()},self._operationTimeout)),this._fn(this._attempts)};RetryOperation.prototype.try=function(fn){console.log("Using RetryOperation.try() is deprecated"),this.attempt(fn)};RetryOperation.prototype.start=function(fn){console.log("Using RetryOperation.start() is deprecated"),this.attempt(fn)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var counts={},mainError=null,mainErrorCount=0,i=0;i<this._errors.length;i++){var error=this._errors[i],message=error.message,count=(counts[message]||0)+1;counts[message]=count,count>=mainErrorCount&&(mainError=error,mainErrorCount=count)}return mainError}}});var require_retry=__commonJS({"../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/lib/retry.js"(exports){var RetryOperation=require_retry_operation();exports.operation=function(options){var timeouts=exports.timeouts(options);return new RetryOperation(timeouts,{forever:options&&options.forever,unref:options&&options.unref})};exports.timeouts=function(options){if(options instanceof Array)return[].concat(options);var opts={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var key in options)opts[key]=options[key];if(opts.minTimeout>opts.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var timeouts=[],i=0;i<opts.retries;i++)timeouts.push(this.createTimeout(i,opts));return options&&options.forever&&!timeouts.length&&timeouts.push(this.createTimeout(i,opts)),timeouts.sort(function(a,b){return a-b}),timeouts};exports.createTimeout=function(attempt,opts){var random=opts.randomize?Math.random()+1:1,timeout=Math.round(random*opts.minTimeout*Math.pow(opts.factor,attempt));return timeout=Math.min(timeout,opts.maxTimeout),timeout};exports.wrap=function(obj,options,methods){if(options instanceof Array&&(methods=options,options=null),!methods){methods=[];for(var key in obj)typeof obj[key]=="function"&&methods.push(key)}for(var i=0;i<methods.length;i++){var method=methods[i],original=obj[method];obj[method]=function(){var op=exports.operation(options),args=Array.prototype.slice.call(arguments),callback=args.pop();args.push(function(err){op.retry(err)||(err&&(arguments[0]=op.mainError()),callback.apply(this,arguments))}),op.attempt(function(){original.apply(obj,args)})},obj[method].options=options}}}});var require_retry2=__commonJS({"../../node_modules/.pnpm/retry@0.10.1/node_modules/retry/index.js"(exports,module){module.exports=require_retry()}});var require_dist2=__commonJS({"../../node_modules/.pnpm/async-retry@1.1.3/node_modules/async-retry/dist/index.js"(exports,module){"use strict";var retrier=require_retry2();module.exports=function(fn,opts){return opts=opts||{},new Promise(function(resolve6,reject){var op=retrier.operation(opts),bail=function(err){return reject(err||new Error("Aborted"))},onError=function(err){if(err.bail)return bail(err);op.retry(err)?opts.onRetry&&opts.onRetry(err):reject(op.mainError())};op.attempt(function(num){var val=void 0;try{val=fn(bail,num)}catch(err){return onError(err)}Promise.resolve(val).then(resolve6,onError)})})}}});var require_types=__commonJS({"../client/dist/types.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),types_exports={};__export(types_exports,{VALID_ARCHIVE_FORMATS:()=>VALID_ARCHIVE_FORMATS,fileNameSymbol:()=>fileNameSymbol2});module.exports=__toCommonJS(types_exports);var VALID_ARCHIVE_FORMATS=["tgz"],fileNameSymbol2=Symbol("fileName")}});import{homedir}from"os";import{resolve}from"path";function humanizePath(path2){let resolved=resolve(path2),_homedir=homedir();return resolved.indexOf(_homedir)===0?`~${resolved.slice(_homedir.length)}`:resolved}var import_chalk=__toESM(require_source(),1);function highlight(text){return import_chalk.default.bold.underline(text)}import os from"os";var ua_default=`${pkg_default.name} ${pkg_default.version} node-${process.version} ${os.platform()} (${os.arch()})`;async function getProjectByNameOrId(client,projectNameOrId,accountId,includeRollbackInfo){try{let qs=includeRollbackInfo?"?rollbackInfo=true":"";return await client.fetch(`/v9/projects/${encodeURIComponent(projectNameOrId)}${qs}`,{accountId})}catch(err){if(isAPIError(err)&&err.status===404)return new ProjectNotFound(projectNameOrId);throw err}}import fs from"node:fs";function isDirectory(targetPath){try{return fs.lstatSync(targetPath).isDirectory()}catch{return!1}}var import_which=__toESM(require_lib(),1);import{accessSync,constants}from"node:fs";import{platform}from"node:os";import{delimiter,isAbsolute,resolve as resolve2}from"node:path";import{execFile}from"node:child_process";function execFileAsync(file,args,options={}){return new Promise((resolve6,reject)=>{execFile(file,args,{...options,encoding:"utf8"},(error,stdout,stderr)=>{error?reject(Object.assign(error,{stdout,stderr})):resolve6({stdout,stderr})})})}var executables=new Map;function getGitExecutable(cwd){if(platform()!=="darwin")return Promise.resolve("git");let searchPath=(process.env.PATH??"/usr/bin:/bin").split(delimiter).map(directory=>resolve2(cwd,directory)).join(delimiter),key=JSON.stringify([searchPath,cwd,process.env.DEVELOPER_DIR,process.env.SDKROOT,process.env.TOOLCHAINS]),executable=executables.get(key);return executable||(executable=resolveExecutable(searchPath,cwd),executables.set(key,executable)),executable}async function resolveExecutable(searchPath,cwd){try{if(import_which.default.sync("git",{path:searchPath,nothrow:!0})!=="/usr/bin/git")return"git";let{stdout}=await execFileAsync("/usr/bin/xcrun",["--find","git"],{cwd}),executable=stdout.trim();if(isAbsolute(executable)&&executable!=="/usr/bin/git")return accessSync(executable,constants.X_OK),executable}catch{}return"git"}import{execFileSync}from"node:child_process";import{join,resolve as resolve3}from"node:path";var DEFAULT_GIT_EXEC_OPTS={unsafe:!1};function getGitRootDirectory(opts){let{cwd,unsafe}={...DEFAULT_GIT_EXEC_OPTS,...opts};try{return execFileSync("git",["rev-parse","--show-toplevel"],{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch(error){if(unsafe)throw error;return null}}function getGitCommonDirectory(opts){let{cwd,unsafe}={...DEFAULT_GIT_EXEC_OPTS,...opts};try{return execFileSync("git",["rev-parse","--git-common-dir"],{cwd,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch(error){if(unsafe)throw error;return null}}function getGitConfigPath(opts){let{cwd}={...DEFAULT_GIT_EXEC_OPTS,...opts},gitCommonDir=getGitCommonDirectory(opts);if(gitCommonDir===null)return null;let absoluteGitCommonDir=resolve3(cwd,gitCommonDir);return join(absoluteGitCommonDir,"config")}var import_fs_extra=__toESM(require_lib2(),1),import_ini=__toESM(require_ini(),1),import_error_utils=__toESM(require_dist(),1);import{join as join2,relative,resolve as resolve4}from"path";import{execFile as execFile2}from"child_process";async function createGitMeta(directory,project){let git=await getGitExecutable(directory),metadata=Promise.allSettled([getLastCommit(directory,git),isDirty(directory)]),gitRoot,branch;try{let{stdout,stderr}=await execFileAsync(git,["rev-parse","--show-toplevel","--abbrev-ref","HEAD"],{cwd:directory});if(stderr.trim())throw new Error(stderr);let lines=stdout.trim().split(/\r?\n/);branch=lines.pop(),gitRoot=lines.join(`
|
|
15
|
+
`)}catch(error){await metadata,output_manager_default.debug(`Failed to get last commit. The directory is likely not a Git repo, there are no latest commits, or it is corrupted.
|
|
16
|
+
${(0,import_error_utils.errorToString)(error)}`);return}let gitConfigPath=join2(gitRoot||directory,".git/config"),remoteUrl;if(project?.link){let{repo}=project.link,remoteUrls=await getRemoteUrls(gitConfigPath);if(remoteUrls)for(let urlValue of Object.values(remoteUrls))urlValue.includes(repo)&&(remoteUrl=urlValue)}remoteUrl||(remoteUrl=await getOriginUrl(gitConfigPath));let[commitResult,dirtyResult]=await metadata;if(commitResult.status==="rejected"){output_manager_default.debug(`Failed to get last commit. The directory is likely not a Git repo, there are no latest commits, or it is corrupted.
|
|
17
|
+
${commitResult.reason}`);return}if(dirtyResult.status==="rejected"){output_manager_default.debug(`Failed to determine if Git repo has been modified:
|
|
18
|
+
${dirtyResult.reason}`);return}let dirty=dirtyResult.value,commit=commitResult.value;return{remoteUrl:remoteUrl||void 0,commitAuthorName:commit.author.name,commitAuthorEmail:commit.author.email,commitMessage:commit.subject,commitRef:branch,commitSha:commit.hash,dirty,rootDirectory:getRootDirectory(directory,gitRoot)}}function getRootDirectory(directory,gitRoot=getGitRootDirectory({cwd:directory})){if(!gitRoot)return;let rootDirectory=relative(gitRoot,resolve4(directory)).replace(/\\/g,"/");if(!(rootDirectory===".."||rootDirectory.startsWith("../")))return rootDirectory==="."?"":rootDirectory}async function getLastCommit(directory,git){let commit=await execFileAsync(git,["log","-1","--format=%H%x00%s%x00%an%x00%ae"],{cwd:directory});if(commit.stderr)throw new Error(commit.stderr);let[hash,subject,name,email]=commit.stdout.replace(/\r?\n$/,"").split("\0");return{hash,subject,author:{name,email}}}async function isDirty(directory){let git=await getGitExecutable(directory);return new Promise((resolve6,reject)=>{execFile2(git,["--no-optional-locks","status","-s"],{cwd:directory},function(err,stdout,stderr){if(err)return reject(err);if(stderr!==void 0&&stderr.trim().length>0)return reject(new Error(stderr));resolve6(stdout.trim().length>0)})})}async function parseGitConfig(configPath){try{return import_ini.default.parse(await import_fs_extra.default.readFile(configPath,"utf-8"))}catch(err){output_manager_default.debug(`Error while parsing repo data: ${(0,import_error_utils.errorToString)(err)}`)}}function pluckRemoteUrls(gitConfig){let remoteUrls={};for(let key of Object.keys(gitConfig))if(key.includes("remote")){let remoteName=key.match(/(?<=").*(?=")/g)?.[0],remoteUrl=gitConfig[key]?.url;remoteName&&remoteUrl&&(remoteUrls[remoteName]=remoteUrl)}if(Object.keys(remoteUrls).length!==0)return remoteUrls}async function getRemoteUrls(configPath){let config2=await parseGitConfig(configPath);return config2?pluckRemoteUrls(config2):void 0}function pluckOriginUrl(gitConfig){return gitConfig['remote "origin"']?.url}async function getOriginUrl(configPath){let gitConfig=await parseGitConfig(configPath);if(!gitConfig)return null;let originUrl=pluckOriginUrl(gitConfig);return originUrl||null}var import_fs_extra5=__toESM(require_lib2(),1);import os2 from"os";import{join as join8}from"path";var import_fs_extra4=__toESM(require_lib2(),1);import fs3 from"fs";import{join as join7,relative as relative2}from"path";import{promisify}from"util";var import_chalk3=__toESM(require_source(),1),import_cli_config=__toESM(require_cli_config(),1),import_async_retry=__toESM(require_dist2(),1);import{join as join4,resolve as resolve5}from"node:path";import{EventEmitter}from"events";import{URL as URL2}from"url";async function responseError(res,fallbackMessage=null,parsedBody={}){let bodyError;if(!res.ok){let body;try{body=await res.json()}catch{body=parsedBody}bodyError=body.error||body.err||body}let msg=bodyError?.message||fallbackMessage||"Response Error";return new APIError(msg,res,bodyError)}var import_chalk2=__toESM(require_source(),1);function printIndications(res){let indications=new Set(["warning","notice","tip"]),regex=/^x-(?:vercel|now)-(warning|notice|tip)-(.*)$/;for(let[name,payload]of res.headers){let match=name.match(regex);if(match){let[,type,identifier]=match,action=res.headers.get(`x-vercel-action-${identifier}`),link=res.headers.get(`x-vercel-link-${identifier}`);if(indications.has(type)){let newline=`
|
|
19
|
+
`,message=prependEmoji(import_chalk2.default.dim(payload),emoji(type))+newline,finalLink="";link&&(finalLink=import_chalk2.default.dim(`${action||"Learn More"}: ${link_default(link)}`)+newline),output_manager_default.print(message+finalLink)}}}}var import_load_json_file=__toESM(require_load_json_file(),1),config=__toESM(require_cli_config(),1),import_error_utils2=__toESM(require_dist(),1),import_types=__toESM(require_types(),1);import{join as join3,basename,dirname}from"path";import{accessSync as accessSync2,constants as constants2}from"fs";import{persistCliAuthConfig,readCliAuthConfig}from"@vercel/cli-auth/credentials-store.js";import path from"path";import{existsSync}from"fs";function getLocalPathConfig(prefix,useCompiledConfig=!0){let customPath=parseArguments(process.argv.slice(2),{},{permissive:!0}).flags["--local-config"];if(customPath){if(typeof customPath!="string")throw new InvalidLocalConfig(customPath);return path.resolve(process.cwd(),customPath)}let vercelConfigPath=path.join(prefix,"vercel.json"),vercelTomlPath=path.join(prefix,"vercel.toml"),nowConfigPath=path.join(prefix,"now.json"),vercelConfigExists=existsSync(vercelConfigPath),vercelTomlExists=existsSync(vercelTomlPath),nowConfigExists=existsSync(nowConfigPath),foundConfigs=[];if(vercelConfigExists&&foundConfigs.push(vercelConfigPath),vercelTomlExists&&foundConfigs.push(vercelTomlPath),nowConfigExists)throw new DeprecatedNowJson(nowConfigPath);if(foundConfigs.length>1)throw new ConflictingConfigFiles(foundConfigs);let compiledConfigPath=path.join(prefix,VERCEL_DIR,"vercel.json"),compiledConfigExists=existsSync(compiledConfigPath);return useCompiledConfig&&compiledConfigExists?compiledConfigPath:vercelConfigPath}var VERCEL_CONFIG_EXTENSIONS=["ts","mts","js","mjs","cjs"],DEFAULT_VERCEL_CONFIG_FILENAME="Vercel config";var globalDir,getVercelDir=()=>globalDir??=getGlobalPathConfig(),readConfigFile=()=>config.readGlobalConfigFile(getConfigFilePath2()),writeToConfigFile=stuff=>{try{config.writeGlobalConfigFile(getConfigFilePath2(),stuff)}catch(err){throw(0,import_error_utils2.isErrnoException)(err)&&((0,import_error_utils2.isErrnoException)(err)&&err.code==="EPERM"?(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (operation not permitted).`),process.exit(1)):err.code==="EBADF"&&(output_manager_default.error(`Not able to create ${highlight(getConfigFilePath2())} (bad file descriptor).`),process.exit(1))),err}},readAuthConfigFile=_globalConfig=>({...config.getDefaultAuthConfig(),...readCliAuthConfig(getVercelDir())}),persistAuthConfig=(authConfig,_globalConfig)=>{try{return persistCliAuthConfig(getVercelDir(),authConfig)}catch(err){let wrappedError=new Error(`Not able to create ${humanizePath(getAuthConfigFilePath2())} (${(0,import_error_utils2.errorToStringFriendly)(err)}).`);throw wrappedError.cause=err,wrappedError}};function getConfigFilePath2(){return config.getConfigFilePath(getVercelDir())}function getAuthConfigFilePath2(){return config.getAuthConfigFilePath(getVercelDir())}function readLocalConfig(prefix=process.cwd()){let config2,target="";try{target=getLocalPathConfig(prefix)}catch(err){if(err instanceof NowError)output_manager_default.error(err.message),process.exit(1);else throw err}if(!target)return;try{accessSync2(target,constants2.F_OK),config2=import_load_json_file.default.sync(target)}catch(err){if(!((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT"))if((0,import_error_utils2.isError)(err)&&err.name==="JSONError")output_manager_default.error(err.message),process.exit(1);else if((0,import_error_utils2.isErrnoException)(err)){let code2=err.code?` (${err.code})`:"";output_manager_default.error(`Failed to read config file: ${target}${code2}`),process.exit(1)}else output_manager_default.prettyError(err),process.exit(1)}if(!config2)return;if(basename(target)==="vercel.json"&&basename(dirname(target))===VERCEL_DIR){let workPath=dirname(dirname(target)),sourceFile=null;for(let ext of VERCEL_CONFIG_EXTENSIONS){let configPath=join3(workPath,`vercel.${ext}`);try{accessSync2(configPath,constants2.F_OK),sourceFile=basename(configPath);break}catch{}}if(!sourceFile){let tomlPath=join3(workPath,"vercel.toml");try{accessSync2(tomlPath,constants2.F_OK),sourceFile="vercel.toml"}catch{}}config2[import_types.fileNameSymbol]=sourceFile||DEFAULT_VERCEL_CONFIG_FILENAME}else config2[import_types.fileNameSymbol]=basename(target);return config2}function sharedPromise(fn){let promise=null;return function(...args){return promise||(promise=fn.apply(this,args),promise.finally(()=>{promise=null})),promise}}var import_error_utils3=__toESM(require_dist(),1);function sleep(ms){return new Promise(resolve6=>{setTimeout(resolve6,ms)})}import{hostname}from"os";var VERCEL_ISSUER=new URL("https://vercel.com"),VERCEL_CLI_CLIENT_ID="cl_HYyOPBNtFMfHhaUn9L4QPfTZz6TP47bp",userAgent=`${hostname()} @ ${ua_default}`,_as;async function as(){if(!_as){let discoveryResponse=await discoveryEndpointRequest(VERCEL_ISSUER),[discoveryResponseError,as2]=await processDiscoveryEndpointResponse(discoveryResponse);if(discoveryResponseError)throw discoveryResponseError;_as=as2}return _as}async function discoveryEndpointRequest(issuer){return await fetch(new URL(".well-known/openid-configuration",issuer),{headers:{"Content-Type":"application/json","user-agent":userAgent}})}async function processDiscoveryEndpointResponse(response){let json=await response.json();if(!response.ok)return[new Error("Discovery endpoint request failed")];if(typeof json!="object"||json===null||!canParseURL(json.issuer)||!canParseURL(json.device_authorization_endpoint)||!canParseURL(json.token_endpoint)||!canParseURL(json.revocation_endpoint)||!canParseURL(json.jwks_uri)||!canParseURL(json.introspection_endpoint))return[new TypeError("Invalid discovery response")];let issuer=new URL(json.issuer);return issuer.href!==VERCEL_ISSUER.href?[new Error("Issuer mismatch")]:[null,{issuer,device_authorization_endpoint:new URL(json.device_authorization_endpoint),token_endpoint:new URL(json.token_endpoint),revocation_endpoint:new URL(json.revocation_endpoint),jwks_uri:new URL(json.jwks_uri),introspection_endpoint:new URL(json.introspection_endpoint)}]}async function deviceAuthorizationRequest(options){let body=new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID});return options?.refresh_token?(body.set("refresh_token",options.refresh_token),options.acr_values&&body.set("acr_values",options.acr_values)):body.set("scope","openid offline_access"),await fetch((await as()).device_authorization_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body})}async function processDeviceAuthorizationResponse(response){let json=await response.json();return response.ok?typeof json!="object"||json===null?[new TypeError("Expected response to be an object")]:!("device_code"in json)||typeof json.device_code!="string"?[new TypeError("Expected `device_code` to be a string")]:!("user_code"in json)||typeof json.user_code!="string"?[new TypeError("Expected `user_code` to be a string")]:!("verification_uri"in json)||typeof json.verification_uri!="string"||!canParseURL(json.verification_uri)?[new TypeError("Expected `verification_uri` to be a string")]:!("verification_uri_complete"in json)||typeof json.verification_uri_complete!="string"||!canParseURL(json.verification_uri_complete)?[new TypeError("Expected `verification_uri_complete` to be a string")]:!("expires_in"in json)||typeof json.expires_in!="number"?[new TypeError("Expected `expires_in` to be a number")]:!("interval"in json)||typeof json.interval!="number"?[new TypeError("Expected `interval` to be a number")]:[null,{device_code:json.device_code,user_code:json.user_code,verification_uri:json.verification_uri,verification_uri_complete:json.verification_uri_complete,expiresAt:Date.now()+json.expires_in*1e3,interval:json.interval}]:[new OAuthError("Device authorization request failed",json)]}async function deviceAccessTokenRequest(options){try{return[null,await fetch((await as()).token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"urn:ietf:params:oauth:grant-type:device_code",...options}),signal:AbortSignal.timeout(10*1e3)})]}catch(error){return error instanceof Error?[error]:[new Error("An unknown error occurred. See the logs for details.",{cause:error})]}}async function processTokenResponse(response){let json=await response.json();return response.ok?typeof json!="object"||json===null?[new TypeError("Expected response to be an object")]:!("access_token"in json)||typeof json.access_token!="string"?[new TypeError("Expected `access_token` to be a string")]:!("token_type"in json)||json.token_type!=="Bearer"?[new TypeError('Expected `token_type` to be "Bearer"')]:!("expires_in"in json)||typeof json.expires_in!="number"?[new TypeError("Expected `expires_in` to be a number")]:"refresh_token"in json&&(typeof json.refresh_token!="string"||!json.refresh_token)?[new TypeError("Expected `refresh_token` to be a string")]:"scope"in json&&typeof json.scope!="string"?[new TypeError("Expected `scope` to be a string")]:[null,json]:[new OAuthError("Device access token request failed",json)]}async function revocationRequest(options){return await fetch((await as()).revocation_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({...options,client_id:VERCEL_CLI_CLIENT_ID})})}async function processRevocationResponse(response){if(response.ok)return[null,null];let json=await response.json();return[new OAuthError("Revocation request failed",json)]}async function refreshTokenRequest(options){return await fetch((await as()).token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({client_id:VERCEL_CLI_CLIENT_ID,grant_type:"refresh_token",...options})})}function processOAuthErrorResponse(json){return typeof json!="object"||json===null?new TypeError("Expected response to be an object"):!("error"in json)||typeof json.error!="string"?new TypeError("Expected `error` to be a string"):"error_description"in json&&typeof json.error_description!="string"?new TypeError("Expected `error_description` to be a string"):"error_uri"in json&&typeof json.error_uri!="string"?new TypeError("Expected `error_uri` to be a string"):json}var OAuthError=class extends Error{constructor(message,response){var __super=(...args)=>{super(...args)};let error=processOAuthErrorResponse(response);if(error instanceof TypeError){let message2=`Unexpected server response: ${JSON.stringify(response)}`;__super(message2),this.cause=new Error(message2,{cause:error}),this.code="server_error";return}let cause=error.error;error.error_description&&(cause+=`: ${error.error_description}`),error.error_uri&&(cause+=` (${error.error_uri})`),__super(message,{cause}),this.cause=new Error(cause),this.code=error.error}};function isOAuthError(error){return error instanceof OAuthError}function canParseURL(url){try{return!!new URL(url)}catch{return!1}}async function inspectTokenRequest(token){return fetch((await as()).introspection_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","user-agent":userAgent},body:new URLSearchParams({token})})}async function processInspectTokenResponse(response){try{let token=await response.json();if(!token||typeof token!="object"||!("active"in token))throw new IntrospectionError("Invalid token introspection response");return[null,token]}catch(cause){return[new IntrospectionError("Could not introspect token.",{cause})]}}var IntrospectionError=class extends Error{constructor(){super(...arguments);this.name="IntrospectionError"}};var PromptCanceledError=class extends Error{constructor(){super("Prompt canceled"),this.name="PromptCanceledError"}},PromptBackError=class extends Error{constructor(){super("Prompt back"),this.name="PromptBackError"}};function isPromptBackError(error){return error instanceof PromptBackError}function isPromptCanceledError(error){return error instanceof PromptCanceledError?!0:error instanceof Error&&error.message.includes("User force closed the prompt")}var TEAM_NOT_CHOSEN="",DOMAINS_API_PATH=/^\/v\d+\/(?:domains|registrar)(?:\/|$)/,isSAMLError=v=>v&&v.saml,isJSONObject=v=>v&&typeof v=="object"&&v.constructor===Object;function isValidAccessToken(authConfig){if(!authConfig.token)return!1;if(typeof authConfig.expiresAt!="number")return!0;let nowInSeconds=Math.floor(Date.now()/1e3);return authConfig.expiresAt>=nowInSeconds}function hasRefreshToken(authConfig){return"refreshToken"in authConfig}var Client=class extends EventEmitter{constructor(opts){super();this._argv=[];this._loggedTokenSource=!1;this.escapePromptCancellationDepth=0;this.promptBackNavigationDepth=0;this.reauthenticate=sharedPromise(async function(error){let{default:reauthenticate}=await import("./reauthenticate-YZXHWSEC.js");if(typeof await reauthenticate(this,error)=="number")throw error instanceof APIError?output_manager_default.prettyError(error):output_manager_default.error(`Failed to re-authenticate for ${(0,import_chalk3.bold)(error.scope)} scope`),error});this._onRetry=error=>{output_manager_default.debug(`Retrying: ${error}
|
|
20
|
+
${error.stack}`)};this.setArgv(opts.argv),this.apiUrl=opts.apiUrl,this.authConfig=opts.authConfig,this.stdin=opts.stdin,this.stdout=opts.stdout,this.stderr=opts.stderr,this.config=opts.config,this.savedTeam=opts.config.currentTeam,this.localConfig=opts.localConfig,this.localConfigPath=opts.localConfigPath,this.requestIdCounter=1,this.telemetryEventStore=opts.telemetryEventStore,this.isAgent=opts.isAgent??!1,this.agentName=opts.agentName,this.nonInteractive=opts.nonInteractive??this.isAgent,this.ignoresSavedTeam=this.isAgent&&this.nonInteractive,this.dangerouslySkipPermissions=opts.dangerouslySkipPermissions??!1;let theme={prefix:(0,import_chalk3.gray)("?"),style:{answer:import_chalk3.gray}};this.input={text:async opts2=>{let{default:input}=await import("./esm-IF453UWS.js");return this.runPrompt(input({theme,...opts2},{input:this.stdin,output:this.stderr}))},password:async opts2=>{let{default:password}=await import("./esm-LABWDJ72.js");return this.runPrompt(password({theme,...opts2},{input:this.stdin,output:this.stderr}))},checkbox:async opts2=>{let{default:checkbox}=await import("./esm-BYG5BWYH.js");return this.runPrompt(checkbox({theme,...opts2},{input:this.stdin,output:this.stderr}))},expand:async opts2=>{let{default:expand}=await import("./esm-TG37FXTU.js");return this.runPrompt(expand({theme,...opts2},{input:this.stdin,output:this.stderr}))},confirm:async(message,default_value)=>{let{default:confirm}=await import("./esm-33752ISR.js");return this.runPrompt(confirm({theme,message,default:default_value},{input:this.stdin,output:this.stderr}))},select:async opts2=>{let{default:select}=await import("./esm-4JKEE7PC.js");return this.runPrompt(select({theme,...opts2},{input:this.stdin,output:this.stderr}))},search:async opts2=>{let{default:search}=await import("./esm-DFFBNKNU.js");return this.runPrompt(search({theme,...opts2},{input:this.stdin,output:this.stderr}))}}}async withEscapePromptCancellation(run){this.escapePromptCancellationDepth++;try{return await run()}finally{this.escapePromptCancellationDepth--}}async withPromptBackNavigation(run){this.promptBackNavigationDepth++;try{return await run()}finally{this.promptBackNavigationDepth--}}runPrompt(prompt){let escapeCancellationEnabled=this.escapePromptCancellationDepth>0,backNavigationEnabled=this.promptBackNavigationDepth>0;if(!escapeCancellationEnabled&&!backNavigationEnabled||!this.stdin.isTTY||!prompt.cancel)return prompt;let cancellation,onKeypress=(_input,key)=>{key?.name==="escape"&&escapeCancellationEnabled&&!cancellation?(cancellation="escape",prompt.cancel?.()):key?.name==="up"&&backNavigationEnabled&&!cancellation&&(cancellation="back",prompt.cancel?.())};return this.stdin.on("keypress",onKeypress),prompt.catch(error=>{throw cancellation==="escape"?new PromptCanceledError:cancellation==="back"?new PromptBackError:error}).finally(()=>{this.stdin.off("keypress",onKeypress)})}get argv(){return this._argv}setArgv(argvOrFirst,...rest){let argv=Array.isArray(argvOrFirst)?argvOrFirst:[argvOrFirst,...rest];this._argv=argv,this._parsedArgsCache=void 0}getParsedArgs(){return this._parsedArgsCache||(this._parsedArgsCache=parseArguments(this.argv.slice(2),{},{permissive:!0})),this._parsedArgsCache}retry(fn,{retries=3,maxTimeout=1/0}={}){return(0,import_async_retry.default)(fn,{retries,maxTimeout,onRetry:this._onRetry})}async ensureAuthorized(){let{authConfig}=this;if(isValidAccessToken(authConfig)){this._loggedTokenSource||(authConfig.tokenSource==="flag"?output_manager_default.debug("Using token from `--token` argument, skipping token refresh."):authConfig.tokenSource==="env"?output_manager_default.debug("Using token from VERCEL_TOKEN environment variable, skipping token refresh."):output_manager_default.debug("Valid access token, skipping token refresh."),this._loggedTokenSource=!0);return}if(!hasRefreshToken(authConfig)){output_manager_default.debug("No refresh token found, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}let tokenResponse=await refreshTokenRequest({refresh_token:authConfig.refreshToken}),[tokensError,tokens]=await processTokenResponse(tokenResponse);if(isOAuthError(tokensError)&&tokensError.code==="invalid_grant"&&!authConfig.tokenSource&&this.stdin.isTTY&&!this.nonInteractive){output_manager_default.debug(`Stored session refresh failed: ${tokensError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login.");let{performDeviceCodeFlow}=await import("./future-N2ZTDYVW.js"),recoveredTokens=await performDeviceCodeFlow(this);if(recoveredTokens){this.updateAuthConfig({token:recoveredTokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+recoveredTokens.expires_in,refreshToken:recoveredTokens.refresh_token}),this.persistAuthConfig();return}}if(tokensError){output_manager_default.debug("Error refreshing token, emptying auth config."),this.emptyAuthConfig(),this.persistAuthConfig();return}this.updateAuthConfig({token:tokens.access_token,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in}),tokens.refresh_token&&this.updateAuthConfig({refreshToken:tokens.refresh_token}),this.persistAuthConfig(),this.writeToConfigFile(),output_manager_default.debug("Tokens refreshed successfully.")}getGlobalPathConfig(){let confFlag=this.getParsedArgs().flags["--global-config"];return typeof confFlag=="string"?resolve5(this.cwd,confFlag):(0,import_cli_config.getGlobalPathConfig)()}async readConfig(fileName,schema){let filePath=join4(this.getGlobalPathConfig(),fileName);return(0,import_cli_config.readConfigFile)(filePath,schema)}async maybeReadConfig(fileName,schema){try{return await this.readConfig(fileName,schema)}catch{return null}}async writeConfig(fileName,schema,value){let filePath=join4(this.getGlobalPathConfig(),fileName);(0,import_cli_config.writeConfigFile)(filePath,schema,value)}updateConfig(config2){this.config={...this.config,...config2},"currentTeam"in config2&&(this.savedTeam=config2.currentTeam)}writeToConfigFile(config2=this.config){writeToConfigFile(this.ignoresSavedTeam?{...config2,currentTeam:this.savedTeam}:config2)}isTeamUnchosen(){return this.ignoresSavedTeam&&this.config.currentTeam===TEAM_NOT_CHOSEN}needsTeamChoice(url,opts){return this.isTeamUnchosen()&&!opts.teamOptional&&!opts.accountId&&opts.useCurrentTeam!==!1&&!new URL2(url,this.apiUrl).searchParams.has("teamId")}chooseTeam({ask=!0}={}){return ask?(this.teamChoice??=this.applyTeamChoice(!0).finally(()=>{this.teamChoice=void 0}),this.teamChoice):this.applyTeamChoice(!1)}async applyTeamChoice(ask){let{resolveAgentTeam}=await import("./resolve-agent-team-DLIROIXX.js"),team=await resolveAgentTeam(this,{ask});team!==null&&this.isTeamUnchosen()&&(this.config.currentTeam=team)}async resolveCurrentTeam({ask=!0}={}){return this.isTeamUnchosen()&&await this.chooseTeam({ask}),this.isTeamUnchosen()?void 0:this.config.currentTeam}updateAuthConfig(authConfig){authConfig.token&&authConfig.token!==this.authConfig.token&&(this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0),this.authConfig={...this.authConfig,...authConfig}}emptyAuthConfig(){this.user=void 0,this.userPromise=void 0,this.teams=void 0,this.teamsPromise=void 0,this.authConfig=this.authConfig.skipWrite?{skipWrite:!0}:{}}persistAuthConfig(){persistAuthConfig(this.authConfig,this.config)}async confirmMutatingOperation(url,method){if(!((method||"GET").toUpperCase()==="DELETE"))return!0;if(this.isAgent&&this.dangerouslySkipPermissions){let agentInfo=this.agentName?` (${this.agentName})`:"";output_manager_default.print(`
|
|
21
|
+
`),output_manager_default.print((0,import_chalk3.bgRed)((0,import_chalk3.white)((0,import_chalk3.bold)(" \u26A0 WARNING ")))+(0,import_chalk3.red)((0,import_chalk3.bold)(` AGENT MODE - DELETE CONFIRMATION BYPASSED
|
|
22
|
+
`))),output_manager_default.print((0,import_chalk3.yellow)(` An AI agent${agentInfo} is executing a ${(0,import_chalk3.bold)("DELETE")} request with --dangerously-skip-permissions flag.
|
|
23
|
+
`)),output_manager_default.print((0,import_chalk3.yellow)(` This operation will delete data: ${(0,import_chalk3.bold)(url)}
|
|
24
|
+
`)),output_manager_default.print((0,import_chalk3.yellow)(` The --dangerously-skip-permissions flag has bypassed the confirmation prompt.
|
|
25
|
+
|
|
26
|
+
`))}if(this.dangerouslySkipPermissions)return!0;if(!this.stdin.isTTY)return output_manager_default.error(`DELETE operations require confirmation. Use ${(0,import_chalk3.bold)("--dangerously-skip-permissions")} to skip confirmation in non-interactive mode.`),!1;let message=`You are about to perform a ${(0,import_chalk3.red)((0,import_chalk3.bold)("DELETE"))} operation on:
|
|
27
|
+
${(0,import_chalk3.bold)(url)}
|
|
28
|
+
|
|
29
|
+
Are you sure you want to proceed?`;output_manager_default.print(`
|
|
30
|
+
`);let confirmed=await this.input.confirm(message,!1);return output_manager_default.print(`
|
|
31
|
+
`),confirmed||output_manager_default.log("Operation canceled by user."),confirmed}async _fetch(_url,opts={}){let url=new URL2(_url,this.apiUrl);(opts.accountId||opts.useCurrentTeam!==!1)&&(opts.accountId?opts.accountId.startsWith("team_")?url.searchParams.set("teamId",opts.accountId):url.searchParams.delete("teamId"):opts.useCurrentTeam!==!1&&this.config.currentTeam&&!url.searchParams.has("teamId")&&url.searchParams.set("teamId",this.config.currentTeam));let headers=new globalThis.Headers(opts.headers);headers.set("user-agent",ua_default),DOMAINS_API_PATH.test(url.pathname)&&headers.set("x-vercel-cli-version",pkg_default.version),this.agentName&&headers.set("x-ai-agent",this.agentName),headers.set("x-vercel-cli-session-id",this.telemetryEventStore.currentSessionId),headers.set("x-vercel-cli-invocation-id",this.telemetryEventStore.currentInvocationId),await this.ensureAuthorized(),this.authConfig.token&&headers.set("authorization",`Bearer ${this.authConfig.token}`);let body;isJSONObject(opts.body)?(body=JSON.stringify(opts.body),headers.set("content-type","application/json; charset=utf-8")):body=opts.body;let requestId=this.requestIdCounter++;return output_manager_default.time(res=>res?`#${requestId} \u2190 ${res.status} ${res.statusText}: ${res.headers.get("x-vercel-id")}`:`#${requestId} \u2192 ${opts.method||"GET"} ${url.href}`,fetch(url,{...opts,headers,body}))}async fetch(url,opts={}){return this.needsTeamChoice(url,opts)&&await this.chooseTeam(),this.retry(async bail=>{let res;try{res=await this._fetch(url,opts)}catch(err){if(err instanceof Error&&(err.name==="AbortError"||err.name==="TimeoutError"))return bail(err);throw err}if(printIndications(res),!res.ok){if(opts.redirect==="manual"&&res.status>=300&&res.status<400)return res;let error=await responseError(res);if(isSAMLError(error)&&error.teamId)try{await this.reauthenticate(error)}catch(reauthError){return bail((0,import_error_utils3.normalizeError)(reauthError))}else{if(res.status===429&&opts.bailOn429)return bail(error);if(typeof error.retryAfterMs=="number"){if(opts.retry?.retries===0)return bail(error);let randomSkewMs=3e4*Math.random();await sleep(error.retryAfterMs+randomSkewMs)}else if(res.status>=400&&res.status<500)return bail(error)}throw error}if(opts.json===!1)return res;let contentType=res.headers.get("content-type");return contentType?contentType.includes("application/json")?res.json():res:null},opts.retry)}async*fetchPaginated(url,opts){let endpoint=typeof url=="string"?new URL2(url,this.apiUrl):new URL2(url.href);endpoint.searchParams.has("limit")||endpoint.searchParams.set("limit","100");let next;do{next&&(await sleep(100),endpoint.searchParams.set("until",String(next)));let res=await this.fetch(endpoint.href,opts);yield res,next=res.pagination?.next}while(next)}get cwd(){return process.cwd()}set cwd(v){process.chdir(v)}};function getCachedUsername(authConfig){let{cachedUser,userId}=authConfig;if(!(!cachedUser||cachedUser.id!==userId)&&!(!isValidAccessToken(authConfig)&&!hasRefreshToken(authConfig)))return cachedUser.username}async function getUser(client){return client.user?client.user:(client.userPromise||(client.userPromise=fetchUser(client).finally(()=>{client.userPromise=void 0})),client.userPromise)}async function fetchUser(client){try{let res=await client.fetch("/v2/user",{useCurrentTeam:!1});if(!res.user)throw new MissingUser;let{userId,cachedUser}=client.authConfig;if(userId!==res.user.id||cachedUser?.id!==res.user.id||cachedUser.username!==res.user.username){client.updateAuthConfig({userId:res.user.id,cachedUser:{id:res.user.id,username:res.user.username}});try{client.persistAuthConfig()}catch{output_manager_default.debug("Failed to persist cached userId to auth config.")}}return client.telemetryEventStore.updateUserId(res.user.id),client.user=res.user,res.user}catch(error){if(error instanceof APIError&&error.status===403){if(client.user=void 0,client.userPromise=void 0,client.authConfig.userId||client.authConfig.cachedUser){client.updateAuthConfig({userId:void 0,cachedUser:void 0});try{client.persistAuthConfig()}catch{output_manager_default.debug("Failed to persist cached userId to auth config.")}}throw new InvalidToken(client.authConfig.tokenSource)}throw error}}async function getOrgById(client,orgId){if(orgId.startsWith("team_"))try{let team=await getTeamByIdOrSlug(client,orgId,{useCurrentTeam:!1});return team?{type:"team",id:team.id,slug:team.slug}:null}catch(err){if(isAPIError(err)&&(err.status===404||err.code==="not_found"||err.code==="mock_unimplemented"))return null;throw err}let user=await getUser(client);return user.id!==orgId?null:{type:"user",id:orgId,slug:user.username}}var import_build_utils2=__toESM(require_build_utils(),1);var import_error_utils4=__toESM(require_dist(),1);var import_chalk4=__toESM(require_source(),1),import_pluralize=__toESM(require_pluralize(),1),import_build_utils=__toESM(require_build_utils(),1),import_fs_extra2=__toESM(require_lib2(),1);import{homedir as homedir2}from"os";import{basename as basename2,join as join5}from"path";var home=homedir2();async function getRepoLink(client,cwd){let rootPath=await findRepoRoot(cwd);if(!rootPath)return;let repoConfigPath=join5(rootPath,VERCEL_DIR,VERCEL_DIR_REPO),repoConfig=await(0,import_fs_extra2.readJSON)(repoConfigPath).catch(err=>{if(err.code!=="ENOENT")throw err});return{rootPath,repoConfig,repoConfigPath}}async function resolveGitRemote(client,rootPath,{yes,existingRemoteName}){let gitConfigPath=getGitConfigPath({cwd:rootPath})??join5(rootPath,".git/config"),remoteUrls=await getRemoteUrls(gitConfigPath);if(!remoteUrls)return;let remoteName;if(existingRemoteName){if(remoteName=existingRemoteName,!remoteUrls[remoteName])throw new Error(`Git remote "${remoteName}" from repo.json no longer exists`)}else remoteName=await selectGitRemote(client,Object.keys(remoteUrls),yes);return{rootPath,remoteName,repoUrl:remoteUrls[remoteName]}}async function selectGitRemote(client,names,yes=!1){let remoteNames=[...names].sort(),defaultRemote=remoteNames.includes("origin")?"origin":remoteNames[0];return remoteNames.length===1||yes?defaultRemote:client.input.select({message:"Which Git remote should be used?",choices:remoteNames.map(name=>({name,value:name})),default:defaultRemote})}async function fetchProjectsForRepoUrl(client,repoUrl,orgId){let query=new URLSearchParams({repoUrl}),projectsIterator=client.fetchPaginated(`/v9/projects?${query}`,{accountId:orgId}),projects=[];for await(let chunk of projectsIterator)projects=projects.concat(chunk.projects);return projects}async function linkRepoProject(client,cwd,{project,orgId,orgSlug,remoteName,successEmoji="link"}){let repoLink=await getRepoLink(client,cwd);if(!repoLink)throw new Error("Could not determine Git repository root directory");let directory=(0,import_build_utils.normalizePath)(project.rootDirectory||"."),projectConfig={id:project.id,name:project.name,directory,orgId},filteredProjects=(repoLink.repoConfig?.projects??[]).filter(p=>p.id!==project.id&&(0,import_build_utils.normalizePath)(p.directory)!==directory),repoConfig={remoteName,projects:[...filteredProjects,projectConfig]};return await(0,import_fs_extra2.outputJSON)(repoLink.repoConfigPath,repoConfig,{spaces:2}),await writeReadme(repoLink.rootPath),await addToGitIgnore(repoLink.rootPath),output_manager_default.print(`
|
|
32
|
+
`),printAlignedLabel("Linked",`${orgSlug}/${project.name}`,{gutter:"\u2713"}),{repoConfig,repoConfigPath:repoLink.repoConfigPath,rootPath:repoLink.rootPath}}async function discoverRepoProjects(client,rootPath,{yes,existingProjectIds,existingDirectories,existingRemoteName}){let{Separator}=await import("./esm-BYG5BWYH.js"),{default:slugify}=await import("./slugify-NMMUASYK.js"),{default:selectOrg}=await import("./select-org-URO7GRAY.js"),{default:createProject}=await import("./create-project-IKCB6MB2.js"),{repoInfoToUrl}=await import("./repo-info-to-url-XQSULSEO.js"),{connectGitProvider,parseRepoUrl}=await import("./connect-git-provider-WEFO2ESM.js"),detectedProjectsPromise=import("./detect-projects-CHMBPFSE.js").then(({detectProjects})=>detectProjects(rootPath)).catch(err=>(output_manager_default.debug(`Failed to detect local projects: ${err}`),new Map)),confirmMessage=(existingRemoteName?"add":"link")==="add"?`Add Project(s) for Git repository at ${import_chalk4.default.dim(`"${humanizePath(rootPath)}"`)}?`:`Link Git repository at ${import_chalk4.default.dim(`"${humanizePath(rootPath)}"`)} to your Project(s)?`;if(!(yes||await client.input.confirm(confirmMessage,!0))){output_manager_default.print(` Canceled. Repository not linked.
|
|
33
|
+
`);return}let org=await selectOrg(client,"Which team?",yes);client.config.currentTeam=org.type==="team"?org.id:void 0;let remote=await resolveGitRemote(client,rootPath,{yes,existingRemoteName});if(!remote)throw new Error("Could not determine Git remote URLs");let{remoteName,repoUrl}=remote,parsedRepoUrl=parseRepoUrl(repoUrl);if(!parsedRepoUrl)throw new Error(`Failed to parse Git URL: ${repoUrl}`);let repoUrlLink=output_manager_default.link(repoUrl,repoInfoToUrl(parsedRepoUrl),{fallback:()=>link_default(repoUrl)});output_manager_default.spinner(`Fetching Projects for ${repoUrlLink} under ${import_chalk4.default.bold(org.slug)}\u2026`);let detectedProjects=await detectedProjectsPromise,projects=await fetchProjectsForRepoUrl(client,repoUrl,org.id);(existingProjectIds||existingDirectories)&&(projects=projects.filter(p=>!(existingProjectIds?.has(p.id)||existingDirectories?.has((0,import_build_utils.normalizePath)(p.rootDirectory||"."))))),projects.length===0?output_manager_default.print(` No Projects are linked to ${repoUrlLink} under ${import_chalk4.default.bold(org.slug)}.
|
|
34
|
+
`):output_manager_default.print(` Found ${(0,import_pluralize.default)("Project",projects.length,!0)} linked to ${repoUrlLink} under ${import_chalk4.default.bold(org.slug)}
|
|
35
|
+
`);for(let project of projects)detectedProjects.delete(project.rootDirectory??"");if(existingDirectories)for(let dir of existingDirectories)detectedProjects.delete(dir==="."?"":dir);let detectedProjectsCount=Array.from(detectedProjects.values()).reduce((o,f)=>o+f.length,0);detectedProjectsCount>0&&output_manager_default.print(` Detected ${(0,import_pluralize.default)("new Project",detectedProjectsCount,!0)} that may be created.
|
|
36
|
+
`);let selected;if(yes)selected=projects;else{let addSeparators=projects.length>0&&detectedProjectsCount>0;selected=await client.input.checkbox({message:`Which Projects should be ${projects.length?"linked to":"created"}?`,choices:[...addSeparators?[new Separator("----- Existing Projects -----")]:[],...projects.map(project=>{let dir=project.rootDirectory||".";return{name:`${org.slug}/${project.name} ${import_chalk4.default.gray(`(${dir})`)}`,value:project,checked:!0}}),...addSeparators?[new Separator("----- New Projects to be created -----")]:[],...Array.from(detectedProjects.entries()).flatMap(([rootDirectory,frameworks])=>frameworks.map((framework,i)=>{let name=slugify([basename2(rootDirectory)||basename2(rootPath),i>0?framework.slug:""].filter(Boolean).join("-"));return{name:`${org.slug}/${name} ${import_chalk4.default.gray(`(${rootDirectory||"."} \xB7 ${framework.name})`)}`,value:{newProject:!0,rootDirectory,name,framework},checked:projects.length===0}}))]})}if(selected.length===0){output_manager_default.print(` No Projects were selected. Repository not linked.
|
|
37
|
+
`);return}for(let i=0;i<selected.length;i++){let selection=selected[i];if(!("newProject"in selection&&selection.newProject))continue;let orgAndName=`${org.slug}/${selection.name}`;output_manager_default.spinner(`Creating new Project: ${orgAndName}`),delete selection.newProject,selection.rootDirectory||delete selection.rootDirectory;let project=selected[i]=await createProject(client,{...selection,framework:selection.framework.slug});await connectGitProvider(client,project.id,parsedRepoUrl.provider,`${parsedRepoUrl.org}/${parsedRepoUrl.repo}`),output_manager_default.print(` Created new Project: ${output_manager_default.link(orgAndName,`https://vercel.com/${orgAndName}`,{fallback:!1})}
|
|
38
|
+
`)}let repoProjects=selected.map(project=>{if(!("id"in project))throw new TypeError(`Not a Project: ${JSON.stringify(project)}`);return{id:project.id,name:project.name,directory:(0,import_build_utils.normalizePath)(project.rootDirectory||"."),orgId:org.id}});return{remoteName,projects:repoProjects,orgSlug:org.slug}}async function ensureRepoLink(client,cwd,{yes,overwrite}){let repoLink=await getRepoLink(client,cwd);if(repoLink)output_manager_default.debug(`Found Git repository root directory: ${repoLink.rootPath}`);else throw new Error("Could not determine Git repository root directory");let{rootPath,repoConfig,repoConfigPath}=repoLink;if(overwrite||!repoConfig){let result=await discoverRepoProjects(client,rootPath,{yes});if(!result)return;repoConfig={remoteName:result.remoteName,projects:result.projects},await(0,import_fs_extra2.outputJSON)(repoConfigPath,repoConfig,{spaces:2}),await writeReadme(rootPath),await addToGitIgnore(rootPath),printAlignedLabel("Linked",`${(0,import_pluralize.default)("Project",result.projects.length,!0)} under ${result.orgSlug}`,{gutter:"\u2713"})}return{repoConfig,repoConfigPath,rootPath}}async function addRepoLink(client,cwd,{yes}){let repoLink=await getRepoLink(client,cwd);if(!repoLink)throw new Error("Could not determine Git repository root directory");let{rootPath,repoConfig,repoConfigPath}=repoLink;if(!repoConfig)throw new Error("No existing repository link found. Run `vc link --repo` first to link the repository.");output_manager_default.debug(`Found Git repository root directory: ${rootPath}`);let existingProjectIds=new Set(repoConfig.projects.map(p=>p.id)),existingDirectories=new Set(repoConfig.projects.map(p=>p.directory)),result=await discoverRepoProjects(client,rootPath,{yes,existingProjectIds,existingDirectories,existingRemoteName:repoConfig.remoteName});if(!result)return;if(result.projects.length===0)return output_manager_default.print(` No new Projects were added.
|
|
39
|
+
`),{repoConfig,repoConfigPath,rootPath};let mergedProjects=[...repoConfig.projects];for(let project of result.projects)existingProjectIds.has(project.id)||mergedProjects.push(project);let updatedConfig={...repoConfig,projects:mergedProjects};return await(0,import_fs_extra2.outputJSON)(repoConfigPath,updatedConfig,{spaces:2}),printAlignedLabel("Added",`${(0,import_pluralize.default)("Project",result.projects.length,!0)} under ${result.orgSlug}`,{gutter:"\u2713"}),{repoConfig:updatedConfig,repoConfigPath,rootPath}}async function findRepoRoot(start){let{debug}=output_manager_default,REPO_JSON_PATH=join5(VERCEL_DIR,VERCEL_DIR_REPO);for(let current of(0,import_build_utils.traverseUpDirectories)({start})){if(current===home){debug("Arrived at home directory");break}let repoConfigPath=join5(current,REPO_JSON_PATH);if(await(0,import_fs_extra2.lstat)(repoConfigPath).catch(err=>{if(err.code!=="ENOENT")throw err}))return debug(`Found "${REPO_JSON_PATH}" - detected "${current}" as repo root`),current}let gitRoot=getGitRootDirectory({cwd:start});if(gitRoot)return debug(`Found git root via "git rev-parse --show-toplevel" - detected "${gitRoot}" as repo root`),gitRoot;for(let current of(0,import_build_utils.traverseUpDirectories)({start})){if(current===home){debug("Arrived at home directory");break}let gitPath=join5(current,".git");if(await(0,import_fs_extra2.lstat)(gitPath).catch(err=>{if(err.code!=="ENOENT")throw err}))return debug(`Found ".git" - detected "${current}" as repo root`),current}debug("Aborting search for repo root")}function sortByDirectory(a,b){let aParts=a.directory.split("/");return b.directory.split("/").length-aParts.length}function findProjectsFromPath(projects,path2){let normalizedPath=(0,import_build_utils.normalizePath)(path2),matches=projects.slice().sort(sortByDirectory).filter(project=>project.directory==="."?!0:normalizedPath===project.directory||normalizedPath.startsWith(`${project.directory}/`)),firstMatch=matches[0];return firstMatch?matches.filter(match=>match.directory===firstMatch.directory):[]}var import_chalk5=__toESM(require_source(),1),import_fs_extra3=__toESM(require_lib2(),1);import{stat}from"fs/promises";import{join as join6,dirname as dirname2}from"path";async function findProjectRoot(startDir){let cwdDev;try{cwdDev=(await stat(startDir)).dev}catch{return null}let dir=dirname2(startDir);for(;dirname2(dir)!==dir;){try{if((await stat(dir)).dev!==cwdDev)return null}catch{return null}let hasVercelDir=await(0,import_fs_extra3.pathExists)(join6(dir,".vercel")),hasVercelJson=await(0,import_fs_extra3.pathExists)(join6(dir,"vercel.json")),hasVercelToml=await(0,import_fs_extra3.pathExists)(join6(dir,"vercel.toml")),hasGit=await(0,import_fs_extra3.pathExists)(join6(dir,".git"));if(hasVercelDir||hasVercelJson||hasVercelToml||hasGit)return dir;dir=dirname2(dir)}return null}async function resolveProjectCwd(cwd){let projectRoot=await findProjectRoot(cwd);if(!projectRoot||projectRoot===cwd)return cwd;let{isExperimentalServicesEnabled,tryDetectServices}=await import("./detect-services-ZYHOOBMO.js");if(!await isExperimentalServicesEnabled(projectRoot))return cwd;let result=await tryDetectServices(projectRoot);return result&&(result.services?.length??0)>0?(output_manager_default.debug(`Running from project root: ${import_chalk5.default.cyan(projectRoot)}`),projectRoot):cwd}var readFile=promisify(fs3.readFile),writeFile=promisify(fs3.writeFile),VERCEL_DIR=".vercel",VERCEL_DIR_FALLBACK=".now",VERCEL_DIR_README="README.txt",VERCEL_DIR_PROJECT="project.json",VERCEL_DIR_REPO="repo.json";function isOwnerLookupUnavailableLink(link){return"ownerLookupUnavailable"in link&&link.ownerLookupUnavailable===!0}function isRemoteLookupSkippedLink(link){return"remoteLookupSkipped"in link&&link.remoteLookupSkipped===!0}function isOwnerLookupUnavailableError(error){return isAPIError(error)&&error.status===403&&error.code==="team_unauthorized"}function isValidProjectLink(value){if(!value||typeof value!="object"||Array.isArray(value))return!1;let link=value;return typeof link.projectId=="string"&&link.projectId.length>0&&typeof link.orgId=="string"&&link.orgId.length>0&&(link.projectName===void 0||typeof link.projectName=="string"&&link.projectName.length>0)}function getVercelDirectory(cwd){let possibleDirs=[join7(cwd,VERCEL_DIR),join7(cwd,VERCEL_DIR_FALLBACK)],existingDirs=possibleDirs.filter(d=>isDirectory(d));if(existingDirs.length>1)throw new import_build_utils2.NowBuildError({code:"CONFLICTING_CONFIG_DIRECTORIES",message:"Both `.vercel` and `.now` directories exist. Please remove the `.now` directory.",link:"https://vercel.link/combining-old-and-new-config"});return existingDirs[0]||possibleDirs[0]}async function getProjectLink(client,path2,projectName,projectNameIsExplicit){let dirLink=await getLinkFromDir(getVercelDirectory(path2));return dirLink&&(!projectNameIsExplicit||!projectName||dirLink.projectId===projectName||dirLink.projectName===projectName)?dirLink:await getProjectLinkFromRepoLink(client,path2,projectName,projectNameIsExplicit)}async function getProjectLinkFromRepoLink(client,path2,projectName,projectNameIsExplicit){let repoLink=await getRepoLink(client,path2);if(!repoLink?.repoConfig)return null;let projects=findProjectsFromPath(repoLink.repoConfig.projects,relative2(repoLink.rootPath,path2)),project;if(projectName&&projectNameIsExplicit)project=repoLink.repoConfig.projects.find(p=>p.id===projectName||p.name===projectName);else if(projects.length===1)project=projects[0];else{let selectableProjects=projects.length>0?projects:repoLink.repoConfig.projects;if(projectName&&(project=selectableProjects.find(p=>p.id===projectName||p.name===projectName)),!project)if(client.nonInteractive)if(selectableProjects.length===1)project=selectableProjects[0];else return null;else project=await client.input.select({message:"Please select a Project:",choices:selectableProjects.map(p=>({value:p,name:p.name}))})}if(project){let orgId=project.orgId??repoLink.repoConfig.orgId;if(!orgId){let projectInfo=[project.name?`name: "${project.name}"`:"",project.directory?`directory: "${project.directory}"`:""].filter(Boolean).join(", "),details=projectInfo?` Project: { ${projectInfo} }.`:"";throw new Error(`Could not determine org ID from repo.json config at "${repoLink.repoConfigPath}".${details} Please re-link the repository.`)}return{repoRoot:repoLink.rootPath,orgId,projectId:project.id,projectName:project.name,projectRootDirectory:project.directory}}return null}function getLinkedProjectIdSync(dir){try{let link=JSON.parse(fs3.readFileSync(join7(dir,VERCEL_DIR_PROJECT),"utf8"));return isValidProjectLink(link)?link.projectId:void 0}catch{return}}async function getLinkFromDir(dir){try{let json=await readFile(join7(dir,VERCEL_DIR_PROJECT),"utf8"),link=JSON.parse(json);if(!isValidProjectLink(link)){let raw=link,projectId=raw.projectId,orgId=raw.orgId;if(!(typeof projectId=="string"&&projectId.length>0&&typeof orgId=="string"&&orgId.length>0))return null;throw new Error(`Project Settings are invalid. To link your project again, remove the ${dir} directory.`)}return link}catch(err){if((0,import_error_utils4.isErrnoException)(err)&&err.code&&["ENOENT","ENOTDIR"].includes(err.code))return null;throw(0,import_error_utils4.isError)(err)&&err.name==="SyntaxError"?new Error(`Project Settings could not be retrieved. To link your project again, remove the ${dir} directory.`):err}}async function hasLocalProjectLink(client,cwd){try{if(await getLinkFromDir(getVercelDirectory(cwd)))return!0}catch{}try{let repoLink=await getRepoLink(client,cwd);return repoLink?.repoConfig?findProjectsFromPath(repoLink.repoConfig.projects,relative2(repoLink.rootPath,cwd)).length>0:!1}catch{return!1}}async function hasProjectLink(client,projectLink,path2){let VERCEL_ORG_ID=(0,import_build_utils2.getPlatformEnv)("ORG_ID"),VERCEL_PROJECT_ID=(0,import_build_utils2.getPlatformEnv)("PROJECT_ID");if(VERCEL_ORG_ID===projectLink.orgId&&VERCEL_PROJECT_ID===projectLink.projectId)return!0;let repoLink=await getRepoLink(client,path2);if(repoLink?.repoConfig){let matchingProject=repoLink.repoConfig.projects.find(p=>p.id===projectLink.projectId);if(matchingProject){let orgId=matchingProject.orgId??repoLink.repoConfig.orgId;if(!orgId)throw new Error(`Invalid "repo.json": missing "orgId" for project "${matchingProject.id}" and no top-level "orgId" is defined.`);if(orgId===projectLink.orgId)return!0}}let link=await getLinkFromDir(getVercelDirectory(path2));return!!(link&&link.orgId===projectLink.orgId&&link.projectId===projectLink.projectId)}async function getLinkedProject(client,options={}){let path2=options.cwd??client.cwd;options.skipProjectRootResolution||(path2=await resolveProjectCwd(path2));let VERCEL_ORG_ID=(0,import_build_utils2.getPlatformEnv)("ORG_ID"),VERCEL_PROJECT_ID=(0,import_build_utils2.getPlatformEnv)("PROJECT_ID"),shouldUseEnv=!!(VERCEL_ORG_ID&&VERCEL_PROJECT_ID),projectName=options.projectName,projectNameIsExplicit=options.projectNameIsExplicit===!0,explicitProjectName=projectNameIsExplicit?projectName:void 0,hasExplicitProject=!!explicitProjectName,shouldUseEnvContext=shouldUseEnv&&!hasExplicitProject;if(!hasExplicitProject&&(VERCEL_ORG_ID||VERCEL_PROJECT_ID)&&!shouldUseEnv)return options.quiet||output_manager_default.error(`You specified ${VERCEL_ORG_ID?"`VERCEL_ORG_ID`":"`VERCEL_PROJECT_ID`"} but you forgot to specify ${VERCEL_ORG_ID?"`VERCEL_PROJECT_ID`":"`VERCEL_ORG_ID`"}. You need to specify both to deploy to a custom project.
|
|
40
|
+
`),{status:"error",exitCode:1};let link,explicitlyResolvedProject=null,orgId;if(explicitProjectName){let hasExplicitScope=options.scopeIsExplicit===!0,matchingLocalLink=hasExplicitScope||shouldUseEnv?null:await getProjectLink(client,path2,explicitProjectName,!0),fallbackOrgId=shouldUseEnv?VERCEL_ORG_ID:matchingLocalLink?.orgId??client.config.currentTeam,lookupOrgId=hasExplicitScope?client.config.currentTeam:fallbackOrgId;orgId=lookupOrgId;let apiProject=await getProjectByNameOrId(client,explicitProjectName,lookupOrgId);if(explicitlyResolvedProject=apiProject instanceof ProjectNotFound?null:apiProject,explicitlyResolvedProject===null)link=null;else{let resolvedOrgId=explicitlyResolvedProject.accountId??lookupOrgId??matchingLocalLink?.orgId,localLink=matchingLocalLink?.projectId===explicitlyResolvedProject.id?matchingLocalLink:null;if(!localLink)try{localLink=await getProjectLink(client,path2,explicitlyResolvedProject.id,!0)}catch(err){output_manager_default.debug(`Ignoring local project metadata after explicit project resolution: ${err}`)}link=resolvedOrgId?{...localLink?.projectId===explicitlyResolvedProject.id&&localLink.orgId===resolvedOrgId?localLink:{},projectId:explicitlyResolvedProject.id,orgId:resolvedOrgId}:null}}else link=shouldUseEnvContext?{orgId:VERCEL_ORG_ID,projectId:VERCEL_PROJECT_ID}:await getProjectLink(client,path2,projectName,projectNameIsExplicit),link&&(orgId=link.orgId);if(!link)return{status:"not_linked",org:null,project:null,orgId};if(options.skipRemoteLookup&&link.projectName){let settings=link.settings,localRootDirectory=link.projectRootDirectory??settings?.rootDirectory??null,rootDirectory=localRootDirectory==="."?null:localRootDirectory,project2={...settings,id:link.projectId,accountId:link.orgId,name:link.projectName,createdAt:settings?.createdAt??0,updatedAt:settings?.updatedAt??settings?.createdAt??0,rootDirectory};return{...{status:"linked",org:{type:link.orgId.startsWith("team_")?"team":"user",id:link.orgId,slug:""},project:project2,repoRoot:link.repoRoot,remoteLookupSkipped:!0},projectRootDirectory:link.projectRootDirectory,orgId:link.orgId}}options.quiet||output_manager_default.spinner("Retrieving project\u2026",1e3);let org=null,project=null,ownerLookupUnavailable=!1;try{let[orgResult,projectResult]=await Promise.allSettled([options.skipOwnerLookup?Promise.resolve({type:link.orgId.startsWith("team_")?"team":"user",id:link.orgId,slug:""}):getOrgById(client,link.orgId),explicitlyResolvedProject?Promise.resolve(explicitlyResolvedProject):getProjectByNameOrId(client,link.projectId,link.orgId)]);if(orgResult.status==="fulfilled")org=orgResult.value;else if(isAPIError(orgResult.reason)&&(orgResult.reason.status===404||orgResult.reason.code==="not_found"||orgResult.reason.code==="mock_unimplemented"))org=null;else if(options.allowOwnerLookupFallback&&isOwnerLookupUnavailableError(orgResult.reason))ownerLookupUnavailable=!0;else throw orgResult.reason;if(projectResult.status==="fulfilled")project=projectResult.value;else if(isAPIError(projectResult.reason)&&(projectResult.reason.status===404||projectResult.reason.code==="not_found"||projectResult.reason.code==="mock_unimplemented"))project=new ProjectNotFound(link.projectId);else throw projectResult.reason}catch(err){if(isAPIError(err)&&err.status===403){if(output_manager_default.stopSpinner(),err.missingToken||err.invalidToken)throw new InvalidToken(client.authConfig.tokenSource);if(err.code==="forbidden"||err.code==="team_unauthorized")throw new import_build_utils2.NowBuildError({message:`Could not retrieve Project Settings. To link your Project, remove the ${code(VERCEL_DIR)} directory and deploy again.`,code:"PROJECT_UNAUTHORIZED",link:"https://vercel.link/cannot-load-project-settings"})}throw err}finally{output_manager_default.stopSpinner()}if(ownerLookupUnavailable&&project&&!(project instanceof ProjectNotFound)){let ownerId=project.accountId||link.orgId;return{status:"linked",org:{type:ownerId.startsWith("team_")?"team":"user",id:ownerId,slug:ownerId},project,repoRoot:link.repoRoot,projectRootDirectory:link.projectRootDirectory,orgId:link.orgId,ownerLookupUnavailable:!0}}return!org||!project||project instanceof ProjectNotFound?shouldUseEnvContext?(options.quiet||output_manager_default.error(`Project not found (${JSON.stringify({VERCEL_PROJECT_ID,VERCEL_ORG_ID})})
|
|
41
|
+
`),{status:"error",exitCode:1,orgId}):(options.quiet||output_manager_default.print(prependEmoji(`Your Project was either deleted, transferred to a new Team, or you don\u2019t have access to it anymore.
|
|
42
|
+
`,emoji("warning"))),{status:"not_linked",org:null,project:null,orgId:link.orgId}):{status:"linked",org,project,repoRoot:link.repoRoot,projectRootDirectory:link.projectRootDirectory,orgId:link.orgId}}var VERCEL_DIR_README_CONTENT=`> Why do I have a folder named ".vercel" in my project?
|
|
43
|
+
The ".vercel" folder is created when you link a directory to a Vercel project.
|
|
44
|
+
|
|
45
|
+
> What does the "project.json" file contain?
|
|
46
|
+
The "project.json" file contains:
|
|
47
|
+
- The ID of the Vercel project that you linked ("projectId")
|
|
48
|
+
- The ID of the user or team your Vercel project is owned by ("orgId")
|
|
49
|
+
|
|
50
|
+
> Should I commit the ".vercel" folder?
|
|
51
|
+
No, you should not share the ".vercel" folder with anyone.
|
|
52
|
+
Upon creation, it will be automatically added to your ".gitignore" file.
|
|
53
|
+
`;async function writeReadme(path2){await writeFile(join7(path2,VERCEL_DIR,VERCEL_DIR_README),VERCEL_DIR_README_CONTENT)}async function linkFolderToProject(client,path2,projectLink,projectName,orgSlug,successEmoji="link",autoConfirm=!1,pullEnv=!0,resultLabel="Linked"){if(await hasProjectLink(client,projectLink,path2))return;try{await(0,import_fs_extra4.ensureDir)(join7(path2,VERCEL_DIR))}catch(err){if((0,import_error_utils4.isErrnoException)(err)&&err.code==="ENOTDIR")return;throw err}if(await writeFile(join7(path2,VERCEL_DIR,VERCEL_DIR_PROJECT),JSON.stringify({...projectLink,projectName})),await writeReadme(path2),await addToGitIgnore(path2),output_manager_default.print(`
|
|
54
|
+
`),printAlignedLabel(resultLabel,`${orgSlug}/${projectName}`,{gutter:"\u2713"}),!pullEnv||!client.stdin.isTTY||client.nonInteractive)return;if(output_manager_default.print(`
|
|
55
|
+
`),autoConfirm||await client.input.confirm("Pull development environment variables into .env.local?",!0)){let originalCwd=client.cwd;try{client.cwd=path2;let args=autoConfirm?["--yes"]:[],{default:pull}=await import("./pull-K3JVXGZM.js");await pull(client,args,"vercel-cli:link")!==0&&output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}catch{output_manager_default.error("Failed to pull environment variables. You can run `vc env pull` manually.")}finally{client.cwd=originalCwd}}}async function addToGitIgnore(path2,ignore=VERCEL_DIR){let isGitIgnoreUpdated=!1;try{let gitIgnorePath=join8(path2,".gitignore"),gitIgnore=await(0,import_fs_extra5.readFile)(gitIgnorePath,"utf8").catch(()=>null)??"",EOL=gitIgnore.includes(`\r
|
|
56
|
+
`)?`\r
|
|
57
|
+
`:os2.EOL,contentModified=!1;gitIgnore.split(EOL).includes(ignore)||(gitIgnore+=`${gitIgnore.endsWith(EOL)||gitIgnore.length===0?"":EOL}${ignore}${EOL}`,contentModified=!0),contentModified&&(await(0,import_fs_extra5.writeFile)(gitIgnorePath,gitIgnore),isGitIgnoreUpdated=!0)}catch{}return isGitIgnoreUpdated}export{require_lib2 as require_lib,humanizePath,highlight,require_dist2 as require_dist,ua_default,responseError,printIndications,require_types,getProjectByNameOrId,getOrgById,isDirectory,require_pluralize,execFileAsync,getGitExecutable,getGitConfigPath,createGitMeta,parseGitConfig,pluckRemoteUrls,getRemoteUrls,addToGitIgnore,getRepoLink,resolveGitRemote,selectGitRemote,fetchProjectsForRepoUrl,linkRepoProject,ensureRepoLink,addRepoLink,findRepoRoot,findProjectsFromPath,VERCEL_CONFIG_EXTENSIONS,DEFAULT_VERCEL_CONFIG_FILENAME,resolveProjectCwd,deviceAuthorizationRequest,processDeviceAuthorizationResponse,deviceAccessTokenRequest,processTokenResponse,revocationRequest,processRevocationResponse,isOAuthError,inspectTokenRequest,processInspectTokenResponse,isPromptBackError,isPromptCanceledError,VERCEL_DIR,VERCEL_DIR_README,VERCEL_DIR_PROJECT,isOwnerLookupUnavailableLink,isRemoteLookupSkippedLink,getVercelDirectory,getProjectLink,getLinkedProjectIdSync,getLinkFromDir,hasLocalProjectLink,getLinkedProject,linkFolderToProject,getLocalPathConfig,readConfigFile,writeToConfigFile,readAuthConfigFile,persistAuthConfig,getConfigFilePath2 as getConfigFilePath,getAuthConfigFilePath2 as getAuthConfigFilePath,readLocalConfig,sleep,TEAM_NOT_CHOSEN,isJSONObject,isValidAccessToken,Client,getCachedUsername,getUser};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_json_parse_better_errors}from"./chunk-25565AGS.js";import{require_lib}from"./chunk-
|
|
7
|
+
import{require_json_parse_better_errors}from"./chunk-25565AGS.js";import{require_lib}from"./chunk-3XDTQFBL.js";import{CantParseJSONFile}from"./chunk-AZ5OUZPP.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_fs_extra=__toESM(require_lib(),1);var import_json_parse_better_errors=__toESM(require_json_parse_better_errors(),1),import_error_utils=__toESM(require_dist(),1);async function readJSONFile(file){let content=await readFileSafe(file);if(content===null)return content;try{return(0,import_json_parse_better_errors.default)(content)}catch(error){return new CantParseJSONFile(file,(0,import_error_utils.errorToString)(error))}}async function readFileSafe(file){try{return await import_fs_extra.default.readFile(file,"utf8")}catch{return null}}export{readJSONFile};
|
|
@@ -4,7 +4,8 @@ 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{
|
|
7
|
+
import{__commonJS,__require}from"./chunk-BZENIQ7N.js";var require_polyfills=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports,module){var constants=__require("constants"),origCwd=process.cwd,cwd=null,platform=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cwd||(cwd=origCwd.call(process)),cwd};try{process.cwd()}catch{}typeof process.chdir=="function"&&(chdir=process.chdir,process.chdir=function(d){cwd=null,chdir.call(process,d)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,chdir));var chdir;module.exports=patch;function patch(fs){constants.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&patchLchmod(fs),fs.lutimes||patchLutimes(fs),fs.chown=chownFix(fs.chown),fs.fchown=chownFix(fs.fchown),fs.lchown=chownFix(fs.lchown),fs.chmod=chmodFix(fs.chmod),fs.fchmod=chmodFix(fs.fchmod),fs.lchmod=chmodFix(fs.lchmod),fs.chownSync=chownFixSync(fs.chownSync),fs.fchownSync=chownFixSync(fs.fchownSync),fs.lchownSync=chownFixSync(fs.lchownSync),fs.chmodSync=chmodFixSync(fs.chmodSync),fs.fchmodSync=chmodFixSync(fs.fchmodSync),fs.lchmodSync=chmodFixSync(fs.lchmodSync),fs.stat=statFix(fs.stat),fs.fstat=statFix(fs.fstat),fs.lstat=statFix(fs.lstat),fs.statSync=statFixSync(fs.statSync),fs.fstatSync=statFixSync(fs.fstatSync),fs.lstatSync=statFixSync(fs.lstatSync),fs.chmod&&!fs.lchmod&&(fs.lchmod=function(path,mode,cb){cb&&process.nextTick(cb)},fs.lchmodSync=function(){}),fs.chown&&!fs.lchown&&(fs.lchown=function(path,uid,gid,cb){cb&&process.nextTick(cb)},fs.lchownSync=function(){}),platform==="win32"&&(fs.rename=typeof fs.rename!="function"?fs.rename:function(fs$rename){function rename(from,to,cb){var start=Date.now(),backoff=0;fs$rename(from,to,function CB(er){if(er&&(er.code==="EACCES"||er.code==="EPERM"||er.code==="EBUSY")&&Date.now()-start<6e4){setTimeout(function(){fs.stat(to,function(stater,st){stater&&stater.code==="ENOENT"?fs$rename(from,to,CB):cb(er)})},backoff),backoff<100&&(backoff+=10);return}cb&&cb(er)})}return Object.setPrototypeOf&&Object.setPrototypeOf(rename,fs$rename),rename}(fs.rename)),fs.read=typeof fs.read!="function"?fs.read:function(fs$read){function read(fd,buffer,offset,length,position,callback_){var callback;if(callback_&&typeof callback_=="function"){var eagCounter=0;callback=function(er,_,__){if(er&&er.code==="EAGAIN"&&eagCounter<10)return eagCounter++,fs$read.call(fs,fd,buffer,offset,length,position,callback);callback_.apply(this,arguments)}}return fs$read.call(fs,fd,buffer,offset,length,position,callback)}return Object.setPrototypeOf&&Object.setPrototypeOf(read,fs$read),read}(fs.read),fs.readSync=typeof fs.readSync!="function"?fs.readSync:function(fs$readSync){return function(fd,buffer,offset,length,position){for(var eagCounter=0;;)try{return fs$readSync.call(fs,fd,buffer,offset,length,position)}catch(er){if(er.code==="EAGAIN"&&eagCounter<10){eagCounter++;continue}throw er}}}(fs.readSync);function patchLchmod(fs2){fs2.lchmod=function(path,mode,callback){fs2.open(path,constants.O_WRONLY|constants.O_SYMLINK,mode,function(err,fd){if(err){callback&&callback(err);return}fs2.fchmod(fd,mode,function(err2){fs2.close(fd,function(err22){callback&&callback(err2||err22)})})})},fs2.lchmodSync=function(path,mode){var fd=fs2.openSync(path,constants.O_WRONLY|constants.O_SYMLINK,mode),threw=!0,ret;try{ret=fs2.fchmodSync(fd,mode),threw=!1}finally{if(threw)try{fs2.closeSync(fd)}catch{}else fs2.closeSync(fd)}return ret}}function patchLutimes(fs2){constants.hasOwnProperty("O_SYMLINK")&&fs2.futimes?(fs2.lutimes=function(path,at,mt,cb){fs2.open(path,constants.O_SYMLINK,function(er,fd){if(er){cb&&cb(er);return}fs2.futimes(fd,at,mt,function(er2){fs2.close(fd,function(er22){cb&&cb(er2||er22)})})})},fs2.lutimesSync=function(path,at,mt){var fd=fs2.openSync(path,constants.O_SYMLINK),ret,threw=!0;try{ret=fs2.futimesSync(fd,at,mt),threw=!1}finally{if(threw)try{fs2.closeSync(fd)}catch{}else fs2.closeSync(fd)}return ret}):fs2.futimes&&(fs2.lutimes=function(_a,_b,_c,cb){cb&&process.nextTick(cb)},fs2.lutimesSync=function(){})}function chmodFix(orig){return orig&&function(target,mode,cb){return orig.call(fs,target,mode,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chmodFixSync(orig){return orig&&function(target,mode){try{return orig.call(fs,target,mode)}catch(er){if(!chownErOk(er))throw er}}}function chownFix(orig){return orig&&function(target,uid,gid,cb){return orig.call(fs,target,uid,gid,function(er){chownErOk(er)&&(er=null),cb&&cb.apply(this,arguments)})}}function chownFixSync(orig){return orig&&function(target,uid,gid){try{return orig.call(fs,target,uid,gid)}catch(er){if(!chownErOk(er))throw er}}}function statFix(orig){return orig&&function(target,options,cb){typeof options=="function"&&(cb=options,options=null);function callback(er,stats){stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),cb&&cb.apply(this,arguments)}return options?orig.call(fs,target,options,callback):orig.call(fs,target,callback)}}function statFixSync(orig){return orig&&function(target,options){var stats=options?orig.call(fs,target,options):orig.call(fs,target);return stats&&(stats.uid<0&&(stats.uid+=4294967296),stats.gid<0&&(stats.gid+=4294967296)),stats}}function chownErOk(er){if(!er||er.code==="ENOSYS")return!0;var nonroot=!process.getuid||process.getuid()!==0;return!!(nonroot&&(er.code==="EINVAL"||er.code==="EPERM"))}}}});var require_legacy_streams=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports,module){var Stream=__require("stream").Stream;module.exports=legacy;function legacy(fs){return{ReadStream,WriteStream};function ReadStream(path,options){if(!(this instanceof ReadStream))return new ReadStream(path,options);Stream.call(this);var self=this;this.path=path,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){self._read()});return}fs.open(this.path,this.flags,this.mode,function(err,fd){if(err){self.emit("error",err),self.readable=!1;return}self.fd=fd,self.emit("open",fd),self._read()})}function WriteStream(path,options){if(!(this instanceof WriteStream))return new WriteStream(path,options);Stream.call(this),this.path=path,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,options=options||{};for(var keys=Object.keys(options),index=0,length=keys.length;index<length;index++){var key=keys[index];this[key]=options[key]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=fs.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}});var require_clone=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js"(exports,module){"use strict";module.exports=clone;var getPrototypeOf=Object.getPrototypeOf||function(obj){return obj.__proto__};function clone(obj){if(obj===null||typeof obj!="object")return obj;if(obj instanceof Object)var copy={__proto__:getPrototypeOf(obj)};else var copy=Object.create(null);return Object.getOwnPropertyNames(obj).forEach(function(key){Object.defineProperty(copy,key,Object.getOwnPropertyDescriptor(obj,key))}),copy}}});var require_graceful_fs=__commonJS({"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports,module){var fs=__require("fs"),polyfills=require_polyfills(),legacy=require_legacy_streams(),clone=require_clone(),util=__require("util"),gracefulQueue,previousSymbol;typeof Symbol=="function"&&typeof Symbol.for=="function"?(gracefulQueue=Symbol.for("graceful-fs.queue"),previousSymbol=Symbol.for("graceful-fs.previous")):(gracefulQueue="___graceful-fs.queue",previousSymbol="___graceful-fs.previous");function noop(){}function publishQueue(context,queue2){Object.defineProperty(context,gracefulQueue,{get:function(){return queue2}})}var debug=noop;util.debuglog?debug=util.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(debug=function(){var m=util.format.apply(util,arguments);m="GFS4: "+m.split(/\n/).join(`
|
|
8
|
+
GFS4: `),console.error(m)});fs[gracefulQueue]||(queue=global[gracefulQueue]||[],publishQueue(fs,queue),fs.close=function(fs$close){function close(fd,cb){return fs$close.call(fs,fd,function(err){err||resetQueue(),typeof cb=="function"&&cb.apply(this,arguments)})}return Object.defineProperty(close,previousSymbol,{value:fs$close}),close}(fs.close),fs.closeSync=function(fs$closeSync){function closeSync(fd){fs$closeSync.apply(fs,arguments),resetQueue()}return Object.defineProperty(closeSync,previousSymbol,{value:fs$closeSync}),closeSync}(fs.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){debug(fs[gracefulQueue]),__require("assert").equal(fs[gracefulQueue].length,0)}));var queue;global[gracefulQueue]||publishQueue(global,fs[gracefulQueue]);module.exports=patch(clone(fs));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fs.__patched&&(module.exports=patch(fs),fs.__patched=!0);function patch(fs2){polyfills(fs2),fs2.gracefulify=patch,fs2.createReadStream=createReadStream,fs2.createWriteStream=createWriteStream;var fs$readFile=fs2.readFile;fs2.readFile=readFile;function readFile(path,options,cb){return typeof options=="function"&&(cb=options,options=null),go$readFile(path,options,cb);function go$readFile(path2,options2,cb2,startTime){return fs$readFile(path2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$readFile,[path2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$writeFile=fs2.writeFile;fs2.writeFile=writeFile;function writeFile(path,data,options,cb){return typeof options=="function"&&(cb=options,options=null),go$writeFile(path,data,options,cb);function go$writeFile(path2,data2,options2,cb2,startTime){return fs$writeFile(path2,data2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$writeFile,[path2,data2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$appendFile=fs2.appendFile;fs$appendFile&&(fs2.appendFile=appendFile);function appendFile(path,data,options,cb){return typeof options=="function"&&(cb=options,options=null),go$appendFile(path,data,options,cb);function go$appendFile(path2,data2,options2,cb2,startTime){return fs$appendFile(path2,data2,options2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$appendFile,[path2,data2,options2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$copyFile=fs2.copyFile;fs$copyFile&&(fs2.copyFile=copyFile);function copyFile(src,dest,flags,cb){return typeof flags=="function"&&(cb=flags,flags=0),go$copyFile(src,dest,flags,cb);function go$copyFile(src2,dest2,flags2,cb2,startTime){return fs$copyFile(src2,dest2,flags2,function(err){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$copyFile,[src2,dest2,flags2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}var fs$readdir=fs2.readdir;fs2.readdir=readdir;var noReaddirOptionVersions=/^v[0-5]\./;function readdir(path,options,cb){typeof options=="function"&&(cb=options,options=null);var go$readdir=noReaddirOptionVersions.test(process.version)?function(path2,options2,cb2,startTime){return fs$readdir(path2,fs$readdirCallback(path2,options2,cb2,startTime))}:function(path2,options2,cb2,startTime){return fs$readdir(path2,options2,fs$readdirCallback(path2,options2,cb2,startTime))};return go$readdir(path,options,cb);function fs$readdirCallback(path2,options2,cb2,startTime){return function(err,files){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$readdir,[path2,options2,cb2],err,startTime||Date.now(),Date.now()]):(files&&files.sort&&files.sort(),typeof cb2=="function"&&cb2.call(this,err,files))}}}if(process.version.substr(0,4)==="v0.8"){var legStreams=legacy(fs2);ReadStream=legStreams.ReadStream,WriteStream=legStreams.WriteStream}var fs$ReadStream=fs2.ReadStream;fs$ReadStream&&(ReadStream.prototype=Object.create(fs$ReadStream.prototype),ReadStream.prototype.open=ReadStream$open);var fs$WriteStream=fs2.WriteStream;fs$WriteStream&&(WriteStream.prototype=Object.create(fs$WriteStream.prototype),WriteStream.prototype.open=WriteStream$open),Object.defineProperty(fs2,"ReadStream",{get:function(){return ReadStream},set:function(val){ReadStream=val},enumerable:!0,configurable:!0}),Object.defineProperty(fs2,"WriteStream",{get:function(){return WriteStream},set:function(val){WriteStream=val},enumerable:!0,configurable:!0});var FileReadStream=ReadStream;Object.defineProperty(fs2,"FileReadStream",{get:function(){return FileReadStream},set:function(val){FileReadStream=val},enumerable:!0,configurable:!0});var FileWriteStream=WriteStream;Object.defineProperty(fs2,"FileWriteStream",{get:function(){return FileWriteStream},set:function(val){FileWriteStream=val},enumerable:!0,configurable:!0});function ReadStream(path,options){return this instanceof ReadStream?(fs$ReadStream.apply(this,arguments),this):ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var that=this;open(that.path,that.flags,that.mode,function(err,fd){err?(that.autoClose&&that.destroy(),that.emit("error",err)):(that.fd=fd,that.emit("open",fd),that.read())})}function WriteStream(path,options){return this instanceof WriteStream?(fs$WriteStream.apply(this,arguments),this):WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var that=this;open(that.path,that.flags,that.mode,function(err,fd){err?(that.destroy(),that.emit("error",err)):(that.fd=fd,that.emit("open",fd))})}function createReadStream(path,options){return new fs2.ReadStream(path,options)}function createWriteStream(path,options){return new fs2.WriteStream(path,options)}var fs$open=fs2.open;fs2.open=open;function open(path,flags,mode,cb){return typeof mode=="function"&&(cb=mode,mode=null),go$open(path,flags,mode,cb);function go$open(path2,flags2,mode2,cb2,startTime){return fs$open(path2,flags2,mode2,function(err,fd){err&&(err.code==="EMFILE"||err.code==="ENFILE")?enqueue([go$open,[path2,flags2,mode2,cb2],err,startTime||Date.now(),Date.now()]):typeof cb2=="function"&&cb2.apply(this,arguments)})}}return fs2}function enqueue(elem){debug("ENQUEUE",elem[0].name,elem[1]),fs[gracefulQueue].push(elem),retry()}var retryTimer;function resetQueue(){for(var now=Date.now(),i=0;i<fs[gracefulQueue].length;++i)fs[gracefulQueue][i].length>2&&(fs[gracefulQueue][i][3]=now,fs[gracefulQueue][i][4]=now);retry()}function retry(){if(clearTimeout(retryTimer),retryTimer=void 0,fs[gracefulQueue].length!==0){var elem=fs[gracefulQueue].shift(),fn=elem[0],args=elem[1],err=elem[2],startTime=elem[3],lastTime=elem[4];if(startTime===void 0)debug("RETRY",fn.name,args),fn.apply(null,args);else if(Date.now()-startTime>=6e4){debug("TIMEOUT",fn.name,args);var cb=args.pop();typeof cb=="function"&&cb.call(null,err)}else{var sinceAttempt=Date.now()-lastTime,sinceStart=Math.max(lastTime-startTime,1),desiredDelay=Math.min(sinceStart*1.2,100);sinceAttempt>=desiredDelay?(debug("RETRY",fn.name,args),fn.apply(null,args.concat([startTime]))):fs[gracefulQueue].push(elem)}retryTimer===void 0&&(retryTimer=setTimeout(retry,0))}}}});var require_strip_bom=__commonJS({"../../node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js"(exports,module){"use strict";module.exports=x=>{if(typeof x!="string")throw new TypeError("Expected a string, got "+typeof x);return x.charCodeAt(0)===65279?x.slice(1):x}}});var require_is_arrayish=__commonJS({"../../node_modules/.pnpm/is-arrayish@0.2.1/node_modules/is-arrayish/index.js"(exports,module){"use strict";module.exports=function(obj){return obj?obj instanceof Array||Array.isArray(obj)||obj.length>=0&&obj.splice instanceof Function:!1}}});var require_error_ex=__commonJS({"../../node_modules/.pnpm/error-ex@1.3.4/node_modules/error-ex/index.js"(exports,module){"use strict";var util=__require("util"),isArrayish=require_is_arrayish(),errorEx=function(name,properties){(!name||name.constructor!==String)&&(properties=name||{},name=Error.name);var errorExError=function ErrorEXError(message){if(!this)return new ErrorEXError(message);message=message instanceof Error?message.message:message||this.message,Error.call(this,message),Error.captureStackTrace(this,errorExError),this.name=name,Object.defineProperty(this,"message",{configurable:!0,enumerable:!1,get:function(){var newMessage=message.split(/\r?\n/g);for(var key in properties)if(properties.hasOwnProperty(key)){var modifier=properties[key];"message"in modifier&&(newMessage=modifier.message(this[key],newMessage)||newMessage,isArrayish(newMessage)||(newMessage=[newMessage]))}return newMessage.join(`
|
|
8
9
|
`)},set:function(v){message=v}});var overwrittenStack=null,stackDescriptor=Object.getOwnPropertyDescriptor(this,"stack"),stackGetter=stackDescriptor.get,stackValue=stackDescriptor.value;delete stackDescriptor.value,delete stackDescriptor.writable,stackDescriptor.set=function(newstack){overwrittenStack=newstack},stackDescriptor.get=function(){var stack=(overwrittenStack||(stackGetter?stackGetter.call(this):stackValue)).split(/\r?\n+/g);overwrittenStack||(stack[0]=this.name+": "+this.message);var lineCount=1;for(var key in properties)if(properties.hasOwnProperty(key)){var modifier=properties[key];if("line"in modifier){var line=modifier.line(this[key]);line&&stack.splice(lineCount++,0," "+line)}"stack"in modifier&&modifier.stack(this[key],stack)}return stack.join(`
|
|
9
10
|
`)},Object.defineProperty(this,"stack",stackDescriptor)};return Object.setPrototypeOf?(Object.setPrototypeOf(errorExError.prototype,Error.prototype),Object.setPrototypeOf(errorExError,Error)):util.inherits(errorExError,Error),errorExError};errorEx.append=function(str,def){return{message:function(v,message){return v=v||def,v&&(message[0]+=" "+str.replace("%s",v.toString())),message}}};errorEx.line=function(str,def){return{line:function(v){return v=v||def,v?str.replace("%s",v.toString()):null}}};module.exports=errorEx}});var require_unicode=__commonJS({"../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/vendor/unicode.js"(exports,module){var Uni=module.exports;module.exports.isWhiteSpace=function(x){return x===" "||x==="\xA0"||x==="\uFEFF"||x>=" "&&x<="\r"||x==="\u1680"||x==="\u180E"||x>="\u2000"&&x<="\u200A"||x==="\u2028"||x==="\u2029"||x==="\u202F"||x==="\u205F"||x==="\u3000"};module.exports.isWhiteSpaceJSON=function(x){return x===" "||x===" "||x===`
|
|
10
11
|
`||x==="\r"};module.exports.isLineTerminator=function(x){return x===`
|
|
@@ -13,4 +14,4 @@ import{require_graceful_fs}from"./chunk-VKPZP4LC.js";import{__commonJS,__require
|
|
|
13
14
|
`,r:"\r",t:" ",v:"\v","/":"/"};function formatError(input,msg,position,lineno,column,json5){var result=msg+" at "+(lineno+1)+":"+(column+1),tmppos=position-column-1,srcline="",underline="",isLineTerminator=json5?Uni.isLineTerminator:Uni.isLineTerminatorJSON;for(tmppos<position-70&&(tmppos=position-70);;){var chr=input[++tmppos];if(isLineTerminator(chr)||tmppos===input.length){position>=tmppos&&(underline+="^");break}if(srcline+=chr,position===tmppos?underline+="^":position>tmppos&&(underline+=input[tmppos]===" "?" ":" "),srcline.length>78)break}return result+`
|
|
14
15
|
`+srcline+`
|
|
15
16
|
`+underline}function parse(input,options){var json5=!(options.mode==="json"||options.legacy),isLineTerminator=json5?Uni.isLineTerminator:Uni.isLineTerminatorJSON,isWhiteSpace=json5?Uni.isWhiteSpace:Uni.isWhiteSpaceJSON,length=input.length,lineno=0,linestart=0,position=0,stack=[],tokenStart=function(){},tokenEnd=function(v){return v};options._tokenize&&function(){var start=null;tokenStart=function(){if(start!==null)throw Error("internal error, token overlap");start=position},tokenEnd=function(v,type){if(start!=position){var hash={raw:input.substr(start,position-start),type,stack:stack.slice(0)};v!==void 0&&(hash.value=v),options._tokenize.call(null,hash)}return start=null,v}}();function fail(msg){var column=position-linestart;if(!msg)if(position<length){var token="'"+JSON.stringify(input[position]).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";msg||(msg="Unexpected token "+token)}else msg||(msg="Unexpected end of input");var error=SyntaxError(formatError(input,msg,position,lineno,column,json5));throw error.row=lineno+1,error.column=column+1,error}function newline(chr){chr==="\r"&&input[position]===`
|
|
16
|
-
`&&position++,linestart=position,lineno++}function parseGeneric(){for(var result;position<length;){tokenStart();var chr=input[position++];return chr==='"'||chr==="'"&&json5?tokenEnd(parseString(chr),"literal"):chr==="{"?(tokenEnd(void 0,"separator"),parseObject()):chr==="["?(tokenEnd(void 0,"separator"),parseArray()):chr==="-"||chr==="."||isDecDigit(chr)||json5&&(chr==="+"||chr==="I"||chr==="N")?tokenEnd(parseNumber(),"literal"):chr==="n"?(parseKeyword("null"),tokenEnd(null,"literal")):chr==="t"?(parseKeyword("true"),tokenEnd(!0,"literal")):chr==="f"?(parseKeyword("false"),tokenEnd(!1,"literal")):(position--,tokenEnd(void 0))}}function parseKey(){for(var result;position<length;){tokenStart();var chr=input[position++];if(chr==='"'||chr==="'"&&json5)return tokenEnd(parseString(chr),"key");if(chr==="{")return tokenEnd(void 0,"separator"),parseObject();if(chr==="[")return tokenEnd(void 0,"separator"),parseArray();if(chr==="."||isDecDigit(chr))return tokenEnd(parseNumber(!0),"key");if(json5&&Uni.isIdentifierStart(chr)||chr==="\\"&&input[position]==="u"){var rollback=position-1,result=parseIdentifier();return result===void 0?(position=rollback,tokenEnd(void 0)):tokenEnd(result,"key")}else return position--,tokenEnd(void 0)}}function skipWhiteSpace(){for(tokenStart();position<length;){var chr=input[position++];if(isLineTerminator(chr))position--,tokenEnd(void 0,"whitespace"),tokenStart(),position++,newline(chr),tokenEnd(void 0,"newline"),tokenStart();else if(!isWhiteSpace(chr))if(chr==="/"&&json5&&(input[position]==="/"||input[position]==="*"))position--,tokenEnd(void 0,"whitespace"),tokenStart(),position++,skipComment(input[position++]==="*"),tokenEnd(void 0,"comment"),tokenStart();else{position--;break}}return tokenEnd(void 0,"whitespace")}function skipComment(multi){for(;position<length;){var chr=input[position++];if(isLineTerminator(chr)){if(!multi){position--;return}newline(chr)}else if(chr==="*"&&multi&&input[position]==="/"){position++;return}}multi&&fail("Unclosed multiline comment")}function parseKeyword(keyword){for(var _pos=position,len=keyword.length,i=1;i<len;i++)(position>=length||keyword[i]!=input[position])&&(position=_pos-1,fail()),position++}function parseObject(){for(var result=options.null_prototype?Object.create(null):{},empty_object={},is_non_empty=!1;position<length;){skipWhiteSpace();var item1=parseKey();skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),chr==="}"&&item1===void 0)return!json5&&is_non_empty&&(position--,fail("Trailing comma in object")),result;if(chr===":"&&item1!==void 0){skipWhiteSpace(),stack.push(item1);var item2=parseGeneric();stack.pop(),item2===void 0&&fail("No value found for key "+item1),typeof item1!="string"&&(!json5||typeof item1!="number")&&fail("Wrong key type: "+item1),(item1 in empty_object||empty_object[item1]!=null)&&options.reserved_keys!=="replace"?options.reserved_keys==="throw"&&fail("Reserved key: "+item1):(typeof options.reviver=="function"&&(item2=options.reviver.call(null,item1,item2)),item2!==void 0&&(is_non_empty=!0,Object.defineProperty(result,item1,{value:item2,enumerable:!0,configurable:!0,writable:!0}))),skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),chr===",")continue;if(chr==="}")return result;fail()}else position--,fail()}fail()}function parseArray(){for(var result=[];position<length;){skipWhiteSpace(),stack.push(result.length);var item=parseGeneric();stack.pop(),skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),item!==void 0&&(typeof options.reviver=="function"&&(item=options.reviver.call(null,String(result.length),item)),item===void 0?(result.length++,item=!0):result.push(item)),chr===",")item===void 0&&fail("Elisions are not supported");else{if(chr==="]")return!json5&&item===void 0&&result.length&&(position--,fail("Trailing comma in array")),result;position--,fail()}}}function parseNumber(){position--;var start=position,chr=input[position++],t,to_num=function(is_octal2){var str=input.substr(start,position-start);if(is_octal2)var result=parseInt(str.replace(/^0o?/,""),8);else var result=Number(str);if(Number.isNaN(result))position--,fail('Bad numeric literal - "'+input.substr(start,position-start+1)+'"');else if(!json5&&!str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i))position--,fail('Non-json numeric literal - "'+input.substr(start,position-start+1)+'"');else return result};if((chr==="-"||chr==="+"&&json5)&&(chr=input[position++]),chr==="N"&&json5)return parseKeyword("NaN"),NaN;if(chr==="I"&&json5)return parseKeyword("Infinity"),to_num();if(chr>="1"&&chr<="9"){for(;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}if(chr==="0"){chr=input[position++];var is_octal=chr==="o"||chr==="O"||isOctDigit(chr),is_hex=chr==="x"||chr==="X";if(json5&&(is_octal||is_hex)){for(;position<length&&(is_hex?isHexDigit:isOctDigit)(input[position]);)position++;var sign=1;return input[start]==="-"?(sign=-1,start++):input[start]==="+"&&start++,sign*to_num(is_octal)}}if(chr==="."){for(;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}if(chr==="e"||chr==="E"){for(chr=input[position++],(chr==="-"||chr==="+")&&position++;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}return position--,to_num()}function parseIdentifier(){position--;for(var result="";position<length;){var chr=input[position++];if(chr==="\\"&&input[position]==="u"&&isHexDigit(input[position+1])&&isHexDigit(input[position+2])&&isHexDigit(input[position+3])&&isHexDigit(input[position+4])&&(chr=String.fromCharCode(parseInt(input.substr(position+1,4),16)),position+=5),result.length)if(Uni.isIdentifierPart(chr))result+=chr;else return position--,result;else if(Uni.isIdentifierStart(chr))result+=chr;else return}fail()}function parseString(endChar){for(var result="";position<length;){var chr=input[position++];if(chr===endChar)return result;if(chr==="\\")if(position>=length&&fail(),chr=input[position++],unescapeMap[chr]&&(json5||chr!="v"&&chr!="'"))result+=unescapeMap[chr];else if(json5&&isLineTerminator(chr))newline(chr);else if(chr==="u"||chr==="x"&&json5){for(var off=chr==="u"?4:2,i=0;i<off;i++)position>=length&&fail(),isHexDigit(input[position])||fail("Bad escape sequence"),position++;result+=String.fromCharCode(parseInt(input.substr(position-off,off),16))}else if(json5&&isOctDigit(chr)){if(chr<"4"&&isOctDigit(input[position])&&isOctDigit(input[position+1]))var digits=3;else if(isOctDigit(input[position]))var digits=2;else var digits=1;position+=digits-1,result+=String.fromCharCode(parseInt(input.substr(position-digits,digits),8))}else json5?result+=chr:(position--,fail());else isLineTerminator(chr)?fail():(!json5&&chr.charCodeAt(0)<32&&(position--,fail("Unexpected control character")),result+=chr)}fail()}skipWhiteSpace();var return_value=parseGeneric();if(return_value!==void 0||position<length){if(skipWhiteSpace(),position>=length)return typeof options.reviver=="function"&&(return_value=options.reviver.call(null,"",return_value)),return_value;fail()}else fail(position?"No data, only a whitespace":"No data, empty input")}module.exports.parse=function(input,options){if(typeof options=="function"&&(options={reviver:options}),input!==void 0){typeof input!="string"&&(input=String(input)),options==null&&(options={}),options.reserved_keys==null&&(options.reserved_keys="ignore"),(options.reserved_keys==="throw"||options.reserved_keys==="ignore")&&options.null_prototype==null&&(options.null_prototype=!0);try{return parse(input,options)}catch(err){if(err instanceof SyntaxError&&err.row!=null&&err.column!=null){var old_err=err;err=SyntaxError(old_err.message),err.column=old_err.column,err.row=old_err.row}throw err}}};module.exports.tokenize=function(input,options){options==null&&(options={}),options._tokenize=function(smth){options._addstack&&smth.stack.unshift.apply(smth.stack,options._addstack),tokens.push(smth)};var tokens=[];return tokens.data=module.exports.parse(input,options),tokens}}});var require_parse_json=__commonJS({"../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js"(exports,module){"use strict";var errorEx=require_error_ex(),fallback=require_parse();function appendPosition(message){let posRe=/ at (\d+:\d+) in/,numbers=posRe.exec(message);return message.replace(posRe," in")+":"+numbers[1]}var JSONError=errorEx("JSONError",{fileName:errorEx.append("in %s"),appendPosition:{message:(shouldAppend,original)=>(shouldAppend&&(original[0]=appendPosition(original[0])),original)}});module.exports=(input,reviver,filename)=>{typeof reviver=="string"&&(filename=reviver,reviver=null);try{try{return JSON.parse(input,reviver)}catch(err){throw fallback.parse(input,{mode:"json",reviver}),err}}catch(err){let jsonErr=new JSONError(err);throw filename&&(jsonErr.fileName=filename,jsonErr.appendPosition=!0),jsonErr}}}});var require_pify=__commonJS({"../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=function(fn,P,opts){return function(){for(var that=this,args=new Array(arguments.length),i=0;i<arguments.length;i++)args[i]=arguments[i];return new P(function(resolve,reject){args.push(function(err,result){if(err)reject(err);else if(opts.multiArgs){for(var results=new Array(arguments.length-1),i2=1;i2<arguments.length;i2++)results[i2-1]=arguments[i2];resolve(results)}else resolve(result)}),fn.apply(that,args)})}},pify=module.exports=function(obj,P,opts){typeof P!="function"&&(opts=P,P=Promise),opts=opts||{},opts.exclude=opts.exclude||[/.+Sync$/];var filter=function(key){var match=function(pattern){return typeof pattern=="string"?key===pattern:pattern.test(key)};return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret=typeof obj=="function"?function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,P,opts).apply(this,arguments)}:{};return Object.keys(obj).reduce(function(ret2,key){var x=obj[key];return ret2[key]=typeof x=="function"&&filter(key)?processFn(x,P,opts):x,ret2},ret)};pify.all=pify}});var require_load_json_file=__commonJS({"../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),stripBom=require_strip_bom(),parseJson=require_parse_json(),pify=require_pify(),parse=(data,fp)=>parseJson(stripBom(data),path.relative(".",fp));module.exports=fp=>pify(fs.readFile)(fp,"utf8").then(data=>parse(data,fp));module.exports.sync=fp=>parse(fs.readFileSync(fp,"utf8"),fp)}});export{require_pify,require_load_json_file};
|
|
17
|
+
`&&position++,linestart=position,lineno++}function parseGeneric(){for(var result;position<length;){tokenStart();var chr=input[position++];return chr==='"'||chr==="'"&&json5?tokenEnd(parseString(chr),"literal"):chr==="{"?(tokenEnd(void 0,"separator"),parseObject()):chr==="["?(tokenEnd(void 0,"separator"),parseArray()):chr==="-"||chr==="."||isDecDigit(chr)||json5&&(chr==="+"||chr==="I"||chr==="N")?tokenEnd(parseNumber(),"literal"):chr==="n"?(parseKeyword("null"),tokenEnd(null,"literal")):chr==="t"?(parseKeyword("true"),tokenEnd(!0,"literal")):chr==="f"?(parseKeyword("false"),tokenEnd(!1,"literal")):(position--,tokenEnd(void 0))}}function parseKey(){for(var result;position<length;){tokenStart();var chr=input[position++];if(chr==='"'||chr==="'"&&json5)return tokenEnd(parseString(chr),"key");if(chr==="{")return tokenEnd(void 0,"separator"),parseObject();if(chr==="[")return tokenEnd(void 0,"separator"),parseArray();if(chr==="."||isDecDigit(chr))return tokenEnd(parseNumber(!0),"key");if(json5&&Uni.isIdentifierStart(chr)||chr==="\\"&&input[position]==="u"){var rollback=position-1,result=parseIdentifier();return result===void 0?(position=rollback,tokenEnd(void 0)):tokenEnd(result,"key")}else return position--,tokenEnd(void 0)}}function skipWhiteSpace(){for(tokenStart();position<length;){var chr=input[position++];if(isLineTerminator(chr))position--,tokenEnd(void 0,"whitespace"),tokenStart(),position++,newline(chr),tokenEnd(void 0,"newline"),tokenStart();else if(!isWhiteSpace(chr))if(chr==="/"&&json5&&(input[position]==="/"||input[position]==="*"))position--,tokenEnd(void 0,"whitespace"),tokenStart(),position++,skipComment(input[position++]==="*"),tokenEnd(void 0,"comment"),tokenStart();else{position--;break}}return tokenEnd(void 0,"whitespace")}function skipComment(multi){for(;position<length;){var chr=input[position++];if(isLineTerminator(chr)){if(!multi){position--;return}newline(chr)}else if(chr==="*"&&multi&&input[position]==="/"){position++;return}}multi&&fail("Unclosed multiline comment")}function parseKeyword(keyword){for(var _pos=position,len=keyword.length,i=1;i<len;i++)(position>=length||keyword[i]!=input[position])&&(position=_pos-1,fail()),position++}function parseObject(){for(var result=options.null_prototype?Object.create(null):{},empty_object={},is_non_empty=!1;position<length;){skipWhiteSpace();var item1=parseKey();skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),chr==="}"&&item1===void 0)return!json5&&is_non_empty&&(position--,fail("Trailing comma in object")),result;if(chr===":"&&item1!==void 0){skipWhiteSpace(),stack.push(item1);var item2=parseGeneric();stack.pop(),item2===void 0&&fail("No value found for key "+item1),typeof item1!="string"&&(!json5||typeof item1!="number")&&fail("Wrong key type: "+item1),(item1 in empty_object||empty_object[item1]!=null)&&options.reserved_keys!=="replace"?options.reserved_keys==="throw"&&fail("Reserved key: "+item1):(typeof options.reviver=="function"&&(item2=options.reviver.call(null,item1,item2)),item2!==void 0&&(is_non_empty=!0,Object.defineProperty(result,item1,{value:item2,enumerable:!0,configurable:!0,writable:!0}))),skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),chr===",")continue;if(chr==="}")return result;fail()}else position--,fail()}fail()}function parseArray(){for(var result=[];position<length;){skipWhiteSpace(),stack.push(result.length);var item=parseGeneric();stack.pop(),skipWhiteSpace(),tokenStart();var chr=input[position++];if(tokenEnd(void 0,"separator"),item!==void 0&&(typeof options.reviver=="function"&&(item=options.reviver.call(null,String(result.length),item)),item===void 0?(result.length++,item=!0):result.push(item)),chr===",")item===void 0&&fail("Elisions are not supported");else{if(chr==="]")return!json5&&item===void 0&&result.length&&(position--,fail("Trailing comma in array")),result;position--,fail()}}}function parseNumber(){position--;var start=position,chr=input[position++],t,to_num=function(is_octal2){var str=input.substr(start,position-start);if(is_octal2)var result=parseInt(str.replace(/^0o?/,""),8);else var result=Number(str);if(Number.isNaN(result))position--,fail('Bad numeric literal - "'+input.substr(start,position-start+1)+'"');else if(!json5&&!str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i))position--,fail('Non-json numeric literal - "'+input.substr(start,position-start+1)+'"');else return result};if((chr==="-"||chr==="+"&&json5)&&(chr=input[position++]),chr==="N"&&json5)return parseKeyword("NaN"),NaN;if(chr==="I"&&json5)return parseKeyword("Infinity"),to_num();if(chr>="1"&&chr<="9"){for(;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}if(chr==="0"){chr=input[position++];var is_octal=chr==="o"||chr==="O"||isOctDigit(chr),is_hex=chr==="x"||chr==="X";if(json5&&(is_octal||is_hex)){for(;position<length&&(is_hex?isHexDigit:isOctDigit)(input[position]);)position++;var sign=1;return input[start]==="-"?(sign=-1,start++):input[start]==="+"&&start++,sign*to_num(is_octal)}}if(chr==="."){for(;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}if(chr==="e"||chr==="E"){for(chr=input[position++],(chr==="-"||chr==="+")&&position++;position<length&&isDecDigit(input[position]);)position++;chr=input[position++]}return position--,to_num()}function parseIdentifier(){position--;for(var result="";position<length;){var chr=input[position++];if(chr==="\\"&&input[position]==="u"&&isHexDigit(input[position+1])&&isHexDigit(input[position+2])&&isHexDigit(input[position+3])&&isHexDigit(input[position+4])&&(chr=String.fromCharCode(parseInt(input.substr(position+1,4),16)),position+=5),result.length)if(Uni.isIdentifierPart(chr))result+=chr;else return position--,result;else if(Uni.isIdentifierStart(chr))result+=chr;else return}fail()}function parseString(endChar){for(var result="";position<length;){var chr=input[position++];if(chr===endChar)return result;if(chr==="\\")if(position>=length&&fail(),chr=input[position++],unescapeMap[chr]&&(json5||chr!="v"&&chr!="'"))result+=unescapeMap[chr];else if(json5&&isLineTerminator(chr))newline(chr);else if(chr==="u"||chr==="x"&&json5){for(var off=chr==="u"?4:2,i=0;i<off;i++)position>=length&&fail(),isHexDigit(input[position])||fail("Bad escape sequence"),position++;result+=String.fromCharCode(parseInt(input.substr(position-off,off),16))}else if(json5&&isOctDigit(chr)){if(chr<"4"&&isOctDigit(input[position])&&isOctDigit(input[position+1]))var digits=3;else if(isOctDigit(input[position]))var digits=2;else var digits=1;position+=digits-1,result+=String.fromCharCode(parseInt(input.substr(position-digits,digits),8))}else json5?result+=chr:(position--,fail());else isLineTerminator(chr)?fail():(!json5&&chr.charCodeAt(0)<32&&(position--,fail("Unexpected control character")),result+=chr)}fail()}skipWhiteSpace();var return_value=parseGeneric();if(return_value!==void 0||position<length){if(skipWhiteSpace(),position>=length)return typeof options.reviver=="function"&&(return_value=options.reviver.call(null,"",return_value)),return_value;fail()}else fail(position?"No data, only a whitespace":"No data, empty input")}module.exports.parse=function(input,options){if(typeof options=="function"&&(options={reviver:options}),input!==void 0){typeof input!="string"&&(input=String(input)),options==null&&(options={}),options.reserved_keys==null&&(options.reserved_keys="ignore"),(options.reserved_keys==="throw"||options.reserved_keys==="ignore")&&options.null_prototype==null&&(options.null_prototype=!0);try{return parse(input,options)}catch(err){if(err instanceof SyntaxError&&err.row!=null&&err.column!=null){var old_err=err;err=SyntaxError(old_err.message),err.column=old_err.column,err.row=old_err.row}throw err}}};module.exports.tokenize=function(input,options){options==null&&(options={}),options._tokenize=function(smth){options._addstack&&smth.stack.unshift.apply(smth.stack,options._addstack),tokens.push(smth)};var tokens=[];return tokens.data=module.exports.parse(input,options),tokens}}});var require_parse_json=__commonJS({"../../node_modules/.pnpm/parse-json@3.0.0/node_modules/parse-json/index.js"(exports,module){"use strict";var errorEx=require_error_ex(),fallback=require_parse();function appendPosition(message){let posRe=/ at (\d+:\d+) in/,numbers=posRe.exec(message);return message.replace(posRe," in")+":"+numbers[1]}var JSONError=errorEx("JSONError",{fileName:errorEx.append("in %s"),appendPosition:{message:(shouldAppend,original)=>(shouldAppend&&(original[0]=appendPosition(original[0])),original)}});module.exports=(input,reviver,filename)=>{typeof reviver=="string"&&(filename=reviver,reviver=null);try{try{return JSON.parse(input,reviver)}catch(err){throw fallback.parse(input,{mode:"json",reviver}),err}}catch(err){let jsonErr=new JSONError(err);throw filename&&(jsonErr.fileName=filename,jsonErr.appendPosition=!0),jsonErr}}}});var require_pify=__commonJS({"../../node_modules/.pnpm/pify@2.3.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=function(fn,P,opts){return function(){for(var that=this,args=new Array(arguments.length),i=0;i<arguments.length;i++)args[i]=arguments[i];return new P(function(resolve,reject){args.push(function(err,result){if(err)reject(err);else if(opts.multiArgs){for(var results=new Array(arguments.length-1),i2=1;i2<arguments.length;i2++)results[i2-1]=arguments[i2];resolve(results)}else resolve(result)}),fn.apply(that,args)})}},pify=module.exports=function(obj,P,opts){typeof P!="function"&&(opts=P,P=Promise),opts=opts||{},opts.exclude=opts.exclude||[/.+Sync$/];var filter=function(key){var match=function(pattern){return typeof pattern=="string"?key===pattern:pattern.test(key)};return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret=typeof obj=="function"?function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,P,opts).apply(this,arguments)}:{};return Object.keys(obj).reduce(function(ret2,key){var x=obj[key];return ret2[key]=typeof x=="function"&&filter(key)?processFn(x,P,opts):x,ret2},ret)};pify.all=pify}});var require_load_json_file=__commonJS({"../../node_modules/.pnpm/load-json-file@3.0.0/node_modules/load-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),stripBom=require_strip_bom(),parseJson=require_parse_json(),pify=require_pify(),parse=(data,fp)=>parseJson(stripBom(data),path.relative(".",fp));module.exports=fp=>pify(fs.readFile)(fp,"utf8").then(data=>parse(data,fp));module.exports.sync=fp=>parse(fs.readFileSync(fp,"utf8"),fp)}});export{require_graceful_fs,require_pify,require_load_json_file};
|
|
@@ -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{formatOption,jsonOption,limitOption,projectOption,sinceOption,untilOption}from"./chunk-ODB7LEAO.js";import{packageName}from"./chunk-JESNVRVR.js";var listSubcommand={name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},inspectSubcommand={name:"inspect",aliases:[],description:"Show details for a single alert group",arguments:[{name:"groupId",required:!0}],options:[formatOption,jsonOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Use team-wide scope (ignore linked project auto-scoping)."}],examples:[{name:"Inspect a group in the linked project",value:`${packageName} alerts inspect grp_abc123`},{name:"Inspect as JSON",value:`${packageName} alerts inspect grp_abc123 --json`}]},alertsCommand={name:"alerts",aliases:[],description:"List alert groups or inspect a group. To manage alert rules, see `vercel monitors`.",arguments:[],subcommands:[listSubcommand,inspectSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by alert type. Repeatable and comma-separated (for example --type usage_anomaly,error_anomaly)."},{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show team-wide alerts (ignore linked project auto-scoping)."},{name:"ai",shorthand:null,type:Boolean,deprecated:!1,description:"Print AI-focused sections (title, resolved time, summary, key findings) instead of table output."},{...sinceOption,description:`${sinceOption.description} (default: 24h ago)`},untilOption,limitOption,formatOption,jsonOption],examples:[{name:"List alerts for the linked project",value:`${packageName} alerts`},{name:"List team-wide alerts",value:`${packageName} alerts --all`},{name:"Filter by type",value:`${packageName} alerts --type usage_anomaly --type error_anomaly`},{name:"Output JSON",value:`${packageName} alerts --json`},{name:"Custom time range",value:`${packageName} alerts --since 2026-03-01T00:00:00.000Z --until 2026-03-02T00:00:00.000Z`}]};export{listSubcommand,inspectSubcommand,alertsCommand};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_dist as require_dist2}from"./chunk-JALVF3C2.js";import{confirmOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{require_dist as require_dist2}from"./chunk-JALVF3C2.js";import{confirmOption,projectOption,yesOption}from"./chunk-ODB7LEAO.js";import{packageName}from"./chunk-JESNVRVR.js";import{require_dist}from"./chunk-RM3ZDRYE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_listen=__toESM(require_dist2(),1),import_error_utils=__toESM(require_dist(),1),DEV_QUEUE_API_PREFIX="/api/v3/topic/",DEV_QUEUE_PROXY_PREFIX="/_svc/_queues",DEV_QUEUE_DEFAULT_PORT=4782,DEV_RUNTIME_CACHE_DEFAULT_PORT=4783,DEV_SCHEDULES_DEFAULT_PORT=4784,DEV_SCHEDULES_PROXY_PREFIX="/_svc/_schedules",DEV_RESOURCE_TOKEN="vc-dev-token";function isValidDevResourceHost(origin,host){let port=new URL(origin).port,suffix=port?`:${port}`:"",normalizedHost=host?.toLowerCase();return normalizedHost===`127.0.0.1${suffix}`||normalizedHost===`localhost${suffix}`}async function listenOnDevResourcePort(server,options){let isPinned=options.port!==void 0,reservedPorts=new Set(options.reservedPorts),port=options.port??options.defaultPort;for(;;){if(!isPinned&&reservedPorts.has(port)){if(port>=65535)throw new Error(`${options.name} could not find an available port at or above 127.0.0.1:${options.defaultPort}. Choose another port with ${options.flag}.`);port++;continue}try{let address=await(0,import_async_listen.listen)(server,port,"127.0.0.1"),url=new URL(address.toString()),serverAddress=server.address(),actualPort=serverAddress&&typeof serverAddress!="string"?serverAddress.port:Number(url.port);return{origin:url.origin,port:actualPort,...port!==options.defaultPort&&!isPinned?{defaultPort:options.defaultPort}:{}}}catch(err){if(!(0,import_error_utils.isErrnoException)(err)||err.code!=="EADDRINUSE")throw err;if(isPinned||port>=65535)throw new Error(`${options.name} could not listen on 127.0.0.1:${port} because the port is already in use. Choose another port with ${options.flag}.`);port++}}}function getDevQueueEnv(baseUrl,hasWorkerServices=!0){return{...hasWorkerServices?{VERCEL_HAS_WORKER_SERVICES:"1"}:{},VERCEL_QUEUE_BASE_URL:baseUrl,VERCEL_QUEUE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_REGION:"dev1"}}function getDevSchedulesEnv(baseUrl,container=!1){if(!baseUrl)return{};let endpoint=new URL(baseUrl);return container&&["localhost","127.0.0.1","[::1]"].includes(endpoint.hostname)&&(endpoint.hostname="host.docker.internal"),{VERCEL_SCHEDULE_BASE_URL:endpoint.toString().replace(/\/$/,""),VERCEL_SCHEDULE_TOKEN:DEV_RESOURCE_TOKEN,VERCEL_SCHEDULE_DEV_API_VERSION:"1"}}var devCommand={name:"dev",aliases:["develop"],description:`Starts the \`${packageName} dev\` server.`,arguments:[{name:"dir",required:!1}],options:[{name:"listen",description:"Specify a URI endpoint on which to listen (default: 0.0.0.0:3000)",argument:"URI",shorthand:"l",type:String,deprecated:!1},{name:"local",shorthand:"L",type:Boolean,deprecated:!1,description:"Start the dev server without linking to a Vercel project"},{name:"queue-port",description:`Specify the local Vercel Queues server port (default: ${DEV_QUEUE_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"runtime-cache-port",description:`Specify the local Runtime Cache server port (default: ${DEV_RUNTIME_CACHE_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},{name:"tunnel",shorthand:null,type:Boolean,deprecated:!1},{name:"schedules-port",description:`Specify the local Vercel Schedules server port (default: ${DEV_SCHEDULES_DEFAULT_PORT})`,argument:"PORT",shorthand:null,type:String,deprecated:!1},yesOption,{name:"port",shorthand:"p",type:String,deprecated:!0},confirmOption,projectOption],examples:[{name:`Start the \`${packageName} dev\` server on port 8080`,value:`${packageName} dev --listen 8080`},{name:"Make the `vercel dev` server bind to localhost on port 5000",value:`${packageName} dev --listen 127.0.0.1:5000 `},{name:"Pin local resource server ports",value:`${packageName} dev --queue-port 5782 --runtime-cache-port 5783 --schedules-port 5784`}]};export{DEV_QUEUE_API_PREFIX,DEV_QUEUE_PROXY_PREFIX,DEV_QUEUE_DEFAULT_PORT,DEV_RUNTIME_CACHE_DEFAULT_PORT,DEV_SCHEDULES_DEFAULT_PORT,DEV_SCHEDULES_PROXY_PREFIX,DEV_RESOURCE_TOKEN,isValidDevResourceHost,listenOnDevResourcePort,getDevQueueEnv,getDevSchedulesEnv,devCommand};
|
|
@@ -4,24 +4,24 @@ 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{buildCommandWithGlobalFlags
|
|
7
|
+
import{buildCommandWithGlobalFlags}from"./chunk-RH2SQQWH.js";import{printAlignedLabel}from"./chunk-WDWYKX2I.js";import{quoteArg}from"./chunk-F53OKXYI.js";import{output_manager_default}from"./chunk-UGZ3HFHI.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var CRITICAL_DELIVERY_DESCRIPTION="Critical only (escalated by Vercel Agent)";function formatMinimumSeverity(notification){let level=notification.minimumSeverityLevel;return level==="critical"?CRITICAL_DELIVERY_DESCRIPTION:level?`${level[0].toUpperCase()}${level.slice(1)} and above`:notification.type==="webhook"&&!("url"in notification.webhook)?"Details unavailable":"Monitor setting"}function formatProjectScope(scope){return scope.type==="all"?"all projects":`${scope.projectName} (${scope.projectId})`}function formatNotificationExpanded(notification,index){if(notification.type==="slack")return[` ${index+1}. ${import_chalk.default.bold("Slack")} ${import_chalk.default.cyan(`#${notification.channelName}`)}`,` ${import_chalk.default.dim("Project scope:")} ${formatProjectScope(notification.projectScope)}`,` ${import_chalk.default.dim("Channel ID:")} ${notification.channelId}`,` ${import_chalk.default.dim("Slack installation ID:")} ${notification.configId}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
|
|
8
8
|
`);let{webhook}=notification;return[` ${index+1}. ${import_chalk.default.bold("Webhook")}`,` ${import_chalk.default.dim("Webhook ID:")} ${webhook.id}`,` ${import_chalk.default.dim("URL:")} ${"url"in webhook?webhook.url:"Details unavailable"}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
|
|
9
9
|
`)}function formatRuleExpanded(ruleId,notifications){let lines=[` ${import_chalk.default.bold(ruleId)}`];return notifications.length===0?lines.push(` ${import_chalk.default.dim("No notification destinations")}`):lines.push(notifications.map((notification,index)=>formatNotificationExpanded(notification,index)).join(`
|
|
10
10
|
|
|
11
11
|
`)),lines.join(`
|
|
12
|
-
`)}function printRuleNotifications(ruleId,notifications){if(notifications.length===0){output_manager_default.log(`No notification destinations are linked to
|
|
12
|
+
`)}function printRuleNotifications(ruleId,notifications){if(notifications.length===0){output_manager_default.log(`No notification destinations are linked to monitor ${ruleId}.`);return}output_manager_default.print(`
|
|
13
13
|
${import_chalk.default.bold("Notification destinations")} for ${import_chalk.default.cyan(ruleId)}
|
|
14
14
|
|
|
15
15
|
${notifications.map(formatNotificationExpanded).join(`
|
|
16
16
|
|
|
17
17
|
`)}
|
|
18
18
|
`)}function printRulesNotifications(result){let ruleEntries=Object.entries(result.notifications).filter(([,notifications])=>notifications.length>0),rendered=ruleEntries.length>0?`
|
|
19
|
-
${import_chalk.default.bold("
|
|
19
|
+
${import_chalk.default.bold("Monitor notification destinations")}
|
|
20
20
|
|
|
21
21
|
${ruleEntries.map(([ruleId,notifications])=>formatRuleExpanded(ruleId,notifications)).join(`
|
|
22
22
|
|
|
23
23
|
`)}
|
|
24
24
|
`:`
|
|
25
25
|
No linked notification destinations found.
|
|
26
|
-
`;output_manager_default.print(rendered)}function formatTarget(target){return target.type==="webhook"?`webhook ${target.webhookId}`:`Slack channel ${target.channelId}${target.configId?` (installation ${target.configId})`:""}`}function buildRuleNotificationsInspectCommand(argv,ruleId){return buildCommandWithGlobalFlags(argv,`
|
|
27
|
-
`),printAlignedLabel(action,formatTarget(target),{gutter:"\u2713"}),printAlignedLabel("
|
|
26
|
+
`;output_manager_default.print(rendered)}function formatTarget(target){return target.type==="webhook"?`webhook ${target.webhookId}`:`Slack channel ${target.channelId}${target.configId?` (installation ${target.configId})`:""}`}function buildRuleNotificationsInspectCommand(argv,ruleId){return buildCommandWithGlobalFlags(argv,`monitors notifications ${quoteArg(ruleId)}`)}function printRuleNotificationMutationReceipt(action,ruleId,target,argv){let inspectCommand=buildRuleNotificationsInspectCommand(argv,ruleId);output_manager_default.print(`
|
|
27
|
+
`),printAlignedLabel(action,formatTarget(target),{gutter:"\u2713"}),printAlignedLabel("Monitor",import_chalk.default.cyan(ruleId)),target.minimumSeverityLevel==="critical"?printAlignedLabel("Delivery",CRITICAL_DELIVERY_DESCRIPTION):target.minimumSeverityLevel===null&&printAlignedLabel("Delivery","Every alert matched by the monitor"),printAlignedLabel("Inspect",import_chalk.default.dim(inspectCommand))}export{printRuleNotifications,printRulesNotifications,buildRuleNotificationsInspectCommand,printRuleNotificationMutationReceipt};
|