@vercel/cli-support 65.15.0 → 65.16.0-snapshot-23cc3b13430e
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-WGP6UVQN.js → add-23XTYQVQ.js} +1 -1
- package/dist/chunks/{add-6T3KGMEH.js → add-GF5MLDMV.js} +1 -1
- package/dist/chunks/{add-LULORXI7.js → add-JMG5ZTBT.js} +1 -1
- package/dist/chunks/{alerts-IFUWVZU4.js → alerts-UZNNHH7L.js} +1 -1
- package/dist/chunks/{build-H5WTYJH4.js → build-GBNAYN3G.js} +1 -1
- package/dist/chunks/{chunk-HVQEYQWF.js → chunk-2AA6C37C.js} +1 -1
- package/dist/chunks/{chunk-6737KAJP.js → chunk-2GBU6ULJ.js} +1 -1
- package/dist/chunks/{chunk-UZXQY5X5.js → chunk-2Y5X7IPM.js} +1 -1
- package/dist/chunks/{chunk-5DEAFZBT.js → chunk-33P2H5LU.js} +1 -1
- package/dist/chunks/{chunk-HVBSYQDN.js → chunk-3Z7AGO42.js} +1 -1
- package/dist/chunks/{chunk-XDBRJ7H3.js → chunk-4K2IT6C4.js} +1 -1
- package/dist/chunks/{chunk-W25UARQV.js → chunk-5ZCSFPWG.js} +1 -1
- package/dist/chunks/{chunk-6MFLATDD.js → chunk-5ZJ6UU6P.js} +1 -1
- package/dist/chunks/{chunk-4TD2KH46.js → chunk-63FPHKCJ.js} +1 -1
- package/dist/chunks/{chunk-SP6E7PHW.js → chunk-6CJFPT4F.js} +1 -1
- package/dist/chunks/{chunk-2LOA3LC6.js → chunk-6FYPSSL4.js} +1 -1
- package/dist/chunks/chunk-6IZ2TU4N.js +12 -0
- package/dist/chunks/{chunk-HIK5CJTT.js → chunk-6QWHJPZE.js} +1 -1
- package/dist/chunks/{chunk-JZ4NMX3Z.js → chunk-75S4X4EB.js} +1 -1
- package/dist/chunks/{chunk-UXRRYYSD.js → chunk-7HLAWGY2.js} +1 -1
- package/dist/chunks/{chunk-ONXOTUO6.js → chunk-7IMGKZ7C.js} +1 -1
- package/dist/chunks/{chunk-4TAAEP5J.js → chunk-7JGDE2VF.js} +1 -1
- package/dist/chunks/{chunk-6C5KUHQP.js → chunk-7KCRYDGK.js} +1 -1
- package/dist/chunks/{chunk-IDHH6QTJ.js → chunk-7W2LEWKG.js} +13 -3
- package/dist/chunks/{chunk-SQ76HIB6.js → chunk-AB4WXRCO.js} +1 -1
- package/dist/chunks/{chunk-KRZBZ7PB.js → chunk-BAB2DG2I.js} +1 -1
- package/dist/chunks/{chunk-HFVCKK5P.js → chunk-BEMUW4DC.js} +1 -1
- package/dist/chunks/{chunk-JVGENO2R.js → chunk-BMIYC2MH.js} +1 -1
- package/dist/chunks/{chunk-2QYOZU6E.js → chunk-BNOIFCAR.js} +1 -1
- package/dist/chunks/{chunk-26EJ4FM6.js → chunk-BPIGFKNN.js} +1 -1
- package/dist/chunks/{chunk-VBGL7MZR.js → chunk-BPM6HU7K.js} +1 -1
- package/dist/chunks/{chunk-CJ6XPDSS.js → chunk-BPQUJWX5.js} +1 -1
- package/dist/chunks/{chunk-YE245S4O.js → chunk-C35SG42R.js} +1 -1
- package/dist/chunks/chunk-CFJBDBYH.js +7 -0
- package/dist/chunks/{chunk-ODM3YKPR.js → chunk-CJJ5SDVD.js} +1 -1
- package/dist/chunks/{chunk-B6WYIUOW.js → chunk-COG7BFSO.js} +1 -1
- package/dist/chunks/chunk-CQYRBFYU.js +12 -0
- package/dist/chunks/{chunk-AR3ADTVY.js → chunk-CY3IWRYB.js} +1 -1
- package/dist/chunks/{chunk-MSJA64LL.js → chunk-D44WCAOX.js} +1 -1
- package/dist/chunks/{chunk-DETGGKXT.js → chunk-D5A6WRSL.js} +1 -1
- package/dist/chunks/chunk-D66BF5UU.js +7 -0
- package/dist/chunks/{chunk-2V6UURUN.js → chunk-DDPH26ZO.js} +1 -1
- package/dist/chunks/{chunk-P333Z5AT.js → chunk-DEMXGBMX.js} +1 -1
- package/dist/chunks/{chunk-Z5FNUSWW.js → chunk-DOBV3XLO.js} +1 -1
- package/dist/chunks/{chunk-OFZUWHZW.js → chunk-DTUEHPME.js} +1 -1
- package/dist/chunks/{chunk-WKSXBH7X.js → chunk-DY643UZ7.js} +2 -1
- package/dist/chunks/chunk-EEXO7TUJ.js +27 -0
- package/dist/chunks/{chunk-554TYJKV.js → chunk-EHJJZKCB.js} +1 -1
- package/dist/chunks/{chunk-U3J3SJJ5.js → chunk-EJEW7ZD2.js} +2 -2
- package/dist/chunks/{chunk-O3DAPRJ3.js → chunk-EJLYDHT7.js} +1 -1
- package/dist/chunks/{chunk-4OO6TXBM.js → chunk-ELM2KPYX.js} +1 -1
- package/dist/chunks/{chunk-XEISEISC.js → chunk-FBLGDSCA.js} +6 -6
- package/dist/chunks/{chunk-UDKIA6WN.js → chunk-FH3QWE3H.js} +1 -1
- package/dist/chunks/chunk-G3W3H7G6.js +24 -0
- package/dist/chunks/{chunk-DCUWC7WP.js → chunk-G4X74FFJ.js} +1 -1
- package/dist/chunks/chunk-GLCSWIB4.js +7 -0
- package/dist/chunks/{chunk-PSPPENIK.js → chunk-GLHDSCKD.js} +1 -1
- package/dist/chunks/{chunk-LT3Z7YQX.js → chunk-GTHS3KJA.js} +1 -1
- package/dist/chunks/{chunk-7O2W7ILO.js → chunk-H6Z4VK22.js} +1 -1
- package/dist/chunks/{chunk-KVDSSSSF.js → chunk-HGMYWGTX.js} +1 -1
- package/dist/chunks/{chunk-N7NTAYBS.js → chunk-HLALNE7R.js} +1 -1
- package/dist/chunks/{chunk-MTJLZGL5.js → chunk-HQGD4PEO.js} +1 -1
- package/dist/chunks/{chunk-W45KFKUW.js → chunk-IG5ACFU6.js} +1 -1
- package/dist/chunks/{chunk-5L566FZB.js → chunk-IIK6GUVI.js} +1 -1
- package/dist/chunks/{chunk-3JM374FP.js → chunk-INICCBM4.js} +1 -1
- package/dist/chunks/{chunk-O3I6OKIE.js → chunk-IOQZ7HZM.js} +1 -1
- package/dist/chunks/chunk-IVZF2PMV.js +11 -0
- package/dist/chunks/{chunk-7GSB5AQE.js → chunk-IVZKAWUI.js} +1 -1
- package/dist/chunks/{chunk-SPV6M2GS.js → chunk-JOU5QETR.js} +1 -1
- package/dist/chunks/chunk-JWKFVECK.js +7 -0
- package/dist/chunks/{chunk-X5I33MJS.js → chunk-K7ZPHS55.js} +1 -1
- package/dist/chunks/{chunk-2W4ND5DH.js → chunk-KEGZOZE5.js} +1 -1
- package/dist/chunks/{chunk-BYJQPGPK.js → chunk-KJY57WAN.js} +1 -1
- package/dist/chunks/{chunk-XF3327G6.js → chunk-KTGYIM7Z.js} +1 -1
- package/dist/chunks/{chunk-GTOSMVDY.js → chunk-L7MSHLII.js} +1 -1
- package/dist/chunks/{chunk-T7XSLFZ6.js → chunk-LKKLTJCC.js} +1 -1
- package/dist/chunks/{chunk-HVZ5OOOP.js → chunk-LU65WWOQ.js} +1 -1
- package/dist/chunks/{chunk-NHB43235.js → chunk-LYL26S3N.js} +1 -1
- package/dist/chunks/{chunk-MCLT57FD.js → chunk-MFBZX4AZ.js} +1 -1
- package/dist/chunks/{chunk-TDHFWPK5.js → chunk-MKXE2IE4.js} +1 -1
- package/dist/chunks/{chunk-X5LOHZT5.js → chunk-MLUKTRNK.js} +1 -1
- package/dist/chunks/{chunk-A7YTYTWM.js → chunk-MXN736AL.js} +1 -1
- package/dist/chunks/{chunk-5THEFDOZ.js → chunk-NJFTAKDY.js} +1 -1
- package/dist/chunks/{chunk-EZ7CJF5G.js → chunk-ODNDNX4C.js} +1 -1
- package/dist/chunks/{chunk-Z2HYNJLC.js → chunk-OHNOZ6A2.js} +1 -1
- package/dist/chunks/{chunk-O47OWLP7.js → chunk-OKRQ2XLR.js} +1 -1
- package/dist/chunks/{chunk-KAYGNWHX.js → chunk-P2D7SOB3.js} +1 -1
- package/dist/chunks/{chunk-VHRQW57O.js → chunk-PDUIYEMP.js} +1 -1
- package/dist/chunks/{chunk-OKKG2FUS.js → chunk-PIDEH4SJ.js} +1 -1
- package/dist/chunks/{chunk-QFCYM4RS.js → chunk-PY4WWD6Z.js} +1 -1
- package/dist/chunks/{chunk-7OJMANDL.js → chunk-QLBFQ6ZO.js} +1 -1
- package/dist/chunks/{chunk-UZQJQXGJ.js → chunk-QOLGACFD.js} +1 -1
- package/dist/chunks/{chunk-3JFPC5MK.js → chunk-R46MWEQR.js} +1 -1
- package/dist/chunks/chunk-R4DN6SUD.js +10 -0
- package/dist/chunks/{chunk-JQHS743O.js → chunk-RGJ7HG4P.js} +1 -1
- package/dist/chunks/{chunk-YVIAN4VL.js → chunk-RMUI75QA.js} +1 -1
- package/dist/chunks/{chunk-U6P3UM3Z.js → chunk-RUGX7ONC.js} +1 -1
- package/dist/chunks/{chunk-TA4HB2ZR.js → chunk-SFLK67U5.js} +1 -1
- package/dist/chunks/{chunk-A3C67PNC.js → chunk-SKYIWHB5.js} +1 -1
- package/dist/chunks/{chunk-XHPIQGUS.js → chunk-SPPRQ753.js} +1 -1
- package/dist/chunks/{chunk-HR66URIC.js → chunk-SYJXONEV.js} +1 -1
- package/dist/chunks/chunk-T3SXUNB7.js +21 -0
- package/dist/chunks/{chunk-ATUJAOUR.js → chunk-T7KRHCGN.js} +1 -1
- package/dist/chunks/{chunk-YEQ7BBOS.js → chunk-TWHV3M4I.js} +1 -1
- package/dist/chunks/{chunk-ABSFPYM4.js → chunk-UDZJCD5W.js} +1 -1
- package/dist/chunks/{chunk-RWK4YZLO.js → chunk-UORINZ3U.js} +1 -1
- package/dist/chunks/chunk-UQZZX2J7.js +7 -0
- package/dist/chunks/chunk-VAZURK7Q.js +12 -0
- package/dist/chunks/{chunk-6Q2XEYCJ.js → chunk-VHSAI6FS.js} +1 -1
- package/dist/chunks/chunk-VRYJNBOR.js +7 -0
- package/dist/chunks/{chunk-QEZ6KFSY.js → chunk-W57EC3DP.js} +1 -1
- package/dist/chunks/chunk-WJX5PGNN.js +7 -0
- package/dist/chunks/{chunk-VTZH5DW3.js → chunk-WLHU7YRP.js} +1 -1
- package/dist/chunks/chunk-WZCLCG4J.js +7 -0
- package/dist/chunks/{chunk-PRNTZKYB.js → chunk-X5BSFW5D.js} +1 -1
- package/dist/chunks/{chunk-PL6TMRQZ.js → chunk-X65CXS2N.js} +1 -1
- package/dist/chunks/{chunk-GUSOYIW6.js → chunk-XDYVJWGX.js} +1 -1
- package/dist/chunks/{chunk-E7CEQ2PO.js → chunk-XECELSF5.js} +1 -1
- package/dist/chunks/chunk-XKPB27SC.js +8 -0
- package/dist/chunks/{chunk-C35XH6YM.js → chunk-YH5ALOQC.js} +1 -1
- package/dist/chunks/{chunk-6TYBUUO4.js → chunk-YUHU5XJW.js} +1 -1
- package/dist/chunks/{chunk-2OQD274E.js → chunk-YY7GJKYH.js} +7 -7
- package/dist/chunks/{chunk-7RAGU3PA.js → chunk-Z3P3P3FD.js} +1 -1
- package/dist/chunks/{chunk-6VUD3LZP.js → chunk-ZKQ47ZXI.js} +1 -1
- package/dist/chunks/{chunk-3EHJOZJB.js → chunk-ZQVRY5GV.js} +1 -1
- package/dist/chunks/{chunk-OFOZ5DBA.js → chunk-ZZD5W5KT.js} +1 -1
- package/dist/chunks/{clear-L4HSULAA.js → clear-UZIH2RGN.js} +1 -1
- package/dist/chunks/{cli-embedded-NCWN74UF.js → cli-embedded-6SKYFUXJ.js} +2 -3
- package/dist/chunks/{compile-vercel-config-3AD57TKS.js → compile-vercel-config-FI2MWKVY.js} +1 -1
- package/dist/chunks/{config-N4SB5PPU.js → config-DFZP6YNK.js} +1 -1
- package/dist/chunks/{config-E7OJDF2P.js → config-YRQIP7I4.js} +1 -1
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{contract-EULMKZS4.js → contract-53UPOIEH.js} +1 -1
- package/dist/chunks/{delete-33WIMH3P.js → delete-G2MHXMJN.js} +1 -1
- package/dist/chunks/{delete-45EEPRWI.js → delete-YNS3RIYE.js} +1 -1
- package/dist/chunks/{describe-QAF4MI7I.js → describe-F7JJIYY2.js} +1 -1
- package/dist/chunks/{detect-projects-XGIE3YBG.js → detect-projects-4GK5I7QF.js} +1 -1
- package/dist/chunks/{detect-services-AAVP4EBS.js → detect-services-PJ6VFJLS.js} +1 -1
- package/dist/chunks/{disable-H3Z7OJJE.js → disable-QYXYWYJI.js} +1 -1
- package/dist/chunks/{discard-KIEAG7NI.js → discard-RVMZ4OSY.js} +1 -1
- package/dist/chunks/{edit-YQJNSZTX.js → edit-NBO46A2S.js} +1 -1
- package/dist/chunks/{edit-3Q36ZYIA.js → edit-VL5VFCYX.js} +1 -1
- package/dist/chunks/{enable-BMB5D7AO.js → enable-7473PGTC.js} +1 -1
- package/dist/chunks/{engine-DkdkXQEy-FDYYIXY7.js → engine-DkdkXQEy-VKQPUSSO.js} +1 -1
- package/dist/chunks/{export-QQAZAQOU.js → export-RI7CWLFY.js} +1 -1
- package/dist/chunks/{future-TZACZMSV.js → future-4EH6EYOT.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-EZM5MW2G.js → generate-cert-for-deploy-HLSDDT3R.js} +1 -1
- package/dist/chunks/{image-YAMHIRFF.js → image-6KALMFIS.js} +1 -1
- package/dist/chunks/{import-builders-DE7NPR7N.js → import-builders-MQYKMGND.js} +1 -1
- package/dist/chunks/{inspect-QNZWH5O3.js → inspect-36SDAS3T.js} +1 -1
- package/dist/chunks/{inspect-VCJDESUJ.js → inspect-7LXD2QBY.js} +1 -1
- package/dist/chunks/{inspect-Y5LG6JUC.js → inspect-7W5YZQLF.js} +1 -1
- package/dist/chunks/{inspect-MFVWIQT4.js → inspect-RQFIEZCX.js} +1 -1
- package/dist/chunks/{inspect-DIH47SML.js → inspect-TBSVBZUN.js} +1 -1
- package/dist/chunks/{inspect-OHNQUBKI.js → inspect-ZBUCCNHT.js} +1 -1
- package/dist/chunks/{list-KB6YGNJZ.js → list-E3H5CO3F.js} +1 -1
- package/dist/chunks/{list-AYUHH7TO.js → list-PM65YO4H.js} +1 -1
- package/dist/chunks/{list-YJSC2ST6.js → list-QJZEUHZD.js} +1 -1
- package/dist/chunks/{list-C7GYUVSJ.js → list-WOGSQOWX.js} +1 -1
- package/dist/chunks/{login-T2VKRCUS.js → login-CKAOEOQ6.js} +1 -1
- package/dist/chunks/{login-E47LQVJN.js → login-UIUHQY7G.js} +1 -1
- package/dist/chunks/{logs-BLMH6Y45.js → logs-2THXE2UF.js} +1 -1
- package/dist/chunks/{ls-BPRVNFEB.js → ls-22ZYL2GV.js} +1 -1
- package/dist/chunks/{ls-CBV4C474.js → ls-HTIM3KWL.js} +1 -1
- package/dist/chunks/{ls-GI4HMBK6.js → ls-MNHUCTET.js} +1 -1
- package/dist/chunks/{ls-5KNEE66N.js → ls-ND2I2ZEU.js} +1 -1
- package/dist/chunks/{ls-V6KTI55Z.js → ls-WMHW6KAR.js} +1 -1
- package/dist/chunks/{ls-EBJTSOO7.js → ls-YKY7FCBX.js} +1 -1
- package/dist/chunks/{ls-JOOH2AF2.js → ls-ZHVWQR4N.js} +1 -1
- package/dist/chunks/{migrate-experimental-services-ZMZITRD4.js → migrate-experimental-services-QMEN4MUW.js} +1 -1
- package/dist/chunks/{mutate-5AQS53DH.js → mutate-634XBSAZ.js} +1 -1
- package/dist/chunks/{notifications-T74YEQUZ.js → notifications-MW7HIYJ4.js} +1 -1
- package/dist/chunks/{open-GUNAPG6S.js → open-AQJJC2OJ.js} +1 -1
- package/dist/chunks/openapi-XZOI5Q7B.js +7 -0
- package/dist/chunks/{permissions-BISSYSWA.js → permissions-EACJF7KK.js} +1 -1
- package/dist/chunks/{plugin-offer-NIDPSYYJ.js → plugin-offer-S5I4DOP7.js} +1 -1
- package/dist/chunks/{prompt-missing-credentials-YR5RBSGW.js → prompt-missing-credentials-VT7AY4KK.js} +1 -1
- package/dist/chunks/{publish-D7EXNS3C.js → publish-T77BHV6C.js} +1 -1
- package/dist/chunks/{pull-NQ2FQBCM.js → pull-7CG4KRWJ.js} +1 -1
- package/dist/chunks/{purchase-domain-if-available-YG3AOXZ7.js → purchase-domain-if-available-WPZGNUTC.js} +1 -1
- package/dist/chunks/{push-OCU3RUHV.js → push-DKH5ZSIF.js} +1 -1
- package/dist/chunks/query-BRFKKULP.js +7 -0
- package/dist/chunks/raw-query-WKQVXUOJ.js +8 -0
- package/dist/chunks/{reauthenticate-S7ZZYONP.js → reauthenticate-C23SIVQ3.js} +1 -1
- package/dist/chunks/{remove-LZTO47IA.js → remove-TRI7VSFC.js} +1 -1
- package/dist/chunks/{reorder-TMBGWMPR.js → reorder-IVMIEDO3.js} +1 -1
- package/dist/chunks/{reply-55HPMB6K.js → reply-VHVNWROQ.js} +1 -1
- package/dist/chunks/{resolve-BTBTAK33.js → resolve-4GYLG7OM.js} +1 -1
- package/dist/chunks/{resolve-agent-team-3QXPCCT7.js → resolve-agent-team-NQAKGG6R.js} +1 -1
- package/dist/chunks/{restore-K6LCLHTG.js → restore-MJ7HJKCB.js} +1 -1
- package/dist/chunks/{rm-I5PRDQHP.js → rm-E7ODXBY3.js} +1 -1
- package/dist/chunks/{rm-LL6X65SS.js → rm-LZ4HKXFF.js} +1 -1
- package/dist/chunks/{rm-CEUCQRIX.js → rm-P7Z5PH52.js} +1 -1
- package/dist/chunks/{rm-4PSIPJUA.js → rm-RE4MRNF5.js} +1 -1
- package/dist/chunks/{rm-UOP7BPBQ.js → rm-UJLSSWMI.js} +1 -1
- package/dist/chunks/{rule-inspect-DKODR7X2.js → rule-inspect-XUHXSWYP.js} +1 -1
- package/dist/chunks/{schema-L3YB2LQE.js → schema-2456IBUM.js} +1 -1
- package/dist/chunks/{schema-LRVPWIYU.js → schema-MSSFENBH.js} +1 -1
- package/dist/chunks/{select-org-JQBD5NDP.js → select-org-QY6NKEO5.js} +1 -1
- package/dist/chunks/{serving-DKny38LK-UNINNTL5.js → serving-DKny38LK-WG5QDDEJ.js} +1 -1
- package/dist/chunks/{set-YBCB2ZLD.js → set-K5RATVZR.js} +1 -1
- package/dist/chunks/{set-UMNUZAGG.js → set-NRTRIRMB.js} +1 -1
- package/dist/chunks/{setup-and-link-JRQ5DLOI.js → setup-and-link-LZVRQNPW.js} +1 -1
- package/dist/chunks/{skills-DDFYTBGG.js → skills-GICDAOI2.js} +3 -1
- package/dist/chunks/{tags-WRH47Z4W.js → tags-N3GVG4FB.js} +1 -1
- package/dist/chunks/token-MYYNOUIT.js +7 -0
- package/dist/chunks/{token-util-KL35LHLQ.js → token-util-OJHS52JP.js} +1 -1
- package/dist/chunks/{types-NQECZN4K.js → types-HBXTZZAC.js} +1 -1
- package/dist/chunks/{update-FAMBH7PW.js → update-G7FP6ZUH.js} +1 -1
- package/dist/chunks/{usage-YACGLTPY.js → usage-7T7NOCPO.js} +1 -1
- package/dist/chunks/{validate-config-X6DF35VG.js → validate-config-6RVSBIWX.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +11 -10
- package/dist/commands/dev/index.js +5 -5
- package/dist/commands/env/index.js +3 -3
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +31 -29
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +18 -18
- package/dist/commands-ai.js +10 -10
- package/dist/commands-blob.js +16 -16
- package/dist/commands-core.js +9 -9
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +164 -141
- package/dist/commands-integrations.js +6 -6
- package/dist/commands-observability.js +3 -3
- package/dist/commands-routing.js +7 -7
- package/dist/help.js +1 -1
- package/dist/index.js +4 -4
- package/dist/internal-build.js +1 -1
- package/dist/package.json +41 -41
- package/dist/version.mjs +1 -1
- package/package.json +44 -44
- package/dist/chunks/chunk-3S7H6NCV.js +0 -20
- package/dist/chunks/chunk-5PAMKYPV.js +0 -14
- package/dist/chunks/chunk-AY523IYR.js +0 -7
- package/dist/chunks/chunk-DIHB5BUY.js +0 -8
- package/dist/chunks/chunk-EB7744O7.js +0 -24
- package/dist/chunks/chunk-EI4CUIVA.js +0 -7
- package/dist/chunks/chunk-EZVNGJN5.js +0 -7
- package/dist/chunks/chunk-HOGVBY6Q.js +0 -11
- package/dist/chunks/chunk-HSCWCGL7.js +0 -7
- package/dist/chunks/chunk-IIMHD3FA.js +0 -7
- package/dist/chunks/chunk-KRVZKKJV.js +0 -12
- package/dist/chunks/chunk-LNQAOLNW.js +0 -10
- package/dist/chunks/chunk-MZ7ITRVR.js +0 -12
- package/dist/chunks/chunk-SEHERY6U.js +0 -7
- package/dist/chunks/chunk-U2ZNF6HN.js +0 -8
- package/dist/chunks/chunk-UIGZMWS6.js +0 -16
- package/dist/chunks/chunk-YANOBY2G.js +0 -7
- package/dist/chunks/openapi-5WTF7EXK.js +0 -7
- package/dist/chunks/query-FM6SRTQP.js +0 -12
- package/dist/chunks/token-3ILJZPAZ.js +0 -7
- package/dist/chunks/token-JJLQVXPI.js +0 -7
- package/dist/chunks/token-util-A4BSB3KP.js +0 -7
- /package/dist/chunks/{chunk-WFS3XBAA.js → chunk-MRCM5VF5.js} +0 -0
- /package/dist/chunks/{chunk-SNGM6NSO.js → chunk-TK7K6GCG.js} +0 -0
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{emitVcrArgParseError,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{emitVcrArgParseError,handleVcrApiError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-BEMUW4DC.js";import{outputError}from"./chunk-ZJNDLFZ7.js";import"./chunk-D3M2JG5C.js";import"./chunk-M32HBBPK.js";import"./chunk-GD7AV7BO.js";import{trackCreatedId}from"./chunk-YJNMDXEG.js";import{addSubcommand}from"./chunk-BMIYC2MH.js";import"./chunk-6CJFPT4F.js";import"./chunk-ZZD5W5KT.js";import"./chunk-VHSAI6FS.js";import{printError}from"./chunk-PDUIYEMP.js";import"./chunk-LU65WWOQ.js";import"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-IVZF2PMV.js";import"./chunk-DTUEHPME.js";import"./chunk-YY7GJKYH.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(addSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr create <name> --project <name-or-id>"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let name=parsedArgs.args[0],project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),!name)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing repository name. Example: ${packageName} vcr create <name>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr create <name>"),when:"Replace <name> with the repository name to create"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS","Usage: `vercel vcr create <name>`");let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=`/v1/vcr/repository?teamId=${encodeURIComponent(scope.teamId)}`;output_manager_default.spinner("Creating repository...");try{let created=await client.fetch(path,{method:"POST",body:{projectId:scope.projectId,name}});return trackCreatedId(client,"vcr-repository",created.repository?.id),fr.jsonOutput?client.stdout.write(`${JSON.stringify(created,null,2)}
|
|
8
8
|
`):output_manager_default.success(`Created repository ${created.repository?.name??name}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List existing repositories (a name conflict means it already exists)"}});throw err}finally{output_manager_default.stopSpinner()}}export{add as default};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{printRuleMutationReceipt}from"./chunk-
|
|
7
|
+
import{printRuleMutationReceipt}from"./chunk-MKXE2IE4.js";import"./chunk-GHNHUSVK.js";import{resolveRulesProject,resolveRulesTeam}from"./chunk-2AA6C37C.js";import"./chunk-6QWHJPZE.js";import{emitRulesArgParseError,getBodyType,handleRulesApiError,outputRulesError,readRuleBody,rulesCollectionPath}from"./chunk-OHNOZ6A2.js";import"./chunk-ZJNDLFZ7.js";import"./chunk-GHAY4PSD.js";import"./chunk-D3M2JG5C.js";import"./chunk-TOTTVS5P.js";import"./chunk-HRR57QNP.js";import"./chunk-GZNDA6SV.js";import"./chunk-PFD7LETF.js";import{trackCreatedId}from"./chunk-YJNMDXEG.js";import"./chunk-CJZE7647.js";import{monitorsAddSubcommand}from"./chunk-5ZCSFPWG.js";import{printError}from"./chunk-PDUIYEMP.js";import"./chunk-LU65WWOQ.js";import"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import"./chunk-IVZF2PMV.js";import"./chunk-DTUEHPME.js";import"./chunk-YY7GJKYH.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";function applyScopeFlag(client,body,type,scope,flags,jsonOutput){if(Object.hasOwn(body,"ruleScope"))return flags["--project"]||flags["--all"]?outputRulesError(client,jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both."):void 0;if(flags["--project"]){body.ruleScope=type==="custom"?{type:"project",projectId:scope.projectId}:{type:"include",projectIds:[scope.projectId]};return}if(flags["--all"]){if(type==="custom")return outputRulesError(client,jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>.");body.ruleScope={type:"all"};return}return outputRulesError(client,jsonOutput,"MISSING_SCOPE","Missing monitor scope. Add ruleScope to the body, or pass --project or --all.")}async function resolveCreateScope(client,flags,jsonOutput){return flags["--project"]&&flags["--all"]?outputRulesError(client,jsonOutput,"MUTUAL_EXCLUSIVITY","Cannot specify both --all and --project. Use one or the other."):flags["--project"]?resolveRulesProject(client,flags["--project"],jsonOutput,"monitors add"):resolveRulesTeam(client,jsonOutput)}async function add(client,argv,api){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(monitorsAddSubcommand.options))}catch(error){return emitRulesArgParseError(client,error,"monitors add --project <name-or-id> --body <path>"),printError(error),2}let flags=parsedArgs.flags,format=validateJsonOutput(flags);if(!format.valid)return outputRulesError(client,!1,"INVALID_ARGUMENTS",format.error);if(!flags["--body"])return outputRulesError(client,format.jsonOutput,"MISSING_ARGUMENTS","Missing required option: --body <PATH>.");let body=readRuleBody(client,flags["--body"],format.jsonOutput);if(typeof body=="number")return body;let type=getBodyType(body);if(!type)return outputRulesError(client,format.jsonOutput,"INVALID_RULE_TYPE","Create body must set a supported monitor type.");if(Object.hasOwn(body,"ruleScope")&&(flags["--project"]||flags["--all"]))return outputRulesError(client,format.jsonOutput,"SCOPE_CONFLICT","Specify monitor scope either in the body or with --project/--all, not both.");if(type==="custom"&&flags["--all"])return outputRulesError(client,format.jsonOutput,"INVALID_SCOPE","Custom monitors must target one project. Use --project <name-or-id>.");let scope=await resolveCreateScope(client,flags,format.jsonOutput);if(typeof scope=="number")return scope;let scopeError=applyScopeFlag(client,body,type,scope,flags,format.jsonOutput);if(scopeError!==void 0)return scopeError;output_manager_default.spinner("Creating monitor\u2026");try{let response=await client.fetch(rulesCollectionPath(api,scope.teamId),{method:"POST",body});return trackCreatedId(client,"monitor",response[api.itemKey]?.id),format.jsonOutput?client.stdout.write(`${JSON.stringify(response,null,2)}
|
|
8
8
|
`):printRuleMutationReceipt("Created",response[api.itemKey],client.argv),0}catch(error){if(isAPIError(error))return handleRulesApiError(client,error,format.jsonOutput);throw error}finally{output_manager_default.stopSpinner()}}export{add as default};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{parseTeamRefs,teamRefBody}from"./chunk-LSF7FY6X.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{parseTeamRefs,teamRefBody}from"./chunk-LSF7FY6X.js";import{repositoryPermissionsPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,resolveVcrScope,validateVcrJsonOutput}from"./chunk-BEMUW4DC.js";import{outputError}from"./chunk-ZJNDLFZ7.js";import"./chunk-D3M2JG5C.js";import{require_async_sema}from"./chunk-NZ2TFADV.js";import"./chunk-M32HBBPK.js";import"./chunk-GD7AV7BO.js";import{permissionsAddSubcommand}from"./chunk-6CJFPT4F.js";import{printError}from"./chunk-PDUIYEMP.js";import"./chunk-LU65WWOQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-IVZF2PMV.js";import"./chunk-DTUEHPME.js";import"./chunk-YY7GJKYH.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{packageName}from"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_async_sema=__toESM(require_async_sema(),1);var USAGE="vcr permissions <repository> add <team>[,<team>...]";async function add(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsAddSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],teamRefs=parseTeamRefs(parsedArgs.args.slice(2)),project=parsedArgs.flags["--project"];if(telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),teamRefs.length===0)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing team. Example: ${packageName} vcr permissions ${repository} add team_1a2b3c4d`,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Replace <team> with a team id or slug (comma-separate multiple teams)"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",`Usage: \`vercel ${USAGE}\``);let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPermissionsPath(scope,repository),added=[],failed=[];output_manager_default.spinner(`Sharing ${repository} with ${teamRefs.length===1?teamRefs[0]:`${teamRefs.length} teams`}...`);let sema=new import_async_sema.default(10),results;try{results=await Promise.all(teamRefs.map(async team=>{await sema.acquire();try{let result=await client.fetch(path,{method:"POST",body:teamRefBody(team)});return{ok:!0,team,permission:result.permission}}catch(err){if(!isAPIError(err))throw err;let message=err.serverMessage||`API error (${err.status}).`;return{ok:!1,team,failure:{team,code:err.code||"API_ERROR",message}}}finally{sema.release()}}))}finally{output_manager_default.stopSpinner()}for(let result of results)result.ok?(added.push(result.permission),fr.jsonOutput||output_manager_default.success(`Shared ${repository} with ${result.permission?.teamSlug??result.team}`)):(failed.push(result.failure),fr.jsonOutput||output_manager_default.error(`Failed to share ${repository} with ${result.team}: ${result.failure.message}`));return failed.length>0&&outputAgentError(client,{status:"error",reason:AGENT_REASON.API_ERROR,message:`Failed to share ${repository} with ${failed.map(f=>`${f.team} (${f.message})`).join(", ")}`},1),fr.jsonOutput&&client.stdout.write(`${JSON.stringify({permissions:added,failed},null,2)}
|
|
8
8
|
`),failed.length>0?1:0}export{add as default};
|
|
@@ -4,5 +4,5 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{loadScopeNames,printBudgetAlertsTable,scopeNameOf}from"./chunk-
|
|
7
|
+
import{loadScopeNames,printBudgetAlertsTable,scopeNameOf}from"./chunk-TWHV3M4I.js";import{organizationTarget,parseBudgetFilterOptions,rejectUnexpectedArgs,resolveBudgetFilter,resolveBudgetOwner,trackScopeOptions,typeFilter}from"./chunk-OKRQ2XLR.js";import{handleValidationError,outputError,validateOptionalIntegerRange,validateTimeBound,validateTimeOrder}from"./chunk-ZJNDLFZ7.js";import"./chunk-KEGZOZE5.js";import"./chunk-ZKQ47ZXI.js";import"./chunk-D3M2JG5C.js";import"./chunk-2AMO2VMV.js";import{INVALID_NEXT_MESSAGE}from"./chunk-C6GY2G73.js";import{budgetAlertJson,listBudgetAlerts,ownerJson}from"./chunk-IG5ACFU6.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import"./chunk-CJZE7647.js";import{MAX_LIST_LIMIT,getNextPageCommand,printNextPageCommand}from"./chunk-D44WCAOX.js";import{getCommandAliases}from"./chunk-CQYRBFYU.js";import"./chunk-DDPH26ZO.js";import"./chunk-PIDEH4SJ.js";import"./chunk-IIK6GUVI.js";import{alertsListSubcommand,alertsSubcommand,isBudgetScope}from"./chunk-C35SG42R.js";import"./chunk-2GBU6ULJ.js";import"./chunk-EJLYDHT7.js";import"./chunk-QOLGACFD.js";import"./chunk-TK7K6GCG.js";import"./chunk-BMIYC2MH.js";import"./chunk-6CJFPT4F.js";import"./chunk-ZZD5W5KT.js";import"./chunk-VHSAI6FS.js";import"./chunk-GLCSWIB4.js";import"./chunk-6FYPSSL4.js";import"./chunk-XECELSF5.js";import"./chunk-5ZCSFPWG.js";import"./chunk-DOBV3XLO.js";import"./chunk-UDZJCD5W.js";import"./chunk-UQZZX2J7.js";import"./chunk-F7L5SXJM.js";import"./chunk-PY4WWD6Z.js";import"./chunk-XDYVJWGX.js";import"./chunk-JALVF3C2.js";import"./chunk-BPIGFKNN.js";import"./chunk-AB4WXRCO.js";import"./chunk-SYJXONEV.js";import{printError}from"./chunk-PDUIYEMP.js";import"./chunk-7KCRYDGK.js";import"./chunk-GLIQ4KNY.js";import{TelemetryClient}from"./chunk-KDCODXVL.js";import"./chunk-NWGBDBZI.js";import{AGENT_REASON}from"./chunk-IVZF2PMV.js";import"./chunk-DTUEHPME.js";import{require_pluralize}from"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import{parseArguments,takeCommand}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import{validateJsonOutput}from"./chunk-6GKP6VUF.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-5MDNVAE6.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import"./chunk-24SIHFEW.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_pluralize=__toESM(require_pluralize(),1);function encodeBudgetAlertsCursor(value){return Buffer.from(JSON.stringify({c:value.cursor,t:value.teamId,o:value.owner==="organization"?value.owner:void 0,s:value.since,u:value.until,sc:value.selector?.scope,si:value.selector&&"scopeId"in value.selector?value.selector.scopeId:void 0})).toString("base64url")}function decodeBudgetAlertsCursor(value){if(value===void 0)return{valid:!0,value:void 0};let invalid={valid:!1,code:"INVALID_NEXT",message:INVALID_NEXT_MESSAGE},raw;try{raw=JSON.parse(Buffer.from(value,"base64url").toString("utf8"))}catch{return invalid}if(typeof raw!="object"||raw===null)return invalid;let{c,t,o,s,u,sc,si}=raw;if(typeof c!="string"||typeof t!="string"||!(o===void 0||o==="organization"&&sc==="organization"&&si===void 0)||!isOptionalMs(s)||!isOptionalMs(u)||!(sc===void 0||isBudgetScope(sc)||isScopeList(sc))||!(si===void 0||typeof si=="string"&&isBudgetScope(sc)))return invalid;let selector;return isScopeList(sc)?selector={scope:sc}:isBudgetScope(sc)&&(selector=si===void 0?{scope:sc}:{scope:sc,scopeId:si}),o==="organization"?{valid:!0,value:{cursor:c,teamId:t,owner:o,since:s,until:u,selector:{scope:"organization",orgId:t}}}:{valid:!0,value:{cursor:c,teamId:t,since:s,until:u,selector}}}function isScopeList(value){return Array.isArray(value)&&value.length>0&&value.every(isBudgetScope)}function isOptionalMs(value){return value===void 0||Number.isFinite(value)}var BudgetAlertsTelemetryClient=class extends TelemetryClient{trackCliOptionOrganization(organization){organization&&this.trackCliOption({option:"organization",value:this.redactedValue})}trackCliOptionProject(project){project&&this.trackCliOption({option:"project",value:this.redactedValue})}trackCliOptionType(types){types?.length&&this.trackCliOption({option:"type",value:types.join(",")})}trackCliOptionProduct(product){product&&this.trackCliOption({option:"product",value:this.redactedValue})}trackCliSubcommandList(actual){this.trackCliSubcommand({subcommand:"list",value:actual})}trackCliOptionSince(since){since&&this.trackCliOption({option:"since",value:this.redactedValue})}trackCliOptionUntil(until){until&&this.trackCliOption({option:"until",value:this.redactedValue})}trackCliOptionLimit(limit){limit!==void 0&&this.trackCliOption({option:"limit",value:String(limit)})}trackCliOptionNext(next){next&&this.trackCliOption({option:"next",value:this.redactedValue})}trackCliOptionFormat(format){format&&this.trackCliOption({option:"format",value:format})}trackCliFlagJson(json){json&&this.trackCliFlag("json")}};async function alerts(client,argv){let telemetry=new BudgetAlertsTelemetryClient({opts:{store:client.telemetryEventStore}}),action,parsedArgs,flagsSpecification=getFlagsSpecification(alertsSubcommand.options);try{let selected=takeCommand(argv,flagsSpecification);action=getSubcommand(selected.command?[selected.command]:[],{list:getCommandAliases(alertsListSubcommand)}),parsedArgs=parseArguments(action.subcommand?selected.args:argv,flagsSpecification)}catch(error){return printError(error),2}let{flags:opts,args}=parsedArgs;action.subcommand==="list"&&telemetry.trackCliSubcommandList(action.subcommandOriginal);let formatResult=validateJsonOutput(opts);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let asJson=formatResult.jsonOutput;if(rejectUnexpectedArgs(args,"billing budgets alerts"))return 2;let scopeArgs=parseBudgetFilterOptions(opts);if("error"in scopeArgs)return outputError(client,asJson,"INVALID_ARGUMENTS",scopeArgs.error);trackScopeOptions(telemetry,opts),telemetry.trackCliOptionType(opts["--type"]),telemetry.trackCliOptionSince(opts["--since"]),telemetry.trackCliOptionUntil(opts["--until"]),telemetry.trackCliOptionLimit(opts["--limit"]),telemetry.trackCliOptionNext(opts["--next"]),telemetry.trackCliOptionFormat(opts["--format"]?"json":void 0),telemetry.trackCliFlagJson(opts["--json"]);let nextResult=decodeBudgetAlertsCursor(opts["--next"]);if(!nextResult.valid)return handleValidationError(nextResult,asJson,client);let cursor=nextResult.value,{types}=scopeArgs.value;if(cursor&&types&&!sameSelector(cursor.selector,{scope:types}))return outputError(client,asJson,"INVALID_NEXT",OTHER_FILTER_CURSOR);let warnings=[],limit=opts["--limit"];if(typeof limit=="number"&&Number.isInteger(limit)&&limit>MAX_LIST_LIMIT){let message=`--limit ${limit} is above the maximum of ${MAX_LIST_LIMIT}. Using ${MAX_LIST_LIMIT}.`;warnings.push({reason:AGENT_REASON.LIMIT_CLAMPED,message}),asJson||output_manager_default.warning(message),limit=MAX_LIST_LIMIT}let limitResult=validateOptionalIntegerRange(limit,{flag:"--limit",min:1,max:MAX_LIST_LIMIT});if(!limitResult.valid)return handleValidationError(limitResult,asJson,client);let sinceResult=validateTimeBound(opts["--since"]);if(!sinceResult.valid)return handleValidationError(sinceResult,asJson,client);let untilResult=validateTimeBound(opts["--until"]);if(!untilResult.valid)return handleValidationError(untilResult,asJson,client);let order=validateTimeOrder(sinceResult.value,untilResult.value);if(!order.valid)return handleValidationError(order,asJson,client);let resolvedOwner=await resolveBudgetOwner(client,scopeArgs.value.input??(cursor?.owner==="organization"?{scope:"organization",value:cursor.teamId}:null));if(!resolvedOwner)return 2;if("error"in resolvedOwner)return outputError(client,asJson,resolvedOwner.usage?"INVALID_ARGUMENTS":"API_ERROR",resolvedOwner.error);let owner=resolvedOwner.value;if(cursor&&cursor.teamId!==owner.id)return outputError(client,asJson,"INVALID_NEXT",`This --next cursor is from another team or organization, not ${owner.slug}. Use the --scope or --organization it was printed with.`);let since=cursor?cursor.since:sinceResult.value?.getTime(),until=cursor?cursor.until:untilResult.value?.getTime();output_manager_default.spinner("Fetching budget alerts\u2026");let resolved=cursor&&!scopeArgs.value.input&&!scopeArgs.value.types?{value:cursorFilter(owner,cursor.selector)}:await resolveBudgetFilter(client,owner,scopeArgs.value);if("error"in resolved)return output_manager_default.stopSpinner(),outputError(client,asJson,resolved.usage?"INVALID_ARGUMENTS":"API_ERROR",resolved.error);let filter=resolved.value;if(cursor&&!sameSelector(cursor.selector,filter.selector))return output_manager_default.stopSpinner(),outputError(client,asJson,"INVALID_NEXT",OTHER_FILTER_CURSOR);let page;try{page=await listBudgetAlerts(client,filter.selector,{since,until,limit:limitResult.value,next:cursor?.cursor})}catch(err){if(output_manager_default.stopSpinner(),isAPIError(err))return err.code==="invalid_cursor"?outputError(client,asJson,"INVALID_NEXT",INVALID_NEXT_MESSAGE):outputError(client,asJson,err.code||"API_ERROR",err.message);throw err}let names=await loadScopeNames(client,owner,page.data);output_manager_default.stopSpinner();let next=page.next?encodeBudgetAlertsCursor({cursor:page.next,teamId:owner.id,owner:owner.type,since,until,selector:filter.selector}):null;if(asJson)return client.stdout.write(`${JSON.stringify({...ownerJson(owner),...filter.selector?{filter:filter.json}:{},alerts:page.data.map(alert=>budgetAlertJson(alert,scopeNameOf(names,alert))),pagination:{next},...warnings.length>0?{warnings}:{}},null,2)}
|
|
8
8
|
`),0;let{where}=filter;return page.data.length===0?(output_manager_default.log(cursor?`No more budget alerts ${where}.`:`No budget alerts found ${where}.`),0):(output_manager_default.log(`${(0,import_pluralize.default)("budget alert",page.data.length,!0)} ${where}`),client.stdout.write(printBudgetAlertsTable(page.data,names)),next&&printNextPageCommand(getNextPageCommand(client.argv,next,WINDOW_FLAGS)),0)}function cursorFilter(owner,selector){if(owner.type==="organization")return organizationTarget(owner);if(!selector)return typeFilter(owner,null);if(Array.isArray(selector.scope))return typeFilter(owner,selector.scope);let{scope}=selector,scopeId="scopeId"in selector?selector.scopeId:void 0;return{selector,args:"",where:scopeId?`on ${scope} ${scopeId}`:`on ${scope}`,json:{scope,scopeId:scopeId??null,name:null}}}var OTHER_FILTER_CURSOR="This --next cursor is from a list with a different --type, --organization, --project, or --product. Use the options it was printed with.";function sameSelector(a,b){return queryKey(a)===queryKey(b)}function queryKey(query){return query?Array.isArray(query.scope)?query.scope.join(","):"scopeId"in query&&query.scopeId?`${query.scope}:${query.scopeId}`:query.scope:""}var WINDOW_FLAGS=["--since","-s","--until","-u"];export{alerts as default};
|
|
@@ -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{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isBuildxAvailable,isEngineInstalled,pushCompressionArgs,reportEngineCommandFailure,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-
|
|
7
|
+
import{DEFAULT_TAG,buildRepositoryReference,parseNameArg,validateImageParts}from"./chunk-HEGJZJO7.js";import{VCR_ENGINES,emitVcrArgParseError,isBuildxAvailable,isEngineInstalled,pushCompressionArgs,reportEngineCommandFailure,reportEnginePushFailure,resolveRegistry,resolveVcrScope,runEngine,splitPassthrough,validateVcrChoice}from"./chunk-BEMUW4DC.js";import{outputError}from"./chunk-ZJNDLFZ7.js";import"./chunk-D3M2JG5C.js";import"./chunk-M32HBBPK.js";import"./chunk-GD7AV7BO.js";import{buildSubcommand}from"./chunk-BMIYC2MH.js";import"./chunk-6CJFPT4F.js";import"./chunk-ZZD5W5KT.js";import"./chunk-VHSAI6FS.js";import{printError}from"./chunk-PDUIYEMP.js";import"./chunk-LU65WWOQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-IVZF2PMV.js";import"./chunk-DTUEHPME.js";import"./chunk-YY7GJKYH.js";import"./chunk-4HR3I3ML.js";import"./chunk-LOA7SZWH.js";import"./chunk-M7FED5YP.js";import"./chunk-MTZYPCZ7.js";import"./chunk-D6REP5QQ.js";import"./chunk-7HLAWGY2.js";import{parseArguments}from"./chunk-LYL26S3N.js";import"./chunk-2VBFQZ72.js";import"./chunk-6GKP6VUF.js";import"./chunk-LUX4PBJL.js";import"./chunk-OPORM35X.js";import"./chunk-FBYA6LLM.js";import"./chunk-MY4MONOH.js";import"./chunk-MXTC4ZAQ.js";import"./chunk-4NTBYNFR.js";import"./chunk-4SAVH3H7.js";import"./chunk-GOI2VVI7.js";import"./chunk-B4KA3ZH2.js";import"./chunk-BOJDM3O7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import"./chunk-BLUPZPAS.js";import"./chunk-AW33SRYY.js";import"./chunk-5MDNVAE6.js";import"./chunk-OCR5CRTH.js";import"./chunk-7EJQLVWX.js";import"./chunk-SCV7XEEO.js";import"./chunk-MCYG7CCE.js";import"./chunk-YHPPP3SF.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";import"./chunk-2BKALEOP.js";import"./chunk-NB2WLB3J.js";import"./chunk-ISWW3DKF.js";import"./chunk-BRQUZ5NC.js";import"./chunk-BULSRTQE.js";import"./chunk-BZENIQ7N.js";var DEFAULT_PLATFORM="linux/amd64";async function build(client,telemetry){let{own,passthrough}=splitPassthrough(client.argv),parsedArgs;try{parsedArgs=parseArguments(own,getFlagsSpecification(buildSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr build <engine> [path] [name[:tag]]"),printError(err),2}let[engineArg,pathArg,nameArg]=parsedArgs.args.slice(2),project=parsedArgs.flags["--project"],platform=parsedArgs.flags["--platform"],push=!!parsedArgs.flags["--push"];if(telemetry.trackCliArgumentEngine(engineArg),telemetry.trackCliArgumentPath(pathArg),telemetry.trackCliArgumentName(nameArg),telemetry.trackCliOptionProject(project),telemetry.trackCliOptionPlatform(platform),telemetry.trackCliFlagPush(push),!engineArg){let message=`Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr build docker"),when:"Replace docker with the container tool you use"}]},2),outputError(client,!1,"MISSING_ARGUMENTS",message)}let choiceError=validateVcrChoice(client,"engine",engineArg,VCR_ENGINES,!1);if(typeof choiceError=="number")return choiceError;let engine=engineArg;if(!isEngineInstalled(engine)){let message=`\`${engine}\` is not installed or not on your PATH. Install it and try again.`;return outputAgentError(client,{status:"error",reason:"engine_not_found",message},1),outputError(client,!1,"ENGINE_NOT_FOUND",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:!1});if(typeof scope=="number")return scope;let parsed=parseNameArg(nameArg,scope.projectName);if("error"in parsed)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:parsed.error},2),outputError(client,!1,"INVALID_ARGUMENTS",parsed.error);let validationError=validateImageParts(parsed);if(validationError)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:validationError},2),outputError(client,!1,"INVALID_ARGUMENTS",validationError);let ref=`${buildRepositoryReference({registry:resolveRegistry(),teamSlug:scope.teamSlug,projectName:scope.projectName,repository:parsed.repository})}:${parsed.tag??DEFAULT_TAG}`,contextPath=pathArg??".",buildPlatform=platform??DEFAULT_PLATFORM;if(push&&engine==="docker"&&await isBuildxAvailable()){let outputSpec=`type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`,engineArgs2=["buildx","build","--platform",buildPlatform,"--output",outputSpec,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);let result2=await runEngine(engine,engineArgs2,{cwd:client.cwd,captureStderr:!0});return result2.exitCode!==0?reportEnginePushFailure(client,engine,"buildx build",result2):(output_manager_default.success(`Built and pushed ${ref} (zstd compression)`),0)}push&&engine==="docker"&&output_manager_default.warn("Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes.");let engineArgs=["build","--platform",buildPlatform,"--tag",ref,...passthrough,contextPath];output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);let result=await runEngine(engine,engineArgs,{cwd:client.cwd});if(result.exitCode!==0)return reportEngineCommandFailure(client,engine,"build",result);if(!push)return output_manager_default.success(`Built ${ref}`),output_manager_default.log(`Push it with \`${buildCommandWithGlobalFlags(client.argv,`vcr push ${engine}${nameArg?` ${nameArg}`:""}`)}\`.`),0;let pushArgs=["push",...pushCompressionArgs(engine),ref];output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);let pushResult=await runEngine(engine,pushArgs,{cwd:client.cwd,captureStderr:!0});if(pushResult.exitCode!==0)return reportEnginePushFailure(client,engine,"push",pushResult);let compressed=engine!=="docker";return output_manager_default.success(`Built and pushed ${ref}${compressed?" (zstd compression)":""}`),0}export{build as default};
|
|
@@ -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{emitAlertsScopeError,resolveAlertsScope}from"./chunk-
|
|
7
|
+
import{emitAlertsScopeError,resolveAlertsScope}from"./chunk-6QWHJPZE.js";import{handleValidationError,validateAllProjectMutualExclusivity}from"./chunk-ZJNDLFZ7.js";import{getScope}from"./chunk-LU65WWOQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-IVZF2PMV.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{ProjectNotFound,isAPIError}from"./chunk-GOI2VVI7.js";async function resolveRulesTeam(client,jsonOutput){let scope;try{scope=await getScope(client,{resolveLocalScope:!0})}catch(err){if(isAPIError(err)&&(err.status===403||err.status===404))return emitAlertsScopeError(client,jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`,{reason:AGENT_REASON.MISSING_SCOPE,hint:"The selected team could not be loaded. Select a team you can access, or pass --scope <team-slug>.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]});throw err}let{team}=scope;return team?{teamId:team.id}:emitAlertsScopeError(client,jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, use `--scope <team>`, or link a team project.",{reason:AGENT_REASON.MISSING_SCOPE,hint:"Monitors belong to a team. Select the team before retrying.",next:[{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Select a team"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Inspect the current scope"}]})}async function resolveRulesProject(client,projectNameOrId,jsonOutput,command){let teamScope=await resolveRulesTeam(client,jsonOutput);if(typeof teamScope=="number")return teamScope;try{let project=await getProjectByNameOrId(client,projectNameOrId,teamScope.teamId);return project instanceof ProjectNotFound?emitAlertsScopeError(client,jsonOutput,"PROJECT_NOT_FOUND",`Project "${projectNameOrId}" was not found in the selected team.`,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,`${command} --project <name_or_id>`),when:"Retry with a valid project"}]}):{...teamScope,projectId:project.id,projectName:project.name}}catch(error){if(!isAPIError(error))throw error;return emitAlertsScopeError(client,jsonOutput,error.code||"API_ERROR",error.serverMessage||`API error (${error.status}).`,{reason:error.status===401?"not_authorized":error.status===403?"forbidden":AGENT_REASON.API_ERROR})}}async function parseRulesFlagsAndScope(client,flags,jsonOutput,command="monitors ls"){let mutual=validateAllProjectMutualExclusivity(flags["--all"],flags["--project"]);if(!mutual.valid)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:mutual.message,next:[{command:buildCommandWithGlobalFlags(client.argv,"monitors --help"),when:"Use either `--project` or `--all`, not both"}]},2),handleValidationError(mutual,jsonOutput,client);if(flags["--all"])return resolveRulesTeam(client,jsonOutput);if(flags["--project"])return resolveRulesProject(client,flags["--project"],jsonOutput,command);let linkedScope=await resolveAlertsScope(client,{jsonOutput,command});if(typeof linkedScope=="number")return linkedScope;let teamScope=await resolveRulesTeam(client,jsonOutput);return typeof teamScope=="number"?teamScope:linkedScope.teamId===teamScope.teamId?linkedScope:teamScope}export{resolveRulesTeam,resolveRulesProject,parseRulesFlagsAndScope};
|
|
@@ -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{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,sinceOption,untilOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,sinceOption,untilOption}from"./chunk-CFJBDBYH.js";var usageCommand={name:"usage",aliases:[],summary:"Show billing usage and costs",description:"Show billing usage and costs for the current billing cycle or a custom date range",arguments:[],options:[{...sinceOption,description:"Start time: YYYY-MM-DD (midnight LA time), ISO 8601, or relative, like 7d (default: start of the current billing cycle)"},{...untilOption,description:"End time: YYYY-MM-DD (end of day LA time), ISO 8601, or relative; requires --since (default: now)"},{name:"from",shorthand:null,type:String,deprecated:!0},{name:"to",shorthand:null,type:String,deprecated:!0},{name:"breakdown",shorthand:null,type:String,argument:"PERIOD",description:"Show usage breakdown by time period instead of aggregated totals (daily, weekly, monthly)",deprecated:!1},{name:"group-by",shorthand:null,type:String,argument:"DIMENSION",description:"Group usage by a dimension instead of aggregated totals (project, region)",deprecated:!1},formatOption,jsonOption],examples:[{name:"Show usage for the current billing period",value:`${packageName} billing usage`},{name:"Show usage for a custom date range",value:`${packageName} billing usage --since 2025-01-01 --until 2025-01-31`},{name:"Show usage for the last 7 days",value:`${packageName} billing usage --since 7d`},{name:"Show daily usage breakdown",value:`${packageName} billing usage --breakdown daily`},{name:"Show weekly usage breakdown",value:`${packageName} billing usage --breakdown weekly`},{name:"Show usage grouped by project",value:`${packageName} billing usage --group-by project`},{name:"Show usage grouped by region",value:`${packageName} billing usage --group-by region`},{name:"Output usage data as JSON",value:`${packageName} billing usage --json`}]};export{usageCommand};
|
|
@@ -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}from"./chunk-
|
|
7
|
+
import{require_dist}from"./chunk-HQGD4PEO.js";import{require_frameworks}from"./chunk-ZKNEIE44.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_frameworks=__toESM(require_frameworks(),1),import_fs_detectors=__toESM(require_dist(),1);import{join}from"path";async function detectProjects(cwd){let fs=new import_fs_detectors.LocalFileSystemDetector(cwd),workspaces=await(0,import_fs_detectors.getWorkspaces)({fs}),detectedProjects=new Map,packagePaths=(await Promise.all(workspaces.map(workspace=>(0,import_fs_detectors.getWorkspacePackagePaths)({fs,workspace})))).flat();return packagePaths.length===0&&packagePaths.push("/"),await Promise.all(packagePaths.map(async p=>{let frameworks=await(0,import_fs_detectors.detectFrameworks)({fs:fs.chdir(join(".",p)),frameworkList:import_frameworks.frameworkList});frameworks.length!==0&&detectedProjects.set(p.slice(1),frameworks)})),detectedProjects}export{detectProjects};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{agentErrorMetadata,getExitCodeForReason,trackAgentError}from"./chunk-
|
|
7
|
+
import{agentErrorMetadata,getExitCodeForReason,trackAgentError}from"./chunk-IVZF2PMV.js";import{recordCliError}from"./chunk-AP6DZGTK.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function recordLine(type,data){return`${JSON.stringify({type,data})}
|
|
8
8
|
`}function summaryLine(progress){return`${JSON.stringify({type:"summary",...progress})}
|
|
9
9
|
`}function writeJsonError(client,payload,exitCode=getExitCodeForReason(payload.reason)){let{status,reason,message,...rest}=payload,document={status,reason,message:(0,import_strip_ansi.default)(message),...rest,...rest.hint?{hint:(0,import_strip_ansi.default)(rest.hint)}:{},...agentErrorMetadata(client)};return recordCliError({code:payload.reason,reportOnSuccess:!0}),trackAgentError(client,document),client.stderr.write(`${JSON.stringify(document)}
|
|
10
10
|
`),exitCode}export{recordLine,summaryLine,writeJsonError};
|
|
@@ -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-YY7GJKYH.js";import{CantParseJSONFile}from"./chunk-GOI2VVI7.js";import{require_dist}from"./chunk-MCYG7CCE.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,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-
|
|
7
|
+
import{did_you_mean_default}from"./chunk-DWZBL4NK.js";import{param}from"./chunk-3G3FQYMW.js";import{shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-IVZF2PMV.js";import{buildCorrectedCommand,suggestCorrection}from"./chunk-LYL26S3N.js";import{getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default,recordCliError}from"./chunk-AP6DZGTK.js";import{getFlagsSpecification}from"./chunk-CFJBDBYH.js";function handleCommandTypo({command,availableCommands,threshold=.7,helpCommand="--help",client}){if(!command||command.startsWith("-"))return!1;let visibleCommands=availableCommands.filter(command2=>!command2.hidden),commandNames=visibleCommands.flatMap(({name,aliases})=>[name,...aliases]),correction=suggestCorrection(command,commandNames),suggestion=correction??did_you_mean_default(command,commandNames,threshold);if(suggestion){if(client){let definition=visibleCommands.find(candidate=>candidate.name===correction||candidate.aliases.some(alias=>alias===correction)),corrected=correction?buildCorrectedCommand(client.argv,command,correction,getFlagsSpecification(definition?.options??[])):void 0,payload={status:"error",reason:"unknown_command",message:`Unknown command "${command}". Did you mean "${suggestion}"?`,hint:corrected?"Use the suggested command after replacing any placeholders with the intended values.":`Accepted commands: ${commandNames.join(", ")}.`,...corrected&&{next:[{command:corrected,when:"Run the corrected command; replace any placeholders first"}]}};return shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,payload):(recordCliError({code:payload.reason}),output_manager_default.fatal(payload.message),corrected&&output_manager_default.print(` ${corrected}
|
|
8
8
|
`),output_manager_default.print(`
|
|
9
9
|
See all commands:
|
|
10
10
|
${getCommandNamePlain(helpCommand)}
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,projectOption,yesOption}from"./chunk-CFJBDBYH.js";var builtInBody={type:"built-in",name:"Production server errors",triggers:{mode:"selected",items:[{type:"error_anomaly",filter:"statusGroup:5xx AND route:/api/*"}]},matchMinimumSeverityLevel:"high"},patchBody={name:"Critical production errors",matchMinimumSeverityLevel:"critical"},authoringReference={title:"Authoring reference",body:[{command:"vercel monitors schema --type built-in"}]},monitorsAddHelpSections=[{title:"Scope",body:["Provide ruleScope in the body or use a scope option, not both.","--project maps to one included project.","--all maps to every project in the team."]},{title:"Built-in body (rule.json)",preformatted:!0,body:[...JSON.stringify(builtInBody,null,2).split(`
|
|
8
8
|
`),"",{command:"vercel monitors add --project my-app --body ./rule.json"}]},authoringReference],monitorsUpdateHelpSections=[{title:"Update body",body:["Include only the fields to change. type is optional and inferred from the stored monitor.","Use --project or --all to change scope with or without --body.","Do not combine a ruleScope field in the body with --project or --all.","--all moves the monitor to team-wide scope."]},{title:"Partial body (patch.json)",preformatted:!0,body:[...JSON.stringify(patchBody,null,2).split(`
|
|
9
9
|
`),"",{command:"vercel monitors update ar_abc123 --body ./patch.json"},{command:"vercel monitors update ar_abc123 --project my-app"}]},authoringReference];var projectScopeOption={...projectOption,shorthand:"p",description:"Use a project by name or ID"},listAllOption={name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"List all accessible monitors in the selected team"},mutationAllOption={...listAllOption,description:"Apply the monitor to all projects in the selected team"},deprecatedItemScopeOptions=[{...projectScopeOption,deprecated:!0},{...listAllOption,deprecated:!0}],bodyOption={name:"body",shorthand:null,type:String,argument:"PATH",deprecated:!1,description:"Read the monitor body from a JSON file"},monitorsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List monitors for a project or team",arguments:[],options:[projectScopeOption,listAllOption,{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by monitor type"},formatOption,jsonOption],examples:[{name:"List monitors affecting the linked project",value:`${packageName} monitors ls`},{name:"List all monitors in the selected team",value:`${packageName} monitors ls --all`},{name:"Write JSON output",value:`${packageName} monitors ls --all --json`}]},monitorsSchemaSubcommand={name:"schema",aliases:[],description:"Show monitor request fields and examples",arguments:[],options:[{name:"type",shorthand:null,type:String,argument:"TYPE",deprecated:!1,description:"Monitor type to describe"},formatOption,jsonOption],examples:[{name:"List supported monitor types",value:`${packageName} monitors schema`},{name:"Show the built-in monitor schema",value:`${packageName} monitors schema --type built-in`}]},monitorsAddSubcommand={name:"add",aliases:["create"],description:"Add a monitor from a JSON body",helpSections:monitorsAddHelpSections,arguments:[],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,bodyOption],examples:[{name:"Create a project-scoped monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Create a team-wide built-in monitor",value:`${packageName} monitors add --all --body ./rule.json`}]},monitorsInspectSubcommand={name:"inspect",aliases:["get"],description:"Show one monitor by ID",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption],examples:[{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors inspect ar_abc123 --json`}]},monitorsRmSubcommand={name:"remove",aliases:["rm","delete"],description:"Remove a monitor",arguments:[{name:"monitorId",required:!0}],options:[...deprecatedItemScopeOptions,formatOption,jsonOption,yesOption],examples:[{name:"Remove with confirmation",value:`${packageName} monitors remove ar_abc123`},{name:"Remove without a prompt",value:`${packageName} monitors remove ar_abc123 --yes`}]},monitorsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a monitor's settings or scope",helpSections:monitorsUpdateHelpSections,arguments:[{name:"monitorId",required:!0}],options:[projectScopeOption,mutationAllOption,formatOption,jsonOption,{...bodyOption,description:"Read the partial update body from a JSON file"}],examples:[{name:"Update fields from a file",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Move a monitor to a project",value:`${packageName} monitors update ar_abc123 --project my-app`}]},notificationTargetOptions=[{name:"webhook",shorthand:null,type:String,argument:"WEBHOOK_ID",deprecated:!1,description:"Select an account webhook by ID"},{name:"slack-channel",shorthand:null,type:String,argument:"CHANNEL_ID",deprecated:!1,description:"Select a Slack channel by ID"},{name:"slack-installation-id",shorthand:null,type:String,argument:"INSTALLATION_ID",deprecated:!1,description:"Slack installation ID. Optional only when the team has exactly one completed Slack installation."}],criticalOnlyOption={name:"critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Notify only when Vercel Agent escalates an alert to Critical"},noCriticalOnlyOption={name:"no-critical-only",shorthand:null,type:Boolean,deprecated:!1,description:"Deliver every alert matched by the monitor"},monitorsNotificationsLsSubcommand={name:"ls",aliases:["list"],default:!0,description:"List notification destinations for all readable monitors or one monitor",arguments:[{name:"monitorId",required:!1}],options:[formatOption,jsonOption],examples:[{name:"List notification destinations for all readable monitors",value:`${packageName} monitors notifications ls`},{name:"List notification destinations for one monitor",value:`${packageName} monitors notifications ls ar_abc123`},{name:"Write JSON output",value:`${packageName} monitors notifications ar_abc123 --json`}]},monitorsNotificationsLinkSubcommand={name:"link",aliases:[],description:"Link a Slack channel or account webhook to a monitor",arguments:[{name:"monitorId",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,formatOption,jsonOption],examples:[{name:"Link a Slack channel",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`},{name:"Link a Slack channel from a specific installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123 --slack-installation-id icfg_abc123`},{name:"Link a webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123`},{name:"Link a Critical-only webhook",value:`${packageName} monitors notifications link ar_abc123 --webhook wh_abc123 --critical-only`}]},monitorsNotificationsUpdateSubcommand={name:"update",aliases:["patch"],description:"Update a notification destination's delivery setting",arguments:[{name:"monitorId",required:!0}],options:[...notificationTargetOptions,criticalOnlyOption,noCriticalOnlyOption,formatOption,jsonOption],examples:[{name:"Restrict a Slack channel to Critical alerts",value:`${packageName} monitors notifications update ar_abc123 --slack-channel C123 --critical-only`},{name:"Restore delivery for every alert matched by the monitor",value:`${packageName} monitors notifications update ar_abc123 --webhook wh_abc123 --no-critical-only`}]},monitorsNotificationsUnlinkSubcommand={name:"unlink",aliases:[],description:"Unlink a Slack channel or account webhook from a monitor",arguments:[{name:"monitorId",required:!0}],options:[...notificationTargetOptions,formatOption,jsonOption],examples:[{name:"Unlink a Slack channel",value:`${packageName} monitors notifications unlink ar_abc123 --slack-channel C123`},{name:"Unlink a webhook",value:`${packageName} monitors notifications unlink ar_abc123 --webhook wh_abc123`}]},monitorsNotificationsAggregateCommand={name:"notifications",aliases:[],description:"List and manage linked Slack and webhook destinations for monitors",arguments:[],subcommands:[monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand],options:[formatOption,jsonOption],examples:[{name:"List destinations for all readable monitors",value:`${packageName} monitors notifications`},{name:"List destinations for one monitor",value:`${packageName} monitors notifications ar_abc123`},{name:"Link Slack with the team's only installation",value:`${packageName} monitors notifications link ar_abc123 --slack-channel C123`}]},monitorsCommand={name:"monitors",aliases:[],description:"Add, inspect, list, update, and remove monitors, and manage their notification destinations",arguments:[],subcommands:[monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsAggregateCommand],options:monitorsLsSubcommand.options,examples:[{name:"List monitors for the linked project",value:`${packageName} monitors ls`},{name:"Add a monitor",value:`${packageName} monitors add --project my-app --body ./rule.json`},{name:"Inspect a monitor",value:`${packageName} monitors inspect ar_abc123`},{name:"Update a monitor",value:`${packageName} monitors update ar_abc123 --body ./patch.json`},{name:"Remove a monitor",value:`${packageName} monitors remove ar_abc123`},{name:"List notification destinations for a monitor",value:`${packageName} monitors notifications ar_abc123`}]};export{monitorsLsSubcommand,monitorsSchemaSubcommand,monitorsAddSubcommand,monitorsInspectSubcommand,monitorsRmSubcommand,monitorsUpdateSubcommand,monitorsNotificationsLsSubcommand,monitorsNotificationsLinkSubcommand,monitorsNotificationsUpdateSubcommand,monitorsNotificationsUnlinkSubcommand,monitorsNotificationsAggregateCommand,monitorsCommand};
|
|
@@ -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{AGENT_REASON,AGENT_STATUS,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-
|
|
7
|
+
import{AGENT_REASON,AGENT_STATUS,shouldEmitNonInteractiveCommandError,writeAgentError}from"./chunk-IVZF2PMV.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";function withWarnings(result,warnings){let added=warnings.filter(warning=>warning!==void 0);if(added.length===0)return result;let existing=result.warnings;return{...result,warnings:[...Array.isArray(existing)?existing:[],...added]}}function getRenamedOption(flags,name,oldName,{json=!1,typedName=oldName}={}){let value=flags[name],oldValue=flags[oldName];if(value!==void 0&&oldValue!==void 0)return{error:`Can't use ${name} with ${typedName}.`};if(typeof value=="string"&&value.trim()==="")return{error:`${name} can't be empty.`};if(oldValue===void 0)return{value};let message=`${typedName} is deprecated. Use ${name}.`;return json?{value:oldValue,warning:{reason:AGENT_REASON.DEPRECATED,message}}:(output_manager_default.warning(message),{value:oldValue})}function reportRenamedOptionError(client,message,{json=!1}={}){return json||shouldEmitNonInteractiveCommandError(client)?writeAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.INVALID_ARGUMENTS,message}):output_manager_default.error(message),2}function renameOptionInArgs(args,oldName,name){let end=args.indexOf("--");return args.map((arg,index)=>(end===-1||index<end)&&(arg===oldName||arg.startsWith(`${oldName}=`))?`${name}${arg.slice(oldName.length)}`:arg)}export{withWarnings,getRenamedOption,reportRenamedOptionError,renameOptionInArgs};
|
|
@@ -25,7 +25,7 @@ ${MANAGED_BLOCK_END}`,existing=current??"",start=existing.indexOf(MANAGED_BLOCK_
|
|
|
25
25
|
|
|
26
26
|
`;return`${existing}${prefix}${block}
|
|
27
27
|
`}async function publishNoClobber(temporary,destination){try{return await link(temporary,destination),!0}catch(error){if(error.code==="EEXIST")return!1;throw error}finally{await unlink(temporary).catch(()=>{})}}async function ensureMode(path,mode){try{await chmod(path,mode)}catch{}}async function backupFile(path,mode){let backupPath=`${path}.bak`;return mode===void 0?(await copyFile(path,backupPath),backupPath):(await ensureMode(backupPath,mode),await writeFile(backupPath,await readFile(path,"utf8"),{mode}),backupPath)}async function writeConfigFile(path,content,mode){await mkdir(dirname(path),{recursive:!0}),mode!==void 0&&await ensureMode(path,mode),await writeFile(path,content,mode===void 0?"utf8":{mode})}var GATEWAY_ANTHROPIC_BASE_URL="https://ai-gateway.vercel.sh",GATEWAY_CODING_AGENT_BASE_URL="https://ai-gateway.vercel.sh/coding-agent/v1",GATEWAY_CURSOR_BASE_URL="https://ai-gateway.vercel.sh/cursor/v1",GATEWAY_CODEX_BASE_URL="https://ai-gateway.vercel.sh/codex/v1",GATEWAY_CLAUDE_CODE_BASE_URL="https://ai-gateway.vercel.sh/claude-code",GATEWAY_API_KEY_ENV="AI_GATEWAY_API_KEY",GATEWAY_DEFAULT_MODEL="anthropic/claude-fable-5",KEY_PLACEHOLDER="__AI_GATEWAY_API_KEY__";function resolveGatewayBaseUrl(override,agentDefault){let trimmed=override?.trim();return trimmed||agentDefault}function maskSecret(secret){return secret&&(secret===KEY_PLACEHOLDER||secret.length<=8?"\u2022\u2022\u2022\u2022":`${secret.slice(0,4)}\u2022\u2022\u2022\u2022${secret.slice(-4)}`)}import{randomUUID}from"node:crypto";import*as fs from"node:fs/promises";import{dirname as dirname2,join}from"node:path";var MAX_RECORD_BYTES=1024*1024;function codeSpan(value){return`\`${value.replace(/[`\r\n]/g,"")}\``}var RECORD_PATTERN=/\.json$/;function claudeAppSupportRoot(home){return process.platform==="darwin"?join(home,"Library","Application Support"):process.platform==="win32"?process.env.APPDATA||join(home,"AppData","Roaming"):join(home,".config")}function toGatewayModelId(model){return model.includes("/")?model:`anthropic/${model}`}async function listSubdirectories(path){try{return(await fs.readdir(path,{withFileTypes:!0})).filter(e=>e.isDirectory()).map(e=>e.name)}catch{return[]}}async function findDestinationIdentity(root){let best=null;for(let account of await listSubdirectories(root))for(let org of await listSubdirectories(join(root,account))){let path=join(root,account,org);try{let stat4=await fs.stat(path);(!best||stat4.mtimeMs>best.mtime)&&(best={path,mtime:stat4.mtimeMs})}catch{}}return best?.path??null}async function readRecord(path){let stat4;try{stat4=await fs.stat(path)}catch{return null}if(!stat4.isFile()||stat4.size>MAX_RECORD_BYTES)return null;try{let raw=await fs.readFile(path,"utf8"),record=JSON.parse(raw);return typeof record!="object"||record===null||Array.isArray(record)?null:{record,bytes:stat4.size}}catch{return null}}async function writeRecordNoClobber(destination,contents){if(await pathExists(destination))return"skipped";await fs.mkdir(dirname2(destination),{recursive:!0});let temp=join(dirname2(destination),`.migrate-${randomUUID()}.tmp`);return await fs.writeFile(temp,contents,{mode:384}),await publishNoClobber(temp,destination)?"copied":"skipped"}async function planClaudeDesktopSessionMigration(home,appSupportRoot=claudeAppSupportRoot(home)){let subscriptionRoot=join(appSupportRoot,"Claude","claude-code-sessions"),gatewayRoot=join(appSupportRoot,"Claude-3p","claude-code-sessions"),destinationDir=await findDestinationIdentity(gatewayRoot);if(!destinationDir)return null;let copies=[],totalBytes=0;for(let account of await listSubdirectories(subscriptionRoot))for(let org of await listSubdirectories(join(subscriptionRoot,account))){let identityDir=join(subscriptionRoot,account,org),names;try{names=await fs.readdir(identityDir)}catch{continue}for(let name of names){if(!RECORD_PATTERN.test(name))continue;let source=join(identityDir,name),destination=join(destinationDir,name);if(await pathExists(destination))continue;let read=await readRecord(source);read&&(copies.push({source,destination,bytes:read.bytes}),totalBytes+=read.bytes)}}return copies.length===0?null:{label:"Claude Desktop sessions",itemCount:copies.length,totalBytes,sourceRoots:[subscriptionRoot],destinationRoots:[destinationDir],prompt:[`Copy the ${copies.length} Claude Desktop session record${copies.length===1?"":"s"} (per-session \`.json\` files) under ${codeSpan(subscriptionRoot)} into ${codeSpan(destinationDir)}, keeping each filename.`,"In each copy, rewrite the top-level `model` field to its AI Gateway id by prefixing `anthropic/` when the value has no provider prefix (e.g. `claude-opus-4-8` \u2192 `anthropic/claude-opus-4-8`); keep any suffix such as `[1m]` intact. Leave every other field unchanged.","Use atomic, no-clobber writes with mode 0600; skip records whose destination already exists. Never move, edit, delete, or overwrite an original record."],async apply(){let copied=0,skipped=0,errors=[];for(let copy of copies)try{let read=await readRecord(copy.source);if(!read){skipped+=1;continue}let record={...read.record};typeof record.model=="string"&&(record.model=toGatewayModelId(record.model)),await writeRecordNoClobber(copy.destination,`${JSON.stringify(record)}
|
|
28
|
-
`)==="copied"?copied+=1:skipped+=1}catch(error){errors.push(`${copy.source}: ${error instanceof Error?error.message:String(error)}`)}return errors.length>0?{copied,skipped,errors}:{copied,skipped}}}}function claudeDir(home){let dir=process.env.CLAUDE_CONFIG_DIR;return dir&&dir.trim()?dir:join2(home,".claude")}var claudeCode={id:"claude-code",displayName:"Claude Code",sessionMigration:{plan:({home})=>planClaudeDesktopSessionMigration(home)},async detect(home){return pathExists(claudeDir(home))},configPath(ctx){return ctx.overrides?.["claude-code"]??join2(claudeDir(ctx.home),"settings.json")},buildPlan(ctx){let path=this.configPath(ctx),env={ANTHROPIC_BASE_URL:resolveGatewayBaseUrl(ctx.baseUrlOverride,GATEWAY_CLAUDE_CODE_BASE_URL),ANTHROPIC_API_KEY:"",CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:"1",ENABLE_TOOL_SEARCH:"true"},envExports=[];return ctx.useKeychain?envExports.push({name:"ANTHROPIC_AUTH_TOKEN",value:ctx.apiKey}):env.ANTHROPIC_AUTH_TOKEN=ctx.apiKey,{fileChanges:[{path,label:"Claude Code settings",format:"json",...ctx.useKeychain?{}:{mode:384},transform:current=>mergeJson(current,{env})}],envExports,notes:[...ctx.useKeychain?["The Anthropic auth token is read from your shell environment (Keychain-backed).","Open a new terminal so ANTHROPIC_AUTH_TOKEN is loaded, then restart Claude Code."]:["Restart Claude Code to pick up the new settings."],"
|
|
28
|
+
`)==="copied"?copied+=1:skipped+=1}catch(error){errors.push(`${copy.source}: ${error instanceof Error?error.message:String(error)}`)}return errors.length>0?{copied,skipped,errors}:{copied,skipped}}}}function claudeDir(home){let dir=process.env.CLAUDE_CONFIG_DIR;return dir&&dir.trim()?dir:join2(home,".claude")}var claudeCode={id:"claude-code",displayName:"Claude Code",sessionMigration:{plan:({home})=>planClaudeDesktopSessionMigration(home)},async detect(home){return pathExists(claudeDir(home))},configPath(ctx){return ctx.overrides?.["claude-code"]??join2(claudeDir(ctx.home),"settings.json")},buildPlan(ctx){let path=this.configPath(ctx),env={ANTHROPIC_BASE_URL:resolveGatewayBaseUrl(ctx.baseUrlOverride,GATEWAY_CLAUDE_CODE_BASE_URL),ANTHROPIC_API_KEY:"",CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY:"1",ENABLE_TOOL_SEARCH:"true"},envExports=[];return ctx.useKeychain?envExports.push({name:"ANTHROPIC_AUTH_TOKEN",value:ctx.apiKey}):env.ANTHROPIC_AUTH_TOKEN=ctx.apiKey,{fileChanges:[{path,label:"Claude Code settings",format:"json",...ctx.useKeychain?{}:{mode:384},transform:current=>mergeJson(current,{env})}],envExports,notes:[...ctx.useKeychain?["The Anthropic auth token is read from your shell environment (Keychain-backed).","Open a new terminal so ANTHROPIC_AUTH_TOKEN is loaded, then restart Claude Code."]:["Restart Claude Code to pick up the new settings."],"This command does not configure the Claude Desktop app. To route it through AI Gateway, switch it yourself: in the app menu, choose Help \u2192 Troubleshooting \u2192 Enable Developer Mode\u2026, then Developer \u2192 Configure Third-Party Inference\u2026 See https://vercel.com/docs/ai-gateway/coding-agents/claude-code#with-the-claude-desktop-app","After the Claude Desktop app has launched once on the gateway, re-run this command to copy your existing desktop sessions over."]}}};import{join as join4}from"node:path";import{createHash as createHash2,randomUUID as randomUUID2}from"node:crypto";var regex_default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function validate(uuid){return typeof uuid=="string"&®ex_default.test(uuid)}var validate_default=validate;function parse3(uuid){if(!validate_default(uuid))throw TypeError("Invalid UUID");let v;return Uint8Array.of((v=parseInt(uuid.slice(0,8),16))>>>24,v>>>16&255,v>>>8&255,v&255,(v=parseInt(uuid.slice(9,13),16))>>>8,v&255,(v=parseInt(uuid.slice(14,18),16))>>>8,v&255,(v=parseInt(uuid.slice(19,23),16))>>>8,v&255,(v=parseInt(uuid.slice(24,36),16))/1099511627776&255,v/4294967296&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255)}var parse_default=parse3;var byteToHex=[];for(let i=0;i<256;++i)byteToHex.push((i+256).toString(16).slice(1));function unsafeStringify(arr,offset=0){return(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase()}function stringToBytes(str){str=unescape(encodeURIComponent(str));let bytes=new Uint8Array(str.length);for(let i=0;i<str.length;++i)bytes[i]=str.charCodeAt(i);return bytes}var DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function v35(version,hash,value,namespace,buf,offset){let valueBytes=typeof value=="string"?stringToBytes(value):value,namespaceBytes=typeof namespace=="string"?parse_default(namespace):namespace;if(typeof namespace=="string"&&(namespace=parse_default(namespace)),namespace?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let bytes=new Uint8Array(16+valueBytes.length);if(bytes.set(namespaceBytes),bytes.set(valueBytes,namespaceBytes.length),bytes=hash(bytes),bytes[6]=bytes[6]&15|version,bytes[8]=bytes[8]&63|128,buf){if(offset??=0,offset<0||offset+16>buf.length)throw new RangeError(`UUID byte range ${offset}:${offset+15} is out of buffer bounds`);for(let i=0;i<16;++i)buf[offset+i]=bytes[i];return buf}return unsafeStringify(bytes)}import{createHash}from"node:crypto";function sha1(bytes){return Array.isArray(bytes)?bytes=Buffer.from(bytes):typeof bytes=="string"&&(bytes=Buffer.from(bytes,"utf8")),createHash("sha1").update(bytes).digest()}var sha1_default=sha1;function v5(value,namespace,buf,offset){return v35(80,sha1_default,value,namespace,buf,offset)}v5.DNS=DNS;v5.URL=URL;var v5_default=v5;import{createReadStream,createWriteStream}from"node:fs";import*as fs2 from"node:fs/promises";import{basename,dirname as dirname3,join as join3}from"node:path";import{pipeline}from"node:stream/promises";var ROLLOUT_PATTERN=/^rollout-.*\.jsonl(?:\.zst)?$/,MAX_METADATA_BYTES=1024*1024;function hasCode(error,code){return error.code===code}async function readMeta(path,gateway=!1){let handle=await fs2.open(path,"r"),buffer=new Uint8Array(MAX_METADATA_BYTES+1),length=0,newline=-1;try{for(;length<buffer.length&&newline<0;){let start=length,read=await handle.read(buffer,start,buffer.length-start,start);if(read.bytesRead===0)break;length+=read.bytesRead,newline=buffer.indexOf(10,start)}}finally{await handle.close()}if(newline<0&&length>MAX_METADATA_BYTES)throw new Error(`${basename(path)} metadata exceeds 1 MiB`);let lineEnd=newline<0?length:newline,carriageReturn=buffer[lineEnd-1]===13,record;try{record=JSON.parse(new TextDecoder().decode(buffer.subarray(0,carriageReturn?lineEnd-1:lineEnd)))}catch{return null}let payload=record.payload,id=typeof payload?.id=="string"?payload.id:typeof payload?.session_id=="string"?payload.session_id:"";return record.type!=="session_meta"||!payload||!validate_default(id)||typeof payload.session_id=="string"&&payload.session_id!==id||payload.originator!=="Codex Desktop"&&!(payload.originator==null&&payload.source==="vscode")||(gateway?payload.model_provider!=="vercel":payload.model_provider==="vercel")?null:{record,payload,id,delimiter:newline<0?"":carriageReturn?`\r
|
|
29
29
|
`:`
|
|
30
30
|
`,restOffset:newline<0?length:newline+1}}function codeSpan2(value){return`\`${value.replace(/[`\r\n]/g,"")}\``}async function findRollouts(root){let files=[];async function visit(directory){let entries;try{entries=await fs2.readdir(directory,{withFileTypes:!0})}catch(error){if(hasCode(error,"ENOENT"))return;throw error}for(let entry of entries){let path=join3(directory,entry.name);entry.isDirectory()?await visit(path):entry.isFile()&&ROLLOUT_PATTERN.test(entry.name)&&files.push(path)}}return await visit(root),files}async function planCopy(path,root){let metadata=await readMeta(path),filename=basename(path);if(!metadata||!filename.toLowerCase().includes(metadata.id.toLowerCase()))return null;let destinationId=v5_default(`vercel-ai-gateway/codex/${metadata.id.toLowerCase()}/vercel`,v5_default.URL),destination=join3(dirname3(path),filename.replace(new RegExp(metadata.id,"i"),destinationId)),item={source:path,destination,sourceId:metadata.id,destinationId,bytes:(await fs2.stat(path)).size,root};try{return await fs2.stat(destination),await validateDestination(item),null}catch(error){if(!hasCode(error,"ENOENT"))throw error}return item}async function bodyHash(path,start){let hash=createHash2("sha256");return await pipeline(createReadStream(path,{start}),hash),hash.digest("hex")}async function validateDestination(item){let[source,destination]=await Promise.all([readMeta(item.source),readMeta(item.destination,!0)]),bodies=await Promise.all([bodyHash(item.source,source?.restOffset??0),bodyHash(item.destination,destination?.restOffset??0)]);if(!(source&&destination?.id===item.destinationId&&bodies[0]===bodies[1]))throw new Error(`Existing destination ${basename(item.destination)} is invalid`)}async function copySession(item){let metadata=await readMeta(item.source);if(!metadata)throw new Error("Codex session metadata is no longer valid");if(metadata.id!==item.sourceId)throw new Error("Codex session metadata changed after planning");let updated={...metadata.record,payload:{...metadata.payload,id:item.destinationId,session_id:item.destinationId,model_provider:"vercel"}},temporary=`${item.destination}.tmp-${process.pid}-${randomUUID2()}`;try{return await fs2.writeFile(temporary,`${JSON.stringify(updated)}${metadata.delimiter}`,{flag:"wx",mode:384}),await pipeline(createReadStream(item.source,{start:metadata.restOffset}),createWriteStream(temporary,{flags:"a",mode:384})),await fs2.chmod(temporary,384),await publishNoClobber(temporary,item.destination)?!0:(await validateDestination(item),!1)}finally{await fs2.unlink(temporary).catch(error=>{if(!hasCode(error,"ENOENT"))throw error})}}async function planCodexSessionMigration(home){let codexHome=process.env.CODEX_HOME||join3(home,".codex"),roots=["sessions","archived_sessions"].map(root=>join3(codexHome,root)),files=[];for(let root of roots)files.push(...(await findRollouts(root)).map(path=>({path,root})));if(files.some(file=>file.path.endsWith(".jsonl.zst")))throw new Error("Found compressed Codex sessions; decompress them first, or pass --no-session-migration to leave them unchanged");let copies=[];for(let file of files){let copy=await planCopy(file.path,file.root);copy&&copies.push(copy)}if(copies.length===0)return null;let sourceRoots=[...new Set(copies.map(copy=>copy.root))];return{label:"Codex Desktop sessions",itemCount:copies.length,totalBytes:copies.reduce((total,copy)=>total+copy.bytes,0),sourceRoots,destinationRoots:sourceRoots,prompt:[`Before changing the provider, copy the ${copies.length} top-level Codex Desktop rollout${copies.length===1?"":"s"} with a non-\`vercel\` provider under ${sourceRoots.map(codeSpan2).join(", ")}. Do not copy subagent rollouts whose \`session_id\` differs from \`id\`.`,"For each copy, derive a deterministic UUID v5 using the URL namespace `6ba7b811-9dad-11d1-80b4-00c04fd430c8` and name `vercel-ai-gateway/codex/<source-id>/vercel`. Replace the filename UUID and `session_meta.payload.id`/`session_id`, set `model_provider` to `vercel`, and preserve every later JSONL byte.","Use atomic, no-clobber writes with mode 0600; skip an existing deterministic destination only after validating its metadata and body. Never move, edit, delete, or overwrite an original session file."],async apply(){let copied=0,skipped=0,errors=[];for(let item of copies)try{await copySession(item)?copied++:skipped++}catch(error){errors.push(`${basename(item.source)}: ${error instanceof Error?error.message:String(error)}`)}return{copied,skipped,errors}}}}function codexDir(home){let dir=process.env.CODEX_HOME;return dir&&dir.trim()?dir:join4(home,".codex")}var codex={id:"codex",displayName:"Codex",sessionMigration:{plan:({home})=>planCodexSessionMigration(home)},async detect(home){return pathExists(codexDir(home))},configPath(ctx){return ctx.overrides?.codex??join4(codexDir(ctx.home),"config.toml")},buildPlan(ctx){return{fileChanges:[{path:this.configPath(ctx),label:"Codex config",format:"toml",transform:current=>mergeToml(current,{model_provider:"vercel",model_providers:{vercel:{name:"Vercel AI Gateway",base_url:resolveGatewayBaseUrl(ctx.baseUrlOverride,GATEWAY_CODEX_BASE_URL),env_key:GATEWAY_API_KEY_ENV,wire_api:"responses"}}})}],envExports:[{name:GATEWAY_API_KEY_ENV,value:ctx.apiKey}],notes:["Codex now defaults to the Vercel AI Gateway; pick a model with --model or in config.",`Open a new terminal so ${GATEWAY_API_KEY_ENV} is loaded, or run: export ${GATEWAY_API_KEY_ENV}=<key>`]}}};import{readFile as readFile3,writeFile as writeFile4}from"node:fs/promises";import{access as access2}from"node:fs/promises";import{join as join5}from"node:path";import{homedir}from"node:os";import{spawn}from"node:child_process";var PREFS_FILE="agent-preferences.json",CLAUDE_LEGACY_PLUGIN_ID="vercel-plugin@vercel",CLAUDE_OFFICIAL_MARKETPLACE="claude-plugins-official",CLAUDE_OFFICIAL_MARKETPLACE_SOURCE="anthropics/claude-plugins-official",CLAUDE_OFFICIAL_PLUGIN_ID=`vercel@${CLAUDE_OFFICIAL_MARKETPLACE}`,CLAUDE_DIRECTORY_PLUGIN_ID="vercel@anthropic-plugin-directory",VERCEL_PLUGIN_VERSION_URL="https://raw.githubusercontent.com/vercel/vercel-plugin/main/.claude-plugin/plugin.json",CLAUDE_STATUS_TIMEOUT_MS=15e3,CLAUDE_CHANGE_TIMEOUT_MS=12e4,VERSION_FETCH_TIMEOUT_MS=5e3,promptedAtSchema=external_exports.codec(external_exports.union([external_exports.iso.date(),external_exports.iso.datetime()]),external_exports.date(),{decode:value=>new Date(value),encode:value=>value.toISOString()}),agentPreferencesSchema=external_exports.object({pluginDeclined:external_exports.boolean().optional(),pluginAutoUpdate:external_exports.boolean().optional(),lastPromptedAt:promptedAtSchema.optional(),lastPluginAutoUpdateAttemptedAt:promptedAtSchema.optional(),lastPluginAutoUpdateAttemptedKey:external_exports.string().optional()});async function fileExists(filePath){try{return await access2(filePath),!0}catch{return!1}}async function readPrefs(client){return await client.maybeReadConfig(PREFS_FILE,agentPreferencesSchema)??{}}async function writePrefs(client,prefs){try{await client.writeConfig(PREFS_FILE,agentPreferencesSchema,prefs)}catch{}}async function getSavedPluginAnswer(client){let{pluginDeclined}=await readPrefs(client);return pluginDeclined===void 0?void 0:!pluginDeclined}async function savePluginAnswer(client,accepted){let prefs=await readPrefs(client);prefs.pluginDeclined=!accepted,prefs.pluginAutoUpdate=accepted,await markPromptedToday(client,prefs)}async function hasClaudeVercelPlugin(home){return(await readClaudeInstalledPluginsFromRegistry(join5(claudeDir(home),"plugins","installed_plugins.json"))).some(plugin=>plugin.id===CLAUDE_OFFICIAL_PLUGIN_ID||plugin.id===CLAUDE_DIRECTORY_PLUGIN_ID)}async function readClaudeInstalledPluginsFromRegistry(registryPath=getClaudeInstalledPluginsRegistryPath()){try{let raw=await readFile3(registryPath,"utf-8"),plugins=JSON.parse(raw)?.plugins??{},entries=[];for(let[id,installs]of Object.entries(plugins))if(Array.isArray(installs))for(let install of installs)!install||typeof install!="object"||entries.push({id,...install,enabled:!0});return entries}catch{return[]}}function getClaudeInstalledPluginsRegistryPath(){return join5(homedir(),".claude","plugins","installed_plugins.json")}async function markStaleClaudePluginInstalls(plugins){return Promise.all(plugins.map(async plugin=>plugin.installPath&&!await fileExists(plugin.installPath)?{...plugin,stale:!0}:plugin))}async function removeClaudePluginFromRegistry(pluginId){try{let registryPath=getClaudeInstalledPluginsRegistryPath(),raw=await readFile3(registryPath,"utf-8"),data=JSON.parse(raw);return!data.plugins||!(pluginId in data.plugins)?!1:(delete data.plugins[pluginId],await writeFile4(registryPath,`${JSON.stringify(data,null,2)}
|
|
31
31
|
`,"utf-8"),!0)}catch(err){return output_manager_default.debug(`Failed to remove Claude plugin registry entry: ${err}`),!1}}async function markPromptedToday(client,prefs){prefs.lastPromptedAt=new Date,await writePrefs(client,prefs)}async function runCommand(command,args,timeoutMs){return await new Promise(resolve=>{let child=spawn(command,args,{stdio:["ignore","pipe","pipe"]}),stdout="",stderr="",settled=!1,settle=result=>{settled||(settled=!0,clearTimeout(timer),resolve(result))},timer=setTimeout(()=>{child.kill(),child.stdout?.destroy(),child.stderr?.destroy(),child.unref(),settle({exitCode:1,stdout,stderr:`${stderr}Timed out after ${timeoutMs/1e3} seconds.`})},timeoutMs);child.stdout.on("data",chunk=>{stdout+=chunk.toString()}),child.stderr.on("data",chunk=>{stderr+=chunk.toString()}),child.on("close",code=>{settle({exitCode:code??1,stdout,stderr})}),child.on("error",err=>{settle({exitCode:1,stdout,stderr:`${stderr}${String(err)}`})})})}async function getClaudeInstalledPlugins(){let result=await runCommand("claude",["plugins","list","--json"],CLAUDE_STATUS_TIMEOUT_MS);if(result.exitCode===0)try{let parsed=JSON.parse(result.stdout);if(Array.isArray(parsed))return markStaleClaudePluginInstalls(parsed)}catch(err){output_manager_default.debug(`Failed to parse Claude plugin list JSON: ${err}`)}else result.stderr.trim().length>0&&output_manager_default.debug(`Failed to run 'claude plugins list --json': ${result.stderr}`);return markStaleClaudePluginInstalls(await readClaudeInstalledPluginsFromRegistry())}async function fetchLatestVercelPluginVersion(){try{let response=await fetch(VERCEL_PLUGIN_VERSION_URL,{signal:AbortSignal.timeout(VERSION_FETCH_TIMEOUT_MS)});if(!response.ok){output_manager_default.debug(`Failed to fetch latest Vercel plugin version: ${response.status}`);return}let manifest=await response.json();return typeof manifest.version=="string"?manifest.version:void 0}catch(err){output_manager_default.debug(`Failed to fetch latest Vercel plugin version: ${err}`);return}}function comparePluginVersions(a,b){if(!a&&!b)return 0;if(!a)return-1;if(!b)return 1;let parse4=value=>value.split(".").map(part=>Number.parseInt(part,10)||0),left=parse4(a),right=parse4(b),maxLength=Math.max(left.length,right.length);for(let i=0;i<maxLength;i++){let l=left[i]??0,r=right[i]??0;if(l>r)return 1;if(l<r)return-1}return 0}function buildClaudePluginStatus(installedPlugins,latestVersion){let legacy=installedPlugins.find(plugin=>plugin.id===CLAUDE_LEGACY_PLUGIN_ID),official=installedPlugins.find(plugin=>plugin.id===CLAUDE_OFFICIAL_PLUGIN_ID),state="none";return legacy&&official?state="both":legacy?state="legacy-only":official&&(state="official-only"),{state,legacy,official,latestVersion}}function buildClaudePluginMigrationPlan(status){let plan={installOfficial:!1,updateOfficial:!1,removeLegacy:!1,removeLegacyMarketplace:!1};switch(status.state){case"none":plan.installOfficial=!0;break;case"legacy-only":plan.installOfficial=!0,plan.removeLegacy=!0,plan.removeLegacyMarketplace=!0;break;case"both":plan.removeLegacy=!0,plan.removeLegacyMarketplace=!0;break;case"official-only":break}return status.official?.version&&status.latestVersion&&comparePluginVersions(status.official.version,status.latestVersion)<0&&(plan.updateOfficial=!0),plan}function hasClaudeMigrationActions(plan){return plan.installOfficial||plan.updateOfficial||plan.removeLegacy||plan.removeLegacyMarketplace}function buildClaudePromptCopy(status,plan){if(plan.installOfficial&&status.state==="none")return{message:"Vercel Plugin for Claude Code is not installed.",confirm:"Would you like to install it now?"};if(plan.installOfficial&&status.state==="legacy-only")return{message:"Update available for Vercel Plugin for Claude Code (legacy -> official).",confirm:"Would you like to update now?"};if(status.state==="both"&&plan.removeLegacy)return{message:"Vercel Plugin for Claude Code has a legacy install to clean up.",confirm:"Would you like to update now?"};if(plan.updateOfficial){let fromVersion=status.official?.version,toVersion=status.latestVersion;return{message:`Update available for Vercel Plugin for Claude Code${fromVersion&&toVersion?` (v${fromVersion} -> v${toVersion})`:""}.`,confirm:"Would you like to update now?"}}return{message:"The Vercel plugin needs attention in Claude Code before your agent harness is fully up to date.",confirm:"Apply the Vercel plugin changes for Claude Code?"}}async function runClaudeCommand(spinnerMessage,successMessage,failureMessage,args,options){output_manager_default.spinner(spinnerMessage);let result=await runCommand("claude",args,CLAUDE_CHANGE_TIMEOUT_MS);return output_manager_default.stopSpinner(),result.exitCode===0?(options?.quietSuccess||output_manager_default.success(successMessage),!0):(output_manager_default.warn(failureMessage),output_manager_default.debug(`Claude command failed: claude ${args.join(" ")}
|
|
@@ -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{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-CFJBDBYH.js";var PERMISSIONS_ACTIONS={ls:["ls","list"],add:["add"],rm:["rm","remove"],clear:["clear"]},projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (default: linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Show the next page using the cursor from the previous output",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},permissionsLsSubcommand={name:"ls",aliases:["list"],description:"List teams with access to a repository",arguments:[],options:[projectScopeOption,{...limitOption,description:"Number of results to return per page (default: 100, max: 100)"},nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"List teams with access as JSON",value:`${packageName} vcr permissions my-app ls --json`}]},permissionsAddSubcommand={name:"add",aliases:[],description:"Give one or more teams access to pull images from a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Share a repository with a team by id",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Share a repository with a team by slug",value:`${packageName} vcr permissions my-app add my-team`},{name:"Share a repository with multiple teams",value:`${packageName} vcr permissions my-app add team_1a2b3c4d,other-team`}]},permissionsRmSubcommand={name:"remove",aliases:["rm"],description:"Remove one or more teams' access to a repository",arguments:[{name:"team",required:!0,multiple:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Remove a team's access by id",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Remove multiple teams' access",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d,other-team`}]},permissionsClearSubcommand={name:"clear",aliases:[],description:"Remove access to a repository for every team",arguments:[],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`},{name:"Clear all repository permissions without the confirmation prompt",value:`${packageName} vcr permissions my-app clear --yes`}]},permissionsAggregateCommand={name:"permissions",aliases:["permission"],argumentsBeforeSubcommand:!0,description:"Manage which teams can pull images from a container registry repository",arguments:[{name:"repository",required:!0}],subcommands:[permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand],options:[],examples:[{name:"List teams with access to a repository",value:`${packageName} vcr permissions my-app ls`},{name:"Share a repository with a team",value:`${packageName} vcr permissions my-app add team_1a2b3c4d`},{name:"Remove a team's access to a repository",value:`${packageName} vcr permissions my-app remove team_1a2b3c4d`},{name:"Clear all repository permissions",value:`${packageName} vcr permissions my-app clear`}]};export{PERMISSIONS_ACTIONS,permissionsLsSubcommand,permissionsAddSubcommand,permissionsRmSubcommand,permissionsClearSubcommand,permissionsAggregateCommand};
|
|
@@ -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{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,sinceOption,untilOption}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-B4KA3ZH2.js";import{formatOption,jsonOption,limitOption,projectOption,sinceOption,untilOption}from"./chunk-CFJBDBYH.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};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{withWarnings}from"./chunk-5ZJ6UU6P.js";import{remoteText}from"./chunk-GLIQ4KNY.js";import{agentErrorMetadata,buildCommandWithGlobalFlags,clientObservabilityPlanRecovery,getErrorRecovery,trackAgentError}from"./chunk-IVZF2PMV.js";import{isAPIError}from"./chunk-GOI2VVI7.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{require_strip_ansi}from"./chunk-BULSRTQE.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_strip_ansi=__toESM(require_strip_ansi(),1);function getApiIssues(error){if(typeof error!="object"||error===null)return[];let issues=error.issues;if(!Array.isArray(issues))return[];let result=[];for(let issue of issues){if(typeof issue!="object"||issue===null)continue;let{message,path}=issue;typeof message!="string"||message.length===0||result.push(typeof path=="string"?{path,message}:{message})}return result}function getRollupColumnName(metric,aggregation){return`${metric}_${aggregation}`.replace(/[./]/g,"_")}function getResolvedOrderMetadata(query,response){let orderBy=query.orderBy??(response.orderBy?"count":void 0),orderDirection=response.orderDirection??query.orderDirection;return{...orderBy?{orderBy}:{},...orderDirection?{orderDirection}:{}}}function formatQueryJson(query,response,warnings=[],details){let orderMetadata=getResolvedOrderMetadata(query,response),queryWithResponseMetadata={...query,...orderMetadata};return JSON.stringify(withWarnings({query:queryWithResponseMetadata,summary:response.summary??[],data:response.data??[],...orderMetadata,...details},warnings),null,2)}var PUBLIC_OUTPUT_FIELDS=["kind","metric","aggregation","unit","per","normalize","dependsOn"];function toPublicQueryMeta(meta,outputColumns){let outputs=Object.entries(meta?.outputs??{}).flatMap(([alias,output])=>{let column=outputColumns?outputColumns[alias]:alias;if(!column)return[];let picked={};for(let field of PUBLIC_OUTPUT_FIELDS)output[field]!==void 0&&Object.assign(picked,{[field]:output[field]});return[[column,picked]]});return{...outputs.length>0?{outputs:Object.fromEntries(outputs)}:{},...meta?.projects?{projects:meta.projects}:{},...meta?.excludedIntervals?{excludedIntervals:meta.excludedIntervals}:{},...meta?.effectiveTimeRange?{effectiveTimeRange:meta.effectiveTimeRange}:{}}}function toFlatRow(row){return{...row.timestamp?{timestamp:row.timestamp}:{},...row.dimensions,...row.isRemainder?{isRemainder:!0}:{},...row.values}}function formatDataQueryJson(query,response){return JSON.stringify({query,summary:(response.summary??[]).map(toFlatRow),data:(response.series??[]).map(toFlatRow),queryId:response.queryId??null,meta:toPublicQueryMeta(response.meta)},null,2)}function formatErrorJson(code,message,allowedValues,recovery={}){let error={code,message};return allowedValues&&allowedValues.length>0&&(error.allowedValues=allowedValues),JSON.stringify({error:{...error,...recovery}},null,2)}var MAX_HUMAN_ISSUES=5;function projectSelectorFromArgv(argv){let args=argv.slice(2);for(let i=0;i<args.length;i++){let arg=args[i];if(arg.startsWith("--project="))return arg.slice(10);if(arg==="--project"&&i+1<args.length)return args[i+1]}}function hintRestatesCommand(hint,steps){if(!steps?.length)return!1;let plain=(0,import_strip_ansi.default)(hint).replace(/`/g,"").trim();return steps.some(step=>{let command=step.command.trim();return command===plain||command.startsWith(`${plain} `)})}function handleApiError(err,jsonOutput,client,overrides={},target={}){let code,message,override=overrides[err.status];if(override)code=override.code||err.code||"BAD_REQUEST",message=override.message;else switch(err.status){case 402:code=err.code||"PAYMENT_REQUIRED",message=err.serverMessage||"This feature requires an Observability Plus subscription.";break;case 429:code=err.code||"RATE_LIMITED",message=err.serverMessage||"You have reached the metrics query rate limit. Please wait and try again. If you need a higher limit, request one from your Vercel account team.";break;case 403:code="FORBIDDEN",message=err.serverMessage&&err.serverMessage!=="Response Error"?err.serverMessage:"You do not have permission to query metrics for this project/team.";break;case 500:code="INTERNAL_ERROR",message="An internal error occurred. Please try again later.";break;case 504:code="TIMEOUT",message="The query timed out. Try a shorter time range or fewer groups.";break;case 400:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`;break;default:code=err.code||"BAD_REQUEST",message=err.serverMessage||`API error (${err.status})`}let billing=err.status===402?clientObservabilityPlanRecovery(client,err,message,target.projectName??projectSelectorFromArgv(client.argv),target.scope):void 0,recovery={...getErrorRecovery({...err,serverMessage:message},client),...billing&&{hint:billing.hint}},next=billing?.command?[{command:buildCommandWithGlobalFlags(client.argv.filter(arg=>!/^(?:--yes|--force|-y)(?:=|$)/.test(arg)),billing.command,void 0,{excludeFlags:billing.excludeFlags,preserveProject:billing.preserveProject}),when:billing.when}]:void 0;recovery.hint&&hintRestatesCommand(recovery.hint,next)&&delete recovery.hint;let issues=getApiIssues(err),details={...recovery,...next&&{next},...issues.length>0&&{issues},...agentErrorMetadata(client)};if(trackAgentError(client,{reason:err.status===403?"forbidden":err.status===402?"payment_required":err.status===429?"rate_limited":code,...recovery}),jsonOutput||client.nonInteractive)client.stdout.write(formatErrorJson(code,message,err.allowedValues,details));else{let issueRows=issues.slice(0,MAX_HUMAN_ISSUES).map(issue=>remoteText(issue.message));issues.length>MAX_HUMAN_ISSUES&&issueRows.push(`and ${issues.length-MAX_HUMAN_ISSUES} more`),output_manager_default.fatal([message,...issueRows].join(`
|
|
8
|
+
`)),recovery.hint&&output_manager_default.print(` ${recovery.hint}
|
|
9
|
+
`);for(let step of next??[])output_manager_default.print(` ${step.command}
|
|
10
|
+
`);err.allowedValues&&err.allowedValues.length>0&&output_manager_default.print(`
|
|
11
|
+
Available values: ${err.allowedValues.join(", ")}
|
|
12
|
+
`)}return 1}var OBSERVABILITY_METRICS_PATH="/metrics/v1",METRIC_CATALOG_PAGE_SIZE=250;async function fetchMetricCatalog(client,accountId,kind,search,activeSince){let metrics=[],cursor=null;do{let searchParams=new URLSearchParams({limit:String(METRIC_CATALOG_PAGE_SIZE),kind});search&&searchParams.set("search",search),activeSince&&searchParams.set("activeSince",activeSince),cursor&&searchParams.set("cursor",cursor);let response=await client.fetch(`${OBSERVABILITY_METRICS_PATH}?${searchParams}`,{accountId,bailOn429:!0});metrics.push(...response.metrics.map(metric=>({id:metric.id,description:metric.description,dimensions:metric.dimensions,unit:metric.unit,aggregations:metric.aggregations}))),cursor=response.pagination.hasMore?response.pagination.nextCursor:null}while(cursor);return metrics.filter(metric=>(kind==="all"||(kind==="system"?metric.id.startsWith("vercel."):!metric.id.startsWith("vercel.")))&&(!search||metric.id.startsWith(search))).sort((left,right)=>left.id.localeCompare(right.id))}async function fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince){let metrics=await fetchMetricCatalog(client,accountId,kind,metricId,activeSince),exactMetric=metrics.find(metric=>metric.id===metricId);return exactMetric?[exactMetric]:metrics}async function fetchSchemaOrExit(client,jsonOutput,operation,accountId){try{return await operation()}catch(err){if(isAPIError(err))return handleApiError(err,jsonOutput,client,{401:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."},403:{code:"SCHEMA_UNAUTHORIZED",message:"The metrics schema API request was not authorized. Run `vercel login` to authenticate and `vercel switch` to select a team, then try again."}},accountId?.startsWith("team_")?{scope:accountId}:{});let message=err instanceof Error?`Failed to fetch metrics schema: ${err.message}`:`Failed to fetch metrics schema: ${String(err)}`;return jsonOutput?client.stdout.write(formatErrorJson("SCHEMA_FETCH_FAILED",message)):output_manager_default.error(message),1}}function fetchCatalogMetricDetailOrExit(client,accountId,jsonOutput,metricId,kind,activeSince){return fetchSchemaOrExit(client,jsonOutput,()=>fetchCatalogMetricDetail(client,accountId,metricId,kind,activeSince),accountId)}function fetchMetricCatalogListOrExit(client,accountId,jsonOutput){return fetchSchemaOrExit(client,jsonOutput,()=>fetchMetricCatalog(client,accountId,"all").then(metrics=>metrics.map(({id,description})=>({id,description}))),accountId)}export{getApiIssues,getRollupColumnName,getResolvedOrderMetadata,formatQueryJson,toPublicQueryMeta,formatDataQueryJson,formatErrorJson,handleApiError,OBSERVABILITY_METRICS_PATH,fetchCatalogMetricDetailOrExit,fetchMetricCatalogListOrExit};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{outputError}from"./chunk-ZJNDLFZ7.js";import{getScope}from"./chunk-
|
|
7
|
+
import{outputError}from"./chunk-ZJNDLFZ7.js";import{getScope}from"./chunk-LU65WWOQ.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-IVZF2PMV.js";import{getLinkedProject}from"./chunk-YY7GJKYH.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{ProjectNotFound,isAPIError}from"./chunk-GOI2VVI7.js";function emitAlertsScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveAlertsScope(client,opts){let command=opts.command??"alerts",projectCommand=`${command} --project <name_or_id>`,allCommand=`${command} --all`;if(opts.all||opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitAlertsScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project or --all with alerts.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}if(opts.all)return{teamId:team.id};let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitAlertsScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitAlertsScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a valid project (replace <name_or_id>)"}]})}return{teamId:team.id,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or use --project <name> or --all.";return emitAlertsScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project or --all when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with an explicit project (replace <name_or_id>)"},{command:buildCommandWithGlobalFlags(client.argv,allCommand),when:"Use team-wide scope without a linked project"}]})}return scopeFromLinkedProject(linkedProject)}function scopeFromLinkedProject(linkedProject){return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope,scopeFromLinkedProject};
|
|
@@ -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{resolveProjectContext}from"./chunk-
|
|
7
|
+
import{resolveProjectContext}from"./chunk-EHJJZKCB.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-IVZF2PMV.js";import{parseArguments}from"./chunk-LYL26S3N.js";import{getCommandName,getCommandNamePlain}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-AP6DZGTK.js";import{getFlagsSpecification,getGlobalFlagsFromArgs}from"./chunk-CFJBDBYH.js";async function requireProjectContext(client,command,projectName){let link=await resolveProjectContext({client,projectNameOrId:projectName});if(link.status==="error")return link.exitCode;if(link.status==="not_linked"){if(client.nonInteractive)if(command==="redirects"){let linkCmd=getCommandNamePlain("link");outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,message:`Your codebase isn't linked to a project on Vercel. Run ${linkCmd} to begin.`,next:[{command:linkCmd}]},1)}else{let flags=getGlobalFlagsFromArgs(client.argv.slice(2)),cmd=getCommandNamePlain(`link ${flags.join(" ")}`.trim());return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_LINKED,userActionRequired:!0,message:`Your codebase is not linked to a Vercel project. Run link first, then retry ${command} commands.`,next:[{command:cmd,when:"to link this directory to a project"}]},1),1}return output_manager_default.error(`Your codebase isn't linked to a project on Vercel. Run ${getCommandName("link")} to begin.`),1}return client.config.currentTeam=link.org.type==="team"?link.org.id:void 0,link}function parseSubcommandArguments(argv,command){let flagsSpecification=getFlagsSpecification(command.options);return parseArguments(argv,flagsSpecification)}function validateRequiredArguments(args,required){for(let i=0;i<required.length;i++)if(!args[i])return`Missing required argument: ${required[i]}`;return null}export{requireProjectContext,parseSubcommandArguments,validateRequiredArguments};
|
|
@@ -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{parseArguments}from"./chunk-
|
|
7
|
+
import{parseArguments}from"./chunk-LYL26S3N.js";import{require_cli_config}from"./chunk-4SAVH3H7.js";import{__toESM}from"./chunk-BZENIQ7N.js";var config=__toESM(require_cli_config(),1);import path from"node:path";function getGlobalPathConfig2(argvSlice=process.argv.slice(2),cwd=process.cwd()){let confFlag=parseArguments(argvSlice,{},{permissive:!0}).flags["--global-config"];return confFlag?path.resolve(cwd,confFlag):config.getGlobalPathConfig()}export{getGlobalPathConfig2 as getGlobalPathConfig};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{ensureLink}from"./chunk-
|
|
7
|
+
import{ensureLink}from"./chunk-EJEW7ZD2.js";import{argvHasNonInteractive}from"./chunk-IVZF2PMV.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-YY7GJKYH.js";import{getProjectByNameOrId}from"./chunk-LOA7SZWH.js";import{LinkRequiredError,ProjectNotFound}from"./chunk-GOI2VVI7.js";async function getProjectByCwdOrLink({autoConfirm,nonInteractive,client,commandName,cwd,projectNameOrId,forReadOnlyCommand,skipOwnerLookup}){if(projectNameOrId){let project=await getProjectByNameOrId(client,projectNameOrId);if(project instanceof ProjectNotFound)throw project;return project}let effectiveNonInteractive=nonInteractive??client.nonInteractive??argvHasNonInteractive(client.argv);if(forReadOnlyCommand&&effectiveNonInteractive){let resolvedCwd=await resolveProjectCwd(cwd??client.cwd),link=await getLinkedProject(client,{cwd:resolvedCwd,skipOwnerLookup});if(link.status==="linked"&&link.project)return link.project;if(link.status==="error"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}throw new LinkRequiredError}let linkedProject=await ensureLink(commandName,client,cwd??client.cwd,{autoConfirm,nonInteractive,skipOwnerLookup});if(typeof linkedProject=="number"){let err=new Error("Link project error");throw err.code="ERR_LINK_PROJECT",err}return linkedProject.project}export{getProjectByCwdOrLink};
|