@vercel/cli-support 68.1.0 → 68.2.0-snapshot-3ff96ca5e2fe
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-57EE2LQO.js → add-4BFJ2SAR.js} +1 -1
- package/dist/chunks/{add-DNRNPUU7.js → add-5BQ3RSZQ.js} +1 -1
- package/dist/chunks/{add-FLVE2M3L.js → add-S7U4ZFBS.js} +1 -1
- package/dist/chunks/{alerts-26PDHRBL.js → alerts-GIT77GJG.js} +1 -1
- package/dist/chunks/{build-6WTRWW2M.js → build-RQ4ABN6Z.js} +1 -1
- package/dist/chunks/{chunk-WKEDN5SX.js → chunk-3JYREVOI.js} +1 -1
- package/dist/chunks/{chunk-U3IPJYB6.js → chunk-4HHDAGMC.js} +1 -1
- package/dist/chunks/{chunk-PP7BNCIG.js → chunk-4KHVAEGO.js} +1 -1
- package/dist/chunks/{chunk-7ZCM4LWL.js → chunk-4U6Y6LWP.js} +1 -1
- package/dist/chunks/{chunk-4FPYV37P.js → chunk-6JY43KSR.js} +1 -1
- package/dist/chunks/{chunk-GNQ7KLCN.js → chunk-BCOUDSOR.js} +1 -1
- package/dist/chunks/{chunk-OICSITNU.js → chunk-DRNUHJ6I.js} +1 -1
- package/dist/chunks/{chunk-76AOTUM2.js → chunk-HJPZOKEB.js} +1 -1
- package/dist/chunks/chunk-IKVQLMEI.js +7 -0
- package/dist/chunks/{chunk-BCD4TRQF.js → chunk-J54A5356.js} +1 -1
- package/dist/chunks/chunk-JOOWSBNQ.js +7 -0
- package/dist/chunks/{chunk-FO7OSSLI.js → chunk-LA3VRJX7.js} +1 -1
- package/dist/chunks/chunk-LUQPAO6K.js +7 -0
- package/dist/chunks/{chunk-732HWE3P.js → chunk-R2LNF5VK.js} +2 -2
- package/dist/chunks/{chunk-ILUU3SGP.js → chunk-R6LM3MBK.js} +2 -2
- package/dist/chunks/{chunk-YVWIDLY4.js → chunk-RBM4KOQ2.js} +3 -3
- package/dist/chunks/{chunk-AASXSNBW.js → chunk-RBZOVE2W.js} +1 -1
- package/dist/chunks/chunk-RVQ26UHS.js +7 -0
- package/dist/chunks/{chunk-QMI7GTT2.js → chunk-RXHW3T4H.js} +1 -1
- package/dist/chunks/chunk-TTJWZ3ZW.js +7 -0
- package/dist/chunks/{chunk-CNGI6Z2G.js → chunk-TXROE436.js} +1 -1
- package/dist/chunks/chunk-USCJFJD4.js +7 -0
- package/dist/chunks/{chunk-PSMKLDLV.js → chunk-YXJXKKS5.js} +1 -1
- package/dist/chunks/{chunk-FSMZPHAA.js → chunk-Z2L36RO3.js} +1 -1
- package/dist/chunks/{chunk-DWA7B7TB.js → chunk-Z3Z5GBKO.js} +1 -1
- package/dist/chunks/{clear-4MDTHLLE.js → clear-PQBUHQMO.js} +1 -1
- package/dist/chunks/{commands-Bx-lrmie-W7FCFL4P.js → commands-Bx-lrmie-3SGNZMAL.js} +1 -1
- package/dist/chunks/{config-A7DCP25J.js → config-6CSTGEZQ.js} +1 -1
- package/dist/chunks/{config-HiWLfXRQ-D7JA4E3D.js → config-HiWLfXRQ-C5TMRFGS.js} +1 -1
- package/dist/chunks/{config-4R62ATWJ.js → config-QQY3G5PG.js} +1 -1
- package/dist/chunks/{connect-U3yG4EtI-XYHDJQT7.js → connect-U3yG4EtI-W4F53AYR.js} +1 -1
- package/dist/chunks/{cp-aFe-HVrK-UAGAR2BC.js → cp-aFe-HVrK-NIJ7LN5P.js} +1 -1
- package/dist/chunks/{create-ilHWvzSk-7KWZXBE2.js → create-ilHWvzSk-5CZ443XL.js} +1 -1
- package/dist/chunks/{delete-DN53BRH7.js → delete-CELW3NLN.js} +1 -1
- package/dist/chunks/{delete-G4MAUBXZ.js → delete-YRATGP5Y.js} +1 -1
- package/dist/chunks/{dist-4F3LAB5Z.js → dist-6OEIUX4D.js} +1 -1
- package/dist/chunks/{domain-DGvr_U55-PNXSOVDO.js → domain-DGvr_U55-DTHIJA2K.js} +1 -1
- package/dist/chunks/{drives-Bi-Mnt2z-Z4T2YY4P.js → drives-Bi-Mnt2z-NUZTZOCO.js} +1 -1
- package/dist/chunks/{edit-7AUE6GXE.js → edit-YAYZEQRX.js} +1 -1
- package/dist/chunks/{exec-Bwv4MDyN-7YUAVBB2.js → exec-Bwv4MDyN-H45MRS5Y.js} +1 -1
- package/dist/chunks/{extend-D9tq9Cot-QT72AXGH.js → extend-D9tq9Cot-VK6JMUOY.js} +1 -1
- package/dist/chunks/{fork-DQ6qfKqB-XXTHHUMZ.js → fork-DQ6qfKqB-F3SVDDUI.js} +1 -1
- package/dist/chunks/group-actions-UOMO2WB2.js +14 -0
- package/dist/chunks/{groups-B8JVEeKk-K57VTXSS.js → groups-B8JVEeKk-K3CAYKG3.js} +1 -1
- package/dist/chunks/{image-DX2IAUKJ.js → image-DXZ4FKTV.js} +1 -1
- package/dist/chunks/{inspect-IHVP2M4H.js → inspect-BZKFXH45.js} +1 -1
- package/dist/chunks/{inspect-PBSKPN4W.js → inspect-TAR6RBRU.js} +1 -1
- package/dist/chunks/{inspect-GJXLYJC7.js → inspect-TDDHNNQS.js} +1 -1
- package/dist/chunks/inspect-YBEV7TZS.js +13 -0
- package/dist/chunks/{inspect-BS5UPI6W.js → inspect-YPATSOEP.js} +1 -1
- package/dist/chunks/{list-2ZCNO6DY.js → list-6JXV7U6T.js} +1 -1
- package/dist/chunks/{list-TUST62E6.js → list-JB32VTAB.js} +2 -2
- package/dist/chunks/{list-ZSQVIQXC.js → list-KJGICUN5.js} +1 -1
- package/dist/chunks/{list-iqQFvOHx-PNAUIUQL.js → list-iqQFvOHx-X3FHHVJX.js} +1 -1
- package/dist/chunks/{login-DGxA9ez--ZRIJ24TS.js → login-DGxA9ez--34Z67E3O.js} +1 -1
- package/dist/chunks/{login-CUEQHDT5.js → login-NXBKDSGN.js} +1 -1
- package/dist/chunks/{logout-OEbPJLu2-7NPM6ALK.js → logout-OEbPJLu2-RYNBWYWW.js} +1 -1
- package/dist/chunks/{ls-EEJQIKNI.js → ls-5UEICZHX.js} +1 -1
- package/dist/chunks/{ls-XYEJ5MR6.js → ls-A576SCRN.js} +1 -1
- package/dist/chunks/ls-BPD6GAEF.js +8 -0
- package/dist/chunks/{ls-UMSUUQCG.js → ls-KSFP2X45.js} +1 -1
- package/dist/chunks/{ls-27K5BB7Z.js → ls-SSLCXR4A.js} +1 -1
- package/dist/chunks/{ls-W7C5I555.js → ls-TBZHWZVO.js} +1 -1
- package/dist/chunks/{mutate-IELSY6ED.js → mutate-IQQTYNNF.js} +1 -1
- package/dist/chunks/{notifications-GZH7CFZY.js → notifications-BC2UCLDC.js} +1 -1
- package/dist/chunks/{open-EVYPUPNZ.js → open-JS5WAG77.js} +1 -1
- package/dist/chunks/{permissions-EHF5MNZP.js → permissions-3CD6EL4U.js} +1 -1
- package/dist/chunks/{push-YWKZ6SOO.js → push-TO7G2R7N.js} +1 -1
- package/dist/chunks/{query-G62G25HV.js → query-EVW5T2PI.js} +1 -1
- package/dist/chunks/{raw-query-WTKAOYCP.js → raw-query-7GAKEK2P.js} +1 -1
- package/dist/chunks/{read-BTA5slYO-IJLWMNSS.js → read-BTA5slYO-BJWNLVXG.js} +1 -1
- package/dist/chunks/{remove-7PSNAEDY.js → remove-AAFJR4EN.js} +1 -1
- package/dist/chunks/{remove-CCa99nz9-LCSNBDLT.js → remove-CCa99nz9-GDMR52SN.js} +1 -1
- package/dist/chunks/{reorder-OLCKSATY.js → reorder-QVSTUVEQ.js} +1 -1
- package/dist/chunks/{reply-OVHQNEBO.js → reply-QSTMHPP5.js} +1 -1
- package/dist/chunks/{resolve-TUHO4FHT.js → resolve-MITWQMP7.js} +1 -1
- package/dist/chunks/{rm-5RGN33Y5.js → rm-6KTCXHBG.js} +1 -1
- package/dist/chunks/{rm-D7CWGBTV.js → rm-GXDLM3SA.js} +1 -1
- package/dist/chunks/{rm-FYU3GBLC.js → rm-HXJWSOE4.js} +1 -1
- package/dist/chunks/{rm-HA752TW6.js → rm-M7QVN2N6.js} +1 -1
- package/dist/chunks/{rule-inspect-Y2MX7LQN.js → rule-inspect-D3BVZZRN.js} +1 -1
- package/dist/chunks/{run-D8obqfKw-D2EGHTU2.js → run-D8obqfKw-OEX3KLVO.js} +1 -1
- package/dist/chunks/{schema-UVTYLX6L.js → schema-T5BO3RBL.js} +1 -1
- package/dist/chunks/{sessions-cvWvPgzc-FBOQQPU5.js → sessions-cvWvPgzc-TBJZH7TC.js} +1 -1
- package/dist/chunks/{sh-7olsIyJh-NFO2QYTK.js → sh-7olsIyJh-FVAQLHEW.js} +1 -1
- package/dist/chunks/{snapshot-D9MAspub-UAVA2YSK.js → snapshot-D9MAspub-3U6JKVET.js} +1 -1
- package/dist/chunks/{snapshots-DQjvm6St-DBG4H2HS.js → snapshots-DQjvm6St-OGXR5PCJ.js} +1 -1
- package/dist/chunks/{stop-SQX-uC-Q-CRDQOA5M.js → stop-SQX-uC-Q-JSVPVN5K.js} +1 -1
- package/dist/chunks/{tags-DEIOW5MM.js → tags-KBCTII3M.js} +1 -1
- package/dist/chunks/{update-VG2LHBRV.js → update-FZESOZEW.js} +1 -1
- package/dist/chunks/{users-CGEsQ4G8-POYTVZJV.js → users-CGEsQ4G8-R2N46HVG.js} +1 -1
- package/dist/chunks/views-YXAMSKLM.js +11 -0
- package/dist/chunks/{write-DixEhGqz-YYDLLSJE.js → write-DixEhGqz-GBORRSZU.js} +1 -1
- package/dist/commands/deploy/index.js +1 -1
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/project/index.js +1 -1
- package/dist/commands-account.js +2 -2
- package/dist/commands-ai.js +1 -1
- package/dist/commands-blob.js +1 -1
- package/dist/commands-core.js +78 -46
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +1 -1
- package/dist/commands-integrations.js +1 -1
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +2 -2
- package/dist/index.js +1 -1
- package/dist/internal-build.js +1 -1
- package/dist/package.json +1 -1
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +11 -11
- package/dist/chunks/chunk-4OOHXEKI.js +0 -7
- package/dist/chunks/chunk-RACUGILV.js +0 -7
- package/dist/chunks/inspect-Y7VXJEI2.js +0 -13
- package/dist/chunks/ls-PAL6FQB6.js +0 -8
- /package/dist/chunks/{chunk-OTIERMC7.js → chunk-COOA33HY.js} +0 -0
|
@@ -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{readJSONFile}from"./chunk-KNKGJD5J.js";import{getNetworkFailureCause}from"./chunk-KXK4TF6L.js";import{commands}from"./chunk-
|
|
7
|
+
import{readJSONFile}from"./chunk-KNKGJD5J.js";import{getNetworkFailureCause}from"./chunk-KXK4TF6L.js";import{commands}from"./chunk-R6LM3MBK.js";import{getScope}from"./chunk-CRPZYLIL.js";import{readConfigFile}from"./chunk-HDKEES7E.js";import{fetch}from"./chunk-MY4MONOH.js";import{getArgs}from"./chunk-E7ICSU45.js";import{require_types}from"./chunk-PH2MLBQO.js";import{CantFindConfig,CantParseJSONFile,DeprecatedNowJson,WorkingDirectoryDoesNotExist,humanizePath}from"./chunk-MTPHHAPR.js";import{pkg_default}from"./chunk-JCDPMWKO.js";import{cliErrorFromUnknown,output_manager_default,recordCliError}from"./chunk-RIXTYUYN.js";import{require_dist}from"./chunk-4SIQE2W4.js";import{__commonJS,__toESM}from"./chunk-NBPLUP7C.js";var require_epipebomb=__commonJS({"../../node_modules/.pnpm/epipebomb@1.0.0/node_modules/epipebomb/epipebomb.js"(exports,module){module.exports=epipeBomb;function epipeBomb(stream,callback){stream==null&&(stream=process.stdout),callback==null&&(callback=process.exit);function epipeFilter(err){if(err.code==="EPIPE")return callback();stream.listeners("error").length<=1&&(stream.removeAllListeners(),stream.emit("error",err),stream.on("error",epipeFilter))}stream.on("error",epipeFilter)}}});function isOutputDebugEnabled(debugFlag){return debugFlag===!0||process.env.VERCEL_CLI_DEBUG==="1"}var import_epipebomb=__toESM(require_epipebomb(),1),SILENCED_ERRORS=["DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead."],installed=!1;function installProcessGuards(){if(installed)return;installed=!0;let originalError=console.error;console.error=msg=>{SILENCED_ERRORS.some(error=>typeof msg=="string"&&msg.includes(error))||originalError(msg)},(0,import_epipebomb.default)()}var import_error_utils=__toESM(require_dist(),1),CRASH_REPORT_TIMEOUT_MS=2e3;async function reportError(client,error){if(ignoreError(error)||!telemetryEnabled(client))return;let user,team,scopeError;if(client&&!getNetworkFailureCause(error))try{({user,team}=await getScope(client))}catch(err){(0,import_error_utils.isError)(err)&&(scopeError=err)}let crashReport={cli_version:pkg_default.version,invocation_id:client?.telemetryEventStore?.currentInvocationId,error:(0,import_error_utils.isError)(error)?{kind:error.name,message:error.message,stack:stackOf(error)}:{kind:"NonError",message:String(error)},user:user?{id:user.id,email:user.email,username:user.username,name:user.name}:void 0,team_id:team?.id,scope_error:scopeError?{name:scopeError.name,message:scopeError.message,stack:scopeError.stack}:void 0,args:reportableArgs(),node:{execPath:process.execPath,version:process.version,platform:process.platform}};try{(await fetch(process.env.VERCEL_TELEMETRY_BRIDGE_URL||"https://telemetry.vercel.com/api/vercel-cli/v1/events",{method:"POST",headers:{"Content-Type":"application/json","x-vercel-cli-crash-report":"1"},body:JSON.stringify({version:1,crashReport}),signal:AbortSignal.timeout(CRASH_REPORT_TIMEOUT_MS)})).body?.cancel().catch(()=>{})}catch{}}function telemetryEnabled(client){if(process.env.VERCEL_TELEMETRY_DISABLED)return!1;if(client?.telemetryEventStore)return client.telemetryEventStore.enabled;try{return readConfigFile().telemetry?.enabled!==!1}catch(err){return(0,import_error_utils.isErrnoException)(err)&&err.code==="ENOENT"}}function stackOf(error){let stacks=[],current=error;for(;(0,import_error_utils.isError)(current)&&stacks.length<5;)stacks.push(current.stack??`${current.name}: ${current.message}`),current=current.cause;return stacks.join(`
|
|
8
8
|
Caused by: `)}function reportableArgs(){try{let parsed=getArgs(process.argv.slice(2),{},{permissive:!0}),{_,...flags}=parsed,[command]=_;return{...typeof command=="string"&&commands.has(command)?{command}:{},flags:Object.keys(flags).sort()}}catch(err){return`Unable to parse args${(0,import_error_utils.isError)(err)?`: ${err}`:""}`}}function ignoreError(error){return(0,import_error_utils.isError)(error)&&error.message.includes("uv_cwd")}var fatalErrorHandlerSymbol=Symbol.for("vercel.cli.fatal-error-handler");async function exitWithUnexpectedError(error){let handler=globalThis[fatalErrorHandlerSymbol];if(typeof handler=="function")try{await handler(error)}catch{}process.exit(1)}async function handleUnexpectedError(client,err){output_manager_default.error(`An unexpected error occurred!
|
|
9
9
|
${err.stack}`),await reportError(client,err)}function registerUnexpectedErrorHandlers(getClient){process.on("unhandledRejection",async err=>{recordCliError(cliErrorFromUnknown(err)),err?err instanceof Error?await handleUnexpectedError(getClient(),err):(output_manager_default.error(`An unexpected rejection occurred
|
|
10
10
|
${err}`),await reportError(getClient(),err)):output_manager_default.error("An unexpected empty rejection occurred"),await exitWithUnexpectedError(err)}),process.on("uncaughtException",async error=>{await handleUnexpectedError(getClient(),error),await exitWithUnexpectedError(error)})}var import_types=__toESM(require_types(),1);import path from"path";var import_error_utils2=__toESM(require_dist(),1);var config;async function earlyGetConfig(configFile){if(config)return config;let localPath;try{localPath=process.cwd()}catch(err){if((0,import_error_utils2.isErrnoException)(err)&&err.code==="ENOENT")return new WorkingDirectoryDoesNotExist;throw err}if(configFile){let localFilePath=path.resolve(localPath,configFile);output_manager_default.debug(`Found config in provided --local-config path ${localFilePath}`);let localConfig=await readJSONFile(localFilePath);return localConfig instanceof CantParseJSONFile?localConfig:localConfig===null?new CantFindConfig([humanizePath(localFilePath)]):(config=localConfig,config[import_types.fileNameSymbol]=configFile,config)}let vercelFilePath=path.resolve(localPath,"vercel.json"),nowFilePath=path.resolve(localPath,"now.json"),[vercelConfig,nowConfig]=await Promise.all([readJSONFile(vercelFilePath),readJSONFile(nowFilePath)]);return vercelConfig instanceof CantParseJSONFile?vercelConfig:nowConfig instanceof CantParseJSONFile?nowConfig:vercelConfig!==null?(output_manager_default.debug(`Found config in file "${vercelFilePath}"`),config=vercelConfig,config[import_types.fileNameSymbol]="vercel.json",config):nowConfig!==null?new DeprecatedNowJson(nowFilePath):new CantFindConfig([vercelFilePath].map(humanizePath))}var fallbackReason;function recordDirectBuildFallback(reason){fallbackReason=reason}function getDirectBuildFallbackAttributes(){return fallbackReason===void 0?void 0:{directBuild:"false",fallbackReason}}function resolveNonInteractive({argv,nonInteractiveFlag,isAgent,stdinIsTTY}){let explicitNonInteractiveFalse=argv.includes("--non-interactive=false")||argv.includes("--no-non-interactive")||argv.includes("--non-interactive")&&argv[argv.indexOf("--non-interactive")+1]==="false";return{nonInteractive:explicitNonInteractiveFalse?!1:nonInteractiveFlag||isAgent&&!stdinIsTTY,explicitNonInteractiveFalse}}export{isOutputDebugEnabled,installProcessGuards,reportError,exitWithUnexpectedError,handleUnexpectedError,registerUnexpectedErrorHandlers,earlyGetConfig,recordDirectBuildFallback,getDirectBuildFallbackAttributes,resolveNonInteractive};
|
|
@@ -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{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{repositoryPermissionsClearPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-TXROE436.js";import"./chunk-6JY43KSR.js";import"./chunk-3WXQHKSS.js";import"./chunk-FIICEEXO.js";import"./chunk-RFD7CEL6.js";import{permissionsClearSubcommand}from"./chunk-T2IZUTGY.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{AGENT_REASON,buildCommandWithYes,outputAgentError}from"./chunk-E6VQXHBD.js";import"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import"./chunk-NBPLUP7C.js";async function clear(client,argv,telemetry){let parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(permissionsClearSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,"vcr permissions <repository> clear"),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],skipConfirmation=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionProject(project),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,"vcr permissions <repository> clear");if(typeof missingRepository=="number")return missingRepository;let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;if(!skipConfirmation&&(outputAgentError(client,{status:"error",reason:AGENT_REASON.CONFIRMATION_REQUIRED,message:"Clearing repository permissions removes access for every team. Re-run with --yes.",next:[{command:buildCommandWithYes(client.argv)}]},1),!await client.input.confirm(`Remove access to ${repository} for all teams? They will no longer be able to pull its images.`,!1)))return output_manager_default.log("Canceled"),0;let path=repositoryPermissionsClearPath(scope,repository);output_manager_default.spinner("Clearing repository permissions...");try{return await client.fetch(path,{method:"DELETE"}),fr.jsonOutput?client.stdout.write(`${JSON.stringify({repository,cleared:!0},null,2)}
|
|
8
8
|
`):output_manager_default.success(`Cleared repository permissions for ${repository}`),0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput);throw err}finally{output_manager_default.stopSpinner()}}export{clear as default};
|
|
@@ -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{a}from"./chunk-GB77JTTX.js";import{APIError$1,Bt,Vt,dist_exports}from"./chunk-
|
|
7
|
+
import{a}from"./chunk-GB77JTTX.js";import{APIError$1,Bt,Vt,dist_exports}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{e}from"./chunk-S7FMMAST.js";import{N}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var s=d(N()),c={sandbox:s.positional({type:a,description:"Sandbox with a running session"}),commandId:s.positional({displayName:"command-id",description:"ID returned by sandbox exec --detach"}),scope:Bt};async function l({sandbox:e2,commandId:t,scope:{token:n,team:r,project:i}}){let s2=await Vt.get({name:e2,projectId:i,teamId:r,token:n,resume:!1}),c2=(()=>{try{return s2.currentSession()}catch{return null}})();if(c2?.status!=="running")throw Error(`Sandbox ${e2} has no running session for command ${t}.`);try{return await c2.getCommand(t)}catch(n2){throw n2 instanceof APIError$1&&n2.response.status===404?Error(`Command ${t} was not found in the current session of ${e2}. It may have run in an earlier session.`,{cause:n2}):n2}}var u=s.command({name:"get",description:"Show the status of a command in the current session",args:c,async handler(e2){let t=await l(e2);process.stdout.write(`${t.cmdId} ${t.exitCode===null?"running":`exited (${t.exitCode})`}
|
|
8
8
|
`)}}),d2=s.command({name:"logs",description:"Stream a command's stdout and stderr",args:c,async handler(e2){let t=await l(e2);for await(let e3 of t.logs())(e3.stream==="stdout"?process.stdout:process.stderr).write(e3.data)}}),f=s.command({name:"wait",description:"Wait for a command to finish and return its exit code",args:c,async handler(e2){let t=await l(e2),n=await t.wait();process.stderr.write(`Command ${t.cmdId} exited with ${n.exitCode}.
|
|
9
9
|
`),process.exitCode=n.exitCode}}),p=s.command({name:"kill",description:"Stop a running command without stopping its sandbox",args:{...c,signal:s.option({long:"signal",description:"Signal to send (default SIGTERM)",type:s.optional(s.oneOf(["SIGTERM","SIGKILL","SIGINT","SIGHUP","SIGQUIT"]))})},async handler({signal:e2,...t}){let n=await l(t);await n.kill(e2),process.stderr.write(`Sent ${e2??"SIGTERM"} to command ${n.cmdId}.
|
|
10
10
|
`)}}),m=s.command({name:"write",description:"Write piped bytes to a command started with --detach --stdin. Wait for each write to finish before starting another, including from other CLI processes.",args:c,async handler(e2){if(process.stdin.isTTY)throw Error("Pipe data to sandbox commands write, for example: printf 'hello\\n' | sandbox commands write <name> <command-id>.");let t=await l(e2);for await(let e3 of process.stdin)await t.writeStdin(e3)}}),h=s.command({name:"close-stdin",description:"Send EOF to a command started with --detach --stdin",args:c,async handler(e2){await(await l(e2)).closeStdin()}}),g=s.command({name:"output",description:"Wait for a command to finish, then print its text output (not binary-safe). Use sandbox commands logs to stream output while it runs.",args:{...c,stream:s.option({long:"stream",description:"Output stream to print (default both)",type:s.optional(s.oneOf(["stdout","stderr","both"]))})},async handler({stream:e2,...t}){let n=await l(t);process.stdout.write(await n.output(e2??"both"))}}),_=s.subcommands({...e.commands,cmds:{get:u,logs:d2,wait:f,kill:p,write:m,"close-stdin":h,output:g}});export{_ as commands};
|
|
@@ -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{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{repositoryPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,handleVcrApiError,requireVcrRepository,resolveVcrScope,validateVcrJsonOutput}from"./chunk-TXROE436.js";import{outputError}from"./chunk-6JY43KSR.js";import"./chunk-3WXQHKSS.js";import"./chunk-FIICEEXO.js";import{readOnOffOption,rewriteLegacyOnOffValues}from"./chunk-MJKDKZ2J.js";import"./chunk-RFD7CEL6.js";import{configSubcommand}from"./chunk-CHTFRAXA.js";import"./chunk-T2IZUTGY.js";import"./chunk-3F3WNT5K.js";import"./chunk-P7GA2C6N.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-E6VQXHBD.js";import"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import"./chunk-NBPLUP7C.js";var USAGE="vcr update <repository> --public";async function config(client,argv,telemetry){let rewritten=rewriteLegacyOnOffValues(argv,configSubcommand.options,client),parsedArgs;try{parsedArgs=parseArguments("error"in rewritten?argv:rewritten.args,getFlagsSpecification(configSubcommand.options))}catch(err){return emitVcrArgParseError(client,err,USAGE),printError(err),2}let fr=validateVcrJsonOutput(client,parsedArgs.flags);if(typeof fr=="number")return fr;if("error"in rewritten)return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:rewritten.error},2),outputError(client,fr.jsonOutput,"INVALID_ARGUMENTS",rewritten.error);let repository=parsedArgs.args[0],project=parsedArgs.flags["--project"],visibility=readOnOffOption(client,parsedArgs.flags,{on:"--public",off:"--no-public"});if("error"in visibility){let err=new Error(visibility.error);return emitVcrArgParseError(client,err,USAGE),outputError(client,fr.jsonOutput,"INVALID_ARGUMENTS",visibility.error)}let desiredPublic=visibility.value;telemetry.trackCliOptionProject(project),telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionPublic(rewritten.legacy.get("--public")),rewritten.legacy.has("--public")||(telemetry.trackCliFlagPublic(parsedArgs.flags["--public"]),telemetry.trackCliFlagNoPublic(parsedArgs.flags["--no-public"]));let missingRepository=requireVcrRepository(client,repository,fr.jsonOutput,USAGE);if(typeof missingRepository=="number")return missingRepository;if(parsedArgs.args.length>1){let message="`vcr update` takes one repository. Pass --public or --no-public without a value.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with one repository"}]},2),outputError(client,fr.jsonOutput,"INVALID_ARGUMENTS",message)}if(desiredPublic===void 0){let message="Missing a setting to change. Pass --public to make the repository public, or --no-public to make it private.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,USAGE),when:"Re-run with --public or --no-public"}]},2),outputError(client,fr.jsonOutput,"MISSING_ARGUMENTS",message)}let scope=await resolveVcrScope(client,{project,jsonOutput:fr.jsonOutput});if(typeof scope=="number")return scope;let path=repositoryPath(scope,repository);output_manager_default.spinner("Updating repository...");try{let updated=await client.fetch(path,{method:"PATCH",body:{public:desiredPublic}});if(fr.jsonOutput)client.stdout.write(`${JSON.stringify(updated,null,2)}
|
|
8
8
|
`);else{let isPublic=updated.repository?.public??desiredPublic;output_manager_default.success(`Repository ${updated.repository?.name??repository} is now ${isPublic?"public":"private"}`)}return 0}catch(err){if(isAPIError(err))return handleVcrApiError(client,err,fr.jsonOutput,{retry:{command:buildCommandWithGlobalFlags(client.argv,"vcr ls"),when:"List repositories to confirm the name or id"}});throw err}finally{output_manager_default.stopSpinner()}}export{config as default};
|
|
@@ -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{
|
|
7
|
+
import{c}from"./chunk-VB6SQWSB.js";import{a as a2}from"./chunk-SIWT2MBT.js";import{B,F,G,H,I,J,ie,m,oe,se,z}from"./chunk-Z2L36RO3.js";import{a as a3,o as o2}from"./chunk-IVJEYHF5.js";import{o}from"./chunk-OVVHONX7.js";import{a}from"./chunk-GB77JTTX.js";import{APIError$1,Bt,Vt,dist_exports,n}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{i,t}from"./chunk-HAM7ZPEC.js";import{Q}from"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import{e}from"./chunk-S7FMMAST.js";import{P}from"./chunk-J5MGMWRV.js";import{N,X,Z}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var A=d(N());Z();var j=d(o2()),M=A.command({name:"vcpus",description:"Update the vCPU count of a sandbox",args:{sandbox:A.positional({type:a,description:"Sandbox name to update"}),count:A.positional({type:H,description:"Number of vCPUs to allocate (each vCPU includes 2048 MB of memory)"}),scope:Bt},async handler({scope:{token:e2,team:n2,project:r},sandbox:i2,count:a4}){let o3=await Vt.get({name:i2,projectId:r,teamId:n2,token:e2}),s=Q("Updating sandbox configuration...").start();try{await o3.update({resources:{vcpus:a4}}),s.stop(),process.stderr.write("\u2705 Configuration updated for sandbox "+X.cyan(i2)+`
|
|
8
8
|
`),process.stderr.write(X.dim(" \u2570 ")+"vcpus: "+X.cyan(a4)+`
|
|
9
9
|
`)}catch(e3){throw s.stop(),e3}}}),N2=A.command({name:"timeout",description:"Set the timeout for new sessions; a higher value extends a running session",args:{sandbox:A.positional({type:a,description:"Sandbox name to update"}),duration:A.positional({type:a3,description:"The maximum duration a sandbox can run for. Example: 5m, 1h"}),scope:Bt},async handler({scope:{token:e2,team:n2,project:r},sandbox:i2,duration:a4}){let o3=await Vt.get({name:i2,projectId:r,teamId:n2,token:e2}),s=Q("Updating sandbox configuration...").start();try{await o3.update({timeout:(0,j.default)(a4)}),s.stop(),process.stderr.write("\u2705 Configuration updated for sandbox "+X.cyan(i2)+`
|
|
10
10
|
`),process.stderr.write(X.dim(" \u2570 ")+"timeout: "+X.cyan(a4)+`
|
|
@@ -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{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-
|
|
7
|
+
import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-R6LM3MBK.js";import"./chunk-XHWA436J.js";import{tracesCommand}from"./chunk-4MAA4BQD.js";import{lsSubcommand,rmSubcommand,setSubcommand,tracesConfigCommand}from"./chunk-OXQKWOLS.js";import"./chunk-GO64LSUW.js";import"./chunk-M3LYYAQ6.js";import"./chunk-TUPVVZ4I.js";import"./chunk-HXIOR7P6.js";import"./chunk-CHTFRAXA.js";import"./chunk-T2IZUTGY.js";import"./chunk-3F3WNT5K.js";import"./chunk-P7GA2C6N.js";import"./chunk-RPYIWRSN.js";import"./chunk-CDO5IECP.js";import"./chunk-6XXXPJBV.js";import"./chunk-L74PQVPL.js";import"./chunk-HT5EXCYX.js";import"./chunk-TTJWZ3ZW.js";import"./chunk-R3ZPLQDI.js";import"./chunk-QPPFQREO.js";import"./chunk-X2UJGCIC.js";import"./chunk-XZYVBYUY.js";import"./chunk-EZ3HXFLB.js";import"./chunk-WMIZ6Y4E.js";import"./chunk-QPNYOR6O.js";import"./chunk-JGEJY7AC.js";import"./chunk-LBJ7EOZM.js";import{TelemetryClient}from"./chunk-QROPMCL2.js";import{warnDeprecatedSubcommand}from"./chunk-BDLZ6WL2.js";import"./chunk-GOXGA37R.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-FUH5PBGR.js";import{help}from"./chunk-7TREJIPV.js";import"./chunk-7QHUMMBA.js";import"./chunk-AUCQKYL2.js";import"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import"./chunk-NBPLUP7C.js";var TracesConfigTelemetryClient=class extends TelemetryClient{trackCliSubcommandLs(actual){this.trackCliSubcommand({subcommand:"ls",value:actual})}trackCliSubcommandSet(actual){this.trackCliSubcommand({subcommand:"set",value:actual})}trackCliSubcommandRemove(actual){this.trackCliSubcommand({subcommand:"remove",value:actual})}};var COMMAND_CONFIG={ls:getCommandAliases(lsSubcommand),set:getCommandAliases(setSubcommand),remove:getCommandAliases(rmSubcommand)},SUBCOMMAND_METADATA={ls:lsSubcommand,set:setSubcommand,remove:rmSubcommand};async function config(client,{args,needHelp,subcommandOriginal,telemetry}){let{subcommand:action,subcommandOriginal:actionOriginal}=getSubcommand(args,COMMAND_CONFIG),actionMetadata=typeof action=="string"?SUBCOMMAND_METADATA[action]:void 0;function printHelp(command){return output_manager_default.print(help(command,{stream:client.stderr,parent:tracesCommand,columns:client.stderr.columns})),needHelp?0:2}if(needHelp)return telemetry.trackCliFlagHelp("traces",subcommandOriginal),printHelp(actionMetadata||tracesConfigCommand);telemetry.trackCliSubcommandConfig(subcommandOriginal);let configTelemetry=new TracesConfigTelemetryClient({opts:{store:client.telemetryEventStore}});switch(action){case"ls":return configTelemetry.trackCliSubcommandLs(actionOriginal),(await import("./ls-TDYTE4HM.js")).default(client);case"set":return configTelemetry.trackCliSubcommandSet(actionOriginal),(await import("./set-774P7GEL.js")).default(client);case"remove":return configTelemetry.trackCliSubcommandRemove(actionOriginal),actionOriginal==="delete"&&warnDeprecatedSubcommand(client,"traces config delete","traces config remove"),(await import("./rm-P6AGSBXP.js")).default(client);default:return printHelp(tracesConfigCommand)}}export{config as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{e as e3}from"./chunk-N3COHC7T.js";import{e as e2}from"./chunk-SX2JJDHM.js";import{M,j}from"./chunk-
|
|
7
|
+
import{e as e3}from"./chunk-N3COHC7T.js";import{e as e2}from"./chunk-SX2JJDHM.js";import{M,j}from"./chunk-YXJXKKS5.js";import"./chunk-IVJEYHF5.js";import"./chunk-OVVHONX7.js";import"./chunk-GB77JTTX.js";import"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import"./chunk-HAM7ZPEC.js";import"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import{e}from"./chunk-S7FMMAST.js";import{N}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var s=d(N()).command({...e.connect,args:e3(j,"command","args","interactive","tty","detached","stdin","timeout"),async handler(e4){return M.handler({...e2,interactive:!0,detached:!1,stdin:!1,tty:!0,timeout:void 0,...e4})}});export{s as connect};
|
|
@@ -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{a as a2,c,i,o}from"./chunk-EV2VKG2V.js";import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-
|
|
7
|
+
import{a as a2,c,i,o}from"./chunk-EV2VKG2V.js";import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{Q}from"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import{e}from"./chunk-S7FMMAST.js";import{N,X,Z}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";import{constants as p}from"node:fs";import m from"node:path";import h from"node:fs/promises";import g from"node:stream/consumers";var _=d(N());Z();var v=_.extendType(_.string,{from:async e2=>{let n=e2.split(":");if(n.length===2){let[r,i2]=n;if(!r||!i2)throw Error([`Invalid copy path format: "${e2}".`,`${X.bold("hint:")} Expected format: SANDBOX_NAME:PATH (e.g., my-sandbox:/home/user/file.txt).`,"\u2570\u25B6 Local paths should not contain colons."].join(`
|
|
8
8
|
`));return{type:"remote",sandboxName:await a.from(r),path:i2}}return{type:"local",path:e2}}}),y=_.command({...e.copy,args:{source:_.positional({displayName:"src",description:"The source file to copy from local file system, or a sandbox_name:path from a remote sandbox",type:v}),dest:_.positional({displayName:"dst",description:"The destination file to copy to local file system, or a sandbox_name:path to a remote sandbox",type:v}),recursive:_.flag({long:"recursive",short:"r",description:"Copy a directory and everything in it. The contents of src end up inside dst."}),scope:Bt},async handler({scope:e2,source:n,dest:r,recursive:i2}){if(n.type==="remote"&&r.type==="remote")throw Error(["Copying between two sandbox paths is not supported.",`${X.bold("hint:")} Copy to your machine first, then copy into the other sandbox.`].join(`
|
|
9
9
|
`));let a3=t=>Vt.get({name:t,teamId:e2.team,token:e2.token,projectId:e2.project}),o2=n.type==="local"?await h.lstat(n.path).catch(()=>null):null;if(n.type==="local"){let e3=o2;if(e3?.isDirectory()){if(!i2){process.exitCode=1,Q().fail([`${n.path} is a directory.`,`${X.bold("hint:")} Pass --recursive (-r) to copy a directory.`].join(`
|
|
10
10
|
`));return}if(r.type!=="remote")throw Error("Copying between two local paths is not supported.");await b(n.path,r,await a3(r.sandboxName));return}else if(i2&&e3?.isSymbolicLink()){if(r.type!=="remote")throw Error("Copying between two local paths is not supported.");await x(n.path,r,await a3(r.sandboxName));return}}else if(i2&&r.type==="local"){let e3=await a3(n.sandboxName);await S(n,r.path,e3);return}let l=Q({text:`Reading source file (${n.path})...`}).start(),u=null;if(n.type==="local")u=await h.readFile(n.path).catch(e3=>{if(e3.code==="ENOENT")return null;throw e3});else{let t=await(await Vt.get({name:n.sandboxName,teamId:e2.team,token:e2.token,projectId:e2.project})).readFile({path:n.path});t&&(u=await g.buffer(t))}if(!u){if(process.exitCode=1,n.type==="remote"){let e3=m.dirname(n.path);l.fail([`File not found: ${n.path} in sandbox ${n.sandboxName}.`,`${X.bold("hint:")} Verify the file path exists using \`sandbox exec ${n.sandboxName} ls ${e3}\`.`,"\u2570\u25B6 To copy a directory, pass --recursive (-r)."].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{Y}from"./chunk-
|
|
7
|
+
import{Y}from"./chunk-4U6Y6LWP.js";import"./chunk-RBZOVE2W.js";import"./chunk-SX2JJDHM.js";import"./chunk-YXJXKKS5.js";import"./chunk-VB6SQWSB.js";import"./chunk-SIWT2MBT.js";import"./chunk-Z2L36RO3.js";import"./chunk-IVJEYHF5.js";import"./chunk-OVVHONX7.js";import"./chunk-GB77JTTX.js";import"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import"./chunk-HAM7ZPEC.js";import"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import"./chunk-S7FMMAST.js";import"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";export{Y as create};
|
|
@@ -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{getRouteVersions}from"./chunk-BVH2AEFE.js";import{STAGING_LEGACY,getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoutes,stagedEffects,validateRouteIdsForApproval,withGlobalFlags}from"./chunk-LHK6B4ER.js";import{requireProjectContext}from"./chunk-WRTBYD4I.js";import{stamp_default}from"./chunk-LY3EY2VG.js";import"./chunk-LLHXL3SV.js";import"./chunk-JJTAADC5.js";import"./chunk-Q4W3R6U2.js";import{requireApproval}from"./chunk-
|
|
7
|
+
import{getRouteVersions}from"./chunk-BVH2AEFE.js";import{STAGING_LEGACY,getRouteTypeLabel,getRoutes,offerAutoPromote,parseSubcommandArgs,resolveRoutes,stagedEffects,validateRouteIdsForApproval,withGlobalFlags}from"./chunk-LHK6B4ER.js";import{requireProjectContext}from"./chunk-WRTBYD4I.js";import{stamp_default}from"./chunk-LY3EY2VG.js";import"./chunk-LLHXL3SV.js";import"./chunk-JJTAADC5.js";import"./chunk-Q4W3R6U2.js";import{requireApproval}from"./chunk-RBM4KOQ2.js";import"./chunk-KDCLHZYL.js";import"./chunk-NFBFXM6X.js";import"./chunk-IQ7FPAI4.js";import"./chunk-WS6UOPMS.js";import"./chunk-GILTW5RJ.js";import{deleteSubcommand}from"./chunk-GO64LSUW.js";import"./chunk-L74PQVPL.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import"./chunk-7EI554V5.js";import"./chunk-E7ICSU45.js";import{AGENT_REASON,AGENT_STATUS,outputAgentError}from"./chunk-E6VQXHBD.js";import"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);async function deleteRoutes(client,projectId,routeIds,options={}){let{teamId}=options,query=new URLSearchParams;teamId&&query.set("teamId",teamId);let queryString=query.toString(),url=`/v1/projects/${projectId}/routes${queryString?`?${queryString}`:""}`;return await client.fetch(url,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeIds})})}async function deleteRoute(client,argv){let parsed=await parseSubcommandArgs(argv,deleteSubcommand,client);if(typeof parsed=="number")return parsed;let link=await requireProjectContext(client,"routes",parsed.flags["--project"]);if(typeof link=="number")return link;let{project,org}=link,teamId=org.type==="team"?org.id:void 0,{args,flags}=parsed;if(args.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.MISSING_ARGUMENTS,message:"At least one route name or ID is required.",next:[{command:withGlobalFlags(client,"routes remove <name-or-id>"),when:"pass one or more ids/names"}]},2),output_manager_default.error(`At least one route name or ID is required. Usage: ${withGlobalFlags(client,"routes remove <name-or-id> [...]")}`),2;output_manager_default.spinner("Fetching routes");let{routes}=await getRoutes(client,project.id,{teamId});if(output_manager_default.stopSpinner(),routes.length===0)return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.NOT_FOUND,message:"No routes found in this project."},1),output_manager_default.error("No routes found in this project."),1;let resolved=await resolveRoutes(client,routes,args);if(!resolved)return 1;output_manager_default.print(`
|
|
8
8
|
`),output_manager_default.log(`The following ${resolved.length===1?"route":`${resolved.length} routes`} will be removed:`);for(let route of resolved){let typeLabels=getRouteTypeLabel(route);output_manager_default.print(` ${import_chalk.default.red("\xD7")} ${route.name} ${import_chalk.default.gray(`(${route.route.src})`)} ${import_chalk.default.gray(`[${typeLabels}]`)}
|
|
9
9
|
`)}if(output_manager_default.print(`
|
|
10
10
|
`),!validateRouteIdsForApproval(client,resolved.map(route=>route.id),"removed"))return 1;let approval=await requireApproval(client,deleteSubcommand.consequence,{kind:"remove",noun:resolved.length===1?"1 route":`${resolved.length} routes`,target:[...new Set(resolved.map(route=>route.id))],effects:stagedEffects(project.name,resolved.map(route=>`the removal of route "${route.name}" (${route.id}, ${route.route.src})`))},flags,{legacy:STAGING_LEGACY});if(!approval.approved)return approval.exitCode;let{versions}=await getRouteVersions(client,project.id,{teamId}),existingStagingVersion=versions.find(v=>v.isStaging),deleteStamp=stamp_default();output_manager_default.spinner(`Removing ${resolved.length===1?"route":`${resolved.length} routes`}`);try{let{deletedCount,version}=await deleteRoutes(client,project.id,resolved.map(r=>r.id),{teamId});return output_manager_default.log(`${import_chalk.default.cyan("Removed")} ${deletedCount} ${deletedCount===1?"route":"routes"} ${import_chalk.default.gray(deleteStamp())}`),await offerAutoPromote(client,project.id,version,!!existingStagingVersion,{teamId,skipPrompts:!approval.prompted}),0}catch(e){let error=e;return client.nonInteractive&&outputAgentError(client,{status:AGENT_STATUS.ERROR,reason:AGENT_REASON.API_ERROR,message:"Failed to remove routes for this project. See hint for error details.",hint:error.message||"Retry with the same command once transient issues are resolved."},1),output_manager_default.error(error.message||"Failed to remove routes"),1}}export{deleteRoute as default};
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-
|
|
7
|
+
import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{deleteMessage,handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts}from"./chunk-HJPZOKEB.js";import{outputError}from"./chunk-6JY43KSR.js";import"./chunk-FIICEEXO.js";import"./chunk-JJTAADC5.js";import"./chunk-Q4W3R6U2.js";import{canPrompt}from"./chunk-IQ7FPAI4.js";import{deleteSubcommand}from"./chunk-HT5EXCYX.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import"./chunk-E6VQXHBD.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);async function deleteCommentMessage(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(deleteSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"delete")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput,yes=!!parsedArgs.flags["--yes"];telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliFlagYes(parsedArgs.flags["--yes"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments delete <thread> <message-id>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;if(!yes){if(!canPrompt(client)||jsonOutput)return outputError(client,jsonOutput,"CONFIRMATION_REQUIRED","Pass --yes to delete the message non-interactively.");if(!await client.input.confirm(`${import_chalk.default.red("Delete")} message ${messageId} from ${threadId} in team ${scope.teamSlug??scope.teamId}? This cannot be undone.`,!1))return output_manager_default.log("Canceled."),0}telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);try{let result=await deleteMessage(client,scope.teamId,threadId,messageId);return jsonOutput?(client.stdout.write(`${JSON.stringify(result,null,2)}
|
|
8
8
|
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Deleted message ${messageId}
|
|
9
9
|
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{deleteCommentMessage as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{t}from"./chunk-W2YAOE3Z.js";import{D,u}from"./chunk-DXFFWNK4.js";import{e}from"./chunk-S7FMMAST.js";import{N}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-YBWLW6SW.js";import"./chunk-NBPLUP7C.js";var r=N(),i={list:()=>import("./list-iqQFvOHx-
|
|
7
|
+
import{t}from"./chunk-W2YAOE3Z.js";import{D,u}from"./chunk-DXFFWNK4.js";import{e}from"./chunk-S7FMMAST.js";import{N}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-YBWLW6SW.js";import"./chunk-NBPLUP7C.js";var r=N(),i={list:()=>import("./list-iqQFvOHx-X3FHHVJX.js").then(({list:e2})=>e2),create:()=>import("./create-ilHWvzSk-5CZ443XL.js").then(({create:e2})=>e2),sh:()=>import("./sh-7olsIyJh-FVAQLHEW.js").then(({sh:e2})=>e2),fork:()=>import("./fork-DQ6qfKqB-F3SVDDUI.js").then(({fork:e2})=>e2),config:()=>import("./config-HiWLfXRQ-C5TMRFGS.js").then(({config:e2})=>e2),copy:()=>import("./cp-aFe-HVrK-NIJ7LN5P.js").then(({cp:e2})=>e2),read:()=>import("./read-BTA5slYO-BJWNLVXG.js").then(({read:e2})=>e2),write:()=>import("./write-DixEhGqz-GBORRSZU.js").then(({write:e2})=>e2),exec:()=>import("./exec-Bwv4MDyN-H45MRS5Y.js").then(({exec:e2})=>e2),connect:()=>import("./connect-U3yG4EtI-W4F53AYR.js").then(({connect:e2})=>e2),stop:()=>import("./stop-SQX-uC-Q-JSVPVN5K.js").then(({stop:e2})=>e2),extend:()=>import("./extend-D9tq9Cot-VK6JMUOY.js").then(({extend:e2})=>e2),commands:()=>import("./commands-Bx-lrmie-3SGNZMAL.js").then(({commands:e2})=>e2),domain:()=>import("./domain-DGvr_U55-DTHIJA2K.js").then(({domain:e2})=>e2),users:()=>import("./users-CGEsQ4G8-R2N46HVG.js").then(({users:e2})=>e2),groups:()=>import("./groups-B8JVEeKk-K3CAYKG3.js").then(({groups:e2})=>e2),remove:()=>import("./remove-CCa99nz9-GDMR52SN.js").then(({remove:e2})=>e2),run:()=>import("./run-D8obqfKw-OEX3KLVO.js").then(({run:e2})=>e2),snapshot:()=>import("./snapshot-D9MAspub-3U6JKVET.js").then(({snapshot:e2})=>e2),snapshots:()=>import("./snapshots-DQjvm6St-OGXR5PCJ.js").then(({snapshots:e2})=>e2),sessions:()=>import("./sessions-cvWvPgzc-TBJZH7TC.js").then(({sessions:e2})=>e2),drives:()=>import("./drives-Bi-Mnt2z-NUZTZOCO.js").then(({drives:e2})=>e2),telemetry:()=>import("./telemetry-KLbte3YE-OAFHJTWE.js").then(({telemetryCommand:e2})=>e2),login:()=>import("./login-DGxA9ez--34Z67E3O.js").then(({login:e2})=>e2),logout:()=>import("./logout-OEbPJLu2-RYNBWYWW.js").then(({logout:e2})=>e2)},a=async(e2,a3)=>{let o=a3?.appName??"sandbox",s={};for(let e3 of Object.keys(i)){if(a3?.withoutAuth&&(e3==="login"||e3==="logout"))continue;let n=e[e3];s[e3]={...(0,r.command)({...n,args:{},handler(){throw Error("Command must be loaded before execution")}}),helpTopics:()=>n.positionals.map(e4=>({category:"arguments",usage:e4,description:"",defaults:[]})),parse:async()=>({_tag:"ok",value:{}})}}let c=(0,r.subcommands)({name:o,description:"Interfacing with Vercel Sandbox",version:u,cmds:s,examples:[{description:"Start a coding agent in a sandbox",command:`${o} create opencode`},{description:"Create a sandbox on a Secure Compute network (requires an Enterprise plan)",command:`${o} create --network-id your_network_id_here`},{description:"Create a sandbox and start a shell",command:`${o} sh`},{description:"Run a command in a new sandbox",command:`${o} run -- node -e "console.log('hello')"`},{description:"Execute command in an existing sandbox",command:`${o} exec <name> -- npm test`},{description:"Read and write files in an existing sandbox",command:`${o} read <name> /vercel/sandbox/package.json`}]}),l=await(0,r.parse)(c,e2);if(l._tag==="ok"){let e3=l.value.command;s[e3]=await i[e3]()}return c};var i2=N();function a2(e2){return{async run(a3){t(e2.getAuthHeaders),await D.trackInvocation({appName:e2.appName,argv:a3});try{await(0,i2.run)(await a(a3,e2),a3),D.trackExitCode(0)}catch(e3){throw D.trackExitCode(1),e3}finally{await D.flush()}}}}export{a2 as createApp};
|
|
@@ -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{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-
|
|
7
|
+
import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{e}from"./chunk-S7FMMAST.js";import{N}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var o=d(N()),s=o.command({...e.domain,args:{sandbox:o.positional({type:a}),port:o.positional({type:o.number,description:"Published port number"}),scope:Bt},async handler({sandbox:e2,port:t,scope:{token:n,team:r,project:i}}){if(!Number.isInteger(t)||t<1||t>65535)throw Error("Port must be an integer between 1 and 65535.");let o2=await Vt.get({name:e2,projectId:i,teamId:r,token:n,resume:!1});if((()=>{try{return o2.currentSession()}catch{return null}})()?.status!=="running")throw Error(`Sandbox ${e2} has no running session.`);process.stdout.write(`${o2.domain(t)}
|
|
8
8
|
`)}});export{s as domain};
|
|
@@ -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{$}from"./chunk-
|
|
7
|
+
import{$}from"./chunk-COOA33HY.js";import{a,d as d2,f}from"./chunk-VB6SQWSB.js";import{Bt,Ut}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{i,t}from"./chunk-HAM7ZPEC.js";import{Q}from"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import{e}from"./chunk-S7FMMAST.js";import{I,M,N as N2,P}from"./chunk-J5MGMWRV.js";import{N,X,Z}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var v=d(N()),y=N();Z();var b=v.command({name:"list",aliases:["ls"],description:"List drives for the specified account and project.",args:{scope:Bt,namePrefix:v.option({long:"name-prefix",description:"Filter drives by name prefix.",type:v.optional(v.string)}),sortOrder:v.option({long:"sort-order",description:"Sort order. Options: asc, desc (default).",type:v.optional(v.oneOf(["asc","desc"]))}),limit:v.option({long:"limit",description:"Maximum number of drives per page (default 50).",type:v.optional(v.number)}),cursor:v.option({long:"cursor",description:"Pagination cursor from a previous 'More results' hint.",type:v.optional(v.string)})},async handler({scope:{token:e2,team:t2,project:n},namePrefix:r,sortOrder:i2,limit:a2,cursor:s}){let{drives:c,pagination:l}=await(async()=>{try{var c2=i();return c2.u(t(()=>Q("Fetching drives...").start(),e3=>e3.stop())),Ut.list({token:e2,teamId:t2,projectId:n,limit:a2??50,...s&&{cursor:s},...r&&{namePrefix:r,sortBy:"name"},...i2&&{sortOrder:i2}})}catch(e3){c2.e=e3}finally{c2.d()}})();D(c),l.next!==null&&console.log(I(l.next))}}),x=v.command({name:"get-or-create",description:"Create a drive if it does not already exist, or retrieve it.",args:{name:v.positional({type:a,description:"Drive name to create or retrieve"}),maxSize:v.option({long:"max-size",description:"Maximum drive size, e.g. 200GiB or 2TiB (bytes if no unit). Fixed after creation. If omitted, a default of 1 TiB is used (1 GiB for Hobby).",type:v.optional(d2)}),region:v.option({long:"region",description:"Region where the drive is created.",type:v.optional(f)}),scope:Bt},async handler({scope:{token:e2,team:n,project:r},name:i2,maxSize:a2,region:s}){let c=await(async()=>{try{var t2=i();return t2.u(t(()=>Q("Creating drive...").start(),e3=>e3.stop())),Ut.getOrCreate({token:e2,teamId:n,projectId:r,name:i2,maxSize:a2,region:s})}catch(e3){t2.e=e3}finally{t2.d()}})();process.stderr.write("\u2705 Drive "+X.cyan(c.name)+` ready.
|
|
8
8
|
`),E(c,{showSizeHint:a2===void 0})}}),S=v.command({name:"fork",description:"Fork a drive with a new name, inheriting the parent drive's data, max size and region.",args:{parent:v.positional({displayName:"parent",type:a,description:"Parent drive name"}),name:v.positional({type:a,description:"Forked drive name"}),scope:Bt},async handler({scope:{token:e2,team:n,project:r},parent:i2,name:a2}){let s=await(async()=>{try{var t2=i();t2.u(t(()=>Q("Forking drive...").start(),e3=>e3.stop()));let s2=await Ut.get({token:e2,teamId:n,projectId:r,name:i2});return Ut.fork(s2,{name:a2})}catch(e3){t2.e=e3}finally{t2.d()}})();process.stderr.write("\u2705 Drive "+X.cyan(s.name)+` created.
|
|
9
9
|
`),E(s,{parentDriveName:i2})}}),C=v.command({name:"delete",aliases:["rm","remove"],description:"Delete one or more drives.",args:{name:v.positional({type:a,description:"Drive name to delete"}),names:v.restPositionals({type:a,description:"More drive names to delete"}),scope:Bt},async handler({scope:{token:e2,team:t2,project:n},name:r,names:i2}){let a2=Array.from(new Set([r,...i2]),r2=>({title:`Deleting drive ${r2}`,async task(){let i3=await O({token:e2,teamId:t2,projectId:n,name:r2});if(i3.currentSandboxName||i3.currentSessionId)throw Error(`Drive ${r2} is attached to a sandbox and cannot be deleted.`);await Ut.delete(i3)}}));try{await new $(a2,{concurrent:!0}).run()}catch{process.exitCode=1}}}),w=(0,y.subcommands)({...e.drives,cmds:{list:b,"get-or-create":x,fork:S,delete:C}}),T={...w,run(e2){return process.stderr.write("Warning: `sandbox drives` is deprecated. Use `vercel drives` instead.\n"),w.run(e2)}};function E(e2,{parentDriveName:n,showSizeHint:r=!1}={}){n&&process.stderr.write(X.dim(" \u2502 ")+"forked from: "+X.cyan(n)+`
|
|
10
10
|
`),process.stderr.write(X.dim(" \u2502 ")+"region: "+X.cyan(e2.region)+`
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{resolveMessageContent}from"./chunk-
|
|
7
|
+
import{resolveMessageContent}from"./chunk-J54A5356.js";import{parseThreadArg}from"./chunk-2S6PE6GB.js";import{handleCommentsParseError,resolveCommentsScope,threadNotFoundMessage,toApiErrorParts,updateMessage}from"./chunk-HJPZOKEB.js";import{outputError}from"./chunk-6JY43KSR.js";import"./chunk-FIICEEXO.js";import"./chunk-JJTAADC5.js";import"./chunk-Q4W3R6U2.js";import"./chunk-IQ7FPAI4.js";import{editSubcommand}from"./chunk-HT5EXCYX.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import"./chunk-E6VQXHBD.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);async function edit(client,telemetry){let parsedArgs,flagsSpecification=getFlagsSpecification(editSubcommand.options);try{parsedArgs=parseArguments(client.argv.slice(2),flagsSpecification)}catch(err){return handleCommentsParseError(err,"update")}let formatResult=validateJsonOutput(parsedArgs.flags);if(!formatResult.valid)return output_manager_default.error(formatResult.error),2;let jsonOutput=formatResult.jsonOutput;telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]),telemetry.trackCliOptionMessage(parsedArgs.flags["--message"]),telemetry.trackCliOptionFile(parsedArgs.flags["--file"]);let[threadInput,messageId]=parsedArgs.args.slice(2);if(telemetry.trackCliArgumentThread(threadInput),telemetry.trackCliArgumentMessageId(messageId),!threadInput||!messageId)return outputError(client,jsonOutput,"MISSING_ARGUMENT","Usage: `vercel comments update <thread> <message-id> --message <text>` \u2014 message IDs are shown in `vercel comments inspect`.");let threadRef=parseThreadArg(threadInput);if(!threadRef)return outputError(client,jsonOutput,"INVALID_THREAD",`Could not extract a thread ID from "${threadInput}".`);let threadId=threadRef.id,content=await resolveMessageContent(client,{message:parsedArgs.flags["--message"],file:parsedArgs.flags["--file"]},jsonOutput);if(typeof content=="number")return content;if(content===void 0)return outputError(client,jsonOutput,"MISSING_CONTENT","Pass the new content with --message <text> or --file <path>.");telemetry.trackCliOptionProject(parsedArgs.flags["--project"]);let scope=await resolveCommentsScope(client,{project:parsedArgs.flags["--project"],requireProject:!1,jsonOutput,urlTeamSlug:threadRef.teamSlug});if(typeof scope=="number")return scope;try{let message=await updateMessage(client,scope.teamId,threadId,messageId,{markdown:content});return jsonOutput?(client.stdout.write(`${JSON.stringify(message,null,2)}
|
|
8
8
|
`),0):(output_manager_default.print(`${import_chalk.default.green("\u2713")} Updated message ${messageId}
|
|
9
9
|
`),0)}catch(err){if(isAPIError(err)){let{code,message}=toApiErrorParts(err);return outputError(client,jsonOutput,code,err.status===404?threadNotFoundMessage(threadId,scope):message)}throw err}}export{edit as default};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{M}from"./chunk-
|
|
7
|
+
import{M}from"./chunk-YXJXKKS5.js";import"./chunk-IVJEYHF5.js";import"./chunk-OVVHONX7.js";import"./chunk-GB77JTTX.js";import"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import"./chunk-HAM7ZPEC.js";import"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import"./chunk-S7FMMAST.js";import"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";export{M as exec};
|
|
@@ -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{a as a2,o}from"./chunk-IVJEYHF5.js";import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-
|
|
7
|
+
import{a as a2,o}from"./chunk-IVJEYHF5.js";import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{e}from"./chunk-S7FMMAST.js";import{N,X,Z}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var u=d(N());Z();var d2=d(o()),f=u.command({...e.extend,args:{sandbox:u.positional({type:a,description:"Sandbox name with a running session"}),duration:u.positional({type:a2,description:"Time to add, for example 5m or 1h"}),scope:Bt},examples:[{description:"Add 30 minutes",command:"sandbox extend my-sandbox 30m"}],async handler({scope:{token:e2,team:n,project:r},sandbox:i,duration:a3}){let o2=(0,d2.default)(a3);if(o2<=0)throw Error("Extension duration must be greater than zero.");let c=await Vt.get({name:i,projectId:r,teamId:n,token:e2,resume:!1}),l=(()=>{try{return c.currentSession()}catch{return null}})();if(l?.status!=="running")throw Error(`Sandbox ${i} has no running session to extend.`);await l.extendTimeout(o2),process.stderr.write(X.green("\u2714")+` Extended ${X.cyan(i)} by ${a3}
|
|
8
8
|
`)}});export{f as extend};
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{l,s,u}from"./chunk-
|
|
7
|
+
import{l,s,u}from"./chunk-RBZOVE2W.js";import{e as e2}from"./chunk-SX2JJDHM.js";import{M}from"./chunk-YXJXKKS5.js";import{F,K,U,Y,ae,se,z}from"./chunk-Z2L36RO3.js";import{a as a2,o as o2}from"./chunk-IVJEYHF5.js";import{o}from"./chunk-OVVHONX7.js";import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import"./chunk-HAM7ZPEC.js";import{Q}from"./chunk-Y2KAVMM4.js";import"./chunk-PW67ZNDU.js";import"./chunk-NE5RTEMC.js";import{e}from"./chunk-S7FMMAST.js";import{N,X,Z}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var w=d(N()),T=d(o2());Z();var E={source:w.positional({displayName:"source",description:"Name of the source sandbox to fork from.",type:a}),name:w.option({long:"name",description:"A user-chosen name for the forked sandbox. Must be unique per project.",type:w.optional(w.string)}),nonPersistent:w.flag({long:"non-persistent",description:"Disable automatic restore of the filesystem between sessions."}),timeout:w.option({long:"timeout",type:w.optional(a2),description:"Override the maximum sandbox duration (inherited from source if omitted). Example: 5m, 30m"}),vcpus:U,ports:se,silent:w.flag({long:"silent",description:"Don't write sandbox name to stdout"}),connect:w.flag({long:"connect",description:"Start an interactive shell session after creating the forked sandbox"}),envVars:w.multioption({long:"env",short:"e",type:o,description:"Environment variables to set on the fork. When provided, fully replaces the env vars copied from the source (no per-key merge)."}),tags:w.multioption({long:"tag",short:"t",type:o,description:"Key-value tags to associate with the fork. When provided, fully replaces the tags copied from the source (no per-key merge)."}),region:K,failoverRegions:Y,networkId:ae,...s,...F,scope:Bt},D=w.command({...e.fork,args:E,examples:[{description:"Fork a sandbox with all config copied from the source",command:"sandbox fork my-source"},{description:"Fork with a specific name and overridden vcpus",command:"sandbox fork my-source --name my-forked-sandbox --vcpus 4"}],async handler(e3){let{source:n,name:r,nonPersistent:i,ports:a3,scope:o3,timeout:l2,vcpus:u2,silent:d2,connect:f,envVars:p,tags:m,region:h,failoverRegions:g,networkId:_,snapshotExpiration:S,keepLastSnapshots:w2,keepLastSnapshotsFor:E2,deleteEvictedSnapshots:D2}=e3,O=z(e3),k=l({keepLastSnapshots:w2,keepLastSnapshotsFor:E2,deleteEvictedSnapshots:D2}),A=Object.keys(m).length>0?m:void 0,j=Object.keys(p).length>0?p:void 0,M2=await Vt.get({name:n,teamId:o3.team,projectId:o3.project,token:o3.token});if(M2.status==="running"){let e4=M2.currentSnapshotId?"last snapshot":"base image (it has no snapshot yet)";console.error(X.yellow([`${X.bold("warn:")} ${n} is running. The fork starts from its ${e4}, not from its live filesystem.`,`\u2570\u25B6 ${X.bold("hint:")} run \`sandbox snapshot --stop ${n}\` first to fork the current filesystem.`].join(`
|
|
8
8
|
`)))}let N2=d2?void 0:Q(`Forking sandbox ${X.cyan(n)}...`).start(),P=await Vt.fork({sourceSandbox:n,teamId:o3.team,projectId:o3.project,token:o3.token,...r!==void 0&&{name:r},...a3.length>0&&{ports:a3},...l2!==void 0&&{timeout:(0,T.default)(l2)},...u2!==void 0&&{resources:{vcpus:u2}},...O!==void 0&&{networkPolicy:O},...j!==void 0&&{env:j},...A!==void 0&&{tags:A},...h!==void 0&&{region:h},...g!==void 0&&{failoverRegions:g},..._!==void 0&&{networkId:_},...i&&{persistent:!1},...S!==void 0&&{snapshotExpiration:(0,T.default)(S)},...k!==void 0&&{keepLastSnapshots:k},__interactive:!0});if(N2?.stop(),!P.interactivePort)throw Error(["Sandbox forked but interactive port is missing.",`${X.bold("hint:")} This is an internal error. Please try again.`,"\u2570\u25B6 Report this issue: https://github.com/vercel/sandbox/issues"].join(`
|
|
9
9
|
`));return d2||u({sandbox:P,scope:o3,action:`forked from ${X.cyan(n)}`,connectHint:!f}),f&&await M.handler({...e2,scope:o3,asSudo:!1,cwd:void 0,skipExtendingTimeout:!1,envVars:{},interactive:!0,detached:!1,stdin:!1,tty:!0,sandbox:P,timeout:void 0}),P}});export{D as fork};
|
|
@@ -0,0 +1,14 @@
|
|
|
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{resolveGroupScope}from"./chunk-USCJFJD4.js";import{endsBefore,getMuteCoverage,getMuteRuleIds,getMutedActions,isAcknowledged}from"./chunk-RVQ26UHS.js";import{getGroupTitle}from"./chunk-QOIG2FJP.js";import"./chunk-RXHW3T4H.js";import"./chunk-IKVQLMEI.js";import{MAX_MUTE_MS,MIN_MUTE_MS,parseMuteDuration}from"./chunk-JOOWSBNQ.js";import"./chunk-GHAY4PSD.js";import"./chunk-EL65DTVZ.js";import{outputError}from"./chunk-6JY43KSR.js";import"./chunk-FIICEEXO.js";import{formatDate}from"./chunk-46R47IE5.js";import"./chunk-GZNDA6SV.js";import"./chunk-OM6NML7C.js";import{effectsDigest,requireApproval}from"./chunk-RBM4KOQ2.js";import"./chunk-KDCLHZYL.js";import"./chunk-NFBFXM6X.js";import"./chunk-IQ7FPAI4.js";import"./chunk-QCYCLWNG.js";import{quoteShellArg}from"./chunk-WS6UOPMS.js";import"./chunk-GILTW5RJ.js";import"./chunk-L74PQVPL.js";import{acknowledgeSubcommand,muteSubcommand,unacknowledgeSubcommand,unmuteSubcommand}from"./chunk-TTJWZ3ZW.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import{printAlignedLabel}from"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-E6VQXHBD.js";import{validateJsonOutput}from"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import{packageName}from"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import{remoteText}from"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import"./chunk-NBPLUP7C.js";import{randomUUID}from"node:crypto";var SUBCOMMANDS={acknowledge:acknowledgeSubcommand,unacknowledge:unacknowledgeSubcommand,mute:muteSubcommand,unmute:unmuteSubcommand},DEFAULT_MUTE_DURATION="24h",MAX_RULE_IDS_PER_REQUEST=100,MUTE_RETRY={retries:2,maxTimeout:2e3},EXPIRY_SLACK_MS=30*1e3;function getMuteExpiresAt(durationMs,now=Date.now()){if(durationMs===null)return null;let clamped=Math.min(Math.max(durationMs,MIN_MUTE_MS+EXPIRY_SLACK_MS),MAX_MUTE_MS-EXPIRY_SLACK_MS);return Math.ceil((now+clamped)/1e3)*1e3}function chunk(items,size){let chunks=[];for(let i=0;i<items.length;i+=size)chunks.push(items.slice(i,i+size));return chunks}function usageError(client,jsonOutput,verb,code,message){return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,`alerts ${verb} --help`),when:`See valid \`alerts ${verb}\` usage`}]},2),outputError(client,jsonOutput,code,message),2}function groupPath(groupId,teamId){let query=new URLSearchParams({teamId});return`/alerts/v4/groups/${encodeURIComponent(groupId)}?${query.toString()}`}function handleApiError(client,jsonOutput,groupId,err,{verb,phase,progress,detection,createsMutes}){let groupArg=quoteShellArg(groupId),inspectCommand=`${packageName} alerts inspect ${groupArg}`,changesMutes=phase==="mute"||phase==="updateMute"||phase==="unmute",outcomeUnknown=changesMutes&&(err.status===0||err.status===409||err.status>=500),partial=!!(progress&&progress.done>0),operation=phase==="unmute"?`unmuting alert group ${groupId}`:phase==="updateMute"?`updating the mutes on alert group ${groupId}`:`muting alert group ${groupId}`,message;if(err.code==="MISSING_REVISION")message=`The API did not return a revision for alert group ${groupId}, so it can't be muted.`;else if(partial&&progress&&(phase==="unmute"||phase==="updateMute")){let remaining=progress.total-progress.done;message=`${phase==="unmute"?"Removed":"Updated"} ${progress.done} of ${progress.total} mutes on alert group ${groupId}. ${remaining} ${outcomeUnknown?"unknown":"failed"}. Run \`${inspectCommand}\` before running this again.`}else err.status===403&&err.code==="feature_not_enabled"?message="Alert group actions are in limited preview and aren't enabled for this team yet.":err.status===403?message=`You don't have permission to ${verb} alert group ${groupId}. ${verb==="mute"||verb==="unmute"?"Muting needs permission to manage alert rules in the project.":"Acknowledging needs permission to update alerts."}`:err.status===404&&(phase==="unmute"||phase==="updateMute")?message=`Some mutes on alert group ${groupId} were already removed or have expired. Run \`${inspectCommand}\` to see its current mutes.`:err.status===404&&phase==="mute"&&detection?message=`The --detection value is not a detection in alert group ${groupId}. Run \`${inspectCommand}\` to see its detections.`:err.status===404?message=`Alert group ${groupId} was not found in this team.`:outcomeUnknown?message=`Can't confirm whether ${operation} finished. ${err.status===409?"Another change to its mutes is still in progress.":err.status===0?"The connection failed before a response arrived.":`The alerts API returned ${err.status}.`} Run \`${inspectCommand}\` before running this again, so it isn't applied twice.`:err.status===409?message=`Alert group ${groupId} is already being updated. Try again in a moment.`:err.status===412?message=`Alert group ${groupId} changed while it was being muted. Run the command again.`:err.status===429?message=`The alerts API is rate limiting requests. Wait a moment, then run \`${inspectCommand}\` before running this again.`:message=`Could not ${verb} the alert group. Re-run with --debug for details.`;partial&&progress&&phase==="mute"&&(message+=` The ${progress.done} existing mutes were already updated.`);let reason=partial?AGENT_REASON.PARTIAL_FAILURE:outcomeUnknown?AGENT_REASON.UNKNOWN_OUTCOME:err.status===401?"not_authorized":err.status===403?"forbidden":err.status===404?AGENT_REASON.NOT_FOUND:err.status===429?"rate_limited":AGENT_REASON.API_ERROR,code=partial?"PARTIAL_FAILURE":outcomeUnknown?"UNKNOWN_OUTCOME":err.code||"API_ERROR",inspectStep={command:buildCommandWithGlobalFlags(client.argv,`alerts inspect ${groupArg}`),when:"Check the alert group before retrying"},scopeError=err.status===403&&err.code!=="feature_not_enabled"||err.status===404&&phase!=="unmute"&&phase!=="updateMute"&&!detection;return outputAgentError(client,{status:"error",reason,message,...changesMutes?{data:{groupId,remote:outcomeUnknown?"unknown":"none",phase,...progress?phase==="mute"?{updatedMutes:{succeeded:progress.done,total:progress.total}}:{succeeded:progress.done,total:progress.total,failed:outcomeUnknown?0:progress.total-progress.done,unknown:outcomeUnknown?progress.total-progress.done:0}:{},...createsMutes?{createMute:phase==="mute"&&err.code!=="MISSING_REVISION"?outcomeUnknown?"unknown":"failed":"not_started"}:{}}}:{},...outcomeUnknown||partial?{retryable:!1}:{},...scopeError?{hint:"Confirm team scope; use --scope <team-slug> if the group belongs to another team.",next:[{command:buildCommandWithGlobalFlags(client.argv,"whoami"),when:"See current user and team"},inspectStep]}:changesMutes||err.status===404?{next:[inspectStep]}:{}},1),outputError(client,jsonOutput,code,message)}function printJson(client,document){return client.stdout.write(`${JSON.stringify(document,null,2)}
|
|
8
|
+
`),0}function printStdoutIdentifier(client,id){client.stdout.isTTY&&!client.nonInteractive||client.stdout.write(`${remoteText(id)}
|
|
9
|
+
`)}function inspectNext(client,groupId){return[{command:buildCommandWithGlobalFlags(client.argv,`alerts inspect ${quoteShellArg(groupId)}`),when:"Inspect the alert group"}]}function formatExpiry(expiresAt){return typeof expiresAt=="number"?formatDate(expiresAt):"unmuted"}function getGroupMutePatterns(group){return[...new Set((group.alerts??[]).map(alert=>JSON.stringify([alert.projectId??group.projectId,alert.detectionKey])))].sort()}function muteChangeDigest(group,teamId,groupId,verb,flags,affectedRuleIds){let detection=flags["--detection"]?.trim(),selected=detection?group.alerts?.find(alert=>alert.id===detection):void 0,mutedActions=getMutedActions(group),rules=mutedActions.flatMap(action=>action.ruleIds.map(ruleId=>({ruleId,expiresAt:action.expiresAt}))).sort((a,b)=>a.ruleId.localeCompare(b.ruleId));return effectsDigest({teamId,groupId,canonicalGroupId:group.id,projectId:group.projectId,verb,...verb==="mute"?{duration:flags["--duration"]??DEFAULT_MUTE_DURATION,detection,target:detection?selected&&{projectId:selected.projectId??group.projectId,detectionKey:selected.detectionKey}:{revision:group.revision,patterns:getGroupMutePatterns(group)}}:{},mutes:verb==="mute"&&detection?void 0:{rules,detectionKeys:[...new Set(mutedActions.flatMap(action=>action.detectionKeys))].sort(),...verb==="mute"?{coverage:getMuteCoverage(group)}:{}},affectedRuleIds:[...affectedRuleIds].sort()})}function muteEffectsChanged(client,jsonOutput){let message="The alert group or its mute effects changed while approval was pending. Nothing was changed. Run the command again to review the current rules.";return outputAgentError(client,{status:"error",reason:AGENT_REASON.EFFECTS_CHANGED,message,retryable:!1},1),outputError(client,jsonOutput,"EFFECTS_CHANGED",message)}async function approveMuteChange(client,group,teamId,groupId,verb,flags,jsonOutput,effects,affectedRuleIds=getMuteRuleIds(group)){let digest=muteChangeDigest(group,teamId,groupId,verb,flags,affectedRuleIds),approval=await requireApproval(client,SUBCOMMANDS[verb].consequence,{kind:"change",action:verb==="mute"?"change mute rules":"remove mute rules",noun:"alert group",target:groupId,identifier:"ID",team:remoteText(teamId),effects,digest},flags);if(!approval.approved)return approval.exitCode;if(approval.prompted){let latest=await client.fetch(groupPath(groupId,teamId));return muteChangeDigest(latest,teamId,groupId,verb,flags,affectedRuleIds)!==digest?muteEffectsChanged(client,jsonOutput):latest}return group}async function groupAction(client,argv,verb,tracking){let{telemetry,subcommandOriginal}=tracking;verb==="acknowledge"?telemetry.trackCliSubcommandAcknowledge(subcommandOriginal):verb==="unacknowledge"?telemetry.trackCliSubcommandUnacknowledge(subcommandOriginal):verb==="mute"?telemetry.trackCliSubcommandMute(subcommandOriginal):telemetry.trackCliSubcommandUnmute(subcommandOriginal);let subcommand=SUBCOMMANDS[verb],parsedArgs;try{parsedArgs=parseArguments(argv,getFlagsSpecification(subcommand.options))}catch(err){return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message:err instanceof Error?err.message:String(err),next:[{command:buildCommandWithGlobalFlags(client.argv,`alerts ${verb} --help`),when:`See valid \`alerts ${verb}\` usage`}]},2),printError(err),2}let flags=parsedArgs.flags;telemetry.trackCliArgumentGroup(parsedArgs.args[0]),telemetry.trackCliOptionDuration(flags["--duration"]),telemetry.trackCliOptionDetection(flags["--detection"]),telemetry.trackCliOptionFormat(flags["--format"]),telemetry.trackCliFlagJson(flags["--json"]),telemetry.trackCliOptionConfirmName(flags["--confirm-name"]),telemetry.trackCliOptionEffectsDigest(flags["--effects-digest"]);let formatResult=validateJsonOutput(flags);if(!formatResult.valid)return usageError(client,!1,verb,"INVALID_FORMAT",formatResult.error);let jsonOutput=formatResult.jsonOutput,groupId=parsedArgs.args[0];if(!groupId)return outputAgentError(client,{status:"error",reason:AGENT_REASON.MISSING_ARGUMENTS,message:`Missing group. Example: ${packageName} alerts ${verb} <group>`,next:[{command:buildCommandWithGlobalFlags(client.argv,"alerts"),when:"List alert groups to find a group ID"}]},2),outputError(client,jsonOutput,"MISSING_ARGUMENTS",`Missing group. Usage: \`${packageName} alerts ${verb} <group>\``);if(parsedArgs.args.length>1)return usageError(client,jsonOutput,verb,"INVALID_ARGUMENTS",`\`alerts ${verb}\` takes one group. Received: ${parsedArgs.args.join(" ")}`);let muteMs=null;if(verb==="mute"){let duration=parseMuteDuration(flags["--duration"]??DEFAULT_MUTE_DURATION);if(!duration.valid)return usageError(client,jsonOutput,verb,"INVALID_DURATION",duration.message);if(muteMs=duration.ms,flags["--detection"]!==void 0&&!flags["--detection"].trim())return usageError(client,jsonOutput,verb,"INVALID_ARGUMENTS","`--detection` requires a detection ID.")}let scope=await resolveGroupScope(client,{jsonOutput,command:`alerts ${verb} ${quoteShellArg(groupId)}`});if(typeof scope=="number")return scope;let path=groupPath(groupId,scope.teamId),showProgress=!jsonOutput&&!client.nonInteractive,failure={verb,phase:"read"};try{showProgress&&output_manager_default.spinner("Fetching alert group\u2026");let current=await client.fetch(path);output_manager_default.stopSpinner();let id=remoteText(current.id||groupId),groupArg=quoteShellArg(groupId);if(verb==="acknowledge"||verb==="unacknowledge"){let ack=verb==="acknowledge";if(isAcknowledged(current)===ack)return jsonOutput?printJson(client,{group:current,outcome:"unchanged"}):(output_manager_default.print(` Alert group ${id} is already ${ack?"acknowledged":"not acknowledged"}.
|
|
10
|
+
`),printStdoutIdentifier(client,id),0);showProgress&&output_manager_default.spinner(ack?"Acknowledging alert group\u2026":"Unacknowledging alert group\u2026"),failure.phase="ack";let result=await client.fetch(path,{method:"PATCH",body:{type:"ack",ack}});output_manager_default.stopSpinner();let outcome=ack?"acknowledged":"unacknowledged";return jsonOutput?printJson(client,{group:result.group,outcome,next:inspectNext(client,groupId)}):(printAlignedLabel(ack?"Acknowledged":"Unacknowledged",id,{gutter:"\u2713"}),printAlignedLabel("Title",remoteText(getGroupTitle(result.group??current))),printStdoutIdentifier(client,id),0)}if(verb==="mute"){let detection=flags["--detection"]?.trim();failure.detection=detection;let warnings=[];if(detection){let target=current.alerts?.find(alert=>alert.id===detection);if(current.alerts&&!target)return usageError(client,jsonOutput,verb,"INVALID_ARGUMENTS",`The --detection value is not a detection in alert group ${id}. Run \`${packageName} alerts inspect ${groupArg}\` to see its detections.`);let existing=getMutedActions(current).find(action=>target?.detectionKey!==void 0&&action.detectionKeys.includes(target.detectionKey));existing&&warnings.push({reason:"already_muted",message:`This detection is already muted ${typeof existing.expiresAt=="number"?`until ${formatDate(existing.expiresAt)}`:"until it is unmuted"}. It stays muted until the later of the two mutes ends; run \`${packageName} alerts unmute ${groupArg}\` first to shorten it.`})}let expiresAt=getMuteExpiresAt(muteMs),existingMutes=detection?[]:getMutedActions(current),existingRuleIds=[...new Set(existingMutes.filter(mute=>endsBefore(mute.expiresAt,expiresAt)).flatMap(mute=>mute.ruleIds))],longerMutes=existingMutes.filter(mute=>endsBefore(expiresAt,mute.expiresAt)),longerRuleIds=[...new Set(longerMutes.flatMap(mute=>mute.ruleIds))].filter(ruleId=>!existingRuleIds.includes(ruleId)),createsMutes=!!detection||existingMutes.length===0||getMuteCoverage(current)!=="all";if(failure.createsMutes=createsMutes,createsMutes&&!current.revision)throw failure.phase="mute",Object.assign(new Error("Missing alert group revision"),{status:400,code:"MISSING_REVISION"});if(longerRuleIds.length>0){let lastsForever=longerMutes.some(mute=>mute.expiresAt===null),latest=Math.max(...longerMutes.map(mute=>mute.expiresAt).filter(at=>typeof at=="number")),count=longerRuleIds.length;warnings.push({reason:"longer_mute_kept",message:`${count} existing ${count===1?"mute already lasts":"mutes already last"} ${lastsForever?"until unmuted":`until ${formatDate(latest)}`}, so ${count===1?"it was":"they were"} left as is.${createsMutes?` The new mute also covers ${count===1?"its detections":"their detections"}, which stay muted until the longer ${count===1?"mute ends":"mutes end"}.`:""} Run \`${packageName} alerts unmute ${groupArg}\` first to shorten ${count===1?"it":"them"}.`})}let mutesById=new Map,group2=current;if(createsMutes||existingRuleIds.length>0){let durationDescription=muteMs===null?"until unmuted":`for ${remoteText((flags["--duration"]??DEFAULT_MUTE_DURATION).trim().toLowerCase())} after approval`,approvedGroup2=await approveMuteChange(client,current,scope.teamId,groupId,"mute",flags,jsonOutput,[`Alert group ${remoteText(groupId)} belongs to project ${remoteText(current.projectId??"unknown")} in team ${remoteText(scope.teamId)}.`,...existingRuleIds.map(ruleId=>`Extends mute rule ${remoteText(ruleId)} to last ${durationDescription}.`),...createsMutes?[detection?`Mutes the pattern for detection ${remoteText(detection)} ${durationDescription}.`:`Mutes the group's ${getGroupMutePatterns(current).length} distinct project/detection patterns ${durationDescription}.`]:[],"Matching future detections in the project are suppressed, including in other alert groups.","Existing rules may have been created by other users.",...existingRuleIds.length>0?["Extending a monitor-wide mute also suppresses detections in the other projects covered by that monitor."]:[]],existingRuleIds);if(typeof approvedGroup2=="number")return approvedGroup2;group2=approvedGroup2,expiresAt=getMuteExpiresAt(muteMs);let refreshedRuleIds=new Set(existingMutes.filter(mute=>endsBefore(mute.expiresAt,expiresAt)).flatMap(mute=>mute.ruleIds));if(refreshedRuleIds.size!==existingRuleIds.length||existingRuleIds.some(ruleId=>!refreshedRuleIds.has(ruleId)))return muteEffectsChanged(client,jsonOutput)}let approvedRevision=group2.revision??current.revision;if(existingRuleIds.length>0){showProgress&&output_manager_default.spinner("Updating mutes\u2026"),failure.phase="updateMute",failure.progress={done:0,total:existingRuleIds.length};for(let ruleIds2 of chunk(existingRuleIds,MAX_RULE_IDS_PER_REQUEST)){let result=await client.fetch(path,{method:"PATCH",body:{type:"updateMute",ruleIds:ruleIds2,expiresAt},retry:MUTE_RETRY,bailOn429:!0});for(let mute of result.mutes??[])mutesById.set(mute.ruleId,mute);group2=result.group??group2,failure.progress.done+=ruleIds2.length}}if(createsMutes){showProgress&&output_manager_default.spinner("Muting alert group\u2026"),failure.phase="mute";let result=await client.fetch(path,{method:"PATCH",headers:{"If-Match":approvedRevision,"Idempotency-Key":randomUUID()},body:{type:"mute",expiresAt,...detection?{detectionId:detection}:{}},retry:MUTE_RETRY,bailOn429:!0});for(let mute of result.mutes??[])mutesById.set(mute.ruleId,mute);group2=result.group??group2}output_manager_default.stopSpinner();let mutes=[...mutesById.values()],outcome=createsMutes?"muted":existingRuleIds.length>0?"updated":"unchanged";if(jsonOutput)return printJson(client,{group:group2,mutes,outcome,...warnings.length>0?{warnings}:{},next:inspectNext(client,groupId)});if(outcome==="unchanged"){output_manager_default.print(` Alert group ${id} is already muted for at least that long.
|
|
11
|
+
`);for(let warning of warnings)output_manager_default.warning(warning.message);return printStdoutIdentifier(client,id),0}let returnedExpiry=mutes.find(mute=>mute.expiresAt!==void 0)?.expiresAt;printAlignedLabel(createsMutes?"Muted":"Mute updated",id,{gutter:"\u2713"}),printAlignedLabel("Title",remoteText(getGroupTitle(group2))),printAlignedLabel("Until",formatExpiry(returnedExpiry!==void 0?returnedExpiry:expiresAt)),detection&&printAlignedLabel("Detection",remoteText(detection)),existingRuleIds.length>0&&printAlignedLabel("Updated",`${existingRuleIds.length} existing ${existingRuleIds.length===1?"mute":"mutes"}`),output_manager_default.print(`
|
|
12
|
+
Matching future detections in the project are suppressed, including in other alert groups.
|
|
13
|
+
`);for(let warning of warnings)output_manager_default.warning(warning.message);return printStdoutIdentifier(client,id),0}let ruleIds=getMuteRuleIds(current);if(ruleIds.length===0)return jsonOutput?printJson(client,{group:current,removedRuleIds:[],outcome:"unchanged"}):(output_manager_default.print(` Alert group ${id} has no mutes created from it that you can read.
|
|
14
|
+
`),printStdoutIdentifier(client,id),0);let approvedGroup=await approveMuteChange(client,current,scope.teamId,groupId,"unmute",flags,jsonOutput,[`Removes ${ruleIds.length} mute ${ruleIds.length===1?"rule":"rules"} created from this group in team ${remoteText(scope.teamId)}, including rules created by other users.`,`The group belongs to project ${remoteText(current.projectId??"unknown")}. Monitor-wide mutes can also affect other projects.`,...ruleIds.map(ruleId=>`Removes mute rule ${remoteText(ruleId)}.`),"Future matching detections will no longer be suppressed by these rules, including in other alert groups."]);if(typeof approvedGroup=="number")return approvedGroup;showProgress&&output_manager_default.spinner("Unmuting alert group\u2026"),failure.phase="unmute",failure.progress={done:0,total:ruleIds.length};let group=approvedGroup,removedRuleIds=[];for(let batch of chunk(ruleIds,MAX_RULE_IDS_PER_REQUEST)){let result=await client.fetch(path,{method:"PATCH",body:{type:"unmute",ruleIds:batch},retry:{retries:0}});removedRuleIds.push(...result.removedRuleIds??batch),group=result.group??group,failure.progress.done=removedRuleIds.length}return output_manager_default.stopSpinner(),jsonOutput?printJson(client,{group,removedRuleIds,outcome:"unmuted",next:inspectNext(client,groupId)}):(printAlignedLabel("Unmuted",id,{gutter:"\u2713"}),printAlignedLabel("Title",remoteText(getGroupTitle(group))),printAlignedLabel("Removed",`${removedRuleIds.length} ${removedRuleIds.length===1?"mute":"mutes"}`),printStdoutIdentifier(client,id),0)}catch(err){if(output_manager_default.stopSpinner(),isAPIError(err))return handleApiError(client,jsonOutput,groupId,err,failure);if(failure.phase==="mute"||failure.phase==="updateMute"||failure.phase==="unmute")return output_manager_default.debug(err),handleApiError(client,jsonOutput,groupId,{status:0,code:"NETWORK_ERROR"},failure);throw err}}export{groupAction as default,getMuteExpiresAt,parseMuteDuration};
|
|
@@ -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{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-
|
|
7
|
+
import{a}from"./chunk-GB77JTTX.js";import{Bt,Vt}from"./chunk-R2LNF5VK.js";import"./chunk-W2YAOE3Z.js";import"./chunk-DXFFWNK4.js";import"./chunk-7Q5I3L37.js";import"./chunk-UGJRAFRA.js";import"./chunk-XHXWUAJE.js";import{e}from"./chunk-S7FMMAST.js";import{N}from"./chunk-6OOJFAF5.js";import"./chunk-NXUDP37D.js";import"./chunk-75TGTOZQ.js";import{d}from"./chunk-YBWLW6SW.js";import"./chunk-BKJ4H6KK.js";import"./chunk-S4ARHJGW.js";import"./chunk-BFS4K2RF.js";import"./chunk-64GNDWWX.js";import"./chunk-M2XLLWK7.js";import"./chunk-TTM4VQ4T.js";import"./chunk-6JBKQ5LR.js";import"./chunk-RFD7CEL6.js";import"./chunk-IFMPBA4K.js";import"./chunk-7Y572CPZ.js";import"./chunk-NBPLUP7C.js";var o=d(N()),s={sandbox:o.positional({type:a}),groupname:o.positional({displayName:"groupname",description:"Linux group name"}),scope:Bt},c=o.command({name:"create",description:"Create a Linux group and its shared directory",args:s,async handler({sandbox:e2,groupname:t,scope:{token:n,team:r,project:i}}){let o2=await(await Vt.get({name:e2,projectId:i,teamId:r,token:n,resume:!0})).createGroup(t);process.stdout.write(`${o2.groupname} ${o2.sharedDir}
|
|
8
8
|
`)}}),l={...s,username:o.positional({displayName:"username",description:"Linux user name"})},u=o.command({name:"add-user",description:"Add a user to a group",args:l,async handler({sandbox:e2,groupname:t,username:n,scope:{token:r,team:i,project:o2}}){await(await Vt.get({name:e2,projectId:o2,teamId:i,token:r,resume:!0})).addUserToGroup(n,t),process.stdout.write(`${n} ${t}
|
|
9
9
|
`)}}),d2=o.command({name:"remove-user",description:"Remove a user from a group",args:l,async handler({sandbox:e2,groupname:t,username:n,scope:{token:r,team:i,project:o2}}){await(await Vt.get({name:e2,projectId:o2,teamId:i,token:r,resume:!0})).removeUserFromGroup(n,t),process.stdout.write(`${n} ${t}
|
|
10
10
|
`)}}),f=o.subcommands({...e.groups,cmds:{create:c,"add-user":u,"remove-user":d2}});export{f as groups};
|
|
@@ -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{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-
|
|
7
|
+
import{getInvalidSubcommand}from"./chunk-TG2RCYTH.js";import{getSubcommand}from"./chunk-ETV3C2CV.js";import{getCommandAliases}from"./chunk-R6LM3MBK.js";import"./chunk-XHWA436J.js";import"./chunk-4MAA4BQD.js";import"./chunk-OXQKWOLS.js";import"./chunk-GO64LSUW.js";import"./chunk-M3LYYAQ6.js";import"./chunk-TUPVVZ4I.js";import"./chunk-HXIOR7P6.js";import"./chunk-CHTFRAXA.js";import"./chunk-T2IZUTGY.js";import"./chunk-3F3WNT5K.js";import{imageRmSubcommand}from"./chunk-P7GA2C6N.js";import"./chunk-RPYIWRSN.js";import"./chunk-CDO5IECP.js";import"./chunk-6XXXPJBV.js";import"./chunk-L74PQVPL.js";import"./chunk-HT5EXCYX.js";import"./chunk-TTJWZ3ZW.js";import"./chunk-R3ZPLQDI.js";import"./chunk-QPPFQREO.js";import"./chunk-X2UJGCIC.js";import"./chunk-XZYVBYUY.js";import"./chunk-EZ3HXFLB.js";import"./chunk-WMIZ6Y4E.js";import"./chunk-QPNYOR6O.js";import"./chunk-JGEJY7AC.js";import"./chunk-LBJ7EOZM.js";import{AGENT_REASON,buildCommandWithGlobalFlags,outputAgentError}from"./chunk-E6VQXHBD.js";import{warnDeprecatedSubcommand}from"./chunk-BDLZ6WL2.js";import"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-FUH5PBGR.js";import"./chunk-7TREJIPV.js";import"./chunk-7QHUMMBA.js";import"./chunk-AUCQKYL2.js";import"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import"./chunk-NBPLUP7C.js";var IMAGE_CONFIG={ls:["ls","list"],inspect:["inspect","get"],delete:getCommandAliases(imageRmSubcommand)};async function image(client,argv,telemetry){let{subcommand,args,subcommandOriginal}=getSubcommand(argv,IMAGE_CONFIG);if(subcommand==null){let message=argv.length===0?getInvalidSubcommand(IMAGE_CONFIG):`Unknown "vcr image" subcommand "${argv[0]}".`;return outputAgentError(client,{status:"error",reason:AGENT_REASON.INVALID_ARGUMENTS,message,next:[{command:buildCommandWithGlobalFlags(client.argv,"vcr image --help"),when:"Show valid image subcommands"}]},2),output_manager_default.error(`${message} Run \`vercel vcr image --help\`.`),2}switch(subcommand){case"ls":return(await import("./ls-5UEICZHX.js")).default(client,args,telemetry);case"inspect":return subcommandOriginal==="get"&&warnDeprecatedSubcommand(client,"vcr image get","vcr image inspect"),(await import("./inspect-TDDHNNQS.js")).default(client,args,telemetry);case"delete":return subcommandOriginal==="remove"&&warnDeprecatedSubcommand(client,"vcr image remove","vcr image delete"),(await import("./rm-M7QVN2N6.js")).default(client,args,telemetry);default:return output_manager_default.error(`Unhandled image subcommand: ${subcommand}`),1}}export{image as default};
|
|
@@ -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{repositoryPath,repositoryTagPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatBytes,formatImageStatus,formatRelativeTime,formatTagReference,handleVcrApiError,requireVcrRepositoryAndTag,resolveVcrScope,validateVcrJsonOutput}from"./chunk-
|
|
7
|
+
import{repositoryPath,repositoryTagPath}from"./chunk-DFVNL5ML.js";import{emitVcrArgParseError,formatBytes,formatImageStatus,formatRelativeTime,formatTagReference,handleVcrApiError,requireVcrRepositoryAndTag,resolveVcrScope,validateVcrJsonOutput}from"./chunk-TXROE436.js";import"./chunk-6JY43KSR.js";import"./chunk-3WXQHKSS.js";import"./chunk-FIICEEXO.js";import"./chunk-RFD7CEL6.js";import{tagsInspectSubcommand}from"./chunk-3F3WNT5K.js";import"./chunk-CRPZYLIL.js";import"./chunk-HDKEES7E.js";import"./chunk-SUD5V67L.js";import"./chunk-7TRHPXCG.js";import"./chunk-UGVOMXYR.js";import"./chunk-QRPBDCDH.js";import"./chunk-2GXP676X.js";import"./chunk-K5GE24PG.js";import"./chunk-IFMPBA4K.js";import"./chunk-KHJWQ4WP.js";import"./chunk-MY4MONOH.js";import"./chunk-YATYCZQJ.js";import"./chunk-2ILZM77F.js";import{printError}from"./chunk-7EI554V5.js";import{parseArguments}from"./chunk-E7ICSU45.js";import"./chunk-E6VQXHBD.js";import"./chunk-BDLZ6WL2.js";import"./chunk-PH2MLBQO.js";import"./chunk-DCFCPAFQ.js";import"./chunk-GOXGA37R.js";import{isAPIError}from"./chunk-MTPHHAPR.js";import"./chunk-EFGZK6OY.js";import"./chunk-JCDPMWKO.js";import{output_manager_default}from"./chunk-RIXTYUYN.js";import"./chunk-7Y572CPZ.js";import"./chunk-BVFFSUG3.js";import"./chunk-RRX2AMWY.js";import"./chunk-GUFRGEM5.js";import"./chunk-SUT2PTL3.js";import"./chunk-AX6UCTOC.js";import"./chunk-4SIQE2W4.js";import"./chunk-MF43WTDT.js";import"./chunk-AUCQKYL2.js";import{getFlagsSpecification}from"./chunk-CUO3CYU3.js";import"./chunk-2BKALEOP.js";import{require_source}from"./chunk-UJ7YUIEJ.js";import"./chunk-L6MWUMWZ.js";import"./chunk-L4CSJDG7.js";import"./chunk-YHZXIBS7.js";import"./chunk-LPYHYTYI.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_chalk=__toESM(require_source(),1);function printTag(tag,scope,repository){output_manager_default.print(`
|
|
8
8
|
`),output_manager_default.print(` ${import_chalk.default.cyan("ID")} ${tag.imageId}
|
|
9
9
|
`),output_manager_default.print(` ${import_chalk.default.cyan("Digest")} ${tag.manifestDigest}
|
|
10
10
|
`),output_manager_default.print(` ${import_chalk.default.cyan("Image")} ${formatTagReference(scope.teamSlug,scope.projectName,repository.name,tag.tag)}
|