@vercel/cli-support 66.6.0 → 68.0.0-snapshot-c9dfd83f2293
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-NIIHCHGH.js +8 -0
- package/dist/chunks/add-ORZO4EJ7.js +8 -0
- package/dist/chunks/add-SKRNSMC6.js +8 -0
- package/dist/chunks/{alerts-72Q42HNT.js → alerts-MNMZH6BO.js} +1 -1
- package/dist/chunks/build-P7KKWO4O.js +7 -0
- package/dist/chunks/{chunk-ZZD5W5KT.js → chunk-23FY4PR3.js} +1 -1
- package/dist/chunks/{chunk-YTRKHRL3.js → chunk-27FVSW45.js} +1 -1
- package/dist/chunks/{chunk-IIK6GUVI.js → chunk-2BK7SZQA.js} +1 -1
- package/dist/chunks/{chunk-WJX5PGNN.js → chunk-2DH6LTUI.js} +1 -1
- package/dist/chunks/{chunk-D2TVI7KK.js → chunk-2HFP22IP.js} +4 -4
- package/dist/chunks/{chunk-7AVHDJSP.js → chunk-2KXLL3DX.js} +4 -4
- package/dist/chunks/{chunk-YEDS2UMW.js → chunk-2ZN4JRDA.js} +1 -1
- package/dist/chunks/{chunk-DJZBJC2A.js → chunk-3AFEVHHY.js} +1 -1
- package/dist/chunks/{chunk-FOFX7LHS.js → chunk-3OPLG6HM.js} +1 -1
- package/dist/chunks/{chunk-Q66LJNIV.js → chunk-3RFQ2NXZ.js} +1 -1
- package/dist/chunks/{chunk-F4UEGELU.js → chunk-3VNS4D7V.js} +1 -1
- package/dist/chunks/{chunk-XAGG5BJT.js → chunk-43XDA7ST.js} +1 -1
- package/dist/chunks/{chunk-OXS5VO4X.js → chunk-4D5DAM3D.js} +1 -1
- package/dist/chunks/chunk-4Z6R5KHZ.js +78 -0
- package/dist/chunks/{chunk-5KSBRQI2.js → chunk-5727HGA6.js} +1 -1
- package/dist/chunks/{chunk-6GE4V7MW.js → chunk-572VGS6P.js} +2 -2
- package/dist/chunks/{chunk-O7GNYVVM.js → chunk-5OGPMRRQ.js} +2 -2
- package/dist/chunks/{chunk-UUBPAYTG.js → chunk-5RMIM4S2.js} +1 -1
- package/dist/chunks/chunk-67GZ5REA.js +7 -0
- package/dist/chunks/{chunk-VHSAI6FS.js → chunk-6FEMU5YF.js} +1 -1
- package/dist/chunks/chunk-6JTZZSFH.js +7 -0
- package/dist/chunks/{chunk-UDZJCD5W.js → chunk-6KNWKZR4.js} +1 -1
- package/dist/chunks/{chunk-ZKNEIE44.js → chunk-6NC2JFUQ.js} +1 -1
- package/dist/chunks/{chunk-5O4AXCN7.js → chunk-6OJVCMG5.js} +1 -1
- package/dist/chunks/{chunk-X7KKWUPS.js → chunk-6WBEU34Y.js} +1 -1
- package/dist/chunks/{chunk-NBTFAXL4.js → chunk-6Z5REGCM.js} +1 -1
- package/dist/chunks/{chunk-VPSR2O55.js → chunk-7AAYWDIZ.js} +3 -3
- package/dist/chunks/{chunk-WIF4VGYZ.js → chunk-7GJ37QPL.js} +1 -1
- package/dist/chunks/chunk-7HQZRU25.js +10 -0
- package/dist/chunks/{chunk-XECELSF5.js → chunk-7JU5RJ3H.js} +1 -1
- package/dist/chunks/{chunk-KSGN5OCV.js → chunk-7K5ZWVDL.js} +1 -1
- package/dist/chunks/{chunk-UQZZX2J7.js → chunk-7OZ7OKPS.js} +1 -1
- package/dist/chunks/{chunk-PFOOPXTN.js → chunk-7RABG6HV.js} +2 -2
- package/dist/chunks/{chunk-AMH5MXDW.js → chunk-7WDSOKOY.js} +1 -1
- package/dist/chunks/{chunk-ELM2KPYX.js → chunk-A4LOQ3UK.js} +1 -1
- package/dist/chunks/{chunk-SYJXONEV.js → chunk-A6CMQOL7.js} +1 -1
- package/dist/chunks/chunk-AOPFMMUK.js +13 -0
- package/dist/chunks/{chunk-2OMI3IUW.js → chunk-AVXX4Q6S.js} +1 -1
- package/dist/chunks/{chunk-YEUIG3JC.js → chunk-AZVSMIPP.js} +1 -1
- package/dist/chunks/{chunk-XLYO5QNG.js → chunk-B7IUFV5P.js} +2 -2
- package/dist/chunks/{chunk-IF6GA273.js → chunk-BGIGZUFG.js} +1 -1
- package/dist/chunks/{chunk-YLLFLPNA.js → chunk-BHL2HM6I.js} +1 -1
- package/dist/chunks/{chunk-YIOMTAUF.js → chunk-BKFRN6C2.js} +1 -1
- package/dist/chunks/chunk-BS32OUOC.js +7 -0
- package/dist/chunks/{chunk-YJNMDXEG.js → chunk-BUBVZ6SQ.js} +1 -1
- package/dist/chunks/{chunk-VZ4URN3U.js → chunk-BYBELFCP.js} +1 -1
- package/dist/chunks/{chunk-B7GCRM5I.js → chunk-BYYNR34Q.js} +1 -1
- package/dist/chunks/{chunk-5TMHRECT.js → chunk-CAJ2OUSR.js} +1 -1
- package/dist/chunks/chunk-CDJ25IKC.js +7 -0
- package/dist/chunks/chunk-CJMNUD2I.js +12 -0
- package/dist/chunks/chunk-CSNP5RIM.js +11 -0
- package/dist/chunks/{chunk-REJLEESP.js → chunk-CTMTO2W4.js} +1 -1
- package/dist/chunks/{chunk-K3MGQQEP.js → chunk-D5JQZXL7.js} +1 -1
- package/dist/chunks/{chunk-6PDKIOAO.js → chunk-DEFA6XAB.js} +1 -1
- package/dist/chunks/{chunk-OE26EQSH.js → chunk-DEX4QU4S.js} +1 -1
- package/dist/chunks/{chunk-W2L24GM7.js → chunk-DMA77UYG.js} +1 -1
- package/dist/chunks/{chunk-LM3YPF3K.js → chunk-DOOBZO4W.js} +1 -1
- package/dist/chunks/chunk-DORCX7UB.js +7 -0
- package/dist/chunks/{chunk-C335SWOB.js → chunk-DUSMVY4N.js} +1 -1
- package/dist/chunks/{chunk-XDYVJWGX.js → chunk-E5A7E7X6.js} +1 -1
- package/dist/chunks/{chunk-GLCSWIB4.js → chunk-E7IN2DGU.js} +1 -1
- package/dist/chunks/chunk-EYRBV6RM.js +25 -0
- package/dist/chunks/{chunk-AKOYIH3A.js → chunk-F4KY2TOK.js} +1 -1
- package/dist/chunks/{chunk-DZ77BIEV.js → chunk-F4ZKTFQH.js} +1 -1
- package/dist/chunks/chunk-F7X6O4ZC.js +7 -0
- package/dist/chunks/{chunk-TSNRTRIM.js → chunk-FB37TFVF.js} +1 -1
- package/dist/chunks/{chunk-BCAI7MED.js → chunk-FGWYM3SF.js} +1 -1
- package/dist/chunks/{chunk-SYVWRGFQ.js → chunk-FGXULLNK.js} +1 -1
- package/dist/chunks/{chunk-T7GKQYWA.js → chunk-FXLZM6Q7.js} +1 -1
- package/dist/chunks/{chunk-JBYROCAC.js → chunk-FYM5EUNW.js} +1 -1
- package/dist/chunks/{chunk-RVIJRFVD.js → chunk-G24EKATW.js} +1 -1
- package/dist/chunks/chunk-GQXKF3PR.js +7 -0
- package/dist/chunks/{chunk-2G2SALNN.js → chunk-H2QMSLKJ.js} +1 -1
- package/dist/chunks/{chunk-33HVDSWP.js → chunk-HMJR6RVF.js} +1 -1
- package/dist/chunks/{chunk-S4AANAHX.js → chunk-HQ3ZFXXQ.js} +1 -1
- package/dist/chunks/chunk-HYGWJQN6.js +8 -0
- package/dist/chunks/chunk-I4O53MKV.js +8 -0
- package/dist/chunks/{chunk-TOTTVS5P.js → chunk-ID663OJ7.js} +1 -1
- package/dist/chunks/{chunk-FFN3EGSF.js → chunk-IKNAOU5O.js} +1 -1
- package/dist/chunks/{chunk-CINNNQDJ.js → chunk-INIZJZ3O.js} +1 -1
- package/dist/chunks/{chunk-LNZEYUEC.js → chunk-IVZNPSHU.js} +1 -1
- package/dist/chunks/{chunk-YOAQNRBN.js → chunk-IY7OKDHU.js} +3 -3
- package/dist/chunks/{chunk-2D5PTFAY.js → chunk-J7POLUHY.js} +1 -1
- package/dist/chunks/{chunk-6CJFPT4F.js → chunk-JDDPCL3K.js} +1 -1
- package/dist/chunks/chunk-JR25PLC7.js +13 -0
- package/dist/chunks/chunk-JV3YIOCO.js +7 -0
- package/dist/chunks/{chunk-RBW62SOU.js → chunk-JXE7GYE3.js} +1 -1
- package/dist/chunks/{chunk-EFP3LK4G.js → chunk-K5SM5NIY.js} +1 -1
- package/dist/chunks/chunk-K6KS5GZD.js +16 -0
- package/dist/chunks/chunk-K7TSWIKR.js +12 -0
- package/dist/chunks/{chunk-FEJD7MRH.js → chunk-KA2KG3SY.js} +1 -1
- package/dist/chunks/{chunk-GUGP6OY2.js → chunk-KFBA2MAV.js} +1 -1
- package/dist/chunks/{table-W6LOHWWF.js → chunk-KG526MHL.js} +1 -1
- package/dist/chunks/chunk-KHMNANEN.js +7 -0
- package/dist/chunks/chunk-KVXEYKIX.js +7 -0
- package/dist/chunks/{chunk-F37XFLFP.js → chunk-L3YEI2RW.js} +1 -1
- package/dist/chunks/{chunk-54FY6GJ5.js → chunk-L46V6VL3.js} +1 -1
- package/dist/chunks/chunk-LD25KYMI.js +30 -0
- package/dist/chunks/{chunk-ANIA2G6F.js → chunk-LDDXXDN5.js} +1 -1
- package/dist/chunks/{chunk-M7FED5YP.js → chunk-M2Q2DUHO.js} +1 -1
- package/dist/chunks/{chunk-5ZCSFPWG.js → chunk-MDRI27KN.js} +1 -1
- package/dist/chunks/{chunk-2AU6O6Z5.js → chunk-MJ77FDK2.js} +1 -1
- package/dist/chunks/{chunk-GHNHUSVK.js → chunk-MMMJO2M3.js} +1 -1
- package/dist/chunks/chunk-N4PID4SD.js +7 -0
- package/dist/chunks/chunk-N6MNUNZ4.js +37 -0
- package/dist/chunks/chunk-NMY2YZ6M.js +8 -0
- package/dist/chunks/{chunk-QRG24GJG.js → chunk-NOAZDAOU.js} +1 -1
- package/dist/chunks/{chunk-ZJNDLFZ7.js → chunk-OOPF73RV.js} +1 -1
- package/dist/chunks/{chunk-YRKW42CD.js → chunk-OQXHBPPS.js} +1 -1
- package/dist/chunks/{chunk-SQCVI2EG.js → chunk-OVWS4CFW.js} +1 -1
- package/dist/chunks/{chunk-WAFBTC45.js → chunk-PHPJS2G2.js} +1 -1
- package/dist/chunks/{chunk-TNQUCTJH.js → chunk-PPCZYUSO.js} +1 -1
- package/dist/chunks/chunk-PZL7NSDA.js +24 -0
- package/dist/chunks/{chunk-OISNKAC6.js → chunk-Q45SQL44.js} +2 -2
- package/dist/chunks/{chunk-XDWAUOFO.js → chunk-Q4XCBBWK.js} +1 -1
- package/dist/chunks/chunk-Q7HFUXJ4.js +10 -0
- package/dist/chunks/chunk-QFE3RPMA.js +19 -0
- package/dist/chunks/{chunk-L5PIUIUM.js → chunk-QFSIUMC6.js} +1 -1
- package/dist/chunks/{chunk-CSCUVSJM.js → chunk-QG5UBKDA.js} +1 -1
- package/dist/chunks/{chunk-KLYFOXYH.js → chunk-QGS3ERDZ.js} +3 -3
- package/dist/chunks/{chunk-3UZE566G.js → chunk-QSL6AG2B.js} +1 -1
- package/dist/chunks/chunk-QU74BFN2.js +10 -0
- package/dist/chunks/{chunk-ACN6DBTC.js → chunk-R3QHEJL6.js} +1 -1
- package/dist/chunks/{chunk-BDXK4TCN.js → chunk-RHFNVIFD.js} +1 -1
- package/dist/chunks/chunk-RPYIWRSN.js +7 -0
- package/dist/chunks/{chunk-AP6DZGTK.js → chunk-RYSO5U3E.js} +1 -1
- package/dist/chunks/{chunk-N6JHFCWC.js → chunk-S7Y24A5X.js} +1 -1
- package/dist/chunks/chunk-SGNDE4YS.js +7 -0
- package/dist/chunks/{chunk-OF32Z3UP.js → chunk-SHJ3XTD3.js} +1 -1
- package/dist/chunks/{chunk-R33HJGYA.js → chunk-SHL6BPBV.js} +1 -1
- package/dist/chunks/{chunk-GLIQ4KNY.js → chunk-SQ62IODX.js} +1 -1
- package/dist/chunks/{chunk-PIDEH4SJ.js → chunk-T44RB754.js} +1 -1
- package/dist/chunks/{chunk-DHKWTBF6.js → chunk-T4DOV5S4.js} +1 -1
- package/dist/chunks/chunk-T5JHWXS5.js +8 -0
- package/dist/chunks/{chunk-TJUZVODP.js → chunk-TLKBGAOL.js} +1 -1
- package/dist/chunks/{chunk-ZA5O22ZY.js → chunk-TOCPUQ6N.js} +1 -1
- package/dist/chunks/{chunk-CJZE7647.js → chunk-U5SZQUYO.js} +1 -1
- package/dist/chunks/chunk-UAS3WUFB.js +11 -0
- package/dist/chunks/chunk-VIOIR6II.js +7 -0
- package/dist/chunks/{chunk-3A3GU62R.js → chunk-VMRFCU6F.js} +1 -1
- package/dist/chunks/{chunk-Y77DXGGN.js → chunk-VQZ773A2.js} +1 -1
- package/dist/chunks/chunk-VWKA6RKB.js +7 -0
- package/dist/chunks/{chunk-FCTTEFC5.js → chunk-WAOS5OCB.js} +1 -1
- package/dist/chunks/chunk-WBEPIG4S.js +31 -0
- package/dist/chunks/{chunk-AFHZC47H.js → chunk-WBXM3W44.js} +1 -1
- package/dist/chunks/{chunk-MINTHN6C.js → chunk-WEL2Y6OH.js} +1 -1
- package/dist/chunks/{chunk-RDDIWY3O.js → chunk-WGU2IQPY.js} +3 -3
- package/dist/chunks/{chunk-DOMBKOLJ.js → chunk-WLD4SGKM.js} +1 -1
- package/dist/chunks/{chunk-6FYPSSL4.js → chunk-X6JQI64G.js} +1 -1
- package/dist/chunks/{chunk-L75A5BMY.js → chunk-X755TPX6.js} +1 -1
- package/dist/chunks/{chunk-QZKRVE44.js → chunk-XQZBXQZ2.js} +1 -1
- package/dist/chunks/{chunk-AB4WXRCO.js → chunk-Y3V4JYK6.js} +1 -1
- package/dist/chunks/{chunk-LKW6GVP2.js → chunk-Y4YBQUQM.js} +1 -1
- package/dist/chunks/{chunk-I5KIA2XV.js → chunk-YBAGKQXC.js} +1 -1
- package/dist/chunks/{chunk-3OZCZF4N.js → chunk-YFOBGEOW.js} +1 -1
- package/dist/chunks/{chunk-E4VPDMRQ.js → chunk-YJJCELMY.js} +1 -1
- package/dist/chunks/chunk-YLXXGQQQ.js +7 -0
- package/dist/chunks/{chunk-BMIYC2MH.js → chunk-YN3HZJXW.js} +1 -1
- package/dist/chunks/chunk-YNMTP26U.js +7 -0
- package/dist/chunks/chunk-YTSGFU5T.js +7 -0
- package/dist/chunks/{chunk-Z2PTPD6J.js → chunk-YTSUDTAK.js} +1 -1
- package/dist/chunks/{chunk-QZJOKECY.js → chunk-YYDI5Q5K.js} +2 -2
- package/dist/chunks/{chunk-DOBV3XLO.js → chunk-Z3YQZSU4.js} +1 -1
- package/dist/chunks/chunk-Z643WTC4.js +15 -0
- package/dist/chunks/{chunk-D2E4COIY.js → chunk-ZBZQEDZY.js} +1 -1
- package/dist/chunks/chunk-ZRFDZO7Y.js +7 -0
- package/dist/chunks/chunk-ZSEFELXB.js +23 -0
- package/dist/chunks/{chunk-UECFEOOH.js → chunk-ZXSZH7N5.js} +1 -1
- package/dist/chunks/clear-B3I7ZYEY.js +8 -0
- package/dist/chunks/cli-embedded-NR5F35LW.js +87 -0
- package/dist/chunks/compile-vercel-config-ZQMPTEM6.js +7 -0
- package/dist/chunks/config-4GZY5MR4.js +7 -0
- package/dist/chunks/config-ZY22VRFX.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/{connect-git-provider-CIRRFPI2.js → connect-git-provider-WGKVFXW2.js} +1 -1
- package/dist/chunks/create-project-BTOHPKZB.js +7 -0
- package/dist/chunks/delete-K2HS7YCM.js +10 -0
- package/dist/chunks/delete-RVTGE4BU.js +9 -0
- package/dist/chunks/describe-5ZCOXUID.js +25 -0
- package/dist/chunks/detect-projects-AZXG6BRD.js +7 -0
- package/dist/chunks/detect-services-FLNYWWJS.js +7 -0
- package/dist/chunks/disable-AS6DQMHM.js +7 -0
- package/dist/chunks/discard-PYU5CG67.js +14 -0
- package/dist/chunks/edit-HSMIPVPN.js +9 -0
- package/dist/chunks/edit-RLRJSNZY.js +8 -0
- package/dist/chunks/enable-JPWR5EPC.js +7 -0
- package/dist/chunks/{engine-D8YAsQS_-WNPHYRQF.js → engine-C8wCzkw--PYVABGU4.js} +1 -1
- package/dist/chunks/esm-5GQXHN7C.js +9 -0
- package/dist/chunks/esm-FJCIOBBV.js +7 -0
- package/dist/chunks/{esm-FSME24KA.js → esm-IYH32MTQ.js} +1 -1
- package/dist/chunks/esm-LEQXRLFV.js +9 -0
- package/dist/chunks/esm-NHCCFW7Z.js +7 -0
- package/dist/chunks/esm-QQ3MUOW4.js +7 -0
- package/dist/chunks/esm-T655CG6O.js +7 -0
- package/dist/chunks/{exec-ALB7WFEF.js → exec-PCSP64LR.js} +1 -1
- package/dist/chunks/{export-TOSUN6JO.js → export-6WFWSAO4.js} +2 -3
- package/dist/chunks/future-QLQMHIPL.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-JKVOVQ3B.js +7 -0
- package/dist/chunks/image-POIJ2G2Y.js +7 -0
- package/dist/chunks/import-builders-YF5MX6ZA.js +7 -0
- package/dist/chunks/{inspect-SX3QQUEQ.js → inspect-4CURZZPU.js} +1 -1
- package/dist/chunks/{inspect-DFYVVIJW.js → inspect-BAYMK22S.js} +1 -1
- package/dist/chunks/inspect-JTBMNWWI.js +13 -0
- package/dist/chunks/{inspect-GBH7FAW6.js → inspect-TBQRBTX3.js} +1 -1
- package/dist/chunks/inspect-W4WSFBOF.js +9 -0
- package/dist/chunks/{inspect-4Y2OD5MI.js → inspect-YKSWSH3T.js} +1 -1
- package/dist/chunks/{list-HD6KXAIG.js → list-E65OFWSS.js} +1 -1
- package/dist/chunks/list-EWYN3F4Y.js +12 -0
- package/dist/chunks/{list-MW2FV253.js → list-ZHES2WYK.js} +1 -1
- package/dist/chunks/{list-4RRL326Z.js → list-ZWJDFJNY.js} +1 -1
- package/dist/chunks/login-JAKNSTW3.js +9 -0
- package/dist/chunks/login-JRGX6HGZ.js +7 -0
- package/dist/chunks/logs-3DPLX3CB.js +7 -0
- package/dist/chunks/{ls-VFE7PE25.js → ls-5YLM3ICH.js} +1 -1
- package/dist/chunks/ls-6HPMZVYA.js +11 -0
- package/dist/chunks/{ls-RKOM46KV.js → ls-FWOTN6V6.js} +1 -1
- package/dist/chunks/{ls-I767MTW4.js → ls-MW3WIHH5.js} +1 -1
- package/dist/chunks/{ls-Q4WGEEBZ.js → ls-RAVFLQTQ.js} +1 -1
- package/dist/chunks/ls-SY2FW3WA.js +8 -0
- package/dist/chunks/{ls-TLEAYYXQ.js → ls-ZX5FNEK2.js} +1 -1
- package/dist/chunks/migrate-experimental-services-XYUCY2G6.js +7 -0
- package/dist/chunks/mutate-4KTZMM3X.js +9 -0
- package/dist/chunks/{native-self-update-JDTL3IBF.js → native-self-update-Q3EN6NZK.js} +1 -1
- package/dist/chunks/notifications-LBZ7KWGS.js +7 -0
- package/dist/chunks/open-PXLVSFII.js +7 -0
- package/dist/chunks/{openapi-NEYEIRF2.js → openapi-6RKKA6JG.js} +1 -1
- package/dist/chunks/permissions-DQ5AF6XL.js +7 -0
- package/dist/chunks/{plugin-offer-NPJAEILN.js → plugin-offer-VU3R572E.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-AJH3HM36.js +7 -0
- package/dist/chunks/publish-QJJL3IHG.js +15 -0
- package/dist/chunks/pull-3PQHXMPB.js +7 -0
- package/dist/chunks/purchase-domain-if-available-IFCQ4QFP.js +7 -0
- package/dist/chunks/push-4VIQFKP3.js +7 -0
- package/dist/chunks/query-BQ4HYVQ7.js +7 -0
- package/dist/chunks/raw-query-VA6VVMR4.js +8 -0
- package/dist/chunks/reauthenticate-2SMCQQHF.js +7 -0
- package/dist/chunks/{remove-IEEZGRB2.js → remove-CSIMGLLS.js} +1 -1
- package/dist/chunks/reorder-ERRB7OJL.js +10 -0
- package/dist/chunks/reply-XCBWXFWS.js +9 -0
- package/dist/chunks/repo-root-DZ6WFHMP.js +7 -0
- package/dist/chunks/resolve-VWGZ632M.js +12 -0
- package/dist/chunks/resolve-agent-team-NWELD5FN.js +7 -0
- package/dist/chunks/{resolve-deployment-framework-preset-4TKUU6AH.js → resolve-deployment-framework-preset-BLMQLCIN.js} +1 -1
- package/dist/chunks/restore-SXZUZGZE.js +16 -0
- package/dist/chunks/rm-5TRC5YND.js +8 -0
- package/dist/chunks/rm-IQ33QTQ2.js +8 -0
- package/dist/chunks/rm-KURYLLD6.js +8 -0
- package/dist/chunks/rm-WCE3ISB2.js +8 -0
- package/dist/chunks/rm-XMWM76JA.js +8 -0
- package/dist/chunks/routes-SBMN6SDF.js +7 -0
- package/dist/chunks/rule-inspect-USW6K7Y7.js +8 -0
- package/dist/chunks/schema-2G5VJ7EY.js +14 -0
- package/dist/chunks/{schema-L5VCG6FJ.js → schema-LRRKG2KJ.js} +1 -1
- package/dist/chunks/select-org-JG6GRWTS.js +7 -0
- package/dist/chunks/{serving-aOQsBok0-OL36TMZU.js → serving-C1mhZQqH-73TMEGEB.js} +1 -1
- package/dist/chunks/set-4JTH62JO.js +7 -0
- package/dist/chunks/{set-6U4QIX7A.js → set-BS5KCRE4.js} +1 -1
- package/dist/chunks/setup-and-link-GY4O7UJP.js +7 -0
- package/dist/chunks/{skills-ZMFZGPQL.js → skills-SUGA6D3G.js} +4 -19
- package/dist/chunks/table-SCLK33K7.js +7 -0
- package/dist/chunks/tags-B7MKMQKJ.js +7 -0
- package/dist/chunks/{types-CVLZCTL2.js → types-YFDB4QZA.js} +1 -1
- package/dist/chunks/{update-A727QN7H.js → update-LWRCCEXG.js} +1 -1
- package/dist/chunks/usage-HABW5VJ7.js +15 -0
- package/dist/chunks/validate-config-LDOYJ4LL.js +7 -0
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +28 -25
- package/dist/commands/dev/index.js +7 -7
- package/dist/commands/env/index.js +12 -11
- package/dist/commands/link/index.js +3 -3
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +4 -4
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +18 -12
- package/dist/commands-ai.js +18 -11
- package/dist/commands-blob.js +6 -6
- package/dist/commands-core.js +34 -48
- package/dist/commands-deployments.js +12 -11
- package/dist/commands-flags.js +27 -22
- package/dist/commands-integrations.js +7 -10
- package/dist/commands-observability.js +38 -28
- package/dist/commands-routing.js +6 -7
- package/dist/help.js +1 -1
- package/dist/index.js +6 -6
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +1 -1
- package/dist/package.json +43 -43
- package/dist/version.mjs +1 -1
- package/package.json +44 -44
- package/dist/chunks/add-563RV6JX.js +0 -8
- package/dist/chunks/add-HRB6XY33.js +0 -8
- package/dist/chunks/add-IUTGTBA4.js +0 -8
- package/dist/chunks/build-OMIYCGMR.js +0 -7
- package/dist/chunks/chunk-2GBU6ULJ.js +0 -7
- package/dist/chunks/chunk-2RRZCRWX.js +0 -7
- package/dist/chunks/chunk-4SS6W6JK.js +0 -11
- package/dist/chunks/chunk-5J4E2W4F.js +0 -12
- package/dist/chunks/chunk-76DSBD4X.js +0 -7
- package/dist/chunks/chunk-7W565DJB.js +0 -8
- package/dist/chunks/chunk-AIXEVICT.js +0 -37
- package/dist/chunks/chunk-AM46JVVN.js +0 -7
- package/dist/chunks/chunk-BULSRTQE.js +0 -7
- package/dist/chunks/chunk-C35SG42R.js +0 -7
- package/dist/chunks/chunk-CFJBDBYH.js +0 -7
- package/dist/chunks/chunk-DDPH26ZO.js +0 -7
- package/dist/chunks/chunk-EAQAV7UZ.js +0 -8
- package/dist/chunks/chunk-EFFJUYYS.js +0 -31
- package/dist/chunks/chunk-GOI2VVI7.js +0 -19
- package/dist/chunks/chunk-GYUNOFDD.js +0 -10
- package/dist/chunks/chunk-H2KNSYPR.js +0 -16
- package/dist/chunks/chunk-KDCODXVL.js +0 -25
- package/dist/chunks/chunk-KMTHGHJV.js +0 -8
- package/dist/chunks/chunk-KQ6X77WP.js +0 -7
- package/dist/chunks/chunk-KRP4EMD2.js +0 -10
- package/dist/chunks/chunk-NLK7NGVP.js +0 -7
- package/dist/chunks/chunk-OCR5CRTH.js +0 -10
- package/dist/chunks/chunk-PKR32I2N.js +0 -30
- package/dist/chunks/chunk-QGHAD5A5.js +0 -12
- package/dist/chunks/chunk-SPVOJ3HW.js +0 -7
- package/dist/chunks/chunk-SXW2G4WD.js +0 -10
- package/dist/chunks/chunk-TC4E2TFA.js +0 -8
- package/dist/chunks/chunk-TUB3APDV.js +0 -7
- package/dist/chunks/chunk-UG3FZ5Q7.js +0 -7
- package/dist/chunks/chunk-VF7XWPXA.js +0 -7
- package/dist/chunks/chunk-VKVH7LHB.js +0 -7
- package/dist/chunks/chunk-VUUU4KDL.js +0 -7
- package/dist/chunks/chunk-W3ZH27MN.js +0 -13
- package/dist/chunks/chunk-X47GV5HM.js +0 -15
- package/dist/chunks/chunk-XBHAU2M3.js +0 -9
- package/dist/chunks/chunk-XR2J7PQN.js +0 -12
- package/dist/chunks/chunk-YI7NKOCU.js +0 -23
- package/dist/chunks/chunk-Z2KANBOU.js +0 -69
- package/dist/chunks/chunk-Z7WZVEPP.js +0 -7
- package/dist/chunks/clear-TH6G33QK.js +0 -8
- package/dist/chunks/cli-embedded-FD3CAPRY.js +0 -84
- package/dist/chunks/compile-vercel-config-24IXPM4W.js +0 -7
- package/dist/chunks/config-2SBML7OY.js +0 -8
- package/dist/chunks/config-BCKJNJPS.js +0 -7
- package/dist/chunks/create-project-I7UXVWIR.js +0 -7
- package/dist/chunks/delete-RGHXL4JH.js +0 -9
- package/dist/chunks/delete-ZV4SHUTR.js +0 -10
- package/dist/chunks/describe-442UUQIF.js +0 -25
- package/dist/chunks/detect-projects-NBZSMQ5C.js +0 -7
- package/dist/chunks/detect-services-CRZW6FKM.js +0 -7
- package/dist/chunks/disable-MYGA6HVS.js +0 -7
- package/dist/chunks/discard-I5TKYCDJ.js +0 -14
- package/dist/chunks/edit-KGCUTTOZ.js +0 -8
- package/dist/chunks/edit-ZRNGGRVL.js +0 -9
- package/dist/chunks/enable-NODSFDKF.js +0 -7
- package/dist/chunks/esm-CF5UHWPM.js +0 -7
- package/dist/chunks/esm-EYOXGOVF.js +0 -7
- package/dist/chunks/esm-IUATPKKB.js +0 -9
- package/dist/chunks/esm-L6OKDFWP.js +0 -7
- package/dist/chunks/esm-ORQC2ZSA.js +0 -7
- package/dist/chunks/esm-PYIZNQIK.js +0 -9
- package/dist/chunks/future-RXI2OW2C.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-7BX47IPD.js +0 -7
- package/dist/chunks/image-6A2EJP4N.js +0 -7
- package/dist/chunks/import-builders-I4JB6BA6.js +0 -7
- package/dist/chunks/inspect-STKCC3MC.js +0 -9
- package/dist/chunks/inspect-VFUV7BDM.js +0 -13
- package/dist/chunks/list-6ENV2ZGG.js +0 -12
- package/dist/chunks/login-O6NLJ42W.js +0 -7
- package/dist/chunks/login-U5VDJURN.js +0 -9
- package/dist/chunks/logs-X3KGHA3J.js +0 -7
- package/dist/chunks/ls-HRSD6VNW.js +0 -8
- package/dist/chunks/ls-OLJMGFTV.js +0 -11
- package/dist/chunks/migrate-experimental-services-7ZYHE5WA.js +0 -7
- package/dist/chunks/mutate-BJXJON5E.js +0 -9
- package/dist/chunks/notifications-F3NRNUHQ.js +0 -7
- package/dist/chunks/open-JK42ZTLB.js +0 -7
- package/dist/chunks/permissions-3AQO3DCH.js +0 -7
- package/dist/chunks/prompt-missing-credentials-AHAH27TZ.js +0 -7
- package/dist/chunks/publish-7SCXBVZR.js +0 -15
- package/dist/chunks/pull-LAPD5XJG.js +0 -7
- package/dist/chunks/purchase-domain-if-available-7MI52MFD.js +0 -7
- package/dist/chunks/push-BCSGQBAM.js +0 -7
- package/dist/chunks/query-U72BDMAK.js +0 -7
- package/dist/chunks/raw-query-4UAW7M5Q.js +0 -8
- package/dist/chunks/reauthenticate-HGOLSK2M.js +0 -7
- package/dist/chunks/reorder-YL6L6IWC.js +0 -10
- package/dist/chunks/reply-7Y5TN5UV.js +0 -9
- package/dist/chunks/resolve-C62436YM.js +0 -12
- package/dist/chunks/resolve-agent-team-SR3ALPCH.js +0 -7
- package/dist/chunks/restore-Z63JM5CN.js +0 -16
- package/dist/chunks/rm-C6QSHEA2.js +0 -8
- package/dist/chunks/rm-DDKE62T7.js +0 -8
- package/dist/chunks/rm-IUB55CCM.js +0 -8
- package/dist/chunks/rm-NZX43GMQ.js +0 -8
- package/dist/chunks/rm-UBUI7JNY.js +0 -8
- package/dist/chunks/routes-TME3VYIF.js +0 -7
- package/dist/chunks/rule-inspect-KF4BLH4K.js +0 -8
- package/dist/chunks/schema-P7DFLXCG.js +0 -14
- package/dist/chunks/select-org-MBBMOUK2.js +0 -7
- package/dist/chunks/set-SCKMJ7LZ.js +0 -7
- package/dist/chunks/setup-and-link-5TPDTJIN.js +0 -7
- package/dist/chunks/tags-7M2EW6LU.js +0 -7
- package/dist/chunks/usage-HT5JXVAA.js +0 -13
- package/dist/chunks/validate-config-Q77XESW5.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __dirname_(__filename);
|
|
7
|
+
import{require_dist as require_dist2}from"./chunk-7AAYWDIZ.js";import{require_dist}from"./chunk-ISSNEDG5.js";import{require_types}from"./chunk-AW33SRYY.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_constants=__commonJS({"../runtimes/dist/constants.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),constants_exports={};__export(constants_exports,{BUILDER_RUNTIMES:()=>BUILDER_RUNTIMES,CONTAINER_ENTRYPOINT_CANDIDATES:()=>CONTAINER_ENTRYPOINT_CANDIDATES,ENTRYPOINT_EXTENSIONS:()=>ENTRYPOINT_EXTENSIONS,ROUTE_OWNING_BUILDERS:()=>ROUTE_OWNING_BUILDERS,RUNTIME_BUILDERS:()=>RUNTIME_BUILDERS,RUNTIME_MANIFESTS:()=>RUNTIME_MANIFESTS,STATIC_BUILDERS:()=>STATIC_BUILDERS});module.exports=__toCommonJS(constants_exports);var RUNTIME_BUILDERS={node:"@vercel/backends",python:"@vercel/python",go:"@vercel/go",rust:"@vercel/rust",ruby:"@vercel/ruby",container:"@vercel/container"},RUNTIME_MANIFESTS={node:["package.json"],python:["pyproject.toml","requirements.txt","Pipfile","pylock.yml","uv.lock","setup.py"],go:["go.mod"],ruby:["Gemfile"],rust:["Cargo.toml"]},ENTRYPOINT_EXTENSIONS={".ts":"node",".mts":"node",".js":"node",".mjs":"node",".cjs":"node",".py":"python",".go":"go",".rs":"rust",".rb":"ruby",".ru":"ruby"},BUILDER_RUNTIMES={...Object.fromEntries(Object.entries(RUNTIME_BUILDERS).map(([runtime,builder])=>[builder,runtime])),"@vercel/node":"node","@vercel/next":"node","@vercel/remix-builder":"node","@vercel/redwood":"node","@vercel/hydrogen":"node","@vercel/express":"node","@vercel/hono":"node","@vercel/h3":"node","@vercel/koa":"node","@vercel/nestjs":"node","@vercel/fastify":"node","@vercel/elysia":"node"},STATIC_BUILDERS=new Set(["@vercel/static-build","@vercel/static"]),ROUTE_OWNING_BUILDERS=new Set(["@vercel/next","@vercel/backends"]),CONTAINER_ENTRYPOINT_CANDIDATES=["Dockerfile.vercel","Containerfile.vercel","Dockerfile","Containerfile"]}});var require_entrypoint=__commonJS({"../runtimes/dist/entrypoint.js"(exports,module){"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),entrypoint_exports={};__export(entrypoint_exports,{isDockerfileEntrypoint:()=>isDockerfileEntrypoint,isNodeScheduleEntrypoint:()=>isNodeScheduleEntrypoint2,parsePyModuleAttrEntrypoint:()=>parsePyModuleAttrEntrypoint,parsePythonScheduleModule:()=>parsePythonScheduleModule2,stripTrailingSlash:()=>stripTrailingSlash});module.exports=__toCommonJS(entrypoint_exports);var import_path=__require("path"),import_constants=require_constants(),PYTHON_MODULE_ATTR_RE=/^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/,PYTHON_MODULE_RE=/^[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*$/,SOURCE_FILE_RE=/\.(?:py|[cm]?[jt]s)$/,NODE_SOURCE_FILE_RE=/\.(?:m?js|[cm]?ts)$/;function parsePyModuleAttrEntrypoint(entrypoint){let match=PYTHON_MODULE_ATTR_RE.exec(entrypoint);if(!match)return null;let[,modulePart,attrName]=match;return!modulePart||!attrName?null:{attrName,filePath:modulePart.replace(/\./g,"/")+".py",moduleName:modulePart}}function parsePythonScheduleModule2(entrypoint){if(!PYTHON_MODULE_RE.test(entrypoint)||SOURCE_FILE_RE.test(entrypoint))return null;let path=entrypoint.replace(/\./g,"/");return{moduleName:entrypoint,sourceFiles:[`${path}/__init__.py`,`${path}.py`]}}function isNodeScheduleEntrypoint2(entrypoint){return NODE_SOURCE_FILE_RE.test(entrypoint)}var CONTAINER_ENTRYPOINT_BASENAMES=new Set(import_constants.CONTAINER_ENTRYPOINT_CANDIDATES.map(name=>name.toLowerCase()));function isDockerfileEntrypoint(entrypoint){return CONTAINER_ENTRYPOINT_BASENAMES.has(import_path.posix.basename(entrypoint).toLowerCase())}function stripTrailingSlash(p){let stripped=p.replace(/\/+$/,"");return stripped===""?".":stripped}}});var import_routing_utils=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1),import_types=__toESM(require_types(),1),import_fs_detectors=__toESM(require_dist2(),1),import_entrypoint=__toESM(require_entrypoint(),1);import{getConfigValidator}from"./config-validator.mjs";var imagesSchema={type:"object",additionalProperties:!1,required:["sizes"],properties:{contentDispositionType:{enum:["inline","attachment"]},contentSecurityPolicy:{type:"string",minLength:1,maxLength:256},dangerouslyAllowSVG:{type:"boolean"},domains:{type:"array",minItems:0,maxItems:50,items:{type:"string",minLength:1,maxLength:256}},formats:{type:"array",minItems:1,maxItems:4,items:{enum:["image/avif","image/webp","image/jpeg","image/png"]}},localPatterns:{type:"array",minItems:0,maxItems:25,items:{type:"object",additionalProperties:!1,properties:{pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},minimumCacheTTL:{type:"integer",minimum:1,maximum:31536e4},qualities:{type:"array",minItems:1,maxItems:20,items:{type:"integer",minimum:1,maximum:100}},remotePatterns:{type:"array",minItems:0,maxItems:50,items:{type:"object",additionalProperties:!1,required:["hostname"],properties:{protocol:{enum:["http","https"]},hostname:{type:"string",minLength:1,maxLength:256},port:{type:"string",minLength:0,maxLength:5},pathname:{type:"string",minLength:1,maxLength:256},search:{type:"string",minLength:0,maxLength:256}}}},sizes:{type:"array",minItems:1,maxItems:50,items:{type:"number"}}}},cronsSchema={type:"array",minItems:0,items:{type:"object",additionalProperties:!1,required:["path","schedule"],properties:{path:{type:"string",minLength:1,maxLength:512,pattern:"^/.*"},schedule:{type:"string",minLength:9,maxLength:256}}}},envVarNamesSchema={pattern:"^[A-Za-z_][A-Za-z0-9_]*$",maxLength:256},servicesBindingSchema={type:"object",additionalProperties:!1,required:["service","format","env"],properties:{type:{description:"Optional binding type marker. Currently the only supported type is `service`. When present this must be `service`.",const:"service"},service:{type:"string",minLength:1,maxLength:64,pattern:import_build_utils.SERVICE_NAME_PATTERN},format:{const:"url"},env:{type:"string",...envVarNamesSchema}}},servicesBindingsSchema={type:"array",maxItems:100,items:servicesBindingSchema},typedBindingsSchema={...servicesBindingsSchema,items:{...servicesBindingSchema,required:["type",...servicesBindingSchema.required]}},scheduleNameSchema={type:"string",minLength:1,maxLength:256,pattern:"^[0-9A-Za-z][0-9A-Za-z._-]*$"},scheduleDefinitionSchema={type:"object",additionalProperties:!1,properties:{schedule:{type:"string",minLength:9,maxLength:256},timezone:{type:"string",minLength:1,maxLength:50,description:"IANA timezone for cron evaluation. Defaults to UTC."},jitter:{type:"integer",minimum:1,maximum:15},path:{description:"Deployment path to invoke over HTTP, like `crons[].path`. Must start with `/`.",type:"string",maxLength:512,pattern:"^/"},requestMethod:{description:"HTTP method used to invoke `path`. Only valid with `path`. Defaults to `POST`.",enum:["GET","POST"]},function:{type:"string",minLength:1},service:{description:"Service that owns `function`, from `services`. When set, `function` is the path within that service. Only valid with `function`.",type:"string",minLength:1,maxLength:64,pattern:"^[a-z]([a-z_-]*[a-z])?$"},topic:{type:"string",minLength:1,maxLength:256,pattern:"^[A-Za-z0-9_-]+$"},run:{description:"Command to run for each firing. Only valid with a Dockerfile or Containerfile entrypoint.",type:"array",minItems:1,items:[{type:"string",pattern:"\\S"}],additionalItems:{type:"string"}},root:{description:"Directory of the service that runs the schedule's `entrypoint`, which is relative to it. Required with `entrypoint`.",type:"string",minLength:1,maxLength:512},entrypoint:{type:"string",minLength:1,maxLength:512},runtime:{description:"Runtime of an `entrypoint` without `run`: `python` for a module path like `jobs.tasks`, or `node` for a JavaScript or TypeScript file.",enum:["python","node"]},bindings:typedBindingsSchema},dependencies:{requestMethod:["path"],service:["function"],run:["entrypoint"],entrypoint:["root"],root:["entrypoint"],bindings:["entrypoint"]},oneOf:[{required:["path"]},{required:["function"]},{required:["topic"]},{required:["entrypoint"]}]},maxSchedules=500,schedulesSchema={type:"object",maxProperties:maxSchedules,propertyNames:scheduleNameSchema,additionalProperties:scheduleDefinitionSchema},experimentalServicesMountSchema={oneOf:[{type:"string",minLength:1,maxLength:512},{type:"object",additionalProperties:!1,properties:{path:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},anyOf:[{required:["path"]},{required:["subdomain"]}]}]},staticExperimentalServiceScheduleSchema={type:"string",minLength:9,maxLength:256,not:{const:"<dynamic>"}},experimentalServiceScheduleSchema={oneOf:[{type:"string",minLength:9,maxLength:256},{type:"array",minItems:1,items:staticExperimentalServiceScheduleSchema}]},experimentalServiceQueueTopicSchema={type:"object",additionalProperties:!1,required:["topic"],properties:{topic:{type:"string",minLength:1,maxLength:256},retryAfterSeconds:{type:"integer",minimum:1,maximum:86400},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400}}},experimentalServiceTopicsSchema={oneOf:[{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:256}},{type:"array",minItems:1,items:experimentalServiceQueueTopicSchema}]},getExperimentalServicesCommonProperties=()=>({entrypoint:{type:"string",minLength:1,maxLength:512},root:{type:"string",minLength:1,maxLength:512},workspace:{type:"string",minLength:1,maxLength:512},framework:{type:"string",minLength:1,maxLength:256},builder:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},buildCommand:{type:"string",minLength:1,maxLength:2048},installCommand:{type:"string",minLength:1,maxLength:2048},preDeployCommand:{type:"string",minLength:1,maxLength:2048},command:{oneOf:[{type:"string",minLength:1,maxLength:2048},{type:"array",minItems:1,items:{type:"string",minLength:1,maxLength:2048}}]},memory:{type:"integer",minimum:128,maximum:10240},maxDuration:(0,import_build_utils.getMaxDurationSchema)(),includeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]},excludeFiles:{oneOf:[{type:"string",minLength:1},{type:"array",items:{type:"string",minLength:1}}]}}),experimentalServicesRoutableProperties={mount:experimentalServicesMountSchema,routePrefix:{type:"string",minLength:1,maxLength:512},subdomain:{type:"string",minLength:1,maxLength:63}},getExperimentalServicesServiceConfigSchema=()=>({oneOf:[{type:"object",additionalProperties:!1,properties:{...getExperimentalServicesCommonProperties(),...experimentalServicesRoutableProperties,type:{enum:["web"]}}},{type:"object",additionalProperties:!1,required:["type","trigger","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"schedule"},schedule:experimentalServiceScheduleSchema}},{type:"object",additionalProperties:!1,required:["type","trigger","topics"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"queue"},topics:experimentalServiceTopicsSchema,consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","trigger","entrypoint"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"job"},trigger:{const:"workflow"}}},{type:"object",additionalProperties:!1,required:["type"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"worker"},topics:{type:"array",items:{type:"string",minLength:1,maxLength:256},minItems:1},consumer:{type:"string",minLength:1,maxLength:256}}},{type:"object",additionalProperties:!1,required:["type","schedule"],properties:{...getExperimentalServicesCommonProperties(),type:{const:"cron"},schedule:experimentalServiceScheduleSchema}}]}),getExperimentalServicesSchema=()=>({type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:getExperimentalServicesServiceConfigSchema()}),experimentalServiceGroupsSchema={type:"object",propertyNames:{pattern:"^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$",maxLength:64},additionalProperties:{type:"array",items:{type:"string",minLength:1,maxLength:256}}},servicesPathSchema={type:"string",minLength:1,maxLength:512},servicesCommandSchema={type:"string",minLength:1,maxLength:2048},containerImageSchema={type:"string",minLength:1,maxLength:1024},getServicesServiceConfigSchema=()=>({type:"object",additionalProperties:!1,anyOf:[{required:["root"]},{required:["image"]}],properties:{root:servicesPathSchema,framework:{type:"string",minLength:1,maxLength:256},runtime:{type:"string",minLength:1,maxLength:256},entrypoint:servicesPathSchema,image:containerImageSchema,command:{oneOf:[{type:"string",minLength:1,maxLength:4096},{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}}]},installCommand:servicesCommandSchema,buildCommand:servicesCommandSchema,devCommand:servicesCommandSchema,ignoreCommand:servicesCommandSchema,outputDirectory:servicesPathSchema,bindings:servicesBindingsSchema,functions:(0,import_build_utils.getFunctionsSchema)(),headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,trailingSlash:import_routing_utils.trailingSlashSchema}}),daemonConfigSchema={type:"object",additionalProperties:!1,anyOf:[{required:["instances"]},{required:["replicas"]}],properties:{root:servicesPathSchema,entrypoint:servicesPathSchema,image:containerImageSchema,command:{type:"array",minItems:1,maxItems:128,items:{type:"string",minLength:1,maxLength:4096}},instances:{type:"object",additionalProperties:{type:"integer",minimum:0}},replicas:{description:"Deprecated. Use `instances`. Ignored when `instances` is set.",deprecated:!0,type:"object",additionalProperties:{type:"integer",minimum:0}},resources:{type:"object",additionalProperties:!1,required:["requests"],properties:{requests:{type:"object",additionalProperties:!1,required:["memory"],properties:{memory:{enum:["1Gi","2Gi","4Gi","8Gi"]}}}}},terminationGracePeriodSeconds:{type:"integer",minimum:0},livenessProbe:{type:"object",additionalProperties:!1,required:["httpGet"],properties:{httpGet:{type:"object",additionalProperties:!1,required:["port"],properties:{path:{type:"string",minLength:1},port:{type:"integer",minimum:1,maximum:65535},host:{type:"string",minLength:1},scheme:{enum:["HTTP","HTTPS"]},httpHeaders:{type:"array",items:{type:"object",additionalProperties:!1,required:["name","value"],properties:{name:{type:"string",minLength:1},value:{type:"string"}}}}}},initialDelaySeconds:{type:"integer",minimum:0,maximum:86400},periodSeconds:{type:"integer",minimum:1,maximum:86400},timeoutSeconds:{type:"integer",minimum:1,maximum:86400},successThreshold:{type:"integer",minimum:1,maximum:10},failureThreshold:{type:"integer",minimum:1,maximum:10}}},bindings:typedBindingsSchema}},getServicesSchema=()=>({type:"object",propertyNames:{pattern:import_build_utils.SERVICE_NAME_PATTERN,maxLength:64},additionalProperties:getServicesServiceConfigSchema()}),maxDaemons=100,daemonsSchema={type:"object",maxProperties:maxDaemons,propertyNames:{pattern:import_build_utils.DAEMON_NAME_PATTERN,maxLength:64},additionalProperties:daemonConfigSchema},proxySchema={type:"object",additionalProperties:!1,required:["entrypoint"],properties:{entrypoint:{type:"string",minLength:1},matcher:{oneOf:[{type:"string",minLength:1},{type:"array",minItems:1,items:{type:"string",minLength:1}}]}}};function buildVercelConfigSchema(){return{type:"object",additionalProperties:!0,properties:{builds:import_build_utils.buildsSchema,routes:import_routing_utils.routesSchema,cleanUrls:import_routing_utils.cleanUrlsSchema,headers:import_routing_utils.headersSchema,redirects:import_routing_utils.redirectsSchema,rewrites:import_routing_utils.rewritesSchema,trailingSlash:import_routing_utils.trailingSlashSchema,functions:(0,import_build_utils.getFunctionsSchema)(),images:imagesSchema,crons:cronsSchema,schedules:schedulesSchema,bunVersion:{type:"string"},proxy:proxySchema,experimentalServices:getExperimentalServicesSchema(),experimentalServiceGroups:experimentalServiceGroupsSchema,services:getServicesSchema(),experimentalServicesV2:getServicesSchema(),daemons:daemonsSchema}}}var isDockerfilePath=entrypoint=>/(docker|container)file/i.test((0,import_build_utils.splitDockerfileEntrypoint)(entrypoint).path.split(/[\\/]/).pop()??""),toPythonModulePath=entrypoint=>entrypoint.replace(/\.py$/,"").replace(/[\\/]+/g,".").replace(/(^|\.)__init__$/,""),hasInvalidDockerfileStage=entrypoint=>{let{buildTarget}=(0,import_build_utils.splitDockerfileEntrypoint)(entrypoint);return buildTarget!==void 0&&!(0,import_build_utils.isValidDockerfileStage)(buildTarget)};function validateConfig(config){let validate=getConfigValidator(buildVercelConfigSchema);if(!validate(config)&&validate.errors&&validate.errors[0]){let error=validate.errors[0],fileName=config[import_types.fileNameSymbol]||"vercel.json",niceError=(0,import_build_utils.getPrettyError)(error);return niceError.message=`Invalid ${fileName} - ${niceError.message}`,niceError}let serviceNames=new Set([...Object.keys(config.services??{}),...Object.keys(config.daemons??{})]),scheduleServices=getScheduleServiceNames(config),destinationServices=new Set(getDestinationServices(config)),invalidSchedule=(code,message)=>new import_build_utils.NowBuildError({code,message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`}),invalidCommand=message=>invalidSchedule("INVALID_SCHEDULE_COMMAND",message),invalidEntrypoint=message=>invalidSchedule("INVALID_SCHEDULE_ENTRYPOINT",message);for(let[name,schedule]of Object.entries(config.schedules??{})){let path=`schedules.${name}`;if("runtime"in schedule&&("run"in schedule||!("entrypoint"in schedule)))return invalidEntrypoint(`\`${path}.runtime\` is only valid with an \`entrypoint\` and without \`run\`.`);if("entrypoint"in schedule&&!("run"in schedule)){let{entrypoint,runtime}=schedule;if(!runtime)return isDockerfilePath(entrypoint)?invalidEntrypoint(`\`${path}.entrypoint\` names a Dockerfile, so \`${path}\` must set \`run\`.`):invalidEntrypoint(`\`${path}\` must set \`runtime\` to run its \`entrypoint\`: "python" for a module path like "jobs.tasks", or "node" for a .js, .mjs, .ts, .mts or .cts file.`);if(runtime==="python"&&!(0,import_entrypoint.parsePythonScheduleModule)(entrypoint)){let suggestion=entrypoint.endsWith(".py")?toPythonModulePath(entrypoint):"";return invalidEntrypoint(`\`${path}.entrypoint\` "${entrypoint}" must be a Python module path like "${(0,import_entrypoint.parsePythonScheduleModule)(suggestion)?suggestion:"jobs.tasks"}", since \`${path}.runtime\` is "python".`)}if(runtime==="node"&&!(0,import_entrypoint.isNodeScheduleEntrypoint)(entrypoint))return invalidEntrypoint(`\`${path}.entrypoint\` "${entrypoint}" must be a .js, .mjs, .ts, .mts or .cts file, since \`${path}.runtime\` is "node".`);let configured=["schedule","timezone","jitter"].find(key=>key in schedule);if(configured)return invalidEntrypoint(runtime==="node"?`\`${path}\` runs "${entrypoint}", whose \`export const config\` sets its cron, timezone and jitter. Remove \`${path}.${configured}\`.`:`\`${path}\` runs the Python module "${entrypoint}", whose \`@schedule\` handlers set their own cron, timezone and jitter. Remove \`${path}.${configured}\`.`)}else if(!("schedule"in schedule))return invalidSchedule("INVALID_SCHEDULE_EXPRESSION",`\`${path}\` is missing required property \`schedule\`.`);if("run"in schedule){if(!isDockerfilePath(schedule.entrypoint))return invalidCommand(`\`${path}.run\` requires a Dockerfile or Containerfile \`entrypoint\`.`);if(hasInvalidDockerfileStage(schedule.entrypoint))return invalidCommand(`\`${path}.entrypoint\` "${schedule.entrypoint}" is invalid. ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}if(scheduleServices.has(name)){if(name.length>64||!new RegExp(import_build_utils.SERVICE_NAME_PATTERN).test(name))return invalidScheduleService(config,`\`${path}\` runs as a service, so its name must be a valid service name: lowercase letters, \`-\` and \`_\`, at most 64 characters.`);if(serviceNames.has(name))return invalidScheduleService(config,`\`${path}\` runs as service "${name}", which is already the name of a service or daemon.`);if(destinationServices.has(name))return invalidScheduleService(config,`Rewrites and routes cannot target schedule "${name}" because schedules do not receive traffic.`)}if(!(!("timezone"in schedule)||schedule.timezone===void 0))try{if(!/^[A-Za-z][A-Za-z0-9_+/-]*$/.test(schedule.timezone))throw new RangeError("Expected a named timezone");new Intl.DateTimeFormat("en-US",{timeZone:schedule.timezone})}catch{return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_TIMEZONE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`schedules.${name}.timezone\` must be a valid IANA timezone, such as "America/New_York". Omit it to use UTC.`})}}let functionMaps=[config.functions,...Object.values(config.services??{}).map(service=>service.functions),...Object.values(config.experimentalServicesV2??{}).map(service=>service.functions)];for(let functions of functionMaps)for(let[pattern,fn]of Object.entries(functions??{})){let regions=[...new Set(fn.regions)];if(fn.affinity?.mode==="strict"&&(regions.includes("all")||regions.length>1))return new import_build_utils.NowBuildError({code:"INVALID_FUNCTION_AFFINITY_REGIONS",message:`Function affinity mode "strict" requires at most one statically configured region. Update \`functions[${JSON.stringify(pattern)}].regions\` to contain a single region.`,link:"https://vercel.com/docs/concepts/projects/project-configuration#functions"})}if(config.proxy){let proxyError=(0,import_fs_detectors.validateProxyConfig)(config.proxy,{field:"proxy",level:"project"});if(proxyError)return new import_build_utils.NowBuildError({code:proxyError.code.toUpperCase(),message:proxyError.message})}if(config.functions&&config.builds)return new import_build_utils.NowBuildError({code:"FUNCTIONS_AND_BUILDS",message:"The `functions` property cannot be used in conjunction with the `builds` property. Please remove one of them.",link:"https://vercel.link/functions-and-builds"});if(config.proxy&&config.builds)return new import_build_utils.NowBuildError({code:"PROXY_AND_BUILDS",message:"The `proxy` property cannot be used with the `builds` property. Remove `builds` to use an explicit proxy entrypoint."});let hasExperimentalServices=!!config.experimentalServices;if(hasExperimentalServices&&config.builds)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_BUILDS",message:"The `experimentalServices` property cannot be used in conjunction with the `builds` property. Please remove one of them."});if(hasExperimentalServices&&config.functions)return new import_build_utils.NowBuildError({code:"EXPERIMENTAL_SERVICES_AND_FUNCTIONS",message:"The `experimentalServices` property cannot be used in conjunction with the `functions` property. Please remove one of them."});if(config.experimentalServiceGroups&&!config.experimentalServices)return new import_build_utils.NowBuildError({code:"SERVICE_GROUPS_WITHOUT_SERVICES",message:"The `experimentalServiceGroups` property requires `experimentalServices` to be defined. Service groups reference services by name."});let hasServices=config.services!=null,hasExperimentalServicesV2=config.experimentalServicesV2!=null;if(hasServices&&hasExperimentalServicesV2)return new import_build_utils.NowBuildError({code:"SERVICES_AND_EXPERIMENTAL_SERVICES_V2",message:"The `services` property cannot be used in conjunction with its deprecated alias `experimentalServicesV2`. Please use only `services`."});let servicesConfig=config.services??config.experimentalServicesV2,servicesConfigKey=hasServices?"services":"experimentalServicesV2",servicesErrorCodePrefix=hasServices?"SERVICES":"EXPERIMENTAL_SERVICES_V2";if(servicesConfig&&hasExperimentalServices)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_EXPERIMENTAL_SERVICES`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`experimentalServices\` property. Please use only one services configuration.`});if(servicesConfig&&config.builds)return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_BUILDS`,message:`The \`${servicesConfigKey}\` property cannot be used in conjunction with the \`builds\` property. Please remove one of them.`});if(servicesConfig){let ambiguousTopLevel=[];if(config.functions!=null&&ambiguousTopLevel.push("functions"),config.installCommand!=null&&ambiguousTopLevel.push("installCommand"),config.buildCommand!=null&&ambiguousTopLevel.push("buildCommand"),config.devCommand!=null&&ambiguousTopLevel.push("devCommand"),config.ignoreCommand!=null&&ambiguousTopLevel.push("ignoreCommand"),config.outputDirectory!=null&&ambiguousTopLevel.push("outputDirectory"),config.framework!=null&&ambiguousTopLevel.push("framework"),ambiguousTopLevel.length>0){let count=ambiguousTopLevel.length,fields=ambiguousTopLevel.map(field=>`\`${field}\``).join(", ");return new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_AND_TOP_LEVEL_BUILD_SETTINGS`,message:`The top-level ${count>1?"properties":"property"} ${fields} cannot be used with \`${servicesConfigKey}\` because the owning service is ambiguous. Move ${count>1?"them":"it"} under the relevant service in \`${servicesConfigKey}\`.`})}}if(config.daemons){let daemonError=validateDaemons(config,config.daemons);if(daemonError)return daemonError}for(let[name,schedule]of Object.entries(config.schedules??{})){if(!("entrypoint"in schedule))continue;let bindingError=validateCallerBindings(config,`Schedule "${name}"`,schedule.bindings,message=>invalidScheduleService(config,message));if(bindingError)return bindingError}if(servicesConfig){let imageError=validateImageServices(config,servicesConfig,servicesConfigKey);if(imageError)return imageError;let serviceNames2=new Set(Object.keys(servicesConfig));for(let[serviceName,serviceConfig]of Object.entries(servicesConfig))for(let binding of serviceConfig.bindings??[])if(!serviceNames2.has(binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,`Service "${serviceName}"`,binding.service):new import_build_utils.NowBuildError({code:`${servicesErrorCodePrefix}_BINDING_UNKNOWN_SERVICE`,message:`Service "${serviceName}" declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`${servicesConfigKey}\` or fix the binding.`})}return null}function validateDaemons(config,daemons){let invalid=message=>new import_build_utils.NowBuildError({code:"INVALID_DAEMON",message}),daemonNames=new Set(Object.keys(daemons));for(let[name,daemon]of Object.entries(daemons)){if(daemon.image!==void 0){let imageProblem=(0,import_build_utils.getVcrImageProblem)(daemon.image);if(imageProblem)return invalidImage(config,`daemons.${name}.image`,imageProblem);if(daemon.entrypoint!==void 0)return invalid(`Daemon "${name}" can set \`image\` or \`entrypoint\`, not both.`);continue}if(daemon.root===void 0||daemon.entrypoint===void 0)return invalid(`Daemon "${name}" must set \`image\`, or \`root\` and \`entrypoint\` to build one.`);if(!isDockerfilePath(daemon.entrypoint))return invalid(`Daemon "${name}" must set \`entrypoint\` to a Dockerfile or Containerfile.`);if(hasInvalidDockerfileStage(daemon.entrypoint))return invalid(`Daemon "${name}" has invalid \`entrypoint\` "${daemon.entrypoint}". ${import_build_utils.DOCKERFILE_STAGE_HINT}`)}let services={...config.experimentalServicesV2,...config.services},isDaemonTarget=name=>daemonNames.has(name)&&!Object.prototype.hasOwnProperty.call(services,name);for(let[name,service]of Object.entries(services)){let binding=service.bindings?.find(binding2=>isDaemonTarget(binding2.service));if(binding)return invalid(`Service "${name}" cannot bind to daemon "${binding.service}" because daemons do not receive traffic.`)}for(let[name,daemon]of Object.entries(daemons)){let bindingError=validateCallerBindings(config,`Daemon "${name}"`,daemon.bindings,invalid);if(bindingError)return bindingError}let daemonTarget=getDestinationServices(config).find(isDaemonTarget);return daemonTarget?invalid(`Rewrites and routes cannot target daemon "${daemonTarget}" because daemons do not receive traffic.`):null}function validateCallerBindings(config,caller,bindings,invalid){let services={...config.experimentalServicesV2,...config.services},scheduleServices=getScheduleServiceNames(config),envs=new Set;for(let binding of bindings??[]){if(!Object.prototype.hasOwnProperty.call(services,binding.service))return scheduleServices.has(binding.service)?scheduleBindingError(config,caller,binding.service):invalid(`${caller} declares a binding to unknown service "${binding.service}". Add "${binding.service}" to \`services\` or fix the binding.`);if(envs.has(binding.env))return invalid(`${caller} declares more than one binding for the environment variable "${binding.env}".`);envs.add(binding.env)}return null}function invalidImage(config,path,problem){return new import_build_utils.NowBuildError({code:"INVALID_CONTAINER_IMAGE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - \`${path}\` ${problem}`})}function validateImageServices(config,services,servicesConfigKey){let fileName=config[import_types.fileNameSymbol]||"vercel.json";for(let[name,service]of Object.entries(services)){if(service.image===void 0)continue;let path=`${servicesConfigKey}.${name}`,imageProblem=(0,import_build_utils.getVcrImageProblem)(service.image);if(imageProblem)return invalidImage(config,`${path}.image`,imageProblem);let invalid=(code,problem)=>new import_build_utils.NowBuildError({code,message:`Invalid ${fileName} - \`${path}\` sets \`image\`, so ${problem}`}),buildSettings=import_build_utils.SERVICE_IMAGE_BUILD_SETTINGS.filter(field=>service[field]!==void 0);if(buildSettings.length>0){let fields=buildSettings.map(field=>`\`${field}\``).join(", ");return invalid("SERVICE_IMAGE_WITH_BUILD_SETTINGS",`it isn't built and can't set ${fields}.`)}if(service.runtime!==void 0&&service.runtime!=="container")return invalid("SERVICE_IMAGE_WITH_RUNTIME",'its `runtime` can only be "container".');if(service.functions!==void 0)return invalid("SERVICE_IMAGE_WITH_FUNCTIONS","it can't set `functions`. The functions configuration isn't supported for image services.")}return null}function getScheduleServiceNames(config){return new Set(Object.entries(config.schedules??{}).filter(([,schedule])=>"entrypoint"in schedule||"run"in schedule).map(([name])=>name))}function invalidScheduleService(config,message){return new import_build_utils.NowBuildError({code:"INVALID_SCHEDULE_SERVICE",message:`Invalid ${config[import_types.fileNameSymbol]||"vercel.json"} - ${message}`})}function scheduleBindingError(config,binder,schedule){return invalidScheduleService(config,`${binder} cannot bind to schedule "${schedule}" because schedules do not receive traffic.`)}function getDestinationServices(config){let services={...config.experimentalServicesV2,...config.services};return[...config.rewrites??[],...config.routes??[],...Object.values(services).flatMap(service=>[...service.rewrites??[],...service.routes??[]])].flatMap(entry=>{let destination="destination"in entry?entry.destination:void 0;return typeof destination=="object"&&destination!==null?[destination.service]:[]})}export{require_constants,require_entrypoint,buildVercelConfigSchema,validateConfig};
|
|
@@ -0,0 +1,37 @@
|
|
|
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{markOnboardingSeen}from"./chunk-HQ3ZFXXQ.js";import{isInteractiveHumanRun}from"./chunk-FB37TFVF.js";import{isGuidanceEnabled}from"./chunk-TAAWMNNL.js";import{require_open}from"./chunk-PVASGBEF.js";import{getTeams}from"./chunk-WLD4SGKM.js";import{TelemetryClient}from"./chunk-EYRBV6RM.js";import{createDpopKey,deleteDpopKey,deviceAccessTokenRequest,deviceAuthorizationRequest,getCachedUsername,getUser,isDpopLoginEnabled,isOAuthError,processDeviceAuthorizationResponse,processTokenResponse}from"./chunk-4Z6R5KHZ.js";import{printError}from"./chunk-HMJR6RVF.js";import{parseArguments}from"./chunk-INIZJZ3O.js";import{getTeamByIdOrSlug}from"./chunk-CSNP5RIM.js";import{humanizePath}from"./chunk-QFE3RPMA.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";import{SPINNER,countRows,output_manager_default}from"./chunk-RYSO5U3E.js";import{require_dist}from"./chunk-MCYG7CCE.js";import{require_ansi_escapes}from"./chunk-YHPPP3SF.js";import{require_source}from"./chunk-NB2WLB3J.js";import{require_strip_ansi}from"./chunk-BS32OUOC.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk3=__toESM(require_source(),1),import_error_utils=__toESM(require_dist(),1),open=__toESM(require_open(),1),import_ansi_escapes=__toESM(require_ansi_escapes(),1);import readline from"node:readline";import{KNOWN_AGENTS}from"@vercel/detect-agent";async function updateCurrentTeamAfterLogin(client,ssoTeamId){if(ssoTeamId)client.updateConfig({currentTeam:ssoTeamId});else{let user=null;try{user=await getUser(client)}catch{return output_manager_default.error("Failed to fetch the logged in user. Please try again."),1}client.updateConfig({currentTeam:user.version==="northstar"&&user.defaultTeamId?user.defaultTeamId:void 0})}}var LoginTelemetryClient=class extends TelemetryClient{trackState(...args){this.trackLoginState(...args)}trackDpopKey(storage){this.trackDpopKeyStorage(storage)}};import{performance}from"node:perf_hooks";var{waitingFrame,settledFrame,entrance,period,finishFrame,finishDuration}=(()=>{let TURN=Math.PI*2.5,SPIN2=2,BIRTH=.02,LAG=.045,GROW=.34,PEAK=TURN*2.4/SPIN2,SETTLE=.5,DRAG=3,REACH=24,LABEL_AT=1.95,TYPE=.045,FADE=.1,T0=1.56,DWELL=.8,CLIMB=.12,PUSH=.7,LATE=.5,GLOW=.3,SHEEN=.85,LEN=Math.hypot(.507,.862),LX=-.507/LEN,LZ=-.862/LEN,LIT=-LZ,S=Math.SQRT1_2,NORMALS=[[0,-1],[S,-S],[1,0],[S,S],[0,1],[-S,S],[-1,0],[-S,-S]],entrance2=2.4,period2=7,clamp2=(n,lo=0,hi=1)=>Math.min(hi,Math.max(lo,n)),smooth=n=>n*n*(3-2*n),easeOut=n=>1-(1-n)**3,lerp=(a,b,s)=>a*(1-s)+b*s,toneOf=n=>Math.max(0,Math.min(255,Math.round(n))),bit=(u,r)=>{let h=Math.imul(u,374761393)^Math.imul(r+11,668265263);return h=Math.imul(h^h>>>13,1274126177),h>>>15&1?"1":"0"},checkTime=time=>{if(typeof time!="number"||!Number.isFinite(time)||time<0)throw new RangeError("time must be a finite number of seconds >= 0")},checkLayout=(width,alignment)=>{if(width!==30&&width!==60)throw new RangeError("width must be 30 or 60");if(alignment!=="left"&&alignment!=="center")throw new RangeError("alignment must be left or center")};function rowAt(t,r){let tau=t-BIRTH-(7-r)*LAG,q=1-clamp2(tau/SPIN2),E=TURN*(8*q**3-3*q**4)/5,vE=tau>0&&tau<SPIN2?-TURN*(24*q*q-12*q**3)/(5*SPIN2):0,phi=(t-T0-(8-1-r)*CLIMB)/period2,f=phi-Math.floor(phi),w=2*Math.PI*f,turn=(1-Math.cos(w))/2,g=easeOut(clamp2(tau/GROW)),settle=1-smooth(clamp2((tau-SPIN2+SETTLE)/SETTLE));return{th:E-Math.PI*f+DWELL/2*Math.sin(w),v:vE-Math.PI/period2*(1-DWELL*Math.cos(w)),g,e:g*Math.min(1,Math.abs(vE)/PEAK+GLOW*turn),live:settle+(1-settle)*SHEEN*turn,drag:E-PUSH*(1-Math.cos(w-LATE))/2,reach:tau/.45}}let restRow=()=>({th:0,v:0,g:1,e:0,live:0,drag:0,reach:9});function labelAt(t){let mix=[];for(let i=0;i<6;i++){let start=LABEL_AT+i*TYPE;mix.push(t<start?0:smooth(clamp2((t-start)/FADE)))}return{mix,keep:t<LABEL_AT?1:1-smooth(clamp2((t-LABEL_AT)/FADE))}}function render(rows,mix,keep,width,alignment){let c=alignment==="left"?12:width/2-4,span=Math.max(c,width-c),grid=[];for(let r=0;r<8;r++){let{th,g,e,live,drag,reach}=rows[r],row=[];for(let x=0;x<width;x++){let dx=x+.5-c,nx=dx/span,k=.35+.65/(1+(dx/REACH)**2),vis=smooth(clamp2((reach-Math.abs(nx))/.3)),tone=toneOf((20+30*e*k)*(1-.72*nx*nx)*vis);row.push(tone>=3?[bit(x-Math.round(drag*DRAG*k),r),tone]:[" ",0])}if(g>0){let hw=10.5*(r+.5)/8*g,hd=8/2*g,ch=Math.min(.5*g,hw/2,hd/2),cs=Math.cos(th),sn=Math.sin(th),at=(px,pz)=>c+px*cs+pz*sn,front=244-2.6*r,fade=.5+.5*g,loop=[[-hw+ch,-hd],[hw-ch,-hd],[hw,-hd+ch],[hw,hd-ch],[hw-ch,hd],[-hw+ch,hd],[-hw,hd-ch],[-hw,-hd+ch]],faces=[];for(let i=0;i<8;i++){let[n0,n1]=NORMALS[i],nx=n0*cs+n1*sn,nz=-n0*sn+n1*cs;if(nz>=-1e-9)continue;let lit=Math.max(0,nx*LX+nz*LZ),tone;i%4===0?tone=56+(front-56)*Math.min(1,lit/LIT)+12*smooth(clamp2((lit-LIT)/(1-LIT))):i%4===2?tone=40+104*lit:tone=front+(48+207*lit**6-front)*live;let p=at(...loop[i]),q=at(...loop[(i+1)%8]);faces.push([Math.min(p,q),Math.max(p,q),tone*fade])}let lo=1/0,hi=-1/0;for(let f of faces)lo=Math.min(lo,f[0]),hi=Math.max(hi,f[1]);let first=-1,last=-1;for(let x=Math.max(0,Math.floor(lo));x<Math.min(width,Math.ceil(hi));x++){let cover=0,ink=0;for(let[l,h,tone2]of faces){let k=Math.max(0,Math.min(x+1,h)-Math.max(x,l));cover+=k,ink+=k*tone2}if(cover<.34)continue;let tone=ink/cover,cell;cover>=.72?cell=["\u2588",tone]:lo>x&&hi>=x+1?cell=["\u2590",tone]:hi<x+1&&lo<=x?cell=["\u258C",tone]:cell=["\u2588",tone*cover];let v=toneOf(cell[1]);v<=0||(row[x]=[cell[0],v],first<0&&(first=x),last=x)}first>0&&(row[first-1]=[" ",0]),last>=0&&last<width-1&&(row[last+1]=[" ",0])}grid.push(row)}let ly=7,lx=c+12;for(let x of[lx-1,lx+6,lx+7]){if(x<0||x>=width)continue;let tone=toneOf(grid[ly][x][1]*keep);grid[ly][x]=tone>=3?[grid[ly][x][0],tone]:[" ",0]}for(let i=0;i<6;i++){let m=mix[i];if(m<=0)continue;let tone=toneOf(grid[ly][lx+i][1]*(1-m)+176*m);grid[ly][lx+i]=tone>0?["Vercel"[i],tone]:[" ",0]}return grid}function waitingFrame2(time,width=60,alignment="left"){checkTime(time),checkLayout(width,alignment);let rows=[];for(let r=0;r<8;r++)rows.push(rowAt(time,r));let{mix,keep}=labelAt(time);return render(rows,mix,keep,width,alignment)}function settledFrame2(width=60,alignment="left"){return checkLayout(width,alignment),render(Array.from({length:8},restRow),[1,1,1,1,1,1],0,width,alignment)}let finishDuration2=3,STEP=1/30,COMMIT=.25,DRIVE=.4,DRIVE_PER=.6,CATCH=2.1,SEAT=.4,LET_GO=.35,RISE=.5,SPEC=1,WARM=.5,WAKE=.9,INK_AT=.3,INK_LEN=.4,PEAK_N=60*.4**2*.6**3,A=s=>1-6*s*s+8*s**3-3*s**4,B=s=>4*s**3-3*s**4,N=s=>60*s*s*(1-s)**3,IA=s=>s-2*s**3+2*s**4-.6*s**5,IB=s=>s**4-.6*s**5,IN=s=>20*s**3-45*s**4+36*s**5-10*s**6,checkProgress=progress=>{if(typeof progress!="number"||!Number.isFinite(progress)||progress<0||progress>1)throw new RangeError("progress must be a number from 0 to 1")};function plan(time){let rows=[],sx=0,sy=0;for(let r=0;r<8;r++){let a=rowAt(time,r),lead=(8-1-r)*STEP,th=a.th+a.v*lead;rows.push({a,lead,th}),sx+=Math.cos(2*th),sy+=Math.sin(2*th)}let mean=Math.atan2(sy,sx)/2,travel=mean-Math.PI*Math.floor(mean/Math.PI);for(travel<COMMIT*Math.PI&&(travel+=Math.PI);;){let drive=DRIVE+DRIVE_PER*travel/Math.PI,forward=!0;for(let row of rows){row.target=Math.PI*Math.round((row.th-travel)/Math.PI),row.from=row.th-row.target,row.k=-row.from/drive-.4*(row.a.v-CATCH);for(let i=0;i<=64&&forward;i++){let s=i/64;row.a.v*A(s)-CATCH*B(s)+row.k*N(s)>0&&(forward=!1)}}if(forward)return{rows,travel,drive,rest:7*STEP+drive+SEAT};travel+=Math.PI}}function poseAt(p,t){let handover=smooth(clamp2(t/LET_GO)),rise=smooth(clamp2(t/RISE)),drive=p.drive;return p.rows.map(({a,lead,target,from,k})=>{let tau=t-lead;if(tau>=drive+SEAT)return{...restRow(),angle:target};let u,v,env=0,wake=0;if(tau<0)u=a.th+a.v*t-target,v=a.v;else if(tau<drive){let s=tau/drive;u=from+drive*(a.v*IA(s)-CATCH*IB(s)+k*IN(s)),v=a.v*A(s)-CATCH*B(s)+k*N(s),env=N(s)/PEAK_N,wake=16*s*s*(1-s)**2}else{let x=(tau-drive)/SEAT;u=-CATCH*SEAT*x*(1-x)**3,v=-CATCH*(1-x)**2*(1-4*x)}return{th:u,v,angle:target+u,g:lerp(a.g,1,rise),e:lerp(a.e,WARM*env,handover),live:lerp(a.live,SPEC*env,handover),drag:a.drag*(1-handover)-WAKE*p.travel/Math.PI*wake,reach:lerp(Math.min(a.reach,9),9,rise)}})}function finishFrame2(time,progress,width=60,alignment="left"){if(checkTime(time),checkLayout(width,alignment),checkProgress(progress),progress===0)return waitingFrame2(time,width,alignment);let p=plan(time),t=progress*finishDuration2;if(progress===1||t>=p.rest)return settledFrame2(width,alignment);let label=labelAt(time),mix=label.mix.map((m0,i)=>lerp(m0,1,smooth(clamp2((t-INK_AT-i*TYPE)/INK_LEN))));return render(poseAt(p,t),mix,lerp(label.keep,0,smooth(clamp2(t/(INK_AT+INK_LEN)))),width,alignment)}return{waitingFrame:waitingFrame2,settledFrame:settledFrame2,entrance:entrance2,period:period2,finishFrame:finishFrame2,finishDuration:finishDuration2}})(),BREATH=.3,VISIT=.5,LEAD=.2,STATUS=.6,SPIN=BREATH+LEAD+STATUS/2,revealDuration=BREATH+LEAD+STATUS,clamp=n=>Math.min(1,Math.max(0,n)),ramp=(time,start,length)=>{let s=clamp((time-start)/length);return s*s*(3-2*s)};function revealFrame(time,reduced=!1){if(typeof time!="number"||!Number.isFinite(time))throw new TypeError("time must be a finite number of seconds");if(typeof reduced!="boolean")throw new TypeError("reduced must be a boolean");return reduced?{visit:1,status:1,spinner:!1,ready:!0}:time>=revealDuration?{visit:1,status:1,spinner:!0,ready:!0}:{visit:ramp(time,BREATH,VISIT),status:ramp(time,BREATH+LEAD,STATUS),spinner:time>=SPIN,ready:!1}}var import_chalk=__toESM(require_source(),1);function encodeGrid(grid,width,colors){return grid.map((row,y)=>{let result="",previous="";for(let x=0;x<width;x++){let[ch,n]=row[x];if(ch===" "||n===0){result+=" ";continue}if(!colors&&(ch==="0"||ch==="1")){let h=Math.imul(x+1,73244475)^Math.imul(y+1,668265261);if(h=Math.imul(h^h>>>16,73244475),((h^h>>>16)>>>0)/4294967296>=n/96){result+=" ";continue}}let style=colors?`\x1B[22;38;2;${colors.background.map((bg,i)=>Math.round(bg+(colors.foreground[i]-bg)*n/255)).join(";")}m`:n<96?"\x1B[2;39m":"\x1B[22;39m";style!==previous&&(result+=style,previous=style),result+=ch}return"\r\x1B[2K"+result.trimEnd()+`\x1B[0m
|
|
8
|
+
`}).join("")}function createSignInWelcome(stream,closeInputOnSignal,colors=()=>{},onShown,layout){let columns=stream.columns,rows=stream.rows,width=columns>=61?60:30,footerRows=layout?.footerRows??0,ownedRows=9+footerRows,skipFooter=footerRows?`\x1B[${footerRows}B\r`:"",spinnerIndex=0,formatSpinnerFrame=()=>`${import_chalk.default.gray(SPINNER.frames[spinnerIndex])} ${import_chalk.default.gray("Waiting for authentication...")}`,spinnerFrame=formatSpinnerFrame(),spinnerUpdated=0,shown=!1,stopped=!1,failed=!1,timer,start=0,finishStart,finishFrom=0,keepFinal=!1,finishPromise,resolveFinish,receipt,receiptRows=0,receiptPrinted=!1,receiptQueued=!1,onReceiptShown,authComplete=!1,instructionsReady=!1,instructionsVisible=!1,skipCompletion=!1,finishDeadline,pendingWrites=0,release;function releaseErrorsWhenIdle(){!stopped||pendingWrites||release||(release=setImmediate(()=>{release=void 0,stopped&&!pendingWrites&&stream.removeListener("error",errored)}))}function writePacket(packet,next){pendingWrites++;try{stream.write(packet,error=>{pendingWrites--,error?errored():next?.(),releaseErrorsWhenIdle()})}catch{pendingWrites--,errored(),releaseErrorsWhenIdle()}}let stop=()=>{if(stopped)return;stopped=!0,clearTimeout(timer),clearTimeout(finishDeadline),stream.removeListener("resize",resized),process.removeListener("exit",exiting),process.removeListener("SIGINT",finishInterrupted);for(let[signal,handler]of signals)process.removeListener(signal,handler);let showInstructions=!authComplete&&layout?.instructions&&!instructionsVisible;shown&&!keepFinal&&!receiptQueued&&!failed&&stream.columns===columns&&stream.rows===rows&&writePacket(layout?`\x1B[${ownedRows}A`+`\r\x1B[2K
|
|
9
|
+
`.repeat(8)+(showInstructions?layout.instructions:authComplete?`\r\x1B[2K
|
|
10
|
+
`.repeat(footerRows):skipFooter)+"\r\x1B[2K\x1B[0m":"\x1B[9A"+`\r\x1B[2K
|
|
11
|
+
`.repeat(9)+"\x1B[9A\r\x1B[0m"),showInstructions&&!failed&&(!shown||stream.columns!==columns||stream.rows!==rows)&&writePacket(`
|
|
12
|
+
`+layout.instructions),releaseErrorsWhenIdle(),resolveFinish?.(receiptQueued)};stop.text="Waiting for authentication...";let resized=()=>{stopped||(stop(),!authComplete&&!failed&&writePacket(`
|
|
13
|
+
Waiting for authentication...
|
|
14
|
+
`))},errored=()=>{failed=!0,stop()},exiting=()=>stop(),signals=["SIGTERM","SIGHUP"].map(signal=>[signal,async()=>{stop();try{await closeInputOnSignal?.()}catch{}process.kill(process.pid,signal)}]),finishInterrupted=async()=>{stop();try{await closeInputOnSignal?.()}catch{}process.kill(process.pid,"SIGINT")},finish=(text,onShown2)=>(authComplete=!0,finishPromise||(stopped||!shown?(stop(),Promise.resolve(!1)):(onReceiptShown=onShown2,receipt=text===void 0?void 0:text.endsWith(`
|
|
15
|
+
`)?text:text+`
|
|
16
|
+
`,receiptRows=receipt===void 0?0:countRows(receipt.slice(0,-1),columns),skipCompletion=receipt!==void 0&&9+receiptRows>=rows,finishPromise=new Promise(resolve=>{resolveFinish=resolve}),finishStart=performance.now(),finishFrom=(finishStart-start)/1e3,clearTimeout(timer),process.once("SIGINT",finishInterrupted),finishDeadline=setTimeout(stop,finishDuration*1e3+250),pendingWrites||tick(),finishPromise)));function ink(text,opacity,quiet=!1){if(opacity<=0)return"";if(opacity>=1&&!quiet)return text;let theme=colors();if(theme){let amount=opacity*(quiet?.53:1);return`\x1B[22;38;2;${theme.background.map((bg,i)=>Math.round(bg+(theme.foreground[i]-bg)*amount)).join(";")}m${text.replace(/\x1b\[[0-9;]*m/g,"")}\x1B[0m`}return opacity<.5?"":`${opacity<1||quiet?"\x1B[2m":""}${text}\x1B[0m`}let tick=()=>{if(stopped)return;if(stream.columns!==columns||stream.rows!==rows){resized();return}let first=!shown;first&&(start=performance.now(),shown=!0);let time=(performance.now()-start)/1e3,progress=finishStart===void 0?0:Math.min(1,(performance.now()-finishStart)/(finishDuration*1e3)),complete=finishStart!==void 0&&(progress>=1||skipCompletion);try{first&&onShown?.();let grid=finishStart===void 0?waitingFrame(time,width):complete?settledFrame(width):finishFrame(finishFrom,progress,width);time-spinnerUpdated>=SPINNER.interval/1e3&&(spinnerIndex=(spinnerIndex+1)%SPINNER.frames.length,spinnerFrame=formatSpinnerFrame(),spinnerUpdated=time);let reveal=layout?.instructions?revealFrame(time-entrance):{visit:1,status:1,spinner:!0,ready:!0},packet=(first?`
|
|
17
|
+
`.repeat(layout?.instructions?ownedRows+1:layout?1:9):"")+`\x1B[${ownedRows}A`+encodeGrid(grid,width,colors()),printingReceipt=receipt!==void 0&&!receiptPrinted,showingInstructions=!1;if(receipt!==void 0)printingReceipt?(packet+=`\r\x1B[2K
|
|
18
|
+
`.repeat(footerRows+1)+`\x1B[${footerRows+1}A\r`+receipt,ownedRows=8+receiptRows):packet+=`\x1B[${receiptRows}B\r`;else{if(layout?.instructions&&!instructionsReady){let auth=ink(layout.instructions.replace(/\n$/,""),reveal.visit);packet+=auth?auth+`
|
|
19
|
+
`:`
|
|
20
|
+
`.repeat(footerRows),showingInstructions=reveal.visit===1,instructionsReady=reveal.ready}else packet+=skipFooter;let status=finishStart!==void 0?"Signed in.":reveal.spinner?spinnerFrame:" Waiting for authentication...";packet+=`\r\x1B[2K${ink(status,reveal.status,finishStart===void 0)}
|
|
21
|
+
`}printingReceipt&&(receiptQueued=!0),writePacket(packet,()=>{if(showingInstructions&&(instructionsVisible=!0),printingReceipt){receiptPrinted=!0;try{onReceiptShown?.()}catch{}}if(!stopped){if(complete){keepFinal=!0,stop();return}timer=setTimeout(tick,1e3/30)}})}catch{errored()}};stream.on("resize",resized),stream.on("error",errored),process.on("exit",exiting);for(let[signal,handler]of signals)process.on(signal,handler);return timer=setTimeout(tick,300),{stop,wasShown:()=>shown,finish}}var import_strip_ansi=__toESM(require_strip_ansi(),1);function isInteractiveHumanSignIn(client){let command;try{command=parseArguments(client.argv.slice(2),{},{permissive:!0}).args[0]}catch{return!1}return isInteractiveHumanRun(client,command,{allowAgentOverride:!0})&&output_manager_default.stream===client.stderr&&(!output_manager_default.spinnersHidden||client.isAgent||usePlainSignInWait())&&!output_manager_default.debugEnabled}function isUnseen(client,key){return client.config[key]===!1||client.config[key]===void 0&&client.config.usedBefore===!1}function canShowSignInIntroduction(client){return!client.isAgent&&isInteractiveHumanSignIn(client)&&isUnseen(client,"loginIntroductionSeen")&&isGuidanceEnabled(client,void 0,!0)}function canShowSignInWelcome(client){return isInteractiveHumanSignIn(client)&&isUnseen(client,"loginWelcomeSeen")&&!output_manager_default.colorDisabled&&!process.env.NO_COLOR&&process.env.FORCE_COLOR!=="0"&&process.env.TERM!=="dumb"&&!usePlainSignInWait()&&client.stderr.columns>=31&&client.stderr.rows>=16}function reserveSignInWelcome(client,instructions){if(!canShowSignInWelcome(client))return;let text=`
|
|
22
|
+
`+instructions.trim()+`
|
|
23
|
+
|
|
24
|
+
`,visible=(0,import_strip_ansi.default)(text);if(/[^\x20-\x7e\n]/.test(visible))return;let{columns,rows}=client.stderr,footerRows=countRows(visible.slice(0,-1),columns);if(!(9+footerRows>=rows))return{footerRows,columns,rows,instructions:text}}function startSignInWelcome(client,closeInputOnSignal,colors,onShown,layout){if(!canShowSignInWelcome(client)||layout&&(layout.columns!==client.stderr.columns||layout.rows!==client.stderr.rows))return null;try{let welcome=createSignInWelcome(output_manager_default.stream,closeInputOnSignal,colors,onShown,layout);return output_manager_default.registerSpinner(welcome.stop),welcome}catch{return null}}function usePlainSignInWait(){return process.env.NO_MOTION==="1"||process.env.REDUCE_MOTION==="1"||process.env.VERCEL_ACCESSIBLE==="1"}function markSignInWelcomeSeen(client){markOnboardingSeen(client,"loginWelcomeSeen")}function markSignInIntroductionSeen(client){markOnboardingSeen(client,"loginIntroductionSeen")}import{Transform}from"node:stream";var prefixes=["\x1B]10;","\x1B]11;"];function createWelcomeThemeInput(input,output){let env=process.env,directGhostty=env.TERM_PROGRAM==="ghostty"&&!env.FORCE_COLOR,colorEnv={...env};colorEnv.NO_COLOR===""&&delete colorEnv.NO_COLOR;let depth=directGhostty?24:output.getColorDepth?.(colorEnv)??1;if(!(["ghostty","iTerm.app","Apple_Terminal","WezTerm","vscode"].includes(env.TERM_PROGRAM??"")||env.TERM==="xterm-kitty")||depth<24||env.TMUX||env.STY||!input.isTTY||input.isRaw||input.listenerCount("data")||input.listenerCount("readable")||typeof input.setRawMode!="function")return null;let pending="",colors,foreground,background,requested=!1,accepting=!1,disposed=!1,timer,drainTimer,releaseDrain=()=>{},drained=new Promise(resolve=>{releaseDrain=resolve}),received=new Set,wasFlowing=input.readableFlowing;function reply(value){let channel=/^\x1b\](10|11);/.exec(value)?.[1];if(channel&&received.add(channel),received.size===2&&(clearTimeout(drainTimer),releaseDrain()),!accepting)return;let match=/^\x1b\](10|11);rgb:([\da-f]{1,4})\/([\da-f]{1,4})\/([\da-f]{1,4})$/i.exec(value);if(!match)return;let rgb=match.slice(2).map(hex=>Math.round(parseInt(hex,16)/(16**hex.length-1)*255));match[1]==="10"?foreground=rgb:background=rgb,foreground&&background&&(colors={foreground,background},accepting=!1,clearTimeout(timer))}let filtered=new Transform({transform(chunk,_encoding,callback){pending+=chunk.toString("latin1");let ordinary="";for(;pending;)if(requested&&prefixes.some(prefix=>pending.startsWith(prefix))){let end=/\x07|\x1b\\/.exec(pending),interrupt=pending.indexOf("");if(interrupt>=0&&(!end||interrupt<end.index))ordinary+="",pending=pending.slice(interrupt+1);else if(end)reply(pending.slice(0,end.index)),pending=pending.slice(end.index+end[0].length);else if(pending.length>256)pending="";else break}else{if(requested&&prefixes.some(prefix=>prefix.startsWith(pending)))break;ordinary+=pending[0],pending=pending.slice(1)}callback(null,Buffer.from(ordinary,"latin1"))}}),terminalInput=Object.assign(filtered,{isTTY:!0,setRawMode:mode=>input.setRawMode?.(mode)});return Object.defineProperty(terminalInput,"isRaw",{get:()=>input.isRaw}),input.pipe(terminalInput),{input:terminalInput,colors:()=>colors,drain:()=>requested?drained:Promise.resolve(),query:()=>{if(!(requested||disposed||!input.isRaw)){requested=accepting=!0,timer=setTimeout(()=>{accepting=!1},250),drainTimer=setTimeout(releaseDrain,500);try{output.write("\x1B]10;?\x1B\\\x1B]11;?\x1B\\",()=>{})}catch{accepting=!1,clearTimeout(timer)}}},dispose:()=>{disposed||(disposed=!0,accepting=!1,clearTimeout(timer),clearTimeout(drainTimer),releaseDrain(),input.unpipe(terminalInput),input.isRaw&&input.setRawMode?.(!1),wasFlowing===!0?input.resume():input.pause(),terminalInput.destroy())}}}var import_chalk2=__toESM(require_source(),1);function formatSignInReceipt({username,introduction=!1,columns=80,color=!0}={}){let bold=text=>color?import_chalk2.default.bold(text):text,command=text=>color?import_chalk2.default.cyan(text):text,marker=color?import_chalk2.default.green("\u2713"):"\u2713",identity=username&&/^[a-zA-Z0-9_-]+$/.test(username)?`Logged in as ${username}`:"Logged in",lines=["",`${marker} ${bold(identity)}`];if(!introduction)return lines.join(`
|
|
25
|
+
`)+`
|
|
26
|
+
`;function prose(text){let width=Math.max(20,Math.min(60,columns)-4),line="";for(let word of text.split(" "))line&&line.length+word.length+1>width&&(lines.push(" "+line),line=""),line+=(line?" ":"")+word;lines.push(" "+line)}return lines.push(""," "+bold("Next steps:")),prose("Deploy your app or backend:"),lines.push(" "+command("vercel deploy"),""),prose("Use AI Gateway models in your coding agent:"),prose("No token markup. One bill across providers."),lines.push(" "+command("vercel ai-gateway setup"),""),prose("Add AI models to your app with one API Key:"),prose("Track costs, set budgets, and use provider fallbacks."),lines.push(" "+command("vercel ai-gateway api-keys create"),""),prose("Find a domain for your project:"),lines.push(" vercel domains search <QUERY>",""),lines.push(" Browse all commands:"," "+command("vercel help")),lines.join(`
|
|
27
|
+
`)+`
|
|
28
|
+
`}function getSignupVerificationUrl(verificationUriComplete,email){let deviceUrl=new URL(verificationUriComplete),signupUrl=new URL("/signup",deviceUrl.origin);return signupUrl.searchParams.set("email",email),signupUrl.searchParams.set("autoSubmit","1"),signupUrl.searchParams.set("next",`${deviceUrl.pathname}${deviceUrl.search}`),signupUrl.toString()}async function performDeviceCodeFlow(client,options){let dpopKey=getDpopKeyForLogin(client,options),isNewKey=dpopKey!==client.authConfig.dpop?.key,tokens=null;try{return tokens=await runDeviceCodeFlow(client,options,dpopKey),tokens}finally{dpopKey&&isNewKey&&!tokens&&deleteDpopKey(dpopKey)}}async function runDeviceCodeFlow(client,options,dpopKey){let deviceAuthorizationResponse=await deviceAuthorizationRequest({refresh_token:options?.refreshToken,acr_values:options?.acrValues});output_manager_default.debug(`Device Authorization response: HTTP ${deviceAuthorizationResponse.status}`);let[deviceAuthorizationError,deviceAuthorization]=await processDeviceAuthorizationResponse(deviceAuthorizationResponse);if(deviceAuthorizationError)return options?.fallbackToLoginOnStepUpFailure&&options.refreshToken&&isOAuthError(deviceAuthorizationError)&&(deviceAuthorizationError.code==="invalid_grant"||deviceAuthorizationError.code==="invalid_scope")?(output_manager_default.debug(`Step-up device authorization failed: ${deviceAuthorizationError.cause.message}`),output_manager_default.log("Couldn't refresh the saved login. Starting a new login."),performDeviceCodeFlow(client,options.teamId?{teamId:options.teamId}:void 0)):(printError(isOAuthError(deviceAuthorizationError)?deviceAuthorizationError.cause:deviceAuthorizationError),null);let{device_code,user_code,verification_uri,expiresAt,interval}=deviceAuthorization,{verification_uri_complete}=deviceAuthorization;if(options?.teamId){let url=new URL(verification_uri_complete);url.searchParams.set("team_id",options.teamId),verification_uri_complete=url.toString()}let isCursorAgent=client.agentName===KNOWN_AGENTS.CURSOR||client.agentName===KNOWN_AGENTS.CURSOR_CLI,shouldSkipBrowser=process.env.CI&&!isCursorAgent,browserUrl=verification_uri_complete,authInstructions;options?.signupEmail?(browserUrl=getSignupVerificationUrl(verification_uri_complete,options.signupEmail),authInstructions=`
|
|
29
|
+
Visit ${import_chalk3.default.bold(output_manager_default.link(new URL(browserUrl).host+"/signup",browserUrl,{color:!1,fallback:()=>browserUrl}))} to create your account with ${import_chalk3.default.bold(options.signupEmail)} (device code ${import_chalk3.default.bold(user_code)}).
|
|
30
|
+
`):authInstructions=`
|
|
31
|
+
Visit ${import_chalk3.default.bold(output_manager_default.link(verification_uri.replace("https://",""),verification_uri_complete,{color:!1,fallback:()=>verification_uri_complete}))}${output_manager_default.supportsHyperlink?` and enter ${import_chalk3.default.bold(user_code)}`:""}
|
|
32
|
+
`;let welcomeLayout=options?.welcomeShown?reserveSignInWelcome(client,options.signupEmail?authInstructions:`
|
|
33
|
+
Visit ${import_chalk3.default.bold(verification_uri_complete)}
|
|
34
|
+
`):void 0;if(welcomeLayout||output_manager_default.log(authInstructions),!shouldSkipBrowser)try{(await open.default(browserUrl)).on("error",error=>{output_manager_default.debug(`Failed to open browser: ${error}`)})}catch(error){output_manager_default.debug(`Failed to open browser: ${error}`),client.isAgent&&client.nonInteractive&&(output_manager_default.log(`
|
|
35
|
+
${import_chalk3.default.yellow("\u26A0")} ${import_chalk3.default.bold("Browser could not be opened automatically.")}
|
|
36
|
+
`),output_manager_default.log(`Please ask the user to manually visit the URL above and complete the authentication process.
|
|
37
|
+
`))}let themeInput=welcomeLayout&&canShowSignInWelcome(client)?createWelcomeThemeInput(client.stdin,output_manager_default.stream):null,rl=readline.createInterface({input:themeInput?.input??process.stdin,output:welcomeLayout||!process.stdin.isTTY?void 0:process.stdout,terminal:welcomeLayout?!0:void 0}).on("SIGINT",async()=>{welcome?.stop();try{await closeInput()}finally{process.exit(welcome?130:0)}});rl.once("close",()=>themeInput?.dispose());let closing,closeInput=()=>closing??=(async()=>{try{await themeInput?.drain()}catch{output_manager_default.debug("Could not drain terminal color replies.")}finally{rl.close()}})(),welcome=welcomeLayout?startSignInWelcome(client,closeInput,themeInput?.colors,themeInput?.query,welcomeLayout):null;welcome||(welcomeLayout&&output_manager_default.log(authInstructions),usePlainSignInWait()&&!output_manager_default.spinnersHidden?output_manager_default.log("Waiting for authentication..."):output_manager_default.spinner("Waiting for authentication..."));let intervalMs=interval*1e3,result=null,flowError=new Error("Timed out waiting for authentication. Please try again.");async function pollForToken(){for(;Date.now()<expiresAt;){let[tokenResponseError,tokenResponse]=await deviceAccessTokenRequest({device_code,dpopKey});if(tokenResponseError){if(tokenResponseError.message.includes("timeout")){intervalMs*=2,output_manager_default.debug(`Connection timeout. Slowing down, polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue}return tokenResponseError}output_manager_default.debug(`Device Access Token response: HTTP ${tokenResponse.status}`);let[tokensError,tokens]=await processTokenResponse(tokenResponse,{dpop:!!dpopKey});if(isOAuthError(tokensError)){let{code}=tokensError;switch(code){case"authorization_pending":await wait(intervalMs);continue;case"slow_down":intervalMs+=5*1e3,output_manager_default.debug(`Authorization server requests to slow down. Polling every ${intervalMs/1e3}s...`),await wait(intervalMs);continue;default:return tokensError.cause}}if(tokensError)return tokensError;welcome||output_manager_default.print((0,import_ansi_escapes.eraseLines)(2)),result={access_token:tokens.access_token,expires_in:tokens.expires_in,refresh_token:tokens.refresh_token,dpop:dpopKey&&{key:dpopKey}};return}}try{flowError=await pollForToken()}finally{result&&!flowError&&welcome?.wasShown()&&options?.welcomeReady&&welcome?options?.welcomeReady?.(welcome,closeInput):(result&&!flowError&&welcome&&!welcome.wasShown()&&await welcome.finish(),output_manager_default.stopSpinner(),await closeInput()),welcome?.wasShown()&&options?.welcomeShown?.()}return flowError?(printError(flowError),null):result}function getDpopKeyForLogin(client,options){if(options?.refreshToken)return client.authConfig.dpop?.key;if(!isDpopLoginEnabled())return;let telemetry=new LoginTelemetryClient({opts:{store:client.telemetryEventStore}});return createDpopKey(storage=>telemetry.trackDpopKey(storage))}async function login(client,telemetry,standalone=!0,scope){let introduction=standalone&&canShowSignInIntroduction(client),receiptHandled=!1,welcomeShown=!1,presentation={welcome:null},tokens=await performDeviceCodeFlow(client,standalone?{welcomeReady:(welcome,closeInput)=>{presentation.welcome=welcome,presentation.closeInput=closeInput},welcomeShown:()=>{welcomeShown=!0}}:void 0);if(!tokens)return telemetry.trackState("error"),1;try{await saveDeviceCodeTokens(client,tokens,scope),welcomeShown&&markSignInWelcomeSeen(client);let inputClosed=presentation.closeInput?.(),receipt=standalone?formatSignInReceipt({username:getCachedUsername(client.authConfig),introduction,columns:client.stderr.columns,color:!output_manager_default.colorDisabled&&client.stderr.isTTY===!0}):void 0;try{presentation.welcome&&(receiptHandled=await presentation.welcome.finish(receipt,introduction?()=>markSignInIntroductionSeen(client):void 0))}catch{output_manager_default.debug("Could not finish the sign-in animation.")}receipt!==void 0&&!receiptHandled&&(output_manager_default.print(receipt),introduction&&markSignInIntroductionSeen(client)),await inputClosed}finally{output_manager_default.stopSpinner(),await presentation.closeInput?.()}return standalone||output_manager_default.success("Logged in."),telemetry.trackState("success"),0}async function saveDeviceCodeTokens(client,tokens,scope){let runTeam=client.config.currentTeam,previousTeamId=client.ignoresSavedTeam?client.savedTeam:runTeam;client.updateAuthConfig({token:tokens.access_token,userId:void 0,expiresAt:Math.floor(Date.now()/1e3)+tokens.expires_in,refreshToken:tokens.refresh_token,dpop:tokens.dpop});let scopeTeamId=scope?await findScopeTeamId(client,scope):void 0;if(scopeTeamId)client.updateConfig({currentTeam:scopeTeamId});else if(previousTeamId){let isMember=!0;try{isMember=(await getTeams(client)).some(team=>team.id===previousTeamId)}catch{}isMember||(output_manager_default.warn("Your previously selected team is no longer accessible; switching to your default scope."),client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client))}else client.updateConfig({currentTeam:void 0}),await updateCurrentTeamAfterLogin(client);client.persistAuthConfig(),client.writeToConfigFile(),client.ignoresSavedTeam&&(client.config.currentTeam=runTeam),output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`)}async function findScopeTeamId(client,scope){try{return(await getTeamByIdOrSlug(client,scope,{useCurrentTeam:!1})).id}catch(err){output_manager_default.debug(`Could not resolve --scope "${scope}": ${(0,import_error_utils.errorToString)(err)}`),output_manager_default.warn(`Couldn't find the team "${scope}", so it wasn't saved. Run ${getCommandName("switch")} to choose a team.`);return}}async function wait(intervalMs){await new Promise(resolve=>setTimeout(resolve,intervalMs))}export{LoginTelemetryClient,getSignupVerificationUrl,performDeviceCodeFlow,login,saveDeviceCodeTokens};
|
|
@@ -0,0 +1,8 @@
|
|
|
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{ZodError,external_exports}from"./chunk-2AMO2VMV.js";function fileSize(bytes){return bytes<1024?`${bytes} B`:bytes<1048576?`${Math.round(bytes/1024)} KB`:`${(bytes/1024/1024).toFixed(1)} MB`}var TYPES={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".mp4":"video/mp4",".webm":"video/webm",".mov":"video/quicktime",".pdf":"application/pdf",".txt":"text/plain",".log":"text/plain",".md":"text/markdown",".json":"application/json",".csv":"text/csv",".html":"text/html",".zip":"application/zip"};function typeOf(name){let dot=name.lastIndexOf(".");return dot>0&&TYPES[name.slice(dot).toLowerCase()]||"application/octet-stream"}function fileName(name){return(name??"").split(/[\\/]/).pop().replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||"file"}var INVISIBLE=/[\p{Cf}\u2028\u2029]/u;function fileNameProblem(name){if(name.startsWith("."))return`attachment names can't start with a dot: ${JSON.stringify(name)}`;if(INVISIBLE.test(name))return`attachment names can't hold invisible formatting characters: ${JSON.stringify(name)}`}function importedFileName(name){return fileName(fileName(name).replace(new RegExp(INVISIBLE.source,"gu"),"").replace(/^[.\s]+/,""))}function mediaType(type){let value=(type??"").split(";")[0].trim().toLowerCase();return/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/.test(value)&&value.length<=255?value:"application/octet-stream"}var InvalidProfileHeader=class extends Error{},TOKEN_START=/[A-Za-z*]/,TCHAR=/[!#$%&'*+\-.^_`|~0-9A-Za-z:/]/,KEY_START=/[a-z*]/,KEY_CHAR=/[a-z0-9_\-.*]/,OTHER_ITEM=/^(?:-?\d{1,15}|-?\d{1,12}\.\d{1,3}|\?[01]|:[A-Za-z0-9+/=]*:)$/;function sfString(value){if(!/^[\x20-\x7e]*$/.test(value))throw new InvalidProfileHeader("an avatar URL is printable ASCII: percent-encode the rest");return`"${value.replace(/[\\"]/g,char=>`\\${char}`)}"`}function formatProfileHeader(profile){if(!profile.avatar)return profile.name;let avatar=/^[\x20-\x7e]*$/.test(profile.avatar)?profile.avatar:URL.parse(profile.avatar)?.href??profile.avatar;return`${profile.name};avatar=${sfString(avatar)}`}function parseProfileHeader(value){let at=0,fail=why=>{throw new InvalidProfileHeader(`x-board-profile is a structured header, like fixer;avatar="https://example.com/fixer.png": ${why}`)},spaces=()=>{for(;value[at]===" ";)at++},string=()=>{at++;let out="";for(;at<value.length;){let char=value[at++];if(char==="\\"){let next=value[at++];next!=='"'&&next!=="\\"&&fail('a string escapes only " and \\'),out+=next}else{if(char==='"')return out;char<" "||char>"~"?fail("a string is printable ASCII"):out+=char}}return fail('a string is missing its closing "')},token=()=>{let start=at;for(;at<value.length&&TCHAR.test(value[at]);)at++;return value.slice(start,at)},bare2=()=>{let char=value[at];if(char==='"')return{kind:"string",value:string()};if(char!==void 0&&TOKEN_START.test(char))return{kind:"token",value:token()};let start=at;for(;at<value.length&&value[at]!==";"&&value[at]!==" ";)at++;let item=value.slice(start,at);return OTHER_ITEM.test(item)||fail(item===""?"a parameter has no value after its =":`${item} isn't a value`),{kind:"other",value:item}};spaces();let name=bare2();name.kind==="other"&&fail(name.value===""?"it names no profile":`${name.value} isn't a profile's name`);let avatar=null;for(;value[at]===";";){at++,spaces(),KEY_START.test(value[at]??"")||fail("a parameter starts with a lowercase letter");let start=at;for(;at<value.length&&KEY_CHAR.test(value[at]);)at++;let key=value.slice(start,at),param={kind:"boolean",value:"?1"};value[at]==="="&&(at++,param=bare2()),key==="avatar"&&(param.kind!=="string"&&fail("avatar is a string, in quotes"),avatar=param.value)}return spaces(),at<value.length&&fail(`${JSON.stringify(value.slice(at,at+20))} follows the profile`),{name:name.value,avatar}}var CHANNEL_PATH_MAX=2048,CHANNEL_PATTERN_MAX=2049,MESSAGE_TEXT_MAX=1e4,CAN_MAX=4e3,RESERVED_LABEL_PREFIX="board.",TASK_LABEL="board.task",TASK_NOTE_MAX=1e3,segment="[a-z0-9][a-z0-9_-]*",ChannelPath=external_exports.string().max(CHANNEL_PATH_MAX).regex(new RegExp(`^${segment}(?:/${segment})*$`),"invalid channel path"),storable=value=>!value.includes("\0")&&value.isWellFormed(),toStorable=value=>value.replaceAll("\0","").toWellFormed(),SentText=external_exports.string().refine(text=>text.trim().length>0,"message text is empty").refine(storable,"message text has a NUL character or a lone surrogate"),MessageText=external_exports.string().max(MESSAGE_TEXT_MAX).refine(text=>text.trim().length>0,"message text is empty").refine(storable,"message text has a NUL character or a lone surrogate"),MessageId=external_exports.number().int().positive(),INHERITED=new Set([...Object.getOwnPropertyNames(Object.prototype),"prototype"]),notInherited=name=>!INHERITED.has(name),notALabelKey=issue=>`${JSON.stringify(String(issue.input))} isn't a label key: one is 1 to 64 lowercase letters, numbers, ., _, and -, starting with a letter or number`,LabelKey=external_exports.string().max(64,{error:notALabelKey}).regex(/^[a-z0-9][a-z0-9_.-]*$/,{error:notALabelKey}).refine(notInherited,"label key is a reserved name"),LabelValue=external_exports.string().max(256,{error:issue=>`a label value is at most 256 characters, and this one has ${String(issue.input).length}`}).refine(storable,"label value has a NUL character or a lone surrogate"),Labels=external_exports.record(LabelKey,LabelValue),NewLabelValue=LabelValue.refine(value=>!/\p{Cc}/u.test(value),"label value has a control character"),NewLabels=external_exports.record(LabelKey,NewLabelValue),Emoji=external_exports.string().max(64).regex(/^[a-z0-9_+-]+$/,"invalid emoji name").refine(notInherited,"emoji name is a reserved name"),ActorId=external_exports.string().min(1).max(256),ActorKind=external_exports.enum(["person","agent","deployment","workflow","external"]),SeenActorKind=external_exports.union([ActorKind,external_exports.literal("profile")]);var Handle=external_exports.string().min(1).max(128).refine(storable,"handle has a NUL character or a lone surrogate");function platformAvatar(avatar){if(avatar===null)return null;try{return new URL(avatar).protocol==="https:"?avatar:null}catch{return null}}var Author=external_exports.object({actor:ActorId,principal:external_exports.string().min(1),profile:external_exports.string().nullable()});var AttachmentId=external_exports.string().regex(/^(?:[A-Za-z0-9_-]{22}|att_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,"invalid attachment id"),Attachment=external_exports.object({id:AttachmentId,name:external_exports.string().min(1).max(255),type:external_exports.string().min(1).max(255),size:external_exports.number().int().nonnegative()}),TaskState=external_exports.enum(["waiting","ready","claimed","blocked","completed","failed","canceled"]);var TaskNote=external_exports.string().max(TASK_NOTE_MAX).refine(text=>text.trim().length>0,"it is empty").refine(storable,"it has a NUL character or a lone surrogate"),SentTaskNote=external_exports.string().refine(text=>text.trim().length>0,"it is empty").refine(storable,"it has a NUL character or a lone surrogate"),SentTaskHoldKind=external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]*$/,"a kind is lowercase letters, numbers, and _.-"),EDITED_HOLD="edited",TaskHoldKind=external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]{0,63}$/,"a kind is up to 64 lowercase letters, numbers, and _.-"),RemoteWatcherId=external_exports.string().regex(/^[A-Za-z][A-Za-z0-9-]{0,31}$/,"ids start with a letter and use up to 32 letters, numbers, and hyphens");var ExternalTarget=external_exports.string().min(3).max(300),Origin=external_exports.object({channel:ExternalTarget.optional(),thread:ExternalTarget,subthread:ExternalTarget.nullable(),message:external_exports.string().min(1).max(300),context:external_exports.string().max(300).nullable()}),LinkSnapshot=external_exports.object({author:external_exports.string().min(1).max(256),text:external_exports.string().max(MESSAGE_TEXT_MAX),createdAt:external_exports.string().max(64).nullable(),files:external_exports.array(external_exports.object({name:external_exports.string().min(1).max(1e3),url:external_exports.string().max(4e3).nullable()})).max(20)}),Link=external_exports.object({url:external_exports.string().min(1).max(4e3),message:MessageId.nullable(),snapshot:LinkSnapshot.nullable(),unavailable:external_exports.string().max(300).nullable()}),ExternalAuthor=external_exports.object({id:external_exports.string().min(1),handle:external_exports.string().min(1),name:external_exports.string().min(1),avatar:external_exports.string().nullable(),isBot:external_exports.boolean()}),ExternalFile=external_exports.object({type:external_exports.enum(["image","file","video","audio"]),name:external_exports.string().max(1e3).optional(),mimeType:external_exports.string().max(255).optional(),size:external_exports.number().int().nonnegative().optional(),url:external_exports.string().max(4e3).optional(),fetchMetadata:external_exports.record(external_exports.string(),external_exports.string().max(4e3)).optional()}),ExternalLink=external_exports.object({url:external_exports.string().min(1).max(4e3),thread:ExternalTarget,message:external_exports.string().min(1).max(300),snapshot:LinkSnapshot.nullable()}),ExternalLocation=external_exports.object({channel:ExternalTarget,thread:ExternalTarget,subthread:ExternalTarget.nullable()}),ExternalEvent=external_exports.discriminatedUnion("kind",[external_exports.object({kind:external_exports.literal("message"),...ExternalLocation.shape,message:external_exports.string(),isRoot:external_exports.boolean(),text:external_exports.string(),context:external_exports.string().nullable(),author:ExternalAuthor,files:external_exports.array(ExternalFile).max(20).optional(),links:external_exports.array(ExternalLink).max(10).optional(),mentioned:external_exports.array(ExternalAuthor).max(50).optional()}),external_exports.object({kind:external_exports.literal("edited"),...ExternalLocation.shape,message:external_exports.string(),text:external_exports.string(),author:ExternalAuthor,links:external_exports.array(ExternalLink).max(10).optional(),linksOnly:external_exports.boolean().optional(),mentioned:external_exports.array(ExternalAuthor).max(50).optional()}),external_exports.object({kind:external_exports.literal("deleted"),...ExternalLocation.shape,message:external_exports.string()}),external_exports.object({kind:external_exports.literal("reaction"),...ExternalLocation.shape,message:external_exports.string(),emoji:external_exports.string(),added:external_exports.boolean(),author:ExternalAuthor}),external_exports.object({kind:external_exports.literal("lifecycle"),...ExternalLocation.omit({subthread:!0}).shape,type:external_exports.string(),title:external_exports.string(),url:external_exports.string().nullable(),body:external_exports.string().nullable().optional(),labels:external_exports.record(external_exports.string(),external_exports.string()),unset:external_exports.array(external_exports.string()),owns:external_exports.array(external_exports.string()).optional(),reply:external_exports.string().nullable(),createRoot:external_exports.boolean(),retitled:external_exports.boolean().optional(),author:ExternalAuthor})]),isThreadTarget=target=>target.slice(target.indexOf(":")+1).includes(":"),channelOf=externalThread=>{let at=externalThread.indexOf(":"),colon=externalThread.slice(at+1).indexOf(":");return colon===-1?externalThread:externalThread.slice(0,at+1+colon)};var EMOJI_TABLE={100:{characters:["\u{1F4AF}"],aliases:[]},thumbs_up:{characters:["\u{1F44D}"],aliases:["+1","thumbsup"]},thumbs_down:{characters:["\u{1F44E}"],aliases:["-1","thumbsdown"]},clap:{characters:["\u{1F44F}"],aliases:[]},wave:{characters:["\u{1F44B}"],aliases:[]},pray:{characters:["\u{1F64F}"],aliases:[]},muscle:{characters:["\u{1F4AA}"],aliases:[]},ok_hand:{characters:["\u{1F44C}"],aliases:[]},point_up:{characters:["\u{1F446}"],aliases:[]},point_down:{characters:["\u{1F447}"],aliases:[]},point_left:{characters:["\u{1F448}"],aliases:[]},point_right:{characters:["\u{1F449}"],aliases:[]},raised_hands:{characters:["\u{1F64C}"],aliases:[]},shrug:{characters:["\u{1F937}"],aliases:[]},facepalm:{characters:["\u{1F926}"],aliases:[]},heart:{characters:["\u2764\uFE0F","\u2764"],aliases:[]},smile:{characters:["\u{1F60A}"],aliases:["slightly_smiling_face"]},laugh:{characters:["\u{1F602}","\u{1F606}"],aliases:["laughing","satisfied","joy"]},thinking:{characters:["\u{1F914}"],aliases:["thinking_face"]},sad:{characters:["\u{1F622}"],aliases:["cry","white_frowning_face"]},cry:{characters:["\u{1F62D}"],aliases:["sob"]},angry:{characters:["\u{1F620}"],aliases:[]},love_eyes:{characters:["\u{1F60D}"],aliases:["heart_eyes"]},cool:{characters:["\u{1F60E}"],aliases:["sunglasses"]},wink:{characters:["\u{1F609}"],aliases:[]},surprised:{characters:["\u{1F62E}"],aliases:["open_mouth"]},worried:{characters:["\u{1F61F}"],aliases:[]},confused:{characters:["\u{1F615}"],aliases:[]},neutral:{characters:["\u{1F610}"],aliases:["neutral_face"]},sleeping:{characters:["\u{1F634}"],aliases:[]},sick:{characters:["\u{1F922}"],aliases:["nauseated_face"]},mind_blown:{characters:["\u{1F92F}"],aliases:["exploding_head"]},relieved:{characters:["\u{1F60C}"],aliases:[]},grimace:{characters:["\u{1F62C}"],aliases:["grimacing"]},rolling_eyes:{characters:["\u{1F644}"],aliases:[]},hug:{characters:["\u{1F917}"],aliases:["hugging_face"]},zany:{characters:["\u{1F92A}"],aliases:["zany_face"]},check:{characters:["\u2705","\u2714\uFE0F"],aliases:["white_check_mark","heavy_check_mark"]},x:{characters:["\u274C","\u2716\uFE0F"],aliases:["heavy_multiplication_x"]},question:{characters:["\u2753","?"],aliases:[]},exclamation:{characters:["\u2757"],aliases:[]},warning:{characters:["\u26A0\uFE0F"],aliases:[]},stop:{characters:["\u{1F6D1}"],aliases:["octagonal_sign"]},info:{characters:["\u2139\uFE0F"],aliases:["information_source"]},fire:{characters:["\u{1F525}"],aliases:[]},star:{characters:["\u2B50"],aliases:[]},sparkles:{characters:["\u2728"],aliases:[]},lightning:{characters:["\u26A1"],aliases:["zap"]},boom:{characters:["\u{1F4A5}"],aliases:[]},eyes:{characters:["\u{1F440}"],aliases:[]},green_circle:{characters:["\u{1F7E2}"],aliases:["large_green_circle"]},yellow_circle:{characters:["\u{1F7E1}"],aliases:["large_yellow_circle"]},red_circle:{characters:["\u{1F534}"],aliases:[]},blue_circle:{characters:["\u{1F535}"],aliases:["large_blue_circle"]},white_circle:{characters:["\u26AA"],aliases:[]},black_circle:{characters:["\u26AB"],aliases:[]},rocket:{characters:["\u{1F680}"],aliases:[]},party:{characters:["\u{1F389}","\u{1F973}"],aliases:["tada","partying_face"]},confetti:{characters:["\u{1F38A}"],aliases:["confetti_ball"]},balloon:{characters:["\u{1F388}"],aliases:[]},gift:{characters:["\u{1F381}"],aliases:[]},trophy:{characters:["\u{1F3C6}"],aliases:[]},medal:{characters:["\u{1F947}"],aliases:["first_place_medal"]},lightbulb:{characters:["\u{1F4A1}"],aliases:["bulb"]},gear:{characters:["\u2699\uFE0F"],aliases:[]},wrench:{characters:["\u{1F527}"],aliases:[]},hammer:{characters:["\u{1F528}"],aliases:[]},bug:{characters:["\u{1F41B}"],aliases:[]},link:{characters:["\u{1F517}"],aliases:[]},lock:{characters:["\u{1F512}"],aliases:[]},unlock:{characters:["\u{1F513}"],aliases:[]},key:{characters:["\u{1F511}"],aliases:[]},pin:{characters:["\u{1F4CC}"],aliases:["pushpin"]},memo:{characters:["\u{1F4DD}"],aliases:[]},clipboard:{characters:["\u{1F4CB}"],aliases:[]},calendar:{characters:["\u{1F4C5}"],aliases:[]},clock:{characters:["\u{1F550}"],aliases:["clock1"]},hourglass:{characters:["\u23F3"],aliases:[]},bell:{characters:["\u{1F514}"],aliases:[]},megaphone:{characters:["\u{1F4E2}"],aliases:["mega"]},speech_bubble:{characters:["\u{1F4AC}"],aliases:["speech_balloon"]},email:{characters:["\u{1F4E7}"],aliases:[]},inbox:{characters:["\u{1F4E5}"],aliases:["inbox_tray"]},outbox:{characters:["\u{1F4E4}"],aliases:["outbox_tray"]},package:{characters:["\u{1F4E6}"],aliases:[]},folder:{characters:["\u{1F4C1}"],aliases:["file_folder"]},file:{characters:["\u{1F4C4}"],aliases:["page_facing_up"]},chart_up:{characters:["\u{1F4C8}"],aliases:["chart_with_upwards_trend"]},chart_down:{characters:["\u{1F4C9}"],aliases:["chart_with_downwards_trend"]},coffee:{characters:["\u2615"],aliases:[]},pizza:{characters:["\u{1F355}"],aliases:[]},beer:{characters:["\u{1F37A}"],aliases:[]},arrow_up:{characters:["\u2B06\uFE0F"],aliases:[]},arrow_down:{characters:["\u2B07\uFE0F"],aliases:[]},arrow_left:{characters:["\u2B05\uFE0F"],aliases:[]},arrow_right:{characters:["\u27A1\uFE0F"],aliases:[]},refresh:{characters:["\u{1F504}"],aliases:["arrows_counterclockwise"]},sun:{characters:["\u2600\uFE0F"],aliases:["sunny"]},cloud:{characters:["\u2601\uFE0F"],aliases:[]},rain:{characters:["\u{1F327}\uFE0F"],aliases:["rain_cloud"]},snow:{characters:["\u2744\uFE0F"],aliases:["snowflake"]},rainbow:{characters:["\u{1F308}"],aliases:[]}},CANONICAL=new Map,SHOWN=new Map,BY_CHARACTER=new Map,bare=character=>character.replace(/️/g,"");function add(name,characters,aliases){CANONICAL.set(name,name);for(let alias of aliases)CANONICAL.has(alias)||CANONICAL.set(alias,name);characters[0]&&SHOWN.set(name,characters[0]);for(let character of characters)BY_CHARACTER.has(bare(character))||BY_CHARACTER.set(bare(character),name)}for(let[name,entry]of Object.entries(EMOJI_TABLE))add(name,entry.characters,entry.aliases);add("rotating_light",["\u{1F6A8}"],[]);add("ship",["\u{1F6A2}"],[]);var canonicalEmoji=name=>CANONICAL.get(name)??name;function normalizeEmoji(input){let trimmed=input.trim(),named=trimmed.match(/^:?([a-z0-9_+-]+):?$/i);if(named)return canonicalEmoji(named[1].toLowerCase());let name=BY_CHARACTER.get(bare(trimmed));if(name)return name;throw new Error(`unknown emoji: ${input} (use a short name like eyes or thumbs_up)`)}var displayEmoji=name=>SHOWN.get(canonicalEmoji(name))??`:${name}:`;var Ref=external_exports.string().min(1).max(128),Revision=external_exports.number().int().positive(),id=Ref,flag=external_exports.enum(["true","false","1","0"]).transform(value=>value==="true"||value==="1"),repeated=external_exports.union([external_exports.string(),external_exports.array(external_exports.string())]).transform(value=>Array.isArray(value)?value:[value]),LabelFilter=external_exports.string().regex(/^[a-z0-9][a-z0-9_.-]*(=.*)?$/,"label filters look like key, key=value, or key=a|b").transform(value=>{let at=value.indexOf("=");return at===-1?[value,null]:[value.slice(0,at),value.slice(at+1).split("|")]}),ResolvedSyncTarget=external_exports.object({target:ExternalTarget,kind:external_exports.enum(["channel","thread"])}),Filters=external_exports.object({channel:external_exports.string().optional(),re:id.optional(),by:external_exports.string().optional(),mentions:external_exports.string().optional(),label:repeated.pipe(external_exports.array(LabelFilter)).optional(),from:external_exports.string().min(1).max(165).optional(),text:external_exports.string().min(1).max(200).optional()}),ChannelMessagesQuery=external_exports.strictObject({channel:ChannelPath,after:Ref.optional(),limit:external_exports.coerce.number().int().min(1).max(500).optional()}),ChannelsQuery=external_exports.strictObject({prefix:external_exports.string().min(1).max(501).optional(),after:external_exports.string().min(1).max(1024).optional(),limit:external_exports.coerce.number().int().min(1).max(500).optional()}),ActorsQuery=external_exports.strictObject({id:repeated.pipe(external_exports.array(external_exports.string().min(1).max(300)).min(1).max(100)).optional()}),ThreadQuery=external_exports.strictObject({after:id.optional(),limit:external_exports.coerce.number().int().min(1).max(500).optional()}),ThreadsQuery=Filters.extend({after:Ref.optional(),before:external_exports.string().min(1).max(1024).optional(),limit:external_exports.coerce.number().int().min(1).max(500).optional()}).refine(query=>query.before===void 0||query.after===void 0,{message:"`before` pages back from a page's `older`, and `after` reads forward: pass one",path:["before"]}),EventsQuery=Filters.extend({after:Ref.optional(),wait:external_exports.coerce.number().min(0).max(300).optional(),all:flag.optional(),last:external_exports.coerce.number().int().min(1).max(100).optional()}).refine(query=>query.last===void 0||query.after===void 0&&query.wait===void 0,{message:"`last` reads the newest events at once: it takes no `after` or `wait`",path:["last"]}),PostBody=external_exports.object({channel:ChannelPath.optional(),re:Ref.optional(),text:external_exports.string().default(""),labels:NewLabels.optional(),noSync:external_exports.boolean().optional(),sync:external_exports.array(external_exports.union([external_exports.string().min(3).max(300),ResolvedSyncTarget])).max(10).optional(),id:external_exports.string().min(1).max(200).refine(storable,"id has a NUL character or a lone surrogate").optional(),attachments:external_exports.array(AttachmentId).optional(),after:Ref.optional()}).refine(body=>body.text.trim().length>0||(body.attachments?.length??0)>0,{message:"message text is empty",path:["text"]}).refine(body=>body.channel===void 0!=(body.re===void 0),{message:"a post needs `channel`; a reply needs `re`"}).refine(body=>!(body.noSync&&body.sync?.length),{message:"`noSync` and `sync` contradict each other"}).refine(body=>body.after===void 0||body.re!==void 0,{message:"`after` is for replies: it names the newest message in `re`'s thread",path:["after"]}),Duration=external_exports.string().regex(/^\d+(\.\d+)?(s|m|h|d)$/,"durations look like 30s, 30m, 12h, or 1d"),Instant=external_exports.string().datetime({offset:!0}),ScheduleBody=external_exports.object({channel:ChannelPath.optional(),re:Ref.optional(),text:external_exports.string().default(""),labels:NewLabels.optional(),noSync:external_exports.boolean().optional(),attachments:external_exports.array(AttachmentId).optional(),in:Duration.optional(),at:Instant.optional(),every:Duration.optional(),until:Instant.optional(),for:Duration.optional(),times:external_exports.number().int().positive().optional()}).refine(body=>body.text.trim().length>0||(body.attachments?.length??0)>0,{message:"message text is empty",path:["text"]}).refine(body=>body.channel===void 0!=(body.re===void 0),{message:"a schedule needs `channel` for a new thread, or `re` for a reply"}).refine(body=>body.in!==void 0||body.at!==void 0||body.every!==void 0,{message:"say when: `in`, `at`, or `every`"}).refine(body=>!(body.in!==void 0&&body.at!==void 0),{message:"`in` and `at` contradict each other"}).refine(body=>[body.until,body.for,body.times].filter(v=>v!==void 0).length<=1,{message:"pick one stop: `until`, `for`, or `times`"}).refine(body=>body.every!==void 0||body.until===void 0&&body.for===void 0&&body.times===void 0,{message:"`until`, `for`, and `times` stop a repeat: add `every`"}),SchedulesQuery=external_exports.object({re:id.optional(),channel:external_exports.string().optional(),by:external_exports.string().optional(),all:flag.optional()}),ChannelOrSubtree=external_exports.string().max(CHANNEL_PATTERN_MAX).regex(/^[a-z0-9][a-z0-9_-]*(?:\/[a-z0-9][a-z0-9_-]*)*\/?$/,"name a channel, or a channel and its subtree (work/)"),Lease=external_exports.number(),Claimed={epoch:external_exports.number().int().positive(),token:external_exports.string().min(1).max(128)},ClaimToken={token:external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/,"a claim token is 32 bytes in base64url: 43 characters").optional()},CreateTaskBody=external_exports.object({channel:ChannelPath.optional(),re:Ref.optional(),text:external_exports.string().optional(),labels:NewLabels.optional(),noSync:external_exports.boolean().optional(),attachments:external_exports.array(AttachmentId).optional(),needs:external_exports.array(Ref).optional(),for:ActorId.nullable().optional(),claim:external_exports.boolean().optional(),lease:Lease.optional(),...ClaimToken,id:external_exports.string().min(1).max(200).refine(storable,"id has a NUL character or a lone surrogate").optional()}).refine(body=>body.channel===void 0!=(body.re===void 0),{message:"a task needs `channel` and `text` for a new thread, or `re` for a thread that's there"}).refine(body=>body.channel===void 0||(body.text??"").trim().length>0||(body.attachments?.length??0)>0,{message:"message text is empty",path:["text"]}).refine(body=>body.text===void 0||storable(body.text),{message:"message text has a NUL character or a lone surrogate",path:["text"]}).refine(body=>body.re===void 0||body.text===void 0&&body.labels===void 0&&body.noSync===void 0&&body.attachments===void 0&&body.id===void 0,{message:"`text`, `labels`, `noSync`, `attachments`, and `id` are a new thread's: `re` makes a task of a thread as it is"}).refine(body=>body.lease===void 0||body.claim===!0,{message:"`lease` goes with `claim`",path:["lease"]}).refine(body=>body.token===void 0||body.claim===!0,{message:"`token` goes with `claim`",path:["token"]}),BatchRequest=external_exports.string().min(1).max(64),TaskKey=external_exports.string().min(1).refine(storable,"key has a NUL character or a lone surrogate"),CreateTasksBody=external_exports.object({channel:ChannelPath,tasks:external_exports.array(external_exports.object({key:TaskKey.optional(),text:external_exports.string(),labels:NewLabels.optional(),noSync:external_exports.boolean().optional(),attachments:external_exports.array(AttachmentId).optional(),needs:external_exports.array(external_exports.union([Ref,external_exports.object({key:TaskKey}).strict()])).optional(),for:ActorId.nullable().optional()}).refine(task=>task.text.trim().length>0||(task.attachments?.length??0)>0,{message:"message text is empty",path:["text"]}).refine(task=>storable(task.text),{message:"message text has a NUL character or a lone surrogate",path:["text"]})).min(1).max(100),id:external_exports.string().min(1).max(200).refine(storable,"id has a NUL character or a lone surrogate").optional(),request:BatchRequest.optional()}),CreatedTasksQuery=external_exports.object({request:BatchRequest.optional()}),TasksQuery=external_exports.object({channel:external_exports.string().optional(),state:external_exports.union([external_exports.enum(["open","all"]),TaskState]).optional(),label:repeated.pipe(external_exports.array(LabelFilter)).optional(),by:external_exports.string().optional(),owner:external_exports.string().optional(),for:external_exports.string().optional(),needs:Ref.optional(),after:Ref.optional(),limit:external_exports.coerce.number().int().min(1).max(500).optional(),latest:flag.optional()}).refine(query=>!query.latest||query.after===void 0,{message:"`latest` reads every task to find the last active: it takes no `after`",path:["latest"]}),ClaimTaskBody=external_exports.object({lease:Lease.optional(),...ClaimToken}).optional(),ClaimReadyTaskBody=external_exports.object({channel:ChannelOrSubtree,label:Labels.optional(),from:external_exports.array(external_exports.string().min(1).max(256)).optional(),lease:Lease.optional(),wait:external_exports.number().min(0).max(300).optional(),...ClaimToken}),RenewTaskBody=external_exports.object({...Claimed,lease:Lease.optional()}),ReleaseTaskBody=external_exports.object(Claimed),CompleteTaskBody=external_exports.object({...Claimed,result:SentTaskNote.optional()}),FailTaskBody=external_exports.object({...Claimed,reason:SentTaskNote}),BlockTaskBody=external_exports.object({reason:SentTaskNote,kind:SentTaskHoldKind.refine(kind=>kind!==EDITED_HOLD,"`edited` is the board's own kind, for a task whose root someone else edited: name another").optional(),epoch:Claimed.epoch.optional(),token:Claimed.token.optional()}).refine(body=>body.epoch===void 0==(body.token===void 0),{message:"a claim is its `epoch` and its `token`: pass both, or neither"}),AssignTaskBody=external_exports.object({for:ActorId.nullable()}),TaskNeedsBody=external_exports.object({needs:external_exports.array(Ref)}),CancelTaskBody=external_exports.object({reason:SentTaskNote}),CanGrant=external_exports.union([external_exports.literal("all"),external_exports.array(external_exports.string().min(1).max(16)).max(8)]),ClaimValue=external_exports.string().min(1).max(1e3),Environments=external_exports.array(external_exports.string().min(1).max(100)).min(1).max(16),PrincipalInput=external_exports.discriminatedUnion("kind",[external_exports.strictObject({kind:external_exports.literal("user"),email:external_exports.string().min(3).max(320).optional(),userId:external_exports.string().min(1).max(200).optional()}),external_exports.strictObject({kind:external_exports.literal("project"),project:external_exports.string().min(1).max(200),environments:Environments.optional()}),external_exports.strictObject({kind:external_exports.literal("github"),repository:external_exports.string().min(3).max(200),workflow:external_exports.string().min(1).max(300).optional(),branch:external_exports.string().min(1).max(255).optional(),event:external_exports.string().min(1).max(64).optional()}),external_exports.strictObject({kind:external_exports.literal("oidc"),issuer:external_exports.string().min(1).max(1e3),claims:external_exports.record(external_exports.string().min(1).max(200),external_exports.union([ClaimValue,external_exports.array(ClaimValue).min(1).max(32)]))}),external_exports.strictObject({kind:external_exports.literal("all-users")}),external_exports.strictObject({kind:external_exports.literal("all-projects"),environments:Environments.optional()}),external_exports.strictObject({kind:external_exports.literal("app"),app:external_exports.string().min(1).max(200)}),external_exports.strictObject({kind:external_exports.literal("all-apps")}),external_exports.strictObject({kind:external_exports.literal("everyone")})]),GrantCan=external_exports.record(external_exports.string().min(1).max(CHANNEL_PATTERN_MAX),CanGrant),LockMeOut=external_exports.boolean().optional(),GrantSpec=external_exports.strictObject({principals:external_exports.array(PrincipalInput).min(1).max(32),can:GrantCan}),GrantBody=GrantSpec.extend({lockMeOut:LockMeOut}),CreateGrantsBody=external_exports.strictObject({grants:external_exports.array(GrantSpec).min(1).max(16),lockMeOut:LockMeOut}),RevokeGrantBody=external_exports.strictObject({lockMeOut:LockMeOut}).optional(),ExplainQuery=external_exports.object({channel:ChannelPath,user:external_exports.string().min(1).max(320).optional(),project:external_exports.string().min(1).max(200).optional(),environment:external_exports.string().min(1).max(100).optional(),github:external_exports.string().min(3).max(200).optional(),workflow:external_exports.string().min(1).max(300).optional(),branch:external_exports.string().min(1).max(255).optional(),event:external_exports.string().min(1).max(64).optional(),oidc:external_exports.string().min(1).max(1e3).optional(),claim:repeated.optional(),app:external_exports.string().min(1).max(200).optional()}).refine(query=>[query.user,query.project,query.github,query.oidc,query.app].filter(value=>value!==void 0).length<=1,"name one principal: user, project, github, oidc, or app").refine(query=>query.environment===void 0||query.project!==void 0,"environment goes with project").refine(query=>query.workflow===void 0&&query.branch===void 0&&query.event===void 0||query.github!==void 0,"workflow, branch, and event go with github").refine(query=>query.claim===void 0||query.oidc!==void 0,"claim goes with oidc"),UpdateGrantBody=external_exports.strictObject({add:external_exports.array(PrincipalInput).min(1).max(32).optional(),remove:external_exports.array(PrincipalInput).min(1).max(32).optional(),can:GrantCan.optional(),lockMeOut:LockMeOut}).refine(body=>body.add!==void 0||body.remove!==void 0||body.can!==void 0,"name principals to add or remove, or a can"),SchemaBody=external_exports.strictObject({name:external_exports.string().regex(/^[a-z][a-z0-9._-]*$/,"a schema name is lowercase letters, numbers, and ._-, starting with a letter"),version:external_exports.number().int().min(1),description:external_exports.string().min(1).refine(storable,"a description has a NUL character or a lone surrogate").optional(),schema:external_exports.record(external_exports.string(),external_exports.unknown())}),SyncBody=external_exports.object({target:external_exports.string().min(3).max(300)}),InboxQuery=external_exports.object({channel:external_exports.string().optional(),limit:external_exports.coerce.number().int().min(1).max(500).optional()}),Registering=external_exports.object({watch:external_exports.record(external_exports.string().max(100),external_exports.object({tail:external_exports.string().max(1e3)})),sync:external_exports.array(external_exports.object({key:external_exports.string().min(1).max(64),platform:external_exports.string().min(1).max(64)})).max(32).optional()}),RegisterBody=external_exports.union([Registering.extend({url:external_exports.string().url().max(500).refine(url=>/^https:\/\//.test(url),"wake-ups go over https").transform(url=>url.replace(/\/+$/,"")).nullable().optional(),path:external_exports.null({error:"register a url or a path, not both"}).optional(),branch:external_exports.null({error:"a branch goes with a path"}).optional()}),Registering.extend({url:external_exports.null({error:"register a url or a path, not both"}).optional(),path:external_exports.string().max(300).regex(/^\/[^?#]*$/,"a path starts with / and has no query or fragment").transform(path2=>path2.replace(/(.)\/+$/,"$1")),branch:external_exports.string().min(1).max(255).nullable().optional()})]),MatchesQuery=external_exports.object({limit:external_exports.coerce.number().int().min(1).max(50).optional(),wait:external_exports.coerce.number().min(0).max(25).optional()}),AckBody=external_exports.object({lease:external_exports.string().min(1).max(64),error:external_exports.string().min(1).max(500).optional(),skip:external_exports.boolean().optional()}),SourceReadQuery=external_exports.object({target:external_exports.string().min(1).max(4e3),limit:external_exports.coerce.number().int().min(1).max(200).optional(),after:external_exports.string().min(1).max(400).optional()}),SourceJoinBody=external_exports.object({target:external_exports.string().min(1).max(4e3)}),LinkedQuery=external_exports.object({url:external_exports.string().url().max(4e3)}),SyncKey=external_exports.string().min(1).max(64),ImportOrigin=external_exports.object({thread:ExternalTarget,message:external_exports.string().min(1).max(300).optional()}),ImportLink=Link.extend({message:Ref.nullable()}),PlatformUser=ExternalAuthor.extend({avatar:external_exports.string().nullable().transform(platformAvatar)}),Imported={author:PlatformUser,from:SyncKey.nullable()},Mentioned=external_exports.array(PlatformUser).max(50).optional(),ImportSource=external_exports.object({key:SyncKey,channel:ExternalTarget,thread:ExternalTarget}),Changed={origin:ImportOrigin.optional(),message:Ref.optional()},SyncImportBody=external_exports.discriminatedUnion("op",[external_exports.object({op:external_exports.literal("post"),...Imported,origin:Origin.nullable().default(null),source:ImportSource.optional(),channel:ChannelPath.optional(),re:Ref.optional(),text:external_exports.string().max(MESSAGE_TEXT_MAX).default(""),labels:NewLabels.optional(),noSync:external_exports.boolean().optional(),attachments:external_exports.array(AttachmentId).max(10).optional(),links:external_exports.array(ImportLink).max(10).optional(),mentioned:Mentioned,id:external_exports.string().min(1).max(200).refine(storable,"id has a NUL character or a lone surrogate").optional(),after:Ref.optional()}),external_exports.object({op:external_exports.literal("edit"),...Imported,...Changed,text:MessageText,source:ImportSource.optional(),revision:Revision.optional(),mentioned:Mentioned}),external_exports.object({op:external_exports.literal("delete"),...Imported,...Changed,revision:Revision.optional()}),external_exports.object({op:external_exports.literal("react"),...Imported,...Changed,emoji:Emoji,remove:external_exports.boolean().optional()}),external_exports.object({op:external_exports.literal("labels"),...Imported,...Changed,set:NewLabels.optional(),unset:external_exports.array(LabelKey).optional(),if:external_exports.record(LabelKey,LabelValue.nullable()).optional()}),external_exports.object({op:external_exports.literal("links"),...Imported,...Changed,links:external_exports.array(ImportLink).max(10)})]),PlatformFiles=external_exports.array(external_exports.string().min(1).max(300)).max(10).nullable(),SyncReceiptBody=external_exports.discriminatedUnion("kind",[external_exports.object({kind:external_exports.literal("message"),message:Ref,target:ExternalTarget,external:external_exports.object({thread:ExternalTarget,message:external_exports.string().min(1).max(300)}),files:PlatformFiles.optional()}),external_exports.object({kind:external_exports.literal("files"),message:Ref,target:ExternalTarget,files:PlatformFiles}),external_exports.object({kind:external_exports.literal("failed"),message:Ref,target:ExternalTarget,error:external_exports.string().min(1).max(500)}),external_exports.object({kind:external_exports.literal("thread"),message:Ref,target:ExternalTarget,targetKind:external_exports.enum(["channel","thread"]),cause:external_exports.enum(["config","request"])})]),SyncFindQuery=external_exports.object({post:external_exports.string().min(1).max(200).optional(),thread:ExternalTarget.optional(),message:external_exports.string().min(1).max(300).optional()}),SyncCopiesQuery=external_exports.object({message:repeated.pipe(external_exports.array(Ref).min(1).max(100))}),InboxPushBody=external_exports.object({events:external_exports.array(external_exports.object({id:external_exports.string().min(1).max(300),event:ExternalEvent,raw:external_exports.unknown()})).min(1).max(50)}),InboxNextQuery=external_exports.object({limit:external_exports.coerce.number().int().min(1).max(50).optional()}),InboxAckBody=external_exports.object({lease:external_exports.string().min(1).max(64),error:external_exports.string().min(1).max(500).optional()}),UploadStartBody=external_exports.object({name:external_exports.string().max(1024).nullable().optional(),type:external_exports.string().max(1024).nullable().optional(),size:external_exports.number().int().positive().max(104857600,`direct uploads are at most ${104857600/1024/1024} MB`),sha256:external_exports.string().regex(/^[A-Za-z0-9+/]{43}=$/,"sha256 is the base64 SHA-256 of the bytes").optional()}),EditBody=external_exports.object({text:SentText,revision:Revision.optional()}),DeleteBody=external_exports.object({revision:Revision.optional()}).optional(),TypingBody=external_exports.object({status:external_exports.string().trim().min(1).max(50).optional()}).optional(),ReactBody=external_exports.object({emoji:Emoji,remove:external_exports.boolean().optional()}),CreateChannelBody=external_exports.strictObject({path:ChannelPath}),LabelBody=external_exports.object({set:NewLabels.optional(),unset:external_exports.array(LabelKey).optional(),if:external_exports.record(LabelKey,LabelValue.nullable()).refine(expected=>Object.keys(expected).length<=16,"at most 16 labels").optional()}).refine(body=>body.set!==void 0||body.unset!==void 0,{message:"nothing to change: pass `set` or `unset`"}),routes={discovery:{method:"GET",path:"/"},me:{method:"GET",path:"/me"},channels:{method:"GET",path:"/channels",query:ChannelsQuery},createChannel:{method:"POST",path:"/channels",body:CreateChannelBody},actors:{method:"GET",path:"/actors",query:ActorsQuery},channelMessages:{method:"GET",path:"/messages",query:ChannelMessagesQuery},message:{method:"GET",path:"/messages/:id",query:ThreadQuery},threads:{method:"GET",path:"/threads",query:ThreadsQuery},post:{method:"POST",path:"/messages",body:PostBody},edit:{method:"POST",path:"/messages/:id/edit",body:EditBody},delete:{method:"POST",path:"/messages/:id/delete",body:DeleteBody},react:{method:"POST",path:"/messages/:id/reactions",body:ReactBody},label:{method:"POST",path:"/messages/:id/labels",body:LabelBody},sync:{method:"POST",path:"/messages/:id/sync",body:SyncBody},synced:{method:"GET",path:"/messages/:id/sync"},linked:{method:"GET",path:"/links",query:LinkedQuery},typing:{method:"POST",path:"/messages/:id/typing",body:TypingBody},schedule:{method:"POST",path:"/schedules",body:ScheduleBody},schedules:{method:"GET",path:"/schedules",query:SchedulesQuery},cancelSchedule:{method:"POST",path:"/schedules/:id/cancel"},tasks:{method:"GET",path:"/tasks",query:TasksQuery},createTask:{method:"POST",path:"/tasks",body:CreateTaskBody},createTasks:{method:"POST",path:"/tasks/batch",body:CreateTasksBody},createdTasks:{method:"GET",path:"/tasks/batch/:id",query:CreatedTasksQuery},claimReadyTask:{method:"POST",path:"/tasks/claim",body:ClaimReadyTaskBody},claimTask:{method:"POST",path:"/tasks/:id/claim",body:ClaimTaskBody},renewTask:{method:"POST",path:"/tasks/:id/renew",body:RenewTaskBody},releaseTask:{method:"POST",path:"/tasks/:id/release",body:ReleaseTaskBody},completeTask:{method:"POST",path:"/tasks/:id/complete",body:CompleteTaskBody},failTask:{method:"POST",path:"/tasks/:id/fail",body:FailTaskBody},blockTask:{method:"POST",path:"/tasks/:id/block",body:BlockTaskBody},unblockTask:{method:"POST",path:"/tasks/:id/unblock"},reopenTask:{method:"POST",path:"/tasks/:id/reopen"},assignTask:{method:"POST",path:"/tasks/:id/assign",body:AssignTaskBody},setTaskNeeds:{method:"POST",path:"/tasks/:id/needs",body:TaskNeedsBody},cancelTask:{method:"POST",path:"/tasks/:id/cancel",body:CancelTaskBody},grants:{method:"GET",path:"/grants"},createGrant:{method:"POST",path:"/grants",body:GrantBody},createGrants:{method:"POST",path:"/grants/batch",body:CreateGrantsBody},updateGrant:{method:"PATCH",path:"/grants/:id",body:UpdateGrantBody},explain:{method:"GET",path:"/grants/explain",query:ExplainQuery},revokeGrant:{method:"POST",path:"/grants/:id/revoke",body:RevokeGrantBody},schemas:{method:"GET",path:"/schemas"},schema:{method:"GET",path:"/schemas/:id"},createSchema:{method:"POST",path:"/schemas",body:SchemaBody},posted:{method:"GET",path:"/posts/:id"},inbox:{method:"GET",path:"/inbox/:key",query:InboxQuery},inboxPush:{method:"POST",path:"/inbox/:key",body:InboxPushBody},inboxNext:{method:"GET",path:"/inbox/:key/next",query:InboxNextQuery},inboxAck:{method:"POST",path:"/inbox/:key/:id/ack",body:InboxAckBody},syncImport:{method:"POST",path:"/sync/imports",body:SyncImportBody},syncReceipt:{method:"POST",path:"/sync/receipts",body:SyncReceiptBody},syncThread:{method:"GET",path:"/sync/threads/:thread"},syncFind:{method:"GET",path:"/sync/find",query:SyncFindQuery},syncCopies:{method:"GET",path:"/sync/copies",query:SyncCopiesQuery},readSource:{method:"GET",path:"/sources/:key/read",query:SourceReadQuery},joinSource:{method:"POST",path:"/sources/:key/join",body:SourceJoinBody},webhook:{method:"POST",path:"/webhooks/:key"},events:{method:"GET",path:"/events",query:EventsQuery},avatar:{method:"GET",path:"/avatars/:name"},upload:{method:"POST",path:"/attachments"},attachment:{method:"GET",path:"/attachments/:id"},uploadStart:{method:"POST",path:"/attachments/uploads",body:UploadStartBody},uploadFinish:{method:"POST",path:"/attachments/uploads/:id"},openapi:{method:"GET",path:"/openapi.json"},watchers:{method:"GET",path:"/watchers"},register:{method:"POST",path:"/watchers",body:RegisterBody},matches:{method:"GET",path:"/watchers/matches",query:MatchesQuery},ack:{method:"POST",path:"/watchers/matches/:id/ack",body:AckBody},wake:{method:"POST",path:"/wake"}};async function*parseSse(body,signal){let reader=body.getReader(),decoder=new TextDecoder,buffer="",onAbort=()=>void reader.cancel().catch(()=>{});signal?.addEventListener("abort",onAbort,{once:!0});try{for(;;){let{value,done}=await reader.read();if(done)return;buffer+=decoder.decode(value,{stream:!0});let boundary;for(;(boundary=buffer.search(/\r?\n\r?\n/))!==-1;){let block=buffer.slice(0,boundary);buffer=buffer.slice(boundary).replace(/^\r?\n\r?\n/,"");let message={},data=[];for(let line of block.split(/\r?\n/)){if(line===""||line.startsWith(":"))continue;let colon=line.indexOf(":"),field=colon===-1?line:line.slice(0,colon),value2=colon===-1?"":line.slice(colon+1).replace(/^ /,"");field==="data"?data.push(value2):field==="id"?message.id=value2:field==="event"&&(message.event=value2)}data.length>0&&(message.data=data.join(`
|
|
8
|
+
`)),(message.id!==void 0||message.data!==void 0)&&(yield message)}}}finally{signal?.removeEventListener("abort",onAbort),reader.releaseLock()}}var BoardError=class extends Error{code;status;hint;origin;retryAfter;constructor(code,message,status,options={}){super(message),this.name="BoardError",this.code=code,this.status=status,this.hint=options.hint,this.origin=options.origin??"handle",this.retryAfter=options.retryAfter}},handleErrors=new WeakSet,resolve=async value=>typeof value=="function"?await value():value,scheduleBody=input=>{let{at,until,...rest}=messageBody(input);return{...rest,...at!==void 0?{at:at instanceof Date?at.toISOString():at}:{},...until!==void 0?{until:until instanceof Date?until.toISOString():until}:{}}},messageBody=input=>{if(typeof input=="string")return{text:input};let{attachments,...rest}=input;return attachments?.length?{...rest,attachments:attachments.map(a=>typeof a=="string"?a:a.id)}:rest};function eventsState(onState){let current=null,tell=next=>{next!==current&&(current=next,onState?.(next))};return{answered:()=>tell("live"),failed:()=>tell("retrying")}}var CLAIM_WAIT_S=25,CLAIM_AGAIN_MS=1e3,UNITS={ms:1,s:1e3,m:6e4,h:36e5,d:864e5};function duration(value){if(typeof value=="number")return value;let match=value.trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/);if(!match)throw new BoardError("invalid_duration",`${value} isn't a duration like 30s, 10m, or 1h.`,0);return Number(match[1])*UNITS[match[2]??"ms"]}var path=id2=>encodeURIComponent(id2);function queryString(query){let params=new URLSearchParams;for(let[key,value]of Object.entries(query))if(value!=null)if(key==="label"){let labels=Array.isArray(value)?value:typeof value=="object"?Object.entries(value).map(([k,v])=>`${k}=${String(v)}`):[value];for(let label of labels)params.append("label",String(label))}else params.set(key,String(value));let text=params.toString();return text?`?${text}`:""}function wireCan(can){return can===null||typeof can!="object"||Array.isArray(can)?can:Object.fromEntries(Object.entries(can).map(([pattern,grant])=>[pattern,grant==="none"?[]:grant]))}var withEnvironments=principal=>(principal.kind==="project"||principal.kind==="all-projects")&&principal.environments===void 0?{...principal,environments:["production"]}:principal,wireGrant=input=>({principals:input.principals.map(withEnvironments),can:wireCan(input.can)}),goAhead=({lockMeOut})=>lockMeOut?{lockMeOut:!0}:{};function creatorOf(me,path2){let[source,kind,id2,environment]=me.principal.split(":");if((source==="vercel"||source==="local")&&kind==="user"&&id2)return{kind:"user",userId:me.principal.split(":").slice(2).join(":")};if(source==="vercel"&&kind==="project"&&id2&&environment)return{kind:"project",project:id2,environments:[environment]};throw new BoardError("no_own_principal",`A private channel lets its creator in, as a person or a project's deployment, and ${me.principal} is neither, so ${path2} wasn't made.`,400,{hint:"Make it as a person or a deployment, or make it and its grants yourself."})}function createBoardClient(options){let base=options.url.replace(/\/+$/,""),doFetch=options.fetch??((input,init)=>globalThis.fetch(input,init)),storeFetch=options.storeFetch??((input,init)=>globalThis.fetch(input,init));async function headers(auth,as){let out={...options.headers?await resolve(options.headers):{}};if(!auth)return out;options.token!==void 0&&(out.authorization=`Bearer ${await resolve(options.token)}`);let profile=as!==void 0?as:options.profile===void 0?null:await resolve(options.profile);return profile!==null&&(out["x-board-profile"]=formatProfileHeader(typeof profile=="string"?{name:profile}:profile)),out}async function raw(method,path2,init={}){let response=await doFetch(`${base}${path2}`,{method,headers:{...await headers(init.auth??!0),...init.body===void 0?{}:{"content-type":"application/json"},...init.headers},...init.body===void 0?{}:{body:JSON.stringify(init.body)},...init.signal?{signal:init.signal}:{}});if(!response.ok)throw await toError(response);return response}async function call(method,path2,init){return await(await raw(method,path2,init)).json()}let filtersQuery=(filters={})=>filters;async function poll(query={},signal){return call("GET",`/events${queryString(query)}`,signal?{signal}:{})}let taskWrite=async(id2,verb,body={})=>(await call("POST",`/tasks/${path(id2)}/${verb}`,{body})).task,held=(id2,proof)=>{let{epoch,token}=proof;return{async renew(lease){let{task,until}=await call("POST",`/tasks/${path(id2)}/renew`,{body:{epoch,token,...lease!==void 0?{lease}:{}}});return claimed(task,{epoch,token,until})},release:()=>taskWrite(id2,"release",{epoch,token}),complete:result=>taskWrite(id2,"complete",{epoch,token,...result!==void 0?{result}:{}}),fail:reason=>taskWrite(id2,"fail",{epoch,token,reason}),block:(reason,opts={})=>taskWrite(id2,"block",{epoch,token,reason,...opts})}},claimed=(task,claim)=>({task,...claim,...held(task.id,claim)});async function createTask(target,input={}){let where=typeof target=="string"?{channel:target}:{re:target.re},made=typeof input=="string"?{text:input}:"attachments"in input&&input.attachments?.length?{...input,attachments:input.attachments.map(file=>typeof file=="string"?file:file.id)}:input,{task,claim,mentions}=await call("POST","/tasks",{body:{...where,...made}});return{task,...claim?{claim:claimed(task,claim)}:{},...mentions?{mentions}:{}}}async function createTasks(channel,tasks,opts={}){return(await call("POST","/tasks/batch",{body:{channel,tasks:tasks.map(task=>task.attachments?.length?{...task,attachments:task.attachments.map(file=>typeof file=="string"?file:file.id)}:task),...opts.id!==void 0?{id:opts.id}:{}}})).tasks}async function claimTask(target,opts={}){let signal=opts.signal?{signal:opts.signal}:{};if(typeof target=="string"){let body={...opts.lease!==void 0?{lease:opts.lease}:{},...opts.token!==void 0?{token:opts.token}:{}},{task,claim}=await call("POST",`/tasks/${path(target)}/claim`,{body,...signal});return claimed(task,claim)}let{wait,...ready}=target,deadline=Date.now()+(wait??0)*1e3;for(;;){let asked=Date.now(),hold=Math.max(0,Math.min(CLAIM_WAIT_S,(deadline-asked)/1e3)),answer=await call("POST","/tasks/claim",{body:{...ready,...hold>0?{wait:hold}:{}},...signal});if(answer.task)return claimed(answer.task,answer.claim);if(Date.now()>=deadline||opts.signal?.aborted)return null;let pause=Math.min(CLAIM_AGAIN_MS-(Date.now()-asked),deadline-Date.now());pause>0&&await new Promise(resolve2=>setTimeout(resolve2,pause))}}return{url:base,request:async(path2,init={})=>doFetch(`${base}${path2}`,{method:init.method??"GET",headers:{...init.headers,...await headers(!0,init.as)},...init.body?{body:init.body}:{},...init.signal?{signal:init.signal}:{}}),discovery:()=>call("GET","/",{auth:!1}),me:()=>call("GET","/me"),channels:async(query={})=>{let page=await call("GET",`/channels${queryString(query)}`);return{...page,next:page.next??null}},createChannel:async(path2,options2={})=>{if(!options2.private)return call("POST","/channels",{body:{path:path2}});let creator=creatorOf(await call("GET","/me"),path2),pattern=`${path2}/`,reaching=async()=>(await call("GET","/grants")).grants.filter(grant=>Object.keys(grant.can).some(at=>at===path2||at.startsWith(pattern))),granted=(grants,mine=[])=>{let changed=grants.filter(grant=>mine.some(ours=>ours.id===grant.id)).map(grant=>grant.id);if(changed.length===grants.length)return new BoardError("channel_granted",`${changed.join(" and ")} changed while ${path2} was being made, so a private ${path2} wouldn't be yours alone: nothing was made.`,409);let named=grants.filter(grant=>!changed.includes(grant.id)).map(grant=>grant.id);return new BoardError("channel_granted",`${named.length===1?named[0]:`${named.slice(0,-1).join(", ")} and ${named.at(-1)}`} already ${named.length===1?"grants":"grant"} in ${path2}, so a private ${path2} wouldn't be yours alone: nothing was made.`,409,{hint:named.length===1?`Revoke it first: vb grants revoke ${named[0]}`:"Revoke them first, each with vb grants revoke <id>."})},before=await reaching();if(before.length>0)throw granted(before);let first=async prefix=>(await call("GET",`/channels${queryString({prefix,limit:1})}`)).channels.find(channel=>channel.path===path2||channel.path.startsWith(pattern)),there=await first(path2)??await first(pattern);if(there)throw new BoardError("channel_exists",there.path===path2?`${path2} is a channel already, so it stays as it is.`:`${there.path} is a channel already, and a private ${path2} would close it too, so nothing was made.`,409,{hint:`Close it with a grant: everyone at ${pattern} with 'none'.`});let own=await call("POST","/grants",{body:{principals:[creator],can:{[pattern]:"all"}}}),takeBack=id2=>{let revoke=body=>call("POST",`/grants/${encodeURIComponent(id2)}/revoke`,{body});return revoke({}).catch(error=>{if(error instanceof BoardError&&error.code==="grant_lockout")return revoke({lockMeOut:!0});throw error})},others=(grants,mine)=>grants.filter(grant=>{let made=mine.find(ours=>ours.id===grant.id);return made===void 0||JSON.stringify([grant.principals,grant.can])!==JSON.stringify([made.principals,made.can])}),raced=others(await reaching(),[own.grant]);if(raced.length>0)throw await takeBack(own.grant.id),granted(raced,[own.grant]);let closed=await call("POST","/grants",{body:{principals:[{kind:"everyone"}],can:{[pattern]:[]}}}),late=others(await reaching(),[own.grant,closed.grant]);if(late.length>0){for(let id2 of[closed.grant.id,own.grant.id])await takeBack(id2);throw granted(late,[own.grant,closed.grant])}return{...await call("POST","/channels",{body:{path:path2}}),grants:[own.grant,closed.grant]}},actors:async(query={})=>{if(query.id===void 0)return(await call("GET","/actors")).actors;let ids=[...new Set(query.id)],batches=Array.from({length:Math.ceil(ids.length/100)},(_,n)=>ids.slice(n*100,(n+1)*100)),named=batch=>call("GET",`/actors?${new URLSearchParams(batch.map(id2=>["id",id2]))}`).then(page=>page.actors),first=batches.length>0?await named(batches[0]):[],asked=new Set(batches[0]),found=first.every(actor=>asked.has(actor.id))?[...first,...(await Promise.all(batches.slice(1).map(named))).flat()]:first,wanted=new Set(ids),seen=new Set;return found.filter(actor=>wanted.has(actor.id)&&!seen.has(actor.id)&&!!seen.add(actor.id))},channel:name=>({messages:(query={})=>call("GET",`/messages${queryString({channel:name,...query})}`)}),thread:(id2,range={})=>call("GET",`/messages/${path(id2)}${queryString(range)}`),posted:async id2=>(await call("GET",`/posts/${path(id2)}`)).message,threads:(query={})=>call("GET",`/threads${queryString(query)}`),async post(channel,input){let{message,mentions}=await call("POST","/messages",{body:{channel,...messageBody(input)}});return mentions?{...message,mentions}:message},async reply(id2,input){let{message,mentions}=await call("POST","/messages",{body:{re:id2,...messageBody(input)}});return mentions?{...message,mentions}:message},async schedule(target,input){let{schedule,mentions}=await call("POST","/schedules",{body:{...typeof target=="string"?{channel:target}:{re:target.re},...scheduleBody(input)}});return mentions?{...schedule,mentions}:schedule},schedules:async(query={})=>(await call("GET",`/schedules${queryString(query)}`)).schedules,cancelSchedule:id2=>call("POST",`/schedules/${path(id2)}/cancel`,{body:{}}),tasks:{list:(query={})=>call("GET",`/tasks${queryString(query)}`),create:createTask,createMany:createTasks,claim:claimTask,held,block:(id2,reason,opts={})=>taskWrite(id2,"block",{reason,...opts}),unblock:id2=>taskWrite(id2,"unblock"),reopen:id2=>taskWrite(id2,"reopen"),assign:(id2,actor)=>taskWrite(id2,"assign",{for:actor}),needs:(id2,needs)=>taskWrite(id2,"needs",{needs}),cancel:(id2,reason)=>taskWrite(id2,"cancel",{reason})},createGrant:(input,options2={})=>call("POST","/grants",{body:{...wireGrant(input),...goAhead(options2)}}),createGrants:(inputs,options2={})=>call("POST","/grants/batch",{body:{grants:inputs.map(wireGrant),...goAhead(options2)}}),updateGrant:(id2,{add:add2,remove,can},options2={})=>call("PATCH",`/grants/${path(id2)}`,{body:{...add2?{add:add2.map(withEnvironments)}:{},...remove?{remove}:{},...can?{can:wireCan(can)}:{},...goAhead(options2)}}),explain:(channel,principal={})=>{let{claims,...rest}=principal,params=new URLSearchParams({channel});for(let[name,value]of Object.entries(rest))value!==void 0&¶ms.set(name,value);for(let[name,value]of Object.entries(claims??{}))params.append("claim",`${name}=${value}`);return call("GET",`/grants/explain?${params}`)},grants:async()=>(await call("GET","/grants")).grants,revokeGrant:(id2,options2={})=>call("POST",`/grants/${path(id2)}/revoke`,{body:goAhead(options2)}),schemas:async()=>(await call("GET","/schemas")).schemas,schema:async id2=>(await call("GET",`/schemas/${path(id2)}`)).schema,createSchema:input=>call("POST","/schemas",{body:input}),async upload(input){let type=input.type||(input.data instanceof Blob?input.data.type:"")||typeOf(input.name),size=input.data instanceof Blob?input.data.size:input.data.byteLength;if(size>4194304){if(size>104857600)throw new BoardError("too_large",`Attachments are at most ${104857600/1024/1024} MB.`,413);let bytes=input.data instanceof Blob?await input.data.arrayBuffer():input.data,sha256=btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest("SHA-256",bytes)))),ticket=await call("POST","/attachments/uploads",{body:{name:input.name,type,size,sha256}}).catch(error=>{throw error instanceof BoardError&&error.status===404&&error.code==="not_found"?new BoardError("too_large",`This board takes files of at most ${4194304/1024/1024} MB.`,413):error}),put=await storeFetch(ticket.url,{method:"PUT",headers:ticket.headers,body:input.data});if(!put.ok)throw new BoardError("upload_failed",`The blob store refused the file: ${put.status} ${(await put.text().catch(()=>"")).slice(0,300)||put.statusText}`,put.status);return(await call("POST",`/attachments/uploads/${encodeURIComponent(ticket.id)}`,{body:{}})).attachment}let response=await doFetch(`${base}/attachments`,{method:"POST",headers:{...await headers(!0),"content-type":type,"x-board-filename":encodeURIComponent(input.name)},body:input.data});if(!response.ok)throw await toError(response);return(await response.json()).attachment},download:(id2,opts={})=>raw("GET",`/attachments/${encodeURIComponent(id2)}`,opts.signal?{signal:opts.signal}:{}),edit:(id2,text,opts={})=>call("POST",`/messages/${path(id2)}/edit`,{body:{text,...opts}}),delete:(id2,opts={})=>call("POST",`/messages/${path(id2)}/delete`,{body:{...opts}}),react:(id2,emoji,opts={})=>call("POST",`/messages/${path(id2)}/reactions`,{body:{emoji:normalizeEmoji(emoji),...opts}}),label:(id2,change)=>call("POST",`/messages/${path(id2)}/labels`,{body:change}),typing:async(id2,status)=>(await call("POST",`/messages/${path(id2)}/typing`,{body:status?{status}:{}})).targets,sync:(id2,target)=>target===void 0?call("GET",`/messages/${path(id2)}/sync`):call("POST",`/messages/${path(id2)}/sync`,{body:{target}}),linked:url=>call("GET",`/links${queryString({url})}`),inbox:async(key,opts={})=>(await call("GET",`/inbox/${key}${queryString(opts)}`)).events,register:input=>call("POST","/watchers",{body:input}),watchers:async()=>(await call("GET","/watchers")).watchers,matches:async(opts={})=>{let{signal,...query}=opts;return(await call("GET",`/watchers/matches${queryString(query)}`,signal?{signal}:{})).matches},ack:(id2,body)=>call("POST",`/watchers/matches/${encodeURIComponent(id2)}/ack`,{body}),readSource:(key,target,opts={})=>call("GET",`/sources/${key}/read${queryString({target,...opts})}`),joinSource:(key,target)=>call("POST",`/sources/${key}/join`,{body:{target}}),poll,syncImport:body=>call("POST","/sync/imports",{body}),syncReceipt:body=>call("POST","/sync/receipts",{body}),syncThread:thread=>call("GET",`/sync/threads/${path(thread)}`),syncFind:(query,opts={})=>call("GET",`/sync/find${queryString(query)}`,opts.signal?{signal:opts.signal}:{}),syncCopies:async messages=>(await call("GET",`/sync/copies?${messages.map(id2=>`message=${encodeURIComponent(id2)}`).join("&")}`)).copies,inboxPush:(key,events)=>call("POST",`/inbox/${path(key)}`,{body:{events}}),inboxNext:async(key,opts={})=>(await call("GET",`/inbox/${path(key)}/next${queryString(opts)}`)).items,inboxAck:(key,id2,body)=>call("POST",`/inbox/${path(key)}/${path(id2)}/ack`,{body}),async*events(query={},opts={}){let{last,...rest}=query,after=query.after,failures=0,state=eventsState(opts.onState);for(;!opts.signal?.aborted;){let response;try{response=await raw("GET",`/events${queryString({...filtersQuery(rest),...after===void 0&&last!==void 0?{last}:{},after})}`,{headers:{accept:"text/event-stream"},...opts.signal?{signal:opts.signal}:{}})}catch(error){if(opts.signal?.aborted)return;if(error instanceof BoardError&&(error.status===501||error.status>=400&&error.status<500))throw error;state.failed(),await new Promise(r=>setTimeout(r,Math.min(3e4,500*2**failures++)));continue}failures=0,state.answered();try{for await(let message of parseSse(response.body,opts.signal))message.id!==void 0&&(after=message.id),message.event==="board"&&message.data&&(yield JSON.parse(message.data))}catch{if(opts.signal?.aborted)return;state.failed(),await new Promise(r=>setTimeout(r,Math.min(3e4,500*2**failures++)))}}},async wait(query={},opts={}){let deadline=Date.now()+duration(opts.timeout??"30m"),after=query.after??(await poll({...query,after:void 0,wait:0},opts.signal)).cursor;for(;Date.now()<deadline&&!opts.signal?.aborted;){let wait=Math.max(0,Math.min(25,Math.ceil((deadline-Date.now())/1e3))),page=await poll({...query,after,wait},opts.signal);if(page.events.length>0)return page.events[0];after=page.cursor}return null}}}async function toError(response){try{let body=await response.json(),retryAfter=response.status===429?/^\d{1,6}$/.exec(response.headers.get("retry-after")??"")?.[0]:void 0;if(body.error?.message)return new BoardError(body.error.code??"error",body.error.message,response.status,{...typeof body.error.hint=="string"?{hint:body.error.hint}:{},origin:handleErrors.has(response)?"handle":"board",...retryAfter!==void 0?{retryAfter:Number(retryAfter)}:{}})}catch{}return new BoardError("http_error",`The board answered ${`${response.status} ${response.statusText}`.trim()}.`,response.status)}var HttpError=class extends Error{status;code;hint;origin;retryAfter;constructor(status,code,message,options={}){super(message),this.status=status,this.code=code,this.hint=options.hint,this.origin=options.origin??"board",this.retryAfter=options.retryAfter}},RejectedError=class extends HttpError{response;constructor(response){super(response.status,"rejected",`rejected with ${response.status}`),this.response=response}},badRequest=(message,code="invalid_request")=>new HttpError(400,code,message),unauthorized=message=>new HttpError(401,"unauthorized",message),forbidden=message=>new HttpError(403,"forbidden",message),notFound=(message,code="not_found")=>new HttpError(404,code,message),textTooLong=()=>new HttpError(400,"text_too_long",`A message's text is at most ${MESSAGE_TEXT_MAX.toLocaleString("en-US")} characters.`,{hint:"Put the long part in a file and attach it to a message, with a short summary as the text."}),duplicateId=()=>new HttpError(409,"duplicate_id","that id was already used for a different write"),batchTooLarge=(tasks,most)=>new HttpError(400,"batch_too_large",`a batch makes ${most} tasks at most, and this one has ${tasks}: send it in parts`),json=(body,status=200,headers)=>new Response(JSON.stringify(body),{status,headers:{"content-type":"application/json",...headers}});function reported(issue){if(issue.code==="invalid_key"&&issue.issues[0])return reported({...issue.issues[0],path:issue.path.slice(0,-1)});if(issue.code!=="invalid_union"||issue.errors.length===0)return issue;let first=issue.errors.reduce((best,option)=>option.length<best.length?option:best)[0];return first?reported({...first,path:[...issue.path,...first.path]}):issue}function toErrorResponse(error){if(error instanceof RejectedError)return error.response;if(error instanceof HttpError){let response=json({error:{code:error.code,message:error.message,...error.hint!==void 0?{hint:error.hint}:{}}},error.status,error.retryAfter!==void 0?{"retry-after":String(error.retryAfter)}:void 0);return error.origin==="handle"&&handleErrors.add(response),response}if(error instanceof ZodError){let issue=error.issues[0]&&reported(error.issues[0]);if(issue?.code==="too_big"&&issue.origin==="string"&&issue.maximum===1e4&&issue.path.length===1&&issue.path[0]==="text")return toErrorResponse(textTooLong());let path2=issue?.path.length?`${issue.path.join(".")}: `:"";return json({error:{code:"invalid_request",message:`${path2}${issue?.message??"invalid request"}`}},400)}let code=error?.code;return code==="INVALID_PAYLOAD"?json({error:{code:"invalid_request",message:error.message}},400):code==="PARTIAL_DUPLICATE_BATCH"||code==="DUPLICATE_EVENT_ID"?toErrorResponse(duplicateId()):code==="STORE_UNAVAILABLE"||code==="STORE_NOT_CONFIGURED"?json({error:{code:"unavailable",message:error.message}},503):(console.error("[board]",error),json({error:{code:"internal",message:"internal error"}},500))}export{fileSize,typeOf,fileName,fileNameProblem,importedFileName,mediaType,formatProfileHeader,parseProfileHeader,MESSAGE_TEXT_MAX,CAN_MAX,RESERVED_LABEL_PREFIX,TASK_LABEL,ChannelPath,toStorable,LabelKey,NewLabels,AttachmentId,RemoteWatcherId,ExternalLocation,ExternalEvent,isThreadTarget,channelOf,canonicalEmoji,normalizeEmoji,displayEmoji,Ref,Filters,ChannelMessagesQuery,ChannelsQuery,ActorsQuery,ThreadQuery,ThreadsQuery,EventsQuery,PostBody,ScheduleBody,SchedulesQuery,CreateTaskBody,CreateTasksBody,CreatedTasksQuery,TasksQuery,ClaimTaskBody,ClaimReadyTaskBody,RenewTaskBody,ReleaseTaskBody,CompleteTaskBody,FailTaskBody,BlockTaskBody,AssignTaskBody,TaskNeedsBody,CancelTaskBody,GrantBody,CreateGrantsBody,RevokeGrantBody,ExplainQuery,UpdateGrantBody,SchemaBody,SyncBody,InboxQuery,RegisterBody,MatchesQuery,AckBody,SourceReadQuery,SourceJoinBody,LinkedQuery,SyncImportBody,SyncReceiptBody,SyncFindQuery,SyncCopiesQuery,InboxPushBody,InboxNextQuery,InboxAckBody,UploadStartBody,EditBody,DeleteBody,TypingBody,ReactBody,CreateChannelBody,LabelBody,routes,BoardError,eventsState,duration,createBoardClient,HttpError,RejectedError,badRequest,unauthorized,forbidden,notFound,duplicateId,batchTooLarge,json,toErrorResponse};
|
|
@@ -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{printAlignedLabel}from"./chunk-
|
|
7
|
+
import{printAlignedLabel}from"./chunk-M2Q2DUHO.js";import{buildCommandWithGlobalFlags}from"./chunk-CSNP5RIM.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";import{quoteArg}from"./chunk-DORCX7UB.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1);var CRITICAL_DELIVERY_DESCRIPTION="Critical only (escalated by Vercel Agent)";function formatMinimumSeverity(notification){let level=notification.minimumSeverityLevel;return level==="critical"?CRITICAL_DELIVERY_DESCRIPTION:level?`${level[0].toUpperCase()}${level.slice(1)} and above`:notification.type==="webhook"&&!("url"in notification.webhook)?"Details unavailable":"Monitor setting"}function formatProjectScope(scope){return scope.type==="all"?"all projects":`${scope.projectName} (${scope.projectId})`}function formatNotificationExpanded(notification,index){if(notification.type==="slack")return[` ${index+1}. ${import_chalk.default.bold("Slack")} ${import_chalk.default.cyan(`#${notification.channelName}`)}`,` ${import_chalk.default.dim("Project scope:")} ${formatProjectScope(notification.projectScope)}`,` ${import_chalk.default.dim("Channel ID:")} ${notification.channelId}`,` ${import_chalk.default.dim("Slack installation ID:")} ${notification.configId}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
|
|
8
8
|
`);let{webhook}=notification;return[` ${index+1}. ${import_chalk.default.bold("Webhook")}`,` ${import_chalk.default.dim("Webhook ID:")} ${webhook.id}`,` ${import_chalk.default.dim("URL:")} ${"url"in webhook?webhook.url:"Details unavailable"}`,` ${import_chalk.default.dim("Minimum severity:")} ${formatMinimumSeverity(notification)}`].join(`
|
|
9
9
|
`)}function formatRuleExpanded(ruleId,notifications){let lines=[` ${import_chalk.default.bold(ruleId)}`];return notifications.length===0?lines.push(` ${import_chalk.default.dim("No notification destinations")}`):lines.push(notifications.map((notification,index)=>formatNotificationExpanded(notification,index)).join(`
|
|
10
10
|
|
|
@@ -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{parseTimeFlag}from"./chunk-D3M2JG5C.js";import{output_manager_default}from"./chunk-
|
|
7
|
+
import{parseTimeFlag}from"./chunk-D3M2JG5C.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";function validateAllProjectMutualExclusivity(all,project){return all&&project?{valid:!1,code:"MUTUAL_EXCLUSIVITY",message:"Cannot specify both --all and --project. Use one or the other."}:{valid:!0}}function validateTimeBound(input){if(!input)return{valid:!0,value:void 0};try{return{valid:!0,value:parseTimeFlag(input)}}catch(err){return{valid:!1,code:"INVALID_TIME",message:err.message}}}function validateTimeOrder(since,until){return since&&until&&since.getTime()>until.getTime()?{valid:!1,code:"INVALID_TIME_RANGE",message:"`--since` must be earlier than `--until`."}:{valid:!0}}function normalizeRepeatableStringFilters(filters){if(!filters||filters.length===0)return[];let normalized=filters.flatMap(filter=>filter.split(",")).map(filter=>filter.trim()).filter(Boolean);return[...new Set(normalized)]}function validateIntegerRangeWithDefault(value,opts){return value===void 0?{valid:!0,value:opts.defaultValue}:Number.isNaN(value)?{valid:!1,code:"INVALID_LIMIT",message:`Please provide a number for option \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function validateOptionalIntegerRange(value,opts){return value===void 0?{valid:!0,value:void 0}:Number.isNaN(value)?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`Please provide a number for option \`${opts.flag}\`.`}:!Number.isInteger(value)||value<opts.min||value>opts.max?{valid:!1,code:opts.code||"INVALID_LIMIT",message:`\`${opts.flag}\` must be an integer between ${opts.min} and ${opts.max}.`}:{valid:!0,value}}function formatJsonError(code,message){return`${JSON.stringify({error:{code,message}},null,2)}
|
|
8
8
|
`}function writeJsonError(client,code,message){client.stdout.write(formatJsonError(code,message))}var USAGE_ERROR_CODES=new Set(["CONFLICTING_CONTENT","INVALID_AGGREGATION","INVALID_ARGUMENTS","INVALID_ATTACHMENT","INVALID_GRANULARITY","INVALID_GROUP_BY","INVALID_LIMIT","INVALID_NEXT","INVALID_RULE_TYPE","INVALID_STATUS","INVALID_THREAD","INVALID_TIME","INVALID_TIME_RANGE","MESSAGE_WITH_MULTIPLE_THREADS","MISSING_ARGUMENT","MISSING_ARGUMENTS","MISSING_CONTENT","MISSING_FLAG","MISSING_THREAD","MUTUAL_EXCLUSIVITY"]);function getExitCodeForErrorCode(code){return USAGE_ERROR_CODES.has(code)?2:1}function outputError(client,jsonOutput,code,message){return jsonOutput?writeJsonError(client,code,message):output_manager_default.error(message),getExitCodeForErrorCode(code)}function handleValidationError(result,jsonOutput,client){return outputError(client,jsonOutput,result.code,result.message)}export{validateAllProjectMutualExclusivity,validateTimeBound,validateTimeOrder,normalizeRepeatableStringFilters,validateIntegerRangeWithDefault,validateOptionalIntegerRange,writeJsonError,getExitCodeForErrorCode,outputError,handleValidationError};
|
|
@@ -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{ellipsis}from"./chunk-
|
|
7
|
+
import{ellipsis}from"./chunk-F4KY2TOK.js";import{ALIGNED_LABEL_WIDTH}from"./chunk-M2Q2DUHO.js";import{require_ms}from"./chunk-MXTC4ZAQ.js";import{require_source}from"./chunk-NB2WLB3J.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_chalk=__toESM(require_source(),1),import_ms=__toESM(require_ms(),1);function alignedRow(label,value){return` ${import_chalk.default.bold(label.padEnd(ALIGNED_LABEL_WIDTH))}${value}`}function actorLabel(actor){if(!actor)return"-";let base=actor.name||actor.username||actor.id;return actor.type==="app"?`${base} (app)`:base}function relativeAge(timestamp){if(!timestamp||!Number.isFinite(timestamp))return"-";let delta=Date.now()-timestamp;return delta<1e3?"now":(0,import_ms.default)(delta)}function displayPath(thread){let href=thread.context?.href;if(href)try{return new URL(href).pathname}catch{}return thread.context?.path||"/"}function truncate(text,max){return ellipsis(text.replace(/\s+/g," ").trim(),max)}function firstMessageText(thread){return thread.messages[0]?.text??""}function threadAge(thread){return relativeAge(thread.messages[0]?.timestamp)}function renderThreadSummary(thread,complete){let replies=thread.messageCount-1,rootAuthorId=complete?thread.messages[0]?.author.id:void 0,names=[],seen=new Set;for(let message of thread.messages){let{author}=message;author.id===rootAuthorId||seen.has(author.id)||(seen.add(author.id),names.push(actorLabel(author)))}let shown=names.slice(0,3),overflow=names.length-shown.length,participants=shown.length>0?`${shown.join(", ")}${overflow>0?` +${overflow} more`:""}`:void 0,lastTimestamp=thread.messages[thread.messages.length-1]?.timestamp,parts=[`\u2192 ${replies} ${replies===1?"reply":"replies"}`];return participants&&parts.push(participants),parts.push(`last ${relativeAge(lastTimestamp)} ago`),parts.join(" \xB7 ")}function renderThreadRow(thread,opts){let complete=thread.messageCount<=thread.messages.length,dot=thread.resolved?import_chalk.default.dim("\u25CB"):"\u25CF",author=complete?actorLabel(thread.messages[0]?.author):"\u2026",columns=[dot,thread.id,import_chalk.default.dim(threadAge(thread)),author,displayPath(thread)];opts.showBranch&&thread.branch&&columns.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&columns.push(import_chalk.default.dim("localhost"));let lines=[` ${columns.join(" ")}`];if(complete){let excerpt=truncate(firstMessageText(thread),80);excerpt&&lines.push(` \u201C${excerpt}\u201D`)}else lines.push(import_chalk.default.dim(" (long thread \u2014 inspect for the full conversation)"));let selection=thread.context?.selection;selection&&lines.push(import_chalk.default.dim(` \u2192 selected: \u201C${truncate(selection,60)}\u201D`)),thread.messageCount>1&&lines.push(import_chalk.default.dim(` ${renderThreadSummary(thread,complete)}`));let meta=[],reactionCount=thread.messages.reduce((acc,message)=>acc+(message.reactions?.length??0),0);reactionCount>0&&meta.push(`${reactionCount} ${reactionCount===1?"reaction":"reactions"}`);let attachmentCount=thread.messages.reduce((acc,message)=>acc+(message.attachments?.length??0),0);return attachmentCount>0&&meta.push(`${attachmentCount} ${attachmentCount===1?"attachment":"attachments"}`),thread.resolved&&meta.push(`resolved by ${actorLabel(thread.resolvedBy)}`),meta.length>0&&lines.push(import_chalk.default.dim(` ${meta.join(" \xB7 ")}`)),lines.join(`
|
|
8
8
|
`)}function renderReactions(message){if(!(!message.reactions||message.reactions.length===0))return message.reactions.map(r=>`${r.emoji} ${r.name} \xB7 ${r.users.length}`).join(" ")}function renderMessage(message){let lines=[`${import_chalk.default.bold(actorLabel(message.author))} \xB7 ${relativeAge(message.timestamp)} ago \xB7 ${import_chalk.default.dim(message.id)}`];for(let textLine of message.text.split(`
|
|
9
9
|
`))lines.push(` ${textLine}`);for(let attachment of message.attachments??[]){let dimensions=attachment.width&&attachment.height?` (${attachment.width}\xD7${attachment.height})`:"";lines.push(`${import_chalk.default.dim(` \u2192 attachment ${attachment.filename}${dimensions}`)} ${import_chalk.default.cyan(attachment.url)}`)}let reactions=renderReactions(message);return reactions&&lines.push(` ${reactions}`),lines.join(`
|
|
10
10
|
`)}function renderThreadDetail(thread,messages,opts){let sections=[],status=thread.resolved?import_chalk.default.dim(`resolved by ${actorLabel(thread.resolvedBy)}`):"unresolved",headline=[import_chalk.default.bold(thread.id),status];thread.branch&&headline.push(import_chalk.default.dim(thread.branch)),thread.isLocalhost&&headline.push(import_chalk.default.dim("localhost")),sections.push(headline.join(" \xB7 "));let headerLines=[],path=displayPath(thread),pageTitle=thread.context?.pageTitle;headerLines.push(pageTitle?`${path} \u2014 \u201C${pageTitle}\u201D`:path),thread.context?.href&&headerLines.push(import_chalk.default.cyan(thread.context.href)),sections.push(headerLines.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{outputError,writeJsonError}from"./chunk-
|
|
7
|
+
import{outputError,writeJsonError}from"./chunk-OOPF73RV.js";import{resolveProjectContext}from"./chunk-JV3YIOCO.js";import{detectExplicitScope,getScope}from"./chunk-VIOIR6II.js";import{getLinkedProject}from"./chunk-4Z6R5KHZ.js";import{printError}from"./chunk-HMJR6RVF.js";import{isAPIError}from"./chunk-QFE3RPMA.js";import{getCommandName}from"./chunk-B4KA3ZH2.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";function handleCommentsParseError(err,subcommandName){return printError(err),err instanceof Error&&/unknown or unexpected option: -[^-]/.test(err.message)&&output_manager_default.log(`An argument starting with "-"? Put it after \`--\`: ${getCommandName(`comments ${subcommandName} -- <arg>`)}`),output_manager_default.log(`Run ${getCommandName(`comments ${subcommandName} --help`)} for usage.`),2}function threadNotFoundMessage(threadId,scope){return`Comment not found: ${threadId} in team ${scope.teamSlug??scope.teamId}. If it belongs to another team, pass --scope <team>.`}function query(teamId,params={}){let search=new URLSearchParams({teamId});for(let[key,value]of Object.entries(params))if(value!==void 0)if(Array.isArray(value))for(let entry of value)search.append(key,entry);else search.set(key,String(value));return search.toString()}var fetchOpts={useCurrentTeam:!1};function listThreads(client,teamId,params){return client.fetch(`/toolbar/threads?${query(teamId,{...params})}`,fetchOpts)}function getThread(client,teamId,threadId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,fetchOpts)}function updateThread(client,teamId,threadId,resolved){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body:{resolved}})}function listMessages(client,teamId,threadId,opts={}){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId,{...opts})}`,fetchOpts)}function addMessage(client,teamId,threadId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages?${query(teamId)}`,{...fetchOpts,method:"POST",body})}function updateMessage(client,teamId,threadId,messageId,body){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"PATCH",body})}function deleteMessage(client,teamId,threadId,messageId){return client.fetch(`/toolbar/threads/${encodeURIComponent(threadId)}/messages/${encodeURIComponent(messageId)}?${query(teamId)}`,{...fetchOpts,method:"DELETE"})}function toApiErrorParts(err){let apiErr=err;return{code:apiErr.code||"API_ERROR",message:apiErr.serverMessage||`API error (${apiErr.status??"unknown"}).`}}import{spawnSync}from"node:child_process";async function resolveCommentsScope(client,opts){if(opts.urlTeamSlug&&!opts.project&&!detectExplicitScope(client))return{teamId:opts.urlTeamSlug,teamSlug:opts.urlTeamSlug};if(opts.project){let context;try{context=await resolveProjectContext({client,projectNameOrId:opts.project,projectNotFoundHandling:opts.jsonOutput?"return":"report"})}catch(err){if(isAPIError(err))return outputError(client,opts.jsonOutput,err.code||"API_ERROR",err.serverMessage||`API error (${err.status}).`);throw err}return context.status==="error"?(opts.jsonOutput&&writeJsonError(client,"PROJECT_CONTEXT_ERROR","Could not resolve the project context."),context.exitCode):context.status==="not_linked"?outputError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",`Project "${opts.project}" was not found in the current scope.`):{teamId:context.org.id,teamSlug:context.org.slug,projectId:context.project.id,projectName:context.project.name,linked:!!context.repoRoot}}let linked=await getLinkedProject(client);if(linked.status==="error")return linked.exitCode;if(linked.status==="linked"){if(detectExplicitScope(client)){let{team:team2}=await getScope(client);if(!team2)return outputError(client,opts.jsonOutput,"NO_TEAM","No team context found for --scope.");if(team2.id!==linked.org.id)return opts.requireProject?outputError(client,opts.jsonOutput,"SCOPE_PROJECT_MISMATCH",`--scope ${team2.slug} does not match the linked project's team (${linked.org.slug}). Pass --project <name-or-id> for a project in ${team2.slug}.`):{teamId:team2.id,teamSlug:team2.slug}}return{teamId:linked.org.id,teamSlug:linked.org.slug,projectId:linked.project.id,projectName:linked.project.name,linked:!0}}if(opts.requireProject)return outputError(client,opts.jsonOutput,"NOT_LINKED","No linked project found. Run `vercel link` to link a project, or pass --project <name-or-id>.");let{team}=await getScope(client);return team?{teamId:team.id,teamSlug:team.slug}:outputError(client,opts.jsonOutput,"NO_TEAM","No team context found. Run `vercel switch` to select a team, or run `vercel link` in a project directory.")}function inferBranch(cwd){let result=spawnSync("git",["rev-parse","--abbrev-ref","HEAD"],{cwd,encoding:"utf8"});if(result.status===0){let branch=result.stdout.trim();if(branch&&branch!=="HEAD")return{value:branch,source:"git"}}let ciRef=process.env.VERCEL_GIT_COMMIT_REF||process.env.GITHUB_HEAD_REF||process.env.GITHUB_REF_NAME;if(ciRef)return{value:ciRef,source:"ci"}}export{handleCommentsParseError,threadNotFoundMessage,listThreads,getThread,updateThread,listMessages,addMessage,updateMessage,deleteMessage,toApiErrorParts,resolveCommentsScope,inferBranch};
|
|
@@ -4,7 +4,7 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{AGENT_REASON,writeActionRequired}from"./chunk-
|
|
7
|
+
import{AGENT_REASON,writeActionRequired}from"./chunk-CSNP5RIM.js";import{output_manager_default}from"./chunk-RYSO5U3E.js";var FIRST_DEPLOYMENT_PRODUCTION_NOTICE="This is the project\u2019s first deployment, so it will go to production.";function isNonProductionTarget(target){return!!target&&target!=="production"}async function hasDeployment(client,org,projectId){let{deployments}=await client.fetch(`/v6/deployments?projectId=${encodeURIComponent(projectId)}&limit=1`,{accountId:org.id});return deployments.length>0}async function hasEarlierDeployment(client,org,projectId,listedDeployments){if(listedDeployments?.length)return!0;try{return await hasDeployment(client,org,projectId)}catch(err){return output_manager_default.debug(`Couldn't check the project for earlier deployments: ${err}`),!0}}function refuseFirstDeployment(client,{target,newProject,prodCommand,prepareCommands=[]}){let environment=target==="preview"?"Preview":target,cause=newProject?"This deploy would create a new project":"This project has no deployments yet",recovery=prepareCommands.length?"pull its Production settings, build again with --prod, then retry with --prod":"retry with --prod",message=`Can't create a ${environment} deployment. ${cause}, and a project's first deployment is assigned to Production. To deploy to Production, ${recovery}. Later deployments can use --environment ${target}.`,note=prodCommand.note?`; ${prodCommand.note}`:"",steps=prepareCommands.length?[...prepareCommands,{command:prodCommand.command,action:`deploy the build to Production${note}`}]:[{command:prodCommand.command,action:`deploy to Production instead${note}`}];return client.nonInteractive&&writeActionRequired(client,{status:"action_required",reason:AGENT_REASON.FIRST_DEPLOYMENT_PRODUCTION,message,userActionRequired:!0,hint:"Ask the user before deploying to Production.",next:steps.map((step,i)=>({command:step.command,when:i===0?`Only after the user approves: ${step.action}`:`Then ${step.action}`}))}),output_manager_default.error(`${message}
|
|
8
8
|
|
|
9
9
|
${steps.map((step,i)=>`${i===0?"To":"Then"} ${step.action}:
|
|
10
10
|
${step.command}`).join(`
|