vercel 62.1.0 → 62.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{add-HANL3P77.js → add-E6SM6YUU.js} +1 -1
- package/dist/chunks/add-K6P7R3M4.js +8 -0
- package/dist/chunks/add-XZMJUVCZ.js +8 -0
- package/dist/chunks/build-ORM2P3M7.js +7 -0
- package/dist/chunks/{chunk-K6GIN2TC.js → chunk-2KCAQTPM.js} +1 -1
- package/dist/chunks/{chunk-NT67T6DL.js → chunk-3HO365U7.js} +1 -1
- package/dist/chunks/{chunk-OGVFR4VL.js → chunk-3P7HVGKM.js} +1 -1
- package/dist/chunks/{chunk-N7XPPYQQ.js → chunk-3YAQUAOG.js} +1 -1
- package/dist/chunks/{chunk-2RQFMCPJ.js → chunk-54SEEVOA.js} +1 -1
- package/dist/chunks/{chunk-ZOIPWLUF.js → chunk-57NFMJ6O.js} +1 -1
- package/dist/chunks/chunk-5G3VXZB4.js +10 -0
- package/dist/chunks/{chunk-B7YJLE3P.js → chunk-6RNZA3VS.js} +1 -1
- package/dist/chunks/chunk-72DVIZTW.js +8 -0
- package/dist/chunks/{chunk-C3XFIO5L.js → chunk-7NEJJJH6.js} +1 -1
- package/dist/chunks/{chunk-TBLJVTTQ.js → chunk-7OBZ2AM6.js} +1 -1
- package/dist/chunks/{chunk-BKNROJQU.js → chunk-7W3B5AJR.js} +2 -2
- package/dist/chunks/{chunk-DECRXYX6.js → chunk-7X34JCBW.js} +1 -1
- package/dist/chunks/{chunk-3R66O72V.js → chunk-AUIBCIET.js} +1 -1
- package/dist/chunks/{chunk-X47XV2WG.js → chunk-B4VX6C2E.js} +1 -1
- package/dist/chunks/{chunk-ACCZWEKL.js → chunk-BIFJ5QEB.js} +1 -1
- package/dist/chunks/{chunk-ZNFC3CZF.js → chunk-DBDWXNAR.js} +1 -1
- package/dist/chunks/{chunk-A752WDCH.js → chunk-DJC2LX46.js} +1 -1
- package/dist/chunks/{chunk-M7ZGWERO.js → chunk-E4M34FSN.js} +1 -1
- package/dist/chunks/chunk-ETYHCI6U.js +7 -0
- package/dist/chunks/{chunk-X5OINFLV.js → chunk-EWW4GCZY.js} +1 -1
- package/dist/chunks/chunk-EZU5U2PZ.js +7 -0
- package/dist/chunks/{chunk-I327YWUE.js → chunk-FSHYI4ZE.js} +1 -1
- package/dist/chunks/{chunk-DT3EUC6S.js → chunk-G3NHWIPJ.js} +3 -2
- package/dist/chunks/{chunk-7JFK53D4.js → chunk-G7AD7DRG.js} +1 -1
- package/dist/chunks/{chunk-U6N2RNDI.js → chunk-GNJPIPBF.js} +1 -1
- package/dist/chunks/{chunk-CQ3RAERR.js → chunk-GTZDB7IL.js} +1 -1
- package/dist/chunks/{chunk-ZUYWATU5.js → chunk-GV6XYKYC.js} +1 -1
- package/dist/chunks/{chunk-4NICAS7W.js → chunk-HNF6WZ5S.js} +2 -2
- package/dist/chunks/{chunk-NYUESPV2.js → chunk-HTZPGIVL.js} +1 -1
- package/dist/chunks/{chunk-AIMMAROX.js → chunk-IHXHZBHR.js} +1 -1
- package/dist/chunks/chunk-IIKYA7SM.js +9 -0
- package/dist/chunks/{chunk-FA6O7FPC.js → chunk-J4YZKLVO.js} +1 -1
- package/dist/chunks/{chunk-7T4CJ6MJ.js → chunk-J7JW6BBJ.js} +1 -1
- package/dist/chunks/chunk-JEYKXG6O.js +7 -0
- package/dist/chunks/{chunk-7VSX264O.js → chunk-JI2BTGLU.js} +2 -2
- package/dist/chunks/{chunk-VDOJERIW.js → chunk-KQM2AGUS.js} +1 -1
- package/dist/chunks/chunk-L37LRUIN.js +7 -0
- package/dist/chunks/{chunk-S5CEIACD.js → chunk-LG4JQAY7.js} +1 -1
- package/dist/chunks/{chunk-RFWCEREA.js → chunk-LKYVY3SY.js} +1 -1
- package/dist/chunks/{chunk-Z5PMK6F2.js → chunk-LOD56FYJ.js} +4 -4
- package/dist/chunks/chunk-LSF7FY6X.js +7 -0
- package/dist/chunks/{chunk-KOSM3DYE.js → chunk-LW3HJWXW.js} +1 -1
- package/dist/chunks/chunk-MB4RN7BI.js +9 -0
- package/dist/chunks/{chunk-A5VLP25I.js → chunk-MCCL762Q.js} +1 -1
- package/dist/chunks/{chunk-RBYCFVJN.js → chunk-MJRZSYU2.js} +3 -3
- package/dist/chunks/chunk-OL3BQESW.js +21 -0
- package/dist/chunks/{chunk-GR76JFDX.js → chunk-OY2H4NBN.js} +1 -1
- package/dist/chunks/{chunk-6JU3QZ3O.js → chunk-PP36OP55.js} +1 -1
- package/dist/chunks/{chunk-LCWCTL6L.js → chunk-PTUZ7ATN.js} +1 -1
- package/dist/chunks/{chunk-NXJLJLEM.js → chunk-QFVAARN7.js} +1 -1
- package/dist/chunks/{chunk-V6BHS2M2.js → chunk-QLJ72TJJ.js} +1 -1
- package/dist/chunks/{chunk-XF5HR3BJ.js → chunk-QYGA4IKR.js} +1 -1
- package/dist/chunks/{chunk-64JYKBGN.js → chunk-RDC4BJSR.js} +5 -5
- package/dist/chunks/{chunk-PV5YI2ZZ.js → chunk-ROOWZCAB.js} +1 -1
- package/dist/chunks/{chunk-FWN57YF7.js → chunk-SANUW37I.js} +8 -4
- package/dist/chunks/{chunk-6OI6SRHZ.js → chunk-SDGWKUST.js} +1 -1
- package/dist/chunks/{chunk-T4QWSTWE.js → chunk-SL5SJUAH.js} +1 -1
- package/dist/chunks/{chunk-JRU6AGXG.js → chunk-TATIUO4V.js} +1 -1
- package/dist/chunks/{chunk-7NSHIG54.js → chunk-TNERVI3E.js} +1 -1
- package/dist/chunks/{chunk-6MR2VYMC.js → chunk-TNJVIC27.js} +1 -1
- package/dist/chunks/{chunk-QMBXEDTG.js → chunk-TQ5ETS24.js} +1 -1
- package/dist/chunks/{chunk-BN3XAVPG.js → chunk-U4C2LU7H.js} +1 -1
- package/dist/chunks/{chunk-JK5Z72G5.js → chunk-UDVWL4I4.js} +1 -1
- package/dist/chunks/chunk-UV4HOEHC.js +24 -0
- package/dist/chunks/chunk-UZ2DSUM6.js +7 -0
- package/dist/chunks/chunk-VGXFOQ4P.js +8 -0
- package/dist/chunks/chunk-VUCFX2G4.js +7 -0
- package/dist/chunks/chunk-VX7JFH7Q.js +7 -0
- package/dist/chunks/{chunk-ULYAF4N3.js → chunk-WGPFU3NA.js} +1 -1
- package/dist/chunks/chunk-WQLEYC3T.js +9 -0
- package/dist/chunks/{chunk-NESZV33T.js → chunk-WT73KR4Y.js} +1 -1
- package/dist/chunks/chunk-WVUD3JPC.js +10 -0
- package/dist/chunks/{chunk-W7PVS44H.js → chunk-XP4C5FLG.js} +1 -1
- package/dist/chunks/{chunk-S2LBGLRE.js → chunk-XQVD5V3T.js} +1 -1
- package/dist/chunks/{chunk-35QWU4NB.js → chunk-YAJFAGUO.js} +3 -3
- package/dist/chunks/{chunk-7I23VXBQ.js → chunk-ZXEYTD3W.js} +1 -1
- package/dist/chunks/clear-IWIBH2TY.js +8 -0
- package/dist/chunks/{compile-vercel-config-SRYQK624.js → compile-vercel-config-B2ZES5JB.js} +1 -1
- package/dist/chunks/{config-6AXT6WNO.js → config-5GNX5VM2.js} +1 -1
- package/dist/chunks/config-BLTCR2NA.js +8 -0
- package/dist/chunks/config-validator.mjs +1 -1
- package/dist/chunks/delete-DSDSQVG7.js +9 -0
- package/dist/chunks/delete-TN2UUEOF.js +10 -0
- package/dist/chunks/{detect-projects-325QE23N.js → detect-projects-AWDCPVLE.js} +1 -1
- package/dist/chunks/detect-services-VQWDU5RR.js +7 -0
- package/dist/chunks/disable-76QRXL7J.js +7 -0
- package/dist/chunks/discard-CWXRCRFL.js +14 -0
- package/dist/chunks/edit-KC6AK6DA.js +9 -0
- package/dist/chunks/edit-LYZPKUZY.js +8 -0
- package/dist/chunks/enable-ZVEULDXQ.js +7 -0
- package/dist/chunks/{export-QOTSGWFE.js → export-SYT5NHSM.js} +2 -2
- package/dist/chunks/{future-GS7ZLJ3N.js → future-YNSZJIAG.js} +1 -1
- package/dist/chunks/{generate-cert-for-deploy-L5NMXX37.js → generate-cert-for-deploy-G26VGC4I.js} +1 -1
- package/dist/chunks/image-XAJFJ6UD.js +7 -0
- package/dist/chunks/{import-builders-WWYNSGXV.js → import-builders-JXIILQOI.js} +1 -1
- package/dist/chunks/inspect-7CODV4HJ.js +9 -0
- package/dist/chunks/{inspect-DKJC7ORF.js → inspect-A76MME2I.js} +2 -2
- package/dist/chunks/{inspect-IIF3N5Z2.js → inspect-DF35I6AZ.js} +2 -2
- package/dist/chunks/{inspect-EHEMDPJD.js → inspect-HIRGIJON.js} +2 -2
- package/dist/chunks/inspect-JEHOMETA.js +13 -0
- package/dist/chunks/{list-MMQAS2OQ.js → list-3KNHQV4S.js} +2 -2
- package/dist/chunks/{list-4TZ6QS5J.js → list-M2YCP5HV.js} +2 -2
- package/dist/chunks/list-XNNJCS5K.js +11 -0
- package/dist/chunks/{login-5QOABZRX.js → login-2GVRFOQQ.js} +1 -1
- package/dist/chunks/login-UM35IU3S.js +9 -0
- package/dist/chunks/{logs-KWMWFGLA.js → logs-HS5YRXDR.js} +1 -1
- package/dist/chunks/ls-ISILCAV4.js +11 -0
- package/dist/chunks/{ls-43NFH2L6.js → ls-KGYG3F3A.js} +2 -2
- package/dist/chunks/ls-M2SGUIZK.js +8 -0
- package/dist/chunks/ls-WROXB2SF.js +8 -0
- package/dist/chunks/{ls-KCE6GJZL.js → ls-Y3CBOCK2.js} +2 -2
- package/dist/chunks/{ls-L454FAKC.js → ls-YJEUWZFT.js} +2 -2
- package/dist/chunks/{ls-HKXEYGZT.js → ls-Z2JKBJKR.js} +2 -2
- package/dist/chunks/mutate-ZCA7FKDL.js +9 -0
- package/dist/chunks/notifications-7QROHXJQ.js +7 -0
- package/dist/chunks/open-FU7OJPAY.js +7 -0
- package/dist/chunks/{openapi-6L7RIFOR.js → openapi-KGCZ7LB4.js} +1 -1
- package/dist/chunks/permissions-I4ZXPUVY.js +7 -0
- package/dist/chunks/{prompt-missing-credentials-N7ETDDXW.js → prompt-missing-credentials-YPLDAGZA.js} +1 -1
- package/dist/chunks/publish-6WBGPES3.js +15 -0
- package/dist/chunks/pull-BJUOPX3J.js +7 -0
- package/dist/chunks/{purchase-domain-if-available-IIEFQGPX.js → purchase-domain-if-available-7KTEXJFK.js} +1 -1
- package/dist/chunks/push-ZRDFCF3D.js +7 -0
- package/dist/chunks/{query-CBEGOTEI.js → query-RXONIAT5.js} +2 -2
- package/dist/chunks/{reauthenticate-3H5Q2ZWD.js → reauthenticate-7RZ2XFR4.js} +1 -1
- package/dist/chunks/reorder-P5LWY3FS.js +10 -0
- package/dist/chunks/reply-QNIIC2TP.js +9 -0
- package/dist/chunks/resolve-RQBKN4WL.js +12 -0
- package/dist/chunks/restore-NPY7XA3A.js +16 -0
- package/dist/chunks/{rm-XW6CPP6J.js → rm-4PBTYQBF.js} +1 -1
- package/dist/chunks/rm-5LVIH5IE.js +8 -0
- package/dist/chunks/rm-GGY4TGSX.js +8 -0
- package/dist/chunks/rm-K3V6KVHW.js +8 -0
- package/dist/chunks/rm-XOE3T2QM.js +8 -0
- package/dist/chunks/{routes-IPGKJ2E4.js → routes-FOCZWOGO.js} +1 -1
- package/dist/chunks/rule-inspect-6UI5XBGA.js +8 -0
- package/dist/chunks/rules-MJWNYYRT.js +7 -0
- package/dist/chunks/schema-ABJKQ6AB.js +14 -0
- package/dist/chunks/{schema-4R7CRVMR.js → schema-SOV2XP24.js} +2 -2
- package/dist/chunks/{select-org-37C26F7T.js → select-org-G4KFHFH3.js} +1 -1
- package/dist/chunks/set-DJO2C6XG.js +7 -0
- package/dist/chunks/setup-and-link-BZCJ74II.js +7 -0
- package/dist/chunks/tags-DY5IM5QF.js +7 -0
- package/dist/chunks/{types-UN5J66MI.js → types-RHUVE4FN.js} +2 -2
- package/dist/chunks/{update-CA3E2G46.js → update-6WSCOLSB.js} +2 -2
- package/dist/commands/build/index.js +2 -2
- package/dist/commands/deploy/index.js +13 -10
- package/dist/commands/dev/index.js +9 -9
- package/dist/commands/env/index.js +12 -12
- package/dist/commands/link/index.js +2 -2
- package/dist/commands/list/index.js +1 -1
- package/dist/commands-bulk.js +309 -308
- package/dist/index.js +6 -3
- package/dist/vc.js +2 -1
- package/dist/version.mjs +1 -1
- package/package.json +58 -57
- package/dist/chunks/add-XNYC3JIL.js +0 -8
- package/dist/chunks/add-XUAM4VOK.js +0 -8
- package/dist/chunks/build-ZBS6SOT7.js +0 -7
- package/dist/chunks/chunk-4O5TQSWD.js +0 -7
- package/dist/chunks/chunk-5VWK73R6.js +0 -10
- package/dist/chunks/chunk-7PQBWGSI.js +0 -7
- package/dist/chunks/chunk-7RT22KMX.js +0 -7
- package/dist/chunks/chunk-CS4QF4YI.js +0 -8
- package/dist/chunks/chunk-CVX5X5RI.js +0 -7
- package/dist/chunks/chunk-G43DZJ2Z.js +0 -7
- package/dist/chunks/chunk-JLOCNOBV.js +0 -7
- package/dist/chunks/chunk-JVCUTKAX.js +0 -24
- package/dist/chunks/chunk-N5Q4IX3H.js +0 -9
- package/dist/chunks/chunk-NKC536ZX.js +0 -9
- package/dist/chunks/chunk-QAPUB4EX.js +0 -9
- package/dist/chunks/chunk-Y3A7ZJNX.js +0 -10
- package/dist/chunks/chunk-Z26EOSNI.js +0 -7
- package/dist/chunks/chunk-Z6TGFLIO.js +0 -21
- package/dist/chunks/clear-UYIYBIU7.js +0 -8
- package/dist/chunks/config-EDC5XGQX.js +0 -8
- package/dist/chunks/delete-GYK2QMZA.js +0 -10
- package/dist/chunks/delete-PIASS7TQ.js +0 -9
- package/dist/chunks/detect-services-QNPD7J6F.js +0 -7
- package/dist/chunks/disable-SFNXBFOL.js +0 -7
- package/dist/chunks/discard-QX7SXCDX.js +0 -14
- package/dist/chunks/edit-4U3ZERPO.js +0 -9
- package/dist/chunks/edit-PNIFJF2H.js +0 -8
- package/dist/chunks/enable-HZFCTROZ.js +0 -7
- package/dist/chunks/image-PY2GZYQD.js +0 -7
- package/dist/chunks/inspect-NIRGPMGV.js +0 -13
- package/dist/chunks/inspect-QQJAYYMO.js +0 -9
- package/dist/chunks/list-4MCOLKTO.js +0 -11
- package/dist/chunks/login-ZAAIOSQ4.js +0 -9
- package/dist/chunks/ls-42F5OUPY.js +0 -8
- package/dist/chunks/ls-ID2DGRGG.js +0 -11
- package/dist/chunks/ls-KAIRQI27.js +0 -8
- package/dist/chunks/mutate-QK3U73PH.js +0 -9
- package/dist/chunks/notifications-2QARJQFZ.js +0 -7
- package/dist/chunks/open-PORNBO4I.js +0 -7
- package/dist/chunks/permissions-EYOTCJGO.js +0 -7
- package/dist/chunks/publish-JTCJ6Z5K.js +0 -15
- package/dist/chunks/pull-FNJGDSP2.js +0 -7
- package/dist/chunks/push-LBPCQFBD.js +0 -7
- package/dist/chunks/reorder-LLR3OV6E.js +0 -10
- package/dist/chunks/reply-3CDS6LPX.js +0 -9
- package/dist/chunks/resolve-XQ6UPCSZ.js +0 -12
- package/dist/chunks/restore-U4EWQAAZ.js +0 -16
- package/dist/chunks/rm-3FAU5JLM.js +0 -8
- package/dist/chunks/rm-7OBAUU4F.js +0 -8
- package/dist/chunks/rm-WEMHKTUL.js +0 -8
- package/dist/chunks/rm-XGXSPQIY.js +0 -8
- package/dist/chunks/rule-inspect-I6WJTC7O.js +0 -8
- package/dist/chunks/rules-TMEV52OR.js +0 -7
- package/dist/chunks/schema-W3ZXTSRT.js +0 -14
- package/dist/chunks/set-FOMKZDT2.js +0 -7
- package/dist/chunks/setup-and-link-QI6PHWVL.js +0 -7
- package/dist/chunks/tags-BTMFM3XQ.js +0 -7
|
@@ -1,10 +0,0 @@
|
|
|
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{quoteArg}from"./chunk-BKV35LVB.js";import{getGlobalFlagsFromArgs,stripSensitiveAuthArgs,suggestionFlagTakesSeparateValue}from"./chunk-PV5YI2ZZ.js";import{teamCache}from"./chunk-VOZEB6PD.js";import{LinkRequiredError,ProjectNotFound,isAPIError}from"./chunk-RINZXCDJ.js";import{getCommandName,packageName}from"./chunk-FI772UVH.js";import{require_dist}from"./chunk-QGIQK47P.js";import{pkg_default}from"./chunk-AVSPFBLM.js";import{__toESM}from"./chunk-6L236MNA.js";import{randomUUID}from"node:crypto";function agentErrorMetadata(client){return client.isAgent?{cliVersion:pkg_default.version,invocationId:client.telemetryEventStore?.currentInvocationId}:{}}function agentErrorCategory(reason){return/^(forbidden|permission_denied|scope_not_accessible)$/i.test(reason)?"permission":/^(payment_required|plan_upgrade_required)$/i.test(reason)?"billing":/^(not_authorized|login_required)$/i.test(reason)?"authentication":/^(rate_limited|too_many_requests)$/i.test(reason)?"rate_limit":/^(invalid_arguments|unknown_command|ARG_UNKNOWN_OPTION)$/i.test(reason)?"usage":/^(link_required|project_not_found|not_found)$/i.test(reason)?"project_context":"other"}function trackAgentError(client,error){!client.isAgent||!client.telemetryEventStore||client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_error",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,category:agentErrorCategory(error.reason),hasRecovery:!!error.hint,retryable:error.retryable,userActionRequired:error.userActionRequired})})}function trackAgentCommandOutcome(client,exitCode){if(!client.isAgent||!client.telemetryEventStore)return;let args=client.argv.slice(2),separator=args.indexOf("--"),help=args.slice(0,separator<0?args.length:separator).some(arg=>arg==="--help"||arg==="-h");client.telemetryEventStore.add({id:randomUUID(),eventTime:Date.now(),key:"agent_command_outcome",value:JSON.stringify({invocationId:client.telemetryEventStore.currentInvocationId,exitCode,outcome:help&&(exitCode===0||exitCode===2)?"help":exitCode===0?"success":"failure"})})}var import_error_utils=__toESM(require_dist(),1);var OBSERVABILITY_PLUS_PURCHASE_COMMAND="buy addon observability-plus";function mentionsObservabilityPlus(message){return/observability\s+plus/i.test(message)}function observabilityPlusPurchaseHint(){return`Subscribe with ${getCommandName(OBSERVABILITY_PLUS_PURCHASE_COMMAND)}.`}function observabilityPlusPurchaseFix(){return{command:OBSERVABILITY_PLUS_PURCHASE_COMMAND,hint:observabilityPlusPurchaseHint(),when:"a person has approved buying the add-on"}}function observabilityPlusRecovery(message){if(mentionsObservabilityPlus(message))return/(?:disabled|switched off|re-enable)/i.test(message)?{hint:"Observability Plus is disabled. Ask a team owner to enable it for the intended team or project, then retry. A new subscription may not be needed."}:/(?:quota|usage limit|query limit)/i.test(message)?{hint:"The usage limit was reached. Ask a team owner to review the limit before retrying."}:{...observabilityPlusPurchaseFix(),hint:`Check whether Observability Plus is disabled for this project or the team needs a subscription. Enable it if already subscribed. Otherwise, ${observabilityPlusPurchaseHint()}`,when:"the team has no subscription and a person has approved buying the add-on"}}function errorContext(client){let teamId=client?.config?.currentTeam;return teamId?client?.teams?.find(team=>team.id===teamId||team.slug===teamId)?.slug??teamCache.get(teamId)?.slug:client?.user?.username||client?.user?.email}function getErrorRecovery(error,client){let reason=error.reason?.toLowerCase(),scope=errorContext(client);if(error.status===403||["forbidden","permission_denied","scope_not_accessible"].includes(reason??""))return{hint:`Check that the selected team is correct${scope?` (${scope})`:""}. If it is, ask a team owner to grant the required access. Retry only after the team or access changes.`,retryable:!1,userActionRequired:!0,...scope&&{scope},...error.action&&{action:error.action},...error.resource&&{resource:error.resource}};if(error.status===401||reason==="not_authorized")return{hint:"Provide valid credentials for the intended account and team, then retry.",retryable:!1,userActionRequired:!0};if(error.status===402||["payment_required","plan_upgrade_required"].includes(reason??"")){let message=error.serverMessage??error.message??"";return{hint:observabilityPlusRecovery(message)?.hint??(/(?:disabled|switched off|re-enable)/i.test(message)?"Enable the feature for the selected team or project, then retry.":/(?:overdue|payment method|unpaid|balance)/i.test(message)?"Ask a team owner to resolve the billing issue, then retry.":/(?:plan|subscription)/i.test(message)?"Ask a team owner to confirm the required plan or subscription before changing billing. Retry after access is enabled.":"Check the billing or feature requirement reported above with a team owner. Retry after that requirement is resolved."),retryable:!1,userActionRequired:!0,...scope&&{scope}}}if(error.status===429||reason==="rate_limited"){let wait=error.retryAfterMs;return{hint:typeof wait=="number"&&Number.isFinite(wait)&&wait>0?`Wait at least ${Math.ceil(wait/1e3)} seconds before trying again.`:wait==="never"?"This request cannot be retried with the current limit. Ask a team owner to review the limit.":"The request limit was reached. Wait before trying again; no retry time was provided.",retryable:wait!=="never",...typeof wait=="number"&&Number.isFinite(wait)&&wait>0&&{retryAfterMs:wait}}}return{}}function buildCommandWithYes(argv,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=args.some(a=>a==="--yes"||a==="-y")?args:[...args,"--yes"];return`${pkgName} ${out.join(" ")}`.trim()}function redactEnvValueArgs(argv){let redacted=[...argv];for(let i=0;i<redacted.length;i++)redacted[i]==="--value"&&i+1<redacted.length?(redacted[i+1]='"<value>"',i++):redacted[i].startsWith("--value=")&&(redacted[i]='--value="<value>"');return redacted}var GLOBAL_FLAG_NAMES=new Set(["--cwd","--config","--yes","-y","--non-interactive","--scope","--team","-S","-T"]),GLOBAL_FLAG_SHORTHANDS={"-y":"--yes","-S":"--scope","-T":"--team"};function canonicalGlobalFlagName(name){return GLOBAL_FLAG_SHORTHANDS[name]??name}function getGlobalFlagsFromArgv(argv){let args=getGlobalFlagsFromArgs(argv.slice(2),{preserveConfig:!0,preserveYes:!0}),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;GLOBAL_FLAG_NAMES.has(name)&&(out.push(arg),suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<args.length&&!args[i+1].startsWith("-")&&(out.push(args[i+1]),i++))}return out}function omitGlobalFlagsFromArgs(args){let safeArgs=stripSensitiveAuthArgs(args),out=[];for(let i=0;i<safeArgs.length;i++){let arg=safeArgs[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(GLOBAL_FLAG_NAMES.has(name)){suggestionFlagTakesSeparateValue(name)&&!arg.includes("=")&&i+1<safeArgs.length&&!safeArgs[i+1].startsWith("-")&&i++;continue}out.push(arg)}return out}function buildIntegrationCommandTailFromArgv(argv){let args=argv.slice(2),idx=args.indexOf("integration");return idx===-1?"integration":omitGlobalFlagsFromArgs(args.slice(idx)).join(" ")}function buildCommandWithGlobalFlags(argv,commandTemplate,pkgName=packageName,options){let preserved=options?.globalFlags==="all"?getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:options.preserveProject}):getGlobalFlagsFromArgv(argv);if(options?.globalFlags!=="all"&&options?.preserveProject){let globalArgs=getGlobalFlagsFromArgs(argv.slice(2)),contextArgs=getGlobalFlagsFromArgs(argv.slice(2),{preserveProject:!0});preserved.push(...contextArgs.slice(globalArgs.length))}let exclude=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0])));for(let flag of options?.excludeFlags??[])exclude.add(canonicalGlobalFlagName(flag));if(exclude.size){let out=[];for(let i=0;i<preserved.length;i++){let arg=preserved[i],name=arg.startsWith("--")?arg.split("=")[0]:arg;if(exclude.has(canonicalGlobalFlagName(name))){!arg.includes("=")&&i+1<preserved.length&&!preserved[i+1].startsWith("-")&&i++;continue}out.push(arg)}preserved=out}let base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:options?.prependGlobalFlags?`${pkgName} ${preserved.join(" ")} ${commandTemplate}`:`${base} ${preserved.join(" ")}`}function withGlobalFlags(client,commandTemplate,options={}){return buildCommandWithGlobalFlags(client.argv,commandTemplate,packageName,{globalFlags:"all",preserveProject:options.preserveProject})}function getPreservedArgsAfterEnvSubcommand(argv,subcommands,positionalCount){let args=stripSensitiveAuthArgs(argv.slice(2)),envIdx=args.findIndex((arg,index)=>arg==="env"&&subcommands.includes(args[index+1])),subcommandIdx=envIdx+1;if(envIdx===-1)return args;let preserved=[],positionals=0,optionsEnded=!1;for(let i=subcommandIdx+1;i<args.length;i++){let arg=args[i];if(arg==="--"&&!optionsEnded){optionsEnded=!0;continue}if(!optionsEnded&&arg.startsWith("-")){preserved.push(arg),!arg.includes("=")&&suggestionFlagTakesSeparateValue(arg)&&i+1<args.length&&!args[i+1].startsWith("-")&&preserved.push(args[++i]);continue}if(positionals<positionalCount){positionals++;continue}optionsEnded&&!preserved.includes("--")&&preserved.push("--"),preserved.push(arg)}return preserved}function omitPreservedFlagsAlreadyInTemplate(args,commandTemplate){let templateFlags=new Set(commandTemplate.split(/\s+/).filter(token=>token.startsWith("-")).map(token=>canonicalGlobalFlagName(token.split("=")[0]))),out=[];for(let i=0;i<args.length;i++){let arg=args[i],name=arg.startsWith("-")?arg.split("=")[0]:arg;if(!templateFlags.has(canonicalGlobalFlagName(name))){out.push(arg);continue}!arg.includes("=")&&suggestionFlagTakesSeparateValue(name)&&i+1<args.length&&!args[i+1].startsWith("-")&&i++}return out}function getPreservedArgsForEnvAdd(argv){return getPreservedArgsAfterEnvSubcommand(argv,["add"],3)}function buildEnvAddCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvAdd(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvPull(argv){return getPreservedArgsAfterEnvSubcommand(argv,["pull"],1)}function getPreservedArgsForEnvRm(argv){return getPreservedArgsAfterEnvSubcommand(argv,["rm","remove"],3)}function buildEnvRmCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvRm(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function getPreservedArgsForEnvUpdate(argv){return getPreservedArgsAfterEnvSubcommand(argv,["update"],3)}function buildEnvUpdateCommandWithPreservedArgs(argv,commandTemplate,pkgName=packageName){let preserved=omitPreservedFlagsAlreadyInTemplate(getPreservedArgsForEnvUpdate(argv),commandTemplate),base=`${pkgName} ${commandTemplate}`;return preserved.length===0?base:`${base} ${preserved.map(quoteArg).join(" ")}`}function buildCommandWithScope(argv,scopeSlug,pkgName=packageName){let args=stripSensitiveAuthArgs(argv.slice(2)),out=[];for(let i=0;i<args.length;i++){if(args[i]==="--scope"||args[i]==="--team"||args[i]==="-S"||args[i]==="-T"){i++;continue}args[i].startsWith("--scope=")||args[i].startsWith("--team=")||out.push(args[i])}return out.push("--scope",scopeSlug),`${pkgName} ${out.join(" ")}`}function enrichActionRequiredWithInvokingCommand(payload,argv){if(payload.reason!=="missing_scope"||!payload.choices?.length)return payload;let next=[],linkArgv=[...argv.slice(0,2),"link",...argv.slice(3)];for(let choice of payload.choices){let slug=choice.name;next.push({command:buildCommandWithScope(linkArgv,slug),when:"Link first (then run any command without --scope)"}),next.push({command:buildCommandWithScope(argv,slug),when:"Run this command with scope (no link)"})}return{...payload,next}}function outputActionRequired(client,payload,exitCode=1){if(!shouldEmitNonInteractiveCommandError(client))return;let enriched=enrichActionRequiredWithInvokingCommand(payload,client.argv);!enriched.hint&&enriched.next?.length&&(enriched.hint="Run one of the commands in next[] to complete without prompting."),client.stdout.write(`${JSON.stringify(enriched,null,2)}
|
|
8
|
-
`),process.exit(exitCode)}function argvHasNonInteractive(argv){if(!argv?.length)return!1;for(let i=0;i<argv.length;i++){let a=argv[i];if(a==="--non-interactive")return argv[i+1]!=="false";if(a.startsWith("--non-interactive="))return a.slice(18)!=="false"}return!1}function shouldEmitNonInteractiveCommandError(client){return client.nonInteractive||argvHasNonInteractive(client.argv??[])}function outputAgentError(client,payload,exitCode=1){shouldEmitNonInteractiveCommandError(client)&&(writeAgentError(client,payload),process.exit(exitCode))}function writeAgentError(client,payload){let enriched={...getErrorRecovery(payload,client),...payload,...agentErrorMetadata(client)};trackAgentError(client,enriched),client.stdout.write(`${JSON.stringify(enriched,null,2)}
|
|
9
|
-
`)}function outputAgentSuccess(client,payload,exitCode=0){shouldEmitNonInteractiveCommandError(client)&&(!payload.hint&&payload.next?.length&&(payload.hint="Follow up with one of the commands in next[]."),client.stdout.write(`${JSON.stringify(payload,null,2)}
|
|
10
|
-
`),process.exit(exitCode))}function buildNextStepsForGlobalConfig(client){return[{command:buildCommandWithGlobalFlags(client.argv,"global-config list"),when:"List Global Config stores in the current team scope"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to the team that owns the Global Config"},{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"Verify the current team or user scope"}]}var GLOBAL_CONFIG_NON_INTERACTIVE_HINT="Global Config commands use your current team scope. Pass --scope or run `vercel teams switch` if the store is missing.",LIST_ERROR_HINT="Project names are team-scoped. Use --scope when the project belongs to another team, or `list --all` to list deployments across all projects.";function buildNextStepsForList(client,projectName){return[projectName?{command:buildCommandWithGlobalFlags(client.argv,`project ls --filter ${projectName}`),when:"Search projects matching the attempted name to find the right one"}:{command:buildCommandWithGlobalFlags(client.argv,"project ls --filter <name>"),when:"Search projects by name substring to find the right one (replace <name>)"},{command:buildCommandWithGlobalFlags(client.argv,"list --all"),when:"List deployments across all projects in the current scope"},{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"}]}function buildNextStepsForProjectSubcommands(client,variant){let byName=variant==="access-groups"?{template:"project access-groups <name>",when:"List access groups by project name (replace <name>)"}:variant==="access-summary"?{template:"project access-summary <name>",when:"Show role counts by project name (replace <name>)"}:variant==="protection"?{template:"project protection <name>",when:"Show deployment protection by project name (replace <name>)"}:variant==="update"?{template:"project update <name> --framework <slug>",when:"Update a framework preset by project name (replace <name> and <slug>)"}:variant==="speed-insights"?{template:"project speed-insights <name>",when:"Enable Speed Insights by project name (replace <name>)"}:variant==="web-analytics"?{template:"project web-analytics <name>",when:"Enable Web Analytics by project name (replace <name>)"}:variant==="observability"?{template:"project observability enable <name>",when:"Enable Observability Plus by project name (replace <name>)"}:variant==="checks"?{template:"project checks add <name>",when:"Create a deployment check by project name (replace <name>)"}:variant==="inspect"?{template:"project inspect <name>",when:"Inspect a project by name (replace <name>)"}:variant==="resume"?{template:"project resume <name>",when:"Resume production traffic by project name (replace <name>)"}:{template:"project members <name>",when:"List members by project name (replace <name>)"};return[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Re-link this directory to the correct Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,byName.template),when:byName.when},{command:buildCommandWithGlobalFlags(client.argv,"project ls"),when:"List projects in the current team to pick a name"}]}var PROJECT_SUBCOMMAND_ERROR_HINT="If you use --cwd, ensure that folder is linked to the right project, or pass an explicit project name. Use --scope when the project belongs to another team.";function resolveNonInteractiveDefaults(client,variant){return variant==="global-config"?{next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT}:variant==="list"?{next:buildNextStepsForList(client),hint:LIST_ERROR_HINT}:{next:buildNextStepsForProjectSubcommands(client,variant),hint:PROJECT_SUBCOMMAND_ERROR_HINT}}function writeAgentErrorPayloadAndExit(client,payload,exitCode,variant){let defaults=["link_required","project_not_found","not_found"].includes(payload.reason)?resolveNonInteractiveDefaults(client,variant):{},out={...payload,next:payload.next??defaults.next,hint:payload.hint??defaults.hint};writeAgentError(client,out),process.exit(exitCode)}function isProjectNotFoundLike(err){return!!(err instanceof ProjectNotFound||(0,import_error_utils.isError)(err)&&"code"in err&&err.code==="PROJECT_NOT_FOUND")}function isLinkRequiredLike(err){return err instanceof LinkRequiredError}function normalizeApiErrorText(message){return message.replace(/\s*\(\d{3}\)\s*$/,"").trim()}function exitWithNonInteractiveError(client,err,exitCode=1,options={variant:"members"}){if(!shouldEmitNonInteractiveCommandError(client))return;let{variant}=options;if(isLinkRequiredLike(err)){if(variant==="global-config"){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err),next:buildNextStepsForGlobalConfig(client),hint:GLOBAL_CONFIG_NON_INTERACTIVE_HINT},exitCode,"global-config");return}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"link_required",message:err instanceof Error?err.message:String(err)},exitCode,variant);return}if(isProjectNotFoundLike(err)){writeAgentErrorPayloadAndExit(client,{status:"error",reason:"project_not_found",message:err instanceof Error?err.message:String(err),...variant==="list"&&options.projectName?{next:buildNextStepsForList(client,options.projectName)}:{}},exitCode,variant);return}if(isAPIError(err)){let rawMessage=err.serverMessage||err.message,message=normalizeApiErrorText(rawMessage),reason=err.status===403?"forbidden":err.status===402?"payment_required":err.status===401?"not_authorized":err.status===404?variant==="global-config"?"not_found":"project_not_found":err.status===429?"rate_limited":"api_error";writeAgentErrorPayloadAndExit(client,{status:"error",reason,message,...getErrorRecovery(err,client),...err.action&&{action:err.action},...err.resource&&{resource:err.resource}},exitCode,variant)}writeAgentErrorPayloadAndExit(client,{status:"error",reason:"unexpected_error",message:err instanceof Error?err.message:String(err)},exitCode,variant)}function openUrlInBrowserCommand(url){return process.platform==="win32"?`start ${url}`:process.platform==="darwin"?`open '${url}'`:`xdg-open '${url}'`}export{mentionsObservabilityPlus,observabilityPlusPurchaseFix,observabilityPlusRecovery,getErrorRecovery,agentErrorMetadata,trackAgentError,trackAgentCommandOutcome,buildCommandWithYes,redactEnvValueArgs,getGlobalFlagsFromArgv,omitGlobalFlagsFromArgs,buildIntegrationCommandTailFromArgv,buildCommandWithGlobalFlags,withGlobalFlags,getPreservedArgsForEnvAdd,buildEnvAddCommandWithPreservedArgs,getPreservedArgsForEnvPull,getPreservedArgsForEnvRm,buildEnvRmCommandWithPreservedArgs,getPreservedArgsForEnvUpdate,buildEnvUpdateCommandWithPreservedArgs,outputActionRequired,argvHasNonInteractive,shouldEmitNonInteractiveCommandError,outputAgentError,writeAgentError,outputAgentSuccess,exitWithNonInteractiveError,openUrlInBrowserCommand};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{outputError}from"./chunk-FA6O7FPC.js";import{AGENT_REASON}from"./chunk-CVX5X5RI.js";import{getScope}from"./chunk-ZNFC3CZF.js";import{getLinkedProject,getProjectByNameOrId}from"./chunk-Z5PMK6F2.js";import{buildCommandWithGlobalFlags,outputAgentError}from"./chunk-5VWK73R6.js";import{ProjectNotFound,isAPIError}from"./chunk-RINZXCDJ.js";function emitAlertsScopeError(client,jsonOutput,code,message,agent){return outputAgentError(client,{status:"error",reason:agent.reason,message,hint:agent.hint,next:agent.next},1),outputError(client,jsonOutput,code,message)}async function resolveAlertsScope(client,opts){let command=opts.command??"alerts",projectCommand=`${command} --project <name_or_id>`,allCommand=`${command} --all`;if(opts.all||opts.project){let{team}=await getScope(client);if(!team){let msg="No team context found. Run `vercel switch` to select a team, or use `vercel link` in a project directory.";return emitAlertsScopeError(client,opts.jsonOutput,"NO_TEAM",msg,{reason:AGENT_REASON.MISSING_SCOPE,hint:"Select a team scope before using --project or --all with alerts.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},{command:buildCommandWithGlobalFlags(client.argv,"teams switch"),when:"Switch to a team that owns the project"}]})}if(opts.all)return{teamId:team.id};let projectResult;try{projectResult=await getProjectByNameOrId(client,opts.project,team.id)}catch(err){if(isAPIError(err)){let msg=err.serverMessage||(err.status===403?`You do not have permission to access project "${opts.project}" in team "${team.slug}".`:`API error (${err.status}).`),reason=err.status===401?"not_authorized":err.status===403?"forbidden":AGENT_REASON.API_ERROR;return emitAlertsScopeError(client,opts.jsonOutput,err.code||"API_ERROR",msg,{reason,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a project you can access (replace <name_or_id>)"}]})}throw err}if(projectResult instanceof ProjectNotFound){let msg=`Project "${opts.project}" was not found in team "${team.slug}".`;return emitAlertsScopeError(client,opts.jsonOutput,"PROJECT_NOT_FOUND",msg,{reason:AGENT_REASON.NOT_FOUND,next:[{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with a valid project (replace <name_or_id>)"}]})}return{teamId:team.id,projectId:projectResult.id,projectName:projectResult.name}}let linkedProject=await getLinkedProject(client);if(linkedProject.status==="error")return linkedProject.exitCode;if(linkedProject.status==="not_linked"){let msg="No linked project found. Run `vercel link` to link a project, or use --project <name> or --all.";return emitAlertsScopeError(client,opts.jsonOutput,"NOT_LINKED",msg,{reason:AGENT_REASON.NOT_LINKED,hint:"Agents should pass --project or --all when no .vercel link exists in --cwd.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"Link this directory to a Vercel project"},{command:buildCommandWithGlobalFlags(client.argv,projectCommand),when:"Retry with an explicit project (replace <name_or_id>)"},{command:buildCommandWithGlobalFlags(client.argv,allCommand),when:"Use team-wide scope without a linked project"}]})}return{teamId:linkedProject.org.id,projectId:linkedProject.project.id,projectName:linkedProject.project.name}}export{emitAlertsScopeError,resolveAlertsScope};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{printProjectNotFoundError}from"./chunk-NXJLJLEM.js";import{param}from"./chunk-SXUEGVWB.js";import{detectExplicitScope}from"./chunk-ZNFC3CZF.js";import{getLinkedProject,resolveProjectCwd}from"./chunk-Z5PMK6F2.js";import{buildCommandWithYes,outputActionRequired}from"./chunk-5VWK73R6.js";import{getCommandName,getCommandNamePlain}from"./chunk-FI772UVH.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";var parseEnv=env=>{if(!env)return{};if(typeof env=="string"&&(env=[env]),Array.isArray(env)){let startingDict={};return env.reduce((o,e)=>{let key,value,equalsSign=e.indexOf("=");return equalsSign===-1?key=e:(key=e.slice(0,equalsSign),value=e.slice(equalsSign+1)),o[key]=value,o},startingDict)}return env};async function ensureLink(commandName,client,cwd,opts={}){cwd=await resolveProjectCwd(cwd);let link=opts.link,nonInteractive=opts.nonInteractive??client.nonInteractive??!1;if(opts.nonInteractive=nonInteractive,link||(opts.forceDelete?link={status:"not_linked",org:null,project:null}:link=await getLinkedProject(client,{cwd,projectName:opts.projectName,projectNameIsExplicit:!!(opts.projectName&&opts.failIfNotFound),scopeIsExplicit:detectExplicitScope(client),allowOwnerLookupFallback:opts.allowOwnerLookupFallback,skipOwnerLookup:opts.skipOwnerLookup,skipRemoteLookup:opts.skipRemoteLookup}),opts.link=link),link.status==="linked"&&opts.forceDelete||link.status==="not_linked"){if(link.status==="not_linked"&&opts.failIfNotFound&&opts.projectName)return await printProjectNotFoundError(client,opts.projectName,commandName,link.orgId),1;if(link.status==="not_linked"&&opts.requireExistingLink)return output_manager_default.error(`Project is not linked. Run ${getCommandName("link")} first.`),1;let{default:setupAndLink}=await import("./setup-and-link-QI6PHWVL.js");if(link=await setupAndLink(client,cwd,opts),link.status==="not_linked")return 0}return link.status==="error"?(link.reason==="HEADLESS"&&(nonInteractive?outputActionRequired(client,{status:"action_required",reason:"confirmation_required",message:`Command ${getCommandNamePlain(commandName)} requires confirmation. Use option --yes to confirm.`,next:[{command:buildCommandWithYes(client.argv),when:"Confirm and run"}]},link.exitCode):output_manager_default.error(`Command ${getCommandName(commandName)} requires confirmation. Use option ${param("--yes")} to confirm.`)),nonInteractive&&process.exit(link.exitCode),link.exitCode):link}export{parseEnv,ensureLink};
|
|
@@ -1,8 +0,0 @@
|
|
|
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_lib}from"./chunk-Z5PMK6F2.js";import{humanizePath}from"./chunk-PPCFQQSU.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";import{require_source}from"./chunk-U7KCDTCH.js";import{__toESM}from"./chunk-6L236MNA.js";var import_fs_extra=__toESM(require_lib(),1),import_chalk=__toESM(require_source(),1);import{homedir}from"os";import{resolve,sep}from"path";async function validateRootDirectory(cwd,path,errorSuffix=""){let pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null),suffix=errorSuffix?` ${errorSuffix}`:"";if(!pathStat)return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} does not exist.${suffix}`),!1;if(!pathStat.isDirectory())return output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is a file, but expected a directory.${suffix}`),!1;let base=resolve(cwd),target=resolve(path);return target!==base&&!target.startsWith(base+sep)?(output_manager_default.error(`The provided path ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)} is outside of the project.${suffix}`),!1):!0}async function validatePaths(client,paths){if(paths.length>1)return output_manager_default.error("Can't deploy more than one path."),{valid:!1,exitCode:1};let path=paths[0],pathStat=await(0,import_fs_extra.lstat)(path).catch(()=>null);return pathStat?pathStat.isDirectory()?path===homedir()&&!await client.input.confirm("You are deploying your home directory. Do you want to continue?",!1)?(output_manager_default.print(`Canceled
|
|
8
|
-
`),{valid:!1,exitCode:0}):{valid:!0,path}:(output_manager_default.prettyError({message:"Support for single file deployments has been removed.",link:"https://vercel.link/no-single-file-deployments"}),{valid:!1,exitCode:1}):(output_manager_default.error(`Could not find ${import_chalk.default.cyan(`\u201C${humanizePath(path)}\u201D`)}`),{valid:!1,exitCode:1})}export{validateRootDirectory,validatePaths};
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
-
var AGENT_STATUS={ERROR:"error",ACTION_REQUIRED:"action_required",OK:"ok"},AGENT_REASON={MISSING_ARGUMENTS:"missing_arguments",INVALID_ARGUMENTS:"invalid_arguments",CONFIRMATION_REQUIRED:"confirmation_required",INTERACTIVE_CONFIRMATION_REQUIRED:"interactive_confirmation_required",LOGIN_REQUIRED:"login_required",PROJECT_SETTINGS_REQUIRED:"project_settings_required",NOT_LINKED:"not_linked",NOT_FOUND:"not_found",PROJECT_NOT_FOUND:"project_not_found",MISSING_SCOPE:"missing_scope",SCOPE_NOT_ACCESSIBLE:"scope_not_accessible",API_ERROR:"api_error",RATE_LIMITED:"rate_limited",SEGMENT_IN_USE:"segment_in_use",ENTITY_IN_USE:"entity_in_use",MISSING_REQUIREMENTS:"missing_requirements",MISSING_NAME:"missing_name",MISSING_VALUE:"missing_value",MISSING_ENVIRONMENT:"missing_environment",ENV_NOT_FOUND:"env_not_found",MULTIPLE_ENVS:"multiple_envs",ENV_FILE_EXISTS:"env_file_exists",GIT_BRANCH_REQUIRED:"git_branch_required",ENV_KEY_SENSITIVE:"env_key_sensitive",AMBIGUOUS_ROUTE:"ambiguous_route",ROUTE_CREATE_FAILED:"route_create_failed",ROUTE_GENERATION_FAILED:"route_generation_failed",DOMAIN_NOT_FOUND:"domain_not_found",DNS_RECORD_NOT_FOUND:"dns_record_not_found",INCOMPLETE_RECORD:"incomplete_record",PERMISSION_DENIED:"permission_denied",INVALID_PORT:"invalid_port",INVALID_DNS_TYPE:"invalid_dns_type",DNS_ADD_FAILED:"dns_add_failed",INVALID_DOMAIN:"invalid_domain",CONFIGURED_CORRECTLY:"configured_correctly",VERIFICATION_NEEDED:"verification_needed",INVALID_CONFIGURATION:"invalid_configuration",DNS_CHANGE_REQUIRED:"dns_change_required",DNS_CHANGE_RECOMMENDED:"dns_change_recommended",DNSSEC_NEEDS_TO_BE_DISABLED:"dnssec_needs_to_be_disabled",PROJECT_ATTACHMENT_RECOMMENDED:"project_attachment_recommended",PROJECT_DOMAIN_MISSING:"project_domain_missing",INTEGRATION_TERMS_ACCEPTANCE_REQUIRED:"integration_terms_acceptance_required",INTEGRATION_SETUP_REQUIRED:"integration_setup_required",HAS_RESOURCES:"has_resources",INTEGRATION_SANDBOX_CLAIM_REQUIRED:"integration_sandbox_claim_required",CLASSIC_TOKEN_REQUIRED:"classic_token_required",TOKEN_USER_SCOPE_REQUIRED:"token_user_scope_required",MISSING_URL:"missing_url",MISSING_EVENTS:"missing_events",INVALID_URL:"invalid_url",INVALID_EVENT:"invalid_event",INVALID_BUDGET:"invalid_budget",INVALID_REFRESH_PERIOD:"invalid_refresh_period",INVALID_EXPIRATION:"invalid_expiration",INVALID_ALERT_THRESHOLDS:"invalid_alert_thresholds",REQUIRES_CONSENT:"requires_consent",MISSING_ISSUER_ID:"missing_issuer_id",MISSING_KEY:"missing_key",MISSING_KEY_ID:"missing_key_id",MISSING_PROJECT:"missing_project",ISSUER_NOT_FOUND:"issuer_not_found",ISSUER_MANAGED:"issuer_managed",ISSUER_REQUIRES_IMPORTED_KEY:"issuer_requires_imported_key",ISSUER_REQUIRES_GENERATED_KEY:"issuer_requires_generated_key",KEY_NOT_REVOKING:"key_not_revoking",NO_CHANGES_REQUESTED:"no_changes_requested",GIT_REPOSITORY_REQUIRED:"git_repository_required",CI_RUN_NOT_FOUND:"ci_run_not_found",CI_RUN_IN_PROGRESS:"ci_run_in_progress",CI_RUN_NOT_RETRYABLE:"ci_run_not_retryable",SCHEDULES_NOT_ENABLED:"schedules_not_enabled",SCHEDULE_ALREADY_EXISTS:"schedule_already_exists",SCHEDULE_COMPLETED:"schedule_completed",STATIC_SCHEDULE:"static_schedule",INVALID_CRON_EXPRESSION:"invalid_cron_expression",INVALID_JITTER:"invalid_jitter",JITTER_EXCEEDS_CADENCE:"jitter_exceeds_cadence",SINGLE_AT_TOO_SOON:"single_at_too_soon",SCHEDULE_PAYLOAD_TOO_LARGE:"payload_too_large",SCHEDULE_PAYLOAD_STORE_FAILED:"payload_store_failed",SCHEDULE_SERVICE_UNAVAILABLE:"service_unavailable",SCHEDULE_SERVICE_ERROR:"service_error",REDIRECT_NOT_FOUND:"redirect_not_found",VERSION_NOT_FOUND:"version_not_found",VERSION_ALREADY_LIVE:"version_already_live",VERSION_IS_STAGING:"version_is_staging",PLAN_UPGRADE_REQUIRED:"plan_upgrade_required",NOT_TEAM_MEMBER:"not_team_member",INVALID_ROLE_COMBINATION:"invalid_role_combination"},AGENT_ACTION={MISSING_ARGUMENTS:"missing_arguments",CONFIRMATION_REQUIRED:"confirmation_required",LOGIN_REQUIRED:"login_required"};export{AGENT_STATUS,AGENT_REASON,AGENT_ACTION};
|
|
@@ -1,7 +0,0 @@
|
|
|
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{permissionsAggregateCommand}from"./chunk-2RQFMCPJ.js";import{tagsAggregateCommand}from"./chunk-NT67T6DL.js";import{imageAggregateCommand}from"./chunk-NESZV33T.js";import{formatOption,jsonOption,limitOption,projectOption,yesOption}from"./chunk-PV5YI2ZZ.js";import{packageName}from"./chunk-FI772UVH.js";var projectScopeOption={...projectOption,shorthand:"p",description:"Project name or ID (defaults to the linked project)."},nextOption={name:"next",shorthand:null,type:String,deprecated:!1,description:"Continue from a previous response",argument:"CURSOR"},cursorOption={name:"cursor",shorthand:"c",type:String,deprecated:!0,description:"Cursor from a previous page to continue listing from",argument:"STRING"},platformOption={name:"platform",shorthand:null,type:String,deprecated:!1,description:"Target platform for the build (defaults to linux/amd64).",argument:"PLATFORM"},pushOption={name:"push",shorthand:null,type:Boolean,deprecated:!1,description:"Push the image after building. With Docker this builds and pushes in one step (Buildx enables zstd compression); Podman and Buildah build, then push with zstd compression."},publicOption={name:"public",shorthand:null,type:String,deprecated:!1,description:"Set the repository visibility: `true` for public, `false` for private.",argument:"BOOLEAN",choices:["true","false"]},listSubcommand={name:"ls",aliases:["list"],description:"List container registry repositories for a project",arguments:[],options:[projectScopeOption,limitOption,nextOption,cursorOption,formatOption,jsonOption],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"List repositories for a specific project as JSON",value:`${packageName} vcr ls --project my-app --json`}]},inspectSubcommand={name:"inspect",aliases:["get"],description:"Show details for a single repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Inspect a repository by name",value:`${packageName} vcr inspect my-repository`}]},addSubcommand={name:"add",aliases:["create"],description:"Create a container registry repository",arguments:[{name:"name",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Create a repository",value:`${packageName} vcr add my-repository`}]},configSubcommand={name:"config",aliases:[],description:"Configure a container registry repository, such as the repository's visibility",arguments:[{name:"repository",required:!0}],options:[publicOption,projectScopeOption,formatOption,jsonOption],examples:[{name:"Make a repository public",value:`${packageName} vcr config my-repository --public true`},{name:"Make a repository private",value:`${packageName} vcr config my-repository --public false`}]},removeSubcommand={name:"rm",aliases:["remove","delete"],description:"Delete a container registry repository",arguments:[{name:"repository",required:!0}],options:[projectScopeOption,yesOption,formatOption,jsonOption],examples:[{name:"Delete a repository",value:`${packageName} vcr rm my-repository`},{name:"Delete a repository without the confirmation prompt",value:`${packageName} vcr rm my-repository --yes`}]},loginSubcommand={name:"login",aliases:[],description:"Authenticate a container tool (docker, podman, or buildah) with the Vercel Container Registry",arguments:[{name:"engine",required:!0}],options:[projectScopeOption,formatOption,jsonOption],examples:[{name:"Log in with Docker",value:`${packageName} vcr login docker`},{name:"Log in with Podman",value:`${packageName} vcr login podman`},{name:"Log in with Buildah",value:`${packageName} vcr login buildah`},{name:"Log in for a specific project",value:`${packageName} vcr login docker --project my-app`}]},buildSubcommand={name:"build",aliases:[],description:"Build a container image tagged for the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"path",required:!1},{name:"name",required:!1}],options:[projectScopeOption,platformOption,pushOption],examples:[{name:"Build the current directory into the linked project (repository defaults to the project name, tag to latest)",value:`${packageName} vcr build docker`},{name:"Build and push in one step (Docker Buildx enables zstd compression)",value:`${packageName} vcr build docker --push`},{name:"Build a specific context path with a repository and tag",value:`${packageName} vcr build docker ./app my-api:1.2.3`},{name:"Pass extra flags through to the container tool",value:`${packageName} vcr build docker . -- --no-cache --build-arg KEY=value`}]},pushSubcommand={name:"push",aliases:[],description:"Push a container image to the Vercel Container Registry by shelling out to your container tool (docker, podman, or buildah)",arguments:[{name:"engine",required:!0},{name:"name",required:!1}],options:[projectScopeOption],examples:[{name:"Push the linked project image (repository defaults to the project name, tag to latest)",value:`${packageName} vcr push docker`},{name:"Push a specific repository and tag",value:`${packageName} vcr push docker my-api:1.2.3`}]},vcrCommand={name:"vcr",aliases:[],description:"Manage Vercel Container Registry repositories and images (see `vcr image`).",arguments:[],subcommands:[listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,tagsAggregateCommand,imageAggregateCommand,permissionsAggregateCommand],options:[],examples:[{name:"List repositories in the linked project",value:`${packageName} vcr ls`},{name:"Create a repository",value:`${packageName} vcr add my-app`},{name:"List images in a repository",value:`${packageName} vcr image ls my-app`}]};export{listSubcommand,inspectSubcommand,addSubcommand,configSubcommand,removeSubcommand,loginSubcommand,buildSubcommand,pushSubcommand,vcrCommand};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
-
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
-
import { dirname as __dirname_ } from 'node:path';
|
|
4
|
-
const require = __createRequire(import.meta.url);
|
|
5
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{resolveProjectContext}from"./chunk-ULYAF4N3.js";import{AGENT_REASON,AGENT_STATUS}from"./chunk-CVX5X5RI.js";import{detectExplicitScope}from"./chunk-ZNFC3CZF.js";import{printError}from"./chunk-7T4CJ6MJ.js";import{getProjectByNameOrId}from"./chunk-Z5PMK6F2.js";import{buildCommandWithGlobalFlags,getErrorRecovery,outputActionRequired,outputAgentError}from"./chunk-5VWK73R6.js";import{ProjectNotFound,isAPIError}from"./chunk-RINZXCDJ.js";import{output_manager_default}from"./chunk-EWWFNMPZ.js";function messageFor(err){return isAPIError(err)?err.serverMessage||err.message:err instanceof Error?err.message:String(err)}function handleTracingApiError(client,err){if(client.nonInteractive){let apiError=isAPIError(err)?err:void 0,status=apiError?.status;outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:status===403?AGENT_REASON.PERMISSION_DENIED:status===404?AGENT_REASON.NOT_FOUND:status===429?AGENT_REASON.RATE_LIMITED:AGENT_REASON.API_ERROR,message:messageFor(err),...apiError?.status===429&&getErrorRecovery(apiError,client)})}return isAPIError(err)&&err.status===403?(output_manager_default.error(messageFor(err)),1):(printError(err),1)}function configError(client,reason,message){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason,message}),output_manager_default.error(message),1}function invalidArguments(client,message){return configError(client,AGENT_REASON.INVALID_ARGUMENTS,message)}function ruleNotFound(client,message){return configError(client,AGENT_REASON.NOT_FOUND,message)}function confirmationRequired(client,message,next){return outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.CONFIRMATION_REQUIRED,message,userActionRequired:!0,next}),output_manager_default.error(message),1}var MISSING_BOTH_MESSAGE="No linked project found. Run `vercel link`, pass --cwd to a linked dir, or use --scope <team> and --project <name>.";async function resolveScope({client,flags={},linkedProject}){let flagScope=flags.scope?.trim()||void 0,flagProject=flags.project?.trim()||void 0;if(linkedProject.status==="linked"){if(!flagScope&&!flagProject)return{teamId:linkedProject.org.id,projectId:linkedProject.project.id};let teamId=flagScope?client.config.currentTeam:linkedProject.org.id;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject??linkedProject.project.id,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id}}if(flagScope&&flagProject){let teamId=client.config.currentTeam;if(!teamId)return{reason:AGENT_REASON.NOT_FOUND,message:`Team not found: ${flagScope}`};let project=await getProjectByNameOrId(client,flagProject,teamId);return project instanceof ProjectNotFound?{reason:AGENT_REASON.NOT_FOUND,message:`Project not found: ${flagProject}`}:{teamId,projectId:project.id}}return{reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE}}async function resolveConfigScope(client,flags){let link=await resolveProjectContext({client,projectNameOrId:flags.project});return link.status==="error"?{exitCode:link.exitCode}:link.status==="not_linked"?(outputActionRequired(client,{status:AGENT_STATUS.ACTION_REQUIRED,reason:AGENT_REASON.NOT_LINKED,message:MISSING_BOTH_MESSAGE,hint:"Link a project or pass --scope and --project.",next:[{command:buildCommandWithGlobalFlags(client.argv,"link"),when:"link this directory to a project"}]}),output_manager_default.error(MISSING_BOTH_MESSAGE),{exitCode:1}):flags.project===void 0&&detectExplicitScope(client)&&link.org.id!==client.config.currentTeam?{exitCode:invalidArguments(client,`The linked project ${link.project.name} belongs to ${link.org.slug||link.org.id}, which is not the scope that was passed. Pass --project <name> to act on a project in that scope.`)}:{teamId:link.org.id,projectId:link.project.id}}export{resolveScope,handleTracingApiError,invalidArguments,ruleNotFound,confirmationRequired,resolveConfigScope};
|