disk1.14.026.5 kB
import { O as REGION_URLS, p as Archil } from "./src-DGB_iQTG.mjs";
import { chmod, mkdir, open, readFile, rename, rm, stat } from "node:fs/promises";
import { dirname, join } from "node:path";
import { homedir } from "node:os";
//#region src/cli/command.ts
/** A usage problem with the command line itself (unknown option, missing argument). */
var CliUsageError = class extends Error {};
function camelCase(name) {
return name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
}
var Option = class {
flags;
description;
short;
long;
attribute;
valueName;
negate;
envVar;
parser;
defaultValue;
constructor(flags, description = "") {
this.flags = flags;
this.description = description;
const match = /^(?:-([A-Za-z]),\s*)?--([A-Za-z][\w-]*)(?:\s+<([^>]+)>)?$/.exec(flags);
if (!match) throw new Error(`Unsupported option flags '${flags}'`);
this.short = match[1];
this.long = match[2];
this.valueName = match[3];
this.negate = this.long.startsWith("no-");
this.attribute = camelCase(this.negate ? this.long.slice(3) : this.long);
if (this.negate) this.defaultValue = true;
}
/** Fall back to this environment variable when the option isn't given. */
env(name) {
this.envVar = name;
return this;
}
get takesValue() {
return this.valueName !== void 0;
}
};
function parseArgument(spec) {
const match = /^([<[])([^>\]]+?)(\.\.\.)?[>\]]$/.exec(spec);
if (!match) throw new Error(`Unsupported argument '${spec}'`);
return {
name: match[2],
required: match[1] === "<",
variadic: match[3] !== void 0
};
}
function argumentUsage(argument) {
const name = `${argument.name}${argument.variadic ? "..." : ""}`;
return argument.required ? `<${name}>` : `[${name}]`;
}
const HELP_OPTION = new Option("-h, --help", "display help for command");
const VERSION_FLAGS = "-V, --version";
/** Lay out `[term, description]` rows as an indented two-column list. */
function formatList(rows) {
const width = Math.max(...rows.map(([term]) => term.length));
return rows.map(([term, description]) => ` ${term.padEnd(width)} ${description}`.trimEnd()).join("\n");
}
var Command = class Command {
commands = [];
parent;
_name;
_description = "";
_version;
_arguments = [];
_options = [];
_action;
_preActionHooks = [];
_helpAfter = "";
_showGlobalOptions = false;
_values = {};
_fromCli = /* @__PURE__ */ new Set();
constructor(name = "") {
this._name = name;
}
name(name) {
if (name === void 0) return this._name;
this._name = name;
return this;
}
description(text) {
this._description = text;
return this;
}
version(version) {
this._version = Object.assign(new Option(VERSION_FLAGS, "output the version number"), { version });
return this;
}
hook(event, hook) {
this._preActionHooks.push(hook);
return this;
}
/** Add a subcommand, e.g. `get <id|name>` or `run <id> <command...>`, and return it. */
command(spec) {
const [name, ...args] = spec.trim().split(/\s+/);
const command = new Command(name);
for (const arg of args) command._arguments.push(parseArgument(arg));
command.parent = this;
this.commands.push(command);
return command;
}
option(flags, description, parserOrDefault, defaultValue) {
const option = new Option(flags, description);
if (typeof parserOrDefault === "function") {
option.parser = parserOrDefault;
if (defaultValue !== void 0) option.defaultValue = defaultValue;
} else if (parserOrDefault !== void 0) option.defaultValue = parserOrDefault;
return this.addOption(option);
}
addOption(option) {
this._options.push(option);
return this;
}
configureHelp(settings) {
this._showGlobalOptions = settings.showGlobalOptions ?? this._showGlobalOptions;
return this;
}
addHelpText(position, text) {
this._helpAfter += text;
return this;
}
action(handler) {
this._action = handler;
return this;
}
opts() {
return { ...this._values };
}
/** Parse `argv` (`[node, script, ...args]`) and run the selected command's action. */
async parseAsync(argv) {
await this._run(argv.slice(2));
return this;
}
_ancestors() {
const chain = [];
for (let command = this; command; command = command.parent) chain.unshift(command);
return chain;
}
_commandPath() {
return this._ancestors().map((command) => command._name).join(" ");
}
_root() {
return this._ancestors()[0];
}
_reset() {
this._values = {};
this._fromCli.clear();
for (const option of this._options) if (option.defaultValue !== void 0) this._values[option.attribute] = option.defaultValue;
}
/** Find an option on this command or an ancestor, by `--long` name or `-s` flag. */
_findOption(matches) {
for (const owner of this._ancestors().reverse()) {
const option = owner._options.find(matches);
if (option) return {
owner,
option
};
}
}
_setOption(owner, option, value) {
if (!option.takesValue) owner._values[option.attribute] = !option.negate;
else {
const previous = owner._values[option.attribute];
owner._values[option.attribute] = option.parser ? option.parser(value, previous) : value;
}
owner._fromCli.add(option.attribute);
}
_applyEnvironment() {
for (const option of this._options) {
if (!option.envVar || this._fromCli.has(option.attribute)) continue;
const value = process.env[option.envVar];
if (value === void 0) continue;
this._values[option.attribute] = option.parser ? option.parser(value, this._values[option.attribute]) : value;
}
}
async _run(args) {
this._reset();
const operands = [];
let index = 0;
const takeValue = (option, inline) => {
if (inline !== void 0) return inline;
const value = args[index++];
if (value === void 0) throw new CliUsageError(`error: option '${option.flags}' argument missing`);
return value;
};
while (index < args.length) {
const token = args[index++];
if (token === "--") {
operands.push(...args.slice(index));
break;
}
if (token.startsWith("--")) {
const eq = token.indexOf("=");
const long = token.slice(2, eq === -1 ? void 0 : eq);
const inline = eq === -1 ? void 0 : token.slice(eq + 1);
if (long === "help") return this._printHelp();
if (long === "version" && this._root()._version) return this._printVersion();
const found = this._findOption((option) => option.long === long);
if (!found) throw new CliUsageError(`error: unknown option '--${long}'`);
if (!found.option.takesValue && inline !== void 0) throw new CliUsageError(`error: option '${found.option.flags}' does not take an argument`);
this._setOption(found.owner, found.option, found.option.takesValue ? takeValue(found.option, inline) : void 0);
continue;
}
if (token.startsWith("-") && token.length > 1) {
for (let position = 1; position < token.length; position++) {
const flag = token[position];
if (flag === "h") return this._printHelp();
if (flag === "V" && this._root()._version) return this._printVersion();
const found = this._findOption((option) => option.short === flag);
if (!found) throw new CliUsageError(`error: unknown option '${position === 1 ? token : `-${flag}`}'`);
if (found.option.takesValue) {
const rest = token.slice(position + 1);
this._setOption(found.owner, found.option, takeValue(found.option, rest === "" ? void 0 : rest));
break;
}
this._setOption(found.owner, found.option, void 0);
}
continue;
}
if (operands.length === 0 && this.commands.length > 0) {
if (token === "help") return (this.commands.find((command) => command._name === args[index]) ?? this)._printHelp();
const subcommand = this.commands.find((command) => command._name === token);
if (!subcommand) throw new CliUsageError(`error: unknown command '${token}'`);
return subcommand._run(args.slice(index));
}
operands.push(token);
}
for (const command of this._ancestors()) command._applyEnvironment();
if (!this._action) {
if (this.commands.length > 0) throw new CliUsageError(this.helpInformation());
return;
}
const values = [];
for (const [position, argument] of this._arguments.entries()) if (argument.variadic) {
const rest = operands.slice(position);
if (argument.required && rest.length === 0) throw new CliUsageError(`error: missing required argument '${argument.name}'`);
values.push(rest);
} else {
const value = operands[position];
if (argument.required && value === void 0) throw new CliUsageError(`error: missing required argument '${argument.name}'`);
values.push(value);
}
if (!this._arguments[this._arguments.length - 1]?.variadic && operands.length > this._arguments.length) throw new CliUsageError(`error: too many arguments for '${this._name}'. Expected ${this._arguments.length} argument${this._arguments.length === 1 ? "" : "s"} but got ${operands.length}.`);
for (const command of this._ancestors()) for (const hook of command._preActionHooks) await hook(command, this);
await this._action(...values, this.opts(), this);
}
_printHelp() {
process.stdout.write(`${this.helpInformation()}${this._helpAfter}`);
}
_printVersion() {
process.stdout.write(`${this._root()._version.version}\n`);
}
_optionRows(options) {
return options.map((option) => {
const term = `${option.short ? `-${option.short}, ` : ""}--${option.long}${option.takesValue ? ` <${option.valueName}>` : ""}`;
const extras = [];
if (option.takesValue && option.defaultValue !== void 0 && !(Array.isArray(option.defaultValue) && option.defaultValue.length === 0)) extras.push(`default: ${JSON.stringify(option.defaultValue)}`);
if (option.envVar) extras.push(`env: ${option.envVar}`);
return [term, extras.length > 0 ? `${option.description} (${extras.join(", ")})` : option.description];
});
}
/** The command's help text. */
helpInformation() {
const usage = [this._commandPath(), "[options]"];
if (this.commands.length > 0) usage.push("[command]");
usage.push(...this._arguments.map(argumentUsage));
const sections = [`Usage: ${usage.join(" ")}`];
if (this._description) sections.push(this._description);
const ownOptions = [...this._options];
if (this === this._root() && this._version) ownOptions.push(this._version);
sections.push(`Options:\n${formatList(this._optionRows([...ownOptions, HELP_OPTION]))}`);
if (this._ancestors().some((command) => command._showGlobalOptions)) {
const inherited = this._ancestors().slice(0, -1).flatMap((command) => command._options);
if (inherited.length > 0) sections.push(`Global Options:\n${formatList(this._optionRows(inherited))}`);
}
if (this.commands.length > 0) {
const rows = this.commands.map((command) => [[
command._name,
...command._options.length > 0 ? ["[options]"] : [],
...command._arguments.map(argumentUsage)
].join(" "), command._description]);
rows.push(["help [command]", "display help for command"]);
sections.push(`Commands:\n${formatList(rows)}`);
}
return `${sections.join("\n\n")}\n`;
}
};
//#endregion
//#region src/cli/spinner.ts
const FRAMES = [
"◒",
"◐",
"◓",
"◑"
];
const CLEAR_LINE = "\r\x1B[2K";
const HIDE_CURSOR = "\x1B[?25l";
const SHOW_CURSOR = "\x1B[?25h";
/** A single-line progress spinner for a TTY stream. */
function spinner(output) {
let timer;
const finish = (line) => {
if (timer === void 0) return;
clearInterval(timer);
timer = void 0;
output.write(`${CLEAR_LINE}${line}${SHOW_CURSOR}`);
};
return {
start(label) {
let frame = 0;
const draw = () => output.write(`${CLEAR_LINE}${FRAMES[frame++ % FRAMES.length]} ${label}`);
output.write(HIDE_CURSOR);
draw();
timer = setInterval(draw, 80);
},
stop(message) {
finish(`◇ ${message}\n`);
},
error(message) {
finish(`■ ${message}\n`);
},
clear() {
finish("");
}
};
}
//#endregion
//#region src/cli/config-paths.ts
function diskConfigDir(env = process.env, platform = process.platform, home = homedir()) {
if (env.ARCHIL_DISK_CONFIG_DIR) return env.ARCHIL_DISK_CONFIG_DIR;
if (platform === "win32") return join(env.APPDATA ?? join(home, "AppData", "Roaming"), "Archil", "disk");
if (platform === "darwin") return join(home, "Library", "Application Support", "Archil", "disk");
return join(env.XDG_CONFIG_HOME ?? join(home, ".config"), "archil", "disk");
}
function profileConfigPath(env = process.env) {
return join(diskConfigDir(env), "config.json");
}
function credentialFilePath(profile, env = process.env) {
return join(diskConfigDir(env), "credentials", `${encodeURIComponent(profile)}.key`);
}
//#endregion
//#region src/cli/credentials.ts
function validateApiKey(value) {
const key = value.trim();
if (!key) throw new Error("API key is empty");
if (/\s/.test(key)) throw new Error("API key must not contain whitespace");
return key;
}
async function readProfileCredential(profile, env = process.env) {
const path = credentialFilePath(profile, env);
try {
if (process.platform !== "win32") {
if (((await stat(path)).mode & 63) !== 0) throw new Error(`Refusing to read credential file ${path}: permissions must be 0600`);
}
return validateApiKey(await readFile(path, "utf8"));
} catch (error) {
if (error.code === "ENOENT") throw new Error(`Missing API key for profile '${profile}': delete and recreate it with 'profile create --profile ${profile}'`);
throw error;
}
}
async function writeProfileCredential(profile, secret, env = process.env) {
const path = credentialFilePath(profile, env);
await mkdir(dirname(path), {
recursive: true,
mode: 448
});
const temporary = `${path}.${process.pid}.${Date.now()}.tmp`;
const handle = await open(temporary, "wx", 384);
try {
await handle.writeFile(`${validateApiKey(secret)}\n`);
await handle.sync();
} finally {
await handle.close();
}
await rename(temporary, path);
}
async function deleteProfileCredential(profile, env = process.env) {
await rm(credentialFilePath(profile, env), { force: true });
}
async function resolveCliCredentials(options, profiles, env = process.env, readCredential = readProfileCredential) {
const selected = options.profile ?? env.ARCHIL_PROFILE ?? profiles.currentProfile;
const profile = selected ? profiles.profiles[selected] : void 0;
if (selected && !profile) throw new Error(`Profile '${selected}' does not exist`);
const apiKey = options.apiKey ?? env.ARCHIL_API_KEY ?? (profile && selected ? await readCredential(selected, env) : void 0);
const region = options.region ?? env.ARCHIL_REGION ?? profile?.region;
const baseUrl = options.baseUrl ?? env.ARCHIL_BASE_URL ?? profile?.baseUrl;
if (!apiKey) throw new Error("Missing API key: pass --api-key, set ARCHIL_API_KEY, or run 'profile create'");
if (!region) throw new Error("Missing region: pass --region, set ARCHIL_REGION, or select a profile");
return {
apiKey: validateApiKey(apiKey),
region,
baseUrl,
profile: selected
};
}
async function promptSecret(prompt = "API key: ", input = process.stdin, output = process.stderr) {
if (!input.isTTY) {
const chunks = [];
for await (const chunk of input) chunks.push(Buffer.from(chunk));
return validateApiKey(Buffer.concat(chunks).toString("utf8"));
}
return readMaskedLine(prompt, input, output);
}
/**
* Read a line from a TTY in raw mode, echoing `*` per character. An invalid key
* prints the reason and asks again; Ctrl-C cancels.
*/
function readMaskedLine(prompt, input, output) {
return new Promise((resolve, reject) => {
const wasRaw = input.isRaw;
let value = "";
const finish = (settle) => {
input.off("data", onData);
input.setRawMode(wasRaw);
input.pause();
output.write("\n");
settle();
};
const onData = (chunk) => {
for (const char of chunk.toString("utf8")) {
if (char === "" || char === "" && value === "") {
finish(() => reject(/* @__PURE__ */ new Error("Profile creation cancelled")));
return;
}
if (char === "\r" || char === "\n") try {
const key = validateApiKey(value);
finish(() => resolve(key));
return;
} catch (error) {
output.write(`\n${error instanceof Error ? error.message : String(error)}\n${prompt}`);
value = "";
}
else if (char === "" || char === "\b") {
if (value) {
value = value.slice(0, -1);
output.write("\b \b");
}
} else if (char >= " ") {
value += char;
output.write("*");
}
}
};
output.write(prompt);
input.setRawMode(true);
input.resume();
input.on("data", onData);
});
}
//#endregion
//#region src/cli/credential-validation.ts
async function validateCredentialAndResolveRegion(options, probe = async ({ apiKey, region, baseUrl }) => {
await new Archil({
apiKey,
region,
baseUrl
}).disks.list({ limit: 1 });
}) {
const apiKey = validateApiKey(options.apiKey);
if (options.region) {
await probe({
...options,
apiKey,
region: options.region
});
return options.region;
}
if (options.baseUrl) throw new Error("Profile creation with --base-url also requires --region because custom environments cannot be auto-detected");
const failures = [];
for (const region of Object.keys(REGION_URLS)) try {
await probe({
apiKey,
region
});
return region;
} catch (error) {
failures.push(error);
}
throw new AggregateError(failures, "API key was not accepted in any known production region; pass --region for a custom environment");
}
//#endregion
//#region src/cli/output.ts
function renderTable(rows, headers) {
const all = headers ? [headers, ...rows] : rows;
if (all.length === 0) return "";
const columnCount = Math.max(...all.map((row) => row.length));
const widths = Array.from({ length: columnCount }, (_, index) => Math.max(...all.map((row) => (row[index] ?? "").length)));
const border = (left, middle, right) => left + widths.map((width) => "─".repeat(width + 2)).join(middle) + right;
const line = (row) => "│ " + widths.map((width, index) => (row[index] ?? "").padEnd(width)).join(" │ ") + " │";
const output = [border("╭", "┬", "╮")];
if (headers) output.push(line(headers), border("├", "┼", "┤"));
output.push(...rows.map(line), border("╰", "┴", "╯"));
return output.join("\n");
}
//#endregion
//#region src/cli/profiles.ts
const EMPTY_PROFILE_CONFIG = {
version: 1,
profiles: {}
};
function parseConfig(value) {
if (!value || typeof value !== "object") throw new Error("Profile configuration must be a JSON object");
const raw = value;
if (raw.version !== 1) throw new Error(`Unsupported profile configuration version: ${String(raw.version)}`);
if (!raw.profiles || typeof raw.profiles !== "object" || Array.isArray(raw.profiles)) throw new Error("Profile configuration has an invalid profiles field");
for (const [name, profile] of Object.entries(raw.profiles)) {
if (!profile || typeof profile !== "object") throw new Error(`Profile '${name}' is invalid`);
const p = profile;
if (typeof p.region !== "string" || !p.region) throw new Error(`Profile '${name}' has no region`);
}
if (raw.currentProfile !== void 0 && typeof raw.currentProfile !== "string") throw new Error("Profile configuration has an invalid currentProfile field");
return value;
}
async function loadProfiles(env = process.env) {
const path = profileConfigPath(env);
try {
return parseConfig(JSON.parse(await readFile(path, "utf8")));
} catch (error) {
if (error.code === "ENOENT") return {
...EMPTY_PROFILE_CONFIG,
profiles: {}
};
if (error instanceof SyntaxError) throw new Error(`Malformed profile configuration at ${path}`);
throw error;
}
}
async function saveProfiles(config, env = process.env) {
const path = profileConfigPath(env);
await mkdir(dirname(path), {
recursive: true,
mode: 448
});
const temporary = `${path}.${process.pid}.${Date.now()}.tmp`;
const handle = await open(temporary, "wx", 384);
try {
await handle.writeFile(`${JSON.stringify(config, null, 2)}\n`);
await handle.sync();
} finally {
await handle.close();
}
await rename(temporary, path);
if (process.platform !== "win32") {
if (((await stat(path)).mode & 511) !== 384) await chmod(path, 384);
}
}
async function deleteProfile(name, env = process.env) {
const config = await loadProfiles(env);
const profile = config.profiles[name];
if (!profile) return void 0;
delete config.profiles[name];
if (config.currentProfile === name) config.currentProfile = void 0;
await saveProfiles(config, env);
return profile;
}
//#endregion
//#region src/cli/common.ts
function addGlobalOptions(program) {
program.configureHelp({ showGlobalOptions: true }).addOption(new Option("-k, --api-key <key>", "Archil API key (prefer profiles, environment variables, or stdin)").env("ARCHIL_API_KEY")).addOption(new Option("-r, --region <region>", "Archil region").env("ARCHIL_REGION")).addOption(new Option("--base-url <url>", "Override control-plane base URL").env("ARCHIL_BASE_URL")).addOption(new Option("--profile <name>", "Named Archil profile").env("ARCHIL_PROFILE"));
}
function isProfileCommand(command) {
return command.parent?.name() === "profile";
}
async function resolveProgramCredentials(program) {
return resolveCliCredentials(program.opts(), await loadProfiles());
}
function addProfileCommands(program, validateCredential = validateCredentialAndResolveRegion) {
const outputOption = (command) => command.option("-o, --output <format>", "Output format: table | text | json", (value) => {
if (value !== "table" && value !== "text" && value !== "json") throw new Error("Output format must be 'table', 'text', or 'json'");
return value;
}, "table");
const profiles = program.command("profile").description("Manage named Archil profiles and credentials");
outputOption(profiles.command("create").description("Create a named profile")).action(async (options) => {
const global = program.opts();
const config = await loadProfiles();
if (global.profile && config.profiles[global.profile]) throw new Error(`Profile '${global.profile}' already exists`);
const apiKey = validateApiKey(global.apiKey ?? await promptSecret());
const progress = !global.region && !global.baseUrl && process.stderr.isTTY ? spinner(process.stderr) : void 0;
progress?.start("Finding the API key's region");
let region;
try {
region = await validateCredential({
apiKey,
region: global.region,
baseUrl: global.baseUrl
});
progress?.stop("Found valid region");
} catch (error) {
progress?.error("No valid region found");
throw error;
}
let name = global.profile ?? region;
if (!global.profile) {
let suffix = 2;
while (config.profiles[name]) name = `${region}-${suffix++}`;
}
await writeProfileCredential(name, apiKey);
config.profiles[name] = {
region,
baseUrl: global.baseUrl
};
config.currentProfile = name;
await saveProfiles(config);
if (options.output === "json") console.log(JSON.stringify({
name,
region,
baseUrl: global.baseUrl,
current: true
}, null, 2));
else console.log(`Created profile '${name}' (${region})`);
});
outputOption(profiles.command("list").description("List profiles without revealing credentials")).action(async (options) => {
const config = await loadProfiles();
const items = Object.entries(config.profiles).sort(([a], [b]) => a.localeCompare(b)).map(([name, profile]) => ({
name,
region: profile.region,
baseUrl: profile.baseUrl,
current: config.currentProfile === name
}));
if (options.output === "json") console.log(JSON.stringify(items, null, 2));
else if (options.output === "text") for (const item of items) console.log(`${item.current ? "*" : " "} ${item.name}\t${item.region}\t${item.baseUrl ?? "default"}`);
else console.log(renderTable(items.map((item) => [
item.current ? "*" : "",
item.name,
item.region,
item.baseUrl ?? "default"
]), [
"current",
"name",
"region",
"base URL"
]));
});
outputOption(profiles.command("use <name>").description("Select the default profile")).action(async (name, options) => {
const config = await loadProfiles();
if (!config.profiles[name]) throw new Error(`Profile '${name}' does not exist`);
config.currentProfile = name;
await saveProfiles(config);
if (options.output === "json") console.log(JSON.stringify({
name,
current: true
}, null, 2));
else console.log(`Using profile '${name}'`);
});
outputOption(profiles.command("delete <name>").description("Delete a profile and its stored credential")).action(async (name, options) => {
if (!(await loadProfiles()).profiles[name]) throw new Error(`Profile '${name}' does not exist`);
await deleteProfileCredential(name);
await deleteProfile(name);
if (options.output === "json") console.log(JSON.stringify({
name,
deleted: true
}, null, 2));
else console.log(`Deleted profile '${name}'`);
});
}
//#endregion
//#region src/cli/sandbox-options.ts
function validateSandboxName(name) {
if (name === void 0) return void 0;
const value = name.trim();
if (!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(value)) throw new Error("Name must be 1–63 lowercase letters, numbers, or hyphens and cannot start or end with a hyphen");
return value;
}
function optionalInteger(value, label, min, max) {
if (value === void 0) return void 0;
const parsed = Number(value);
if (!Number.isInteger(parsed) || parsed < min || parsed > max) throw new Error(`${label} must be an integer from ${min} to ${max}`);
return parsed;
}
function optionalTimeoutAction(value) {
if (value === void 0 || value === "pause" || value === "delete") return value;
throw new Error("On timeout must be 'pause' or 'delete'");
}
function parseEnvironment(entries) {
if (entries.length === 0) return void 0;
const environment = {};
for (const entry of entries) {
const separator = entry.indexOf("=");
if (separator <= 0) throw new Error(`Invalid environment entry '${entry}'; use NAME=value`);
const name = entry.slice(0, separator);
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) throw new Error(`Invalid environment variable name '${name}'`);
environment[name] = entry.slice(separator + 1);
}
return environment;
}
function parseCreateSandboxOptions(name, options) {
return {
name: validateSandboxName(name),
vcpuCount: optionalInteger(options.vcpuCount, "CPU count", 1, 32),
memSizeMiB: optionalInteger(options.memSizeMib, "Memory", 256, 65536),
baseImage: options.baseImage,
maxTtlSeconds: optionalInteger(options.maxTtlSeconds, "Max TTL", 1, 2147483647),
idleTtlSeconds: optionalInteger(options.idleTtlSeconds, "Idle TTL", 0, 86400),
onTimeout: optionalTimeoutAction(options.onTimeout),
maxConcurrentExecs: optionalInteger(options.maxConcurrentProcesses, "Max concurrent processes", 1, 1024),
env: parseEnvironment(options.env)
};
}
function parseRunOptions(options) {
return {
env: parseEnvironment(options.env),
timeoutSeconds: optionalInteger(options.timeout, "Timeout", 1, 2147483647)
};
}
//#endregion
export { addGlobalOptions as a, resolveProgramCredentials as c, Command as d, validateSandboxName as i, renderTable as l, parseCreateSandboxOptions as n, addProfileCommands as o, parseRunOptions as r, isProfileCommand as s, optionalInteger as t, spinner as u };
Shown as plain text from the published tarball, after apm checked it against the version's checksum. Nothing in it runs on this page.