@computesdk/cli 2.7.1 → 2.7.3
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/cli-manifest.json +1 -1
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -189,7 +189,7 @@ function formatResources(r) {
|
|
|
189
189
|
function printLaneRouting(r, lane) {
|
|
190
190
|
const label = (text) => text.padEnd(12);
|
|
191
191
|
const managed = r.managed.length > 0 ? arrow(r.managed) : pc2.dim("no managed account is live");
|
|
192
|
-
const strategy = r.strategy ?? (r.routing === "default" ? "
|
|
192
|
+
const strategy = r.strategy ?? (r.routing === "default" ? "auto" : "custom");
|
|
193
193
|
const size = r.size !== void 0 && strategy === "cheapest" ? pc2.dim(` (priced at ${r.size})`) : "";
|
|
194
194
|
console.log(`${label("Routing")}${STRATEGY_LABEL[strategy]}`);
|
|
195
195
|
console.log(`${label("Order")}${managed}${size}`);
|
|
@@ -279,7 +279,7 @@ function registerSettingsCommands(group, lane, common2, deps) {
|
|
|
279
279
|
const set = common2(
|
|
280
280
|
settings.command("set").description(`Change the ${routerName} router (owner/admin)`).option(
|
|
281
281
|
"--routing <strategy|providers>",
|
|
282
|
-
"managed routing:
|
|
282
|
+
"managed routing: auto (default) | cheapest | your own managed-account order (e.g. daytona,e2b)"
|
|
283
283
|
).option("--byok <mode>", `use your own keys: ${BYOK_MODES.join(" | ")}`).option(
|
|
284
284
|
"--byok-order <providers>",
|
|
285
285
|
lane === "sandboxes" ? 'your own providers in order (e.g. tensorlake,blaxel); "inherit" uses the Actions BYOK order' : "your own providers in order (e.g. tensorlake,blaxel)"
|
|
@@ -396,9 +396,10 @@ var init_settings = __esm({
|
|
|
396
396
|
fallback: "managed accounts first, then your keys",
|
|
397
397
|
only: "your keys only, never managed accounts"
|
|
398
398
|
};
|
|
399
|
-
MANAGED_STRATEGIES = ["
|
|
399
|
+
MANAGED_STRATEGIES = ["auto", "cheapest", "computesdk"];
|
|
400
400
|
STRATEGY_LABEL = {
|
|
401
|
-
|
|
401
|
+
auto: "Auto (recommended)",
|
|
402
|
+
computesdk: "Auto (recommended)",
|
|
402
403
|
cheapest: "Cheapest",
|
|
403
404
|
custom: "Custom"
|
|
404
405
|
};
|
|
@@ -4929,7 +4930,7 @@ function resolveTwoArgTarget(argId, resourceId, opts, label) {
|
|
|
4929
4930
|
return { resolved: resolveSandbox(argId, opts), resource: resourceId };
|
|
4930
4931
|
}
|
|
4931
4932
|
function addCreateFlags(c) {
|
|
4932
|
-
return c.option("--provider <names>", "place only on these providers, through your router (its BYOK mode and order), e.g. daytona or daytona,e2b").option("--byok", "use only your own keys for this create").option("--managed", "use only ComputeSDK managed accounts for this create").option("--strategy <strategy>", "order managed accounts for this create:
|
|
4933
|
+
return c.option("--provider <names>", "place only on these providers, through your router (its BYOK mode and order), e.g. daytona or daytona,e2b").option("--byok", "use only your own keys for this create").option("--managed", "use only ComputeSDK managed accounts for this create").option("--strategy <strategy>", "order managed accounts for this create: auto (recommended), cheapest, or custom (your saved order)").option("--ignore <names>", "never place on these providers for this create, e.g. e2b or e2b,modal").addOption(new Option3("--order <providers>").hideHelp()).option("--size <size>", "platform size: small (1 vCPU/2 GiB), medium, large, xlarge, 2xlarge (16/32 GiB), 3xlarge (32/64 GiB); default medium").option("--region <regions>", REGION_HELP).addOption(new Option3("--region-class <areas>").hideHelp()).option("--region-prefer", REGION_PREFER_HELP).addOption(new Option3("--region-only").hideHelp()).option("--label <label>", "label for the sandbox").option("--image <image>", "container image to boot").option("--snapshot-id <id>", "provider snapshot to resume").option("--cpus <n>", "CPU cores (raw resources \u2014 mutually exclusive with --size)").option("--memory-mb <n>", "memory in MB (raw resources)").option("--disk-mb <n>", "ephemeral disk in MB (raw resources)").addOption(new Option3("--max-price <usd/unit>").hideHelp()).addOption(new Option3("--max-price-per <unit>").hideHelp()).addOption(new Option3("--market").hideHelp()).addOption(new Option3("--order-type <type>").hideHelp()).option("--timeout-ms <ms>", "sandbox timeout in ms (provider minimums apply, e.g. blaxel \u22655m)").option("--secret <name>", "vault secret name to inject (repeatable)", (v, a) => a.concat(v), []);
|
|
4933
4934
|
}
|
|
4934
4935
|
var REGION_HELP = "standard areas to place in, in order: us, us-east, us-central, us-south, us-west (e.g. us-west,us-east); fails if none fits unless --region-prefer; with one --provider, also its own region id (e.g. sfo1); default: your router's region rules";
|
|
4935
4936
|
var REGION_PREFER_HELP = "try the --region areas first, then place anywhere if none fits";
|
|
@@ -4978,11 +4979,12 @@ function providerNames(value, flag = "--provider") {
|
|
|
4978
4979
|
if (names.length === 0) throw new Error(`${flag} "${value}" names no providers.`);
|
|
4979
4980
|
return names;
|
|
4980
4981
|
}
|
|
4981
|
-
var STRATEGIES = ["
|
|
4982
|
+
var STRATEGIES = ["auto", "cheapest", "custom"];
|
|
4983
|
+
var LEGACY_STRATEGY = "computesdk";
|
|
4982
4984
|
function routerOverrides(opts) {
|
|
4983
4985
|
const out = {};
|
|
4984
4986
|
if (opts.strategy !== void 0) {
|
|
4985
|
-
if (!STRATEGIES.includes(opts.strategy)) {
|
|
4987
|
+
if (opts.strategy !== LEGACY_STRATEGY && !STRATEGIES.includes(opts.strategy)) {
|
|
4986
4988
|
throw new Error(`--strategy must be one of ${STRATEGIES.join(", ")}`);
|
|
4987
4989
|
}
|
|
4988
4990
|
out.strategy = opts.strategy;
|
|
@@ -5066,7 +5068,8 @@ function listQuery(opts) {
|
|
|
5066
5068
|
};
|
|
5067
5069
|
}
|
|
5068
5070
|
var STRATEGY_LINE = {
|
|
5069
|
-
|
|
5071
|
+
auto: "ComputeSDK's order (Sandboxes: weekly composite score)",
|
|
5072
|
+
computesdk: "ComputeSDK's order (Sandboxes: weekly composite score)",
|
|
5070
5073
|
cheapest: "cheapest first",
|
|
5071
5074
|
custom: "your own order"
|
|
5072
5075
|
};
|
|
@@ -5110,7 +5113,7 @@ function printSandboxOptions(o) {
|
|
|
5110
5113
|
console.log(`Router: ${BYOK_MODE_LINE[o.byokMode]} (BYOK ${o.byokMode}).`);
|
|
5111
5114
|
if (o.strategy !== void 0 && o.byokMode !== "only") {
|
|
5112
5115
|
const size = o.strategy === "cheapest" && o.size !== void 0 ? ` at ${o.size}` : "";
|
|
5113
|
-
console.log(`Managed accounts: ${STRATEGY_LINE[o.strategy]}${size} \u2014 change with compute sandboxes settings set --routing <
|
|
5116
|
+
console.log(`Managed accounts: ${STRATEGY_LINE[o.strategy]}${size} \u2014 change with compute sandboxes settings set --routing <auto|cheapest|providers>.`);
|
|
5114
5117
|
}
|
|
5115
5118
|
if (first !== null) console.log(pc11.dim(`A plain \`compute new\` lands on ${first}. Pick one: compute new --${first} --size <size>`));
|
|
5116
5119
|
}
|
|
@@ -5260,7 +5263,7 @@ function registerSandboxOperations(cmd) {
|
|
|
5260
5263
|
}
|
|
5261
5264
|
});
|
|
5262
5265
|
for (const name of ["route", "quote"]) {
|
|
5263
|
-
const command2 = cmd.command(name, { hidden: name === "quote" }).description("Show where a sandbox create would land, how it is billed, and the price \u2014 creates nothing").option("--size <size>", "platform size: small, medium (default), large, xlarge, 2xlarge (16/32 GiB), 3xlarge (32/64 GiB)").option("--provider <names>", "only these providers, through your router (e.g. daytona)").option("--byok", "only your own keys").option("--managed", "only ComputeSDK managed accounts").option("--strategy <strategy>", "order managed accounts:
|
|
5266
|
+
const command2 = cmd.command(name, { hidden: name === "quote" }).description("Show where a sandbox create would land, how it is billed, and the price \u2014 creates nothing").option("--size <size>", "platform size: small, medium (default), large, xlarge, 2xlarge (16/32 GiB), 3xlarge (32/64 GiB)").option("--provider <names>", "only these providers, through your router (e.g. daytona)").option("--byok", "only your own keys").option("--managed", "only ComputeSDK managed accounts").option("--strategy <strategy>", "order managed accounts: auto (recommended), cheapest, or custom (your saved order)").option("--ignore <names>", "never these providers (e.g. e2b)").option("--cpus <n>", "CPU cores (raw resources instead of --size)").option("--memory-mb <n>", "memory in MB").option("--disk-mb <n>", "ephemeral disk in MB").option("--region <regions>", REGION_HELP).addOption(new Option3("--region-class <areas>").hideHelp()).option("--region-prefer", REGION_PREFER_HELP).addOption(new Option3("--region-only").hideHelp()).option("--timeout-ms <ms>", "sandbox timeout in ms; a managed account holds credit for it").addOption(new Option3("--order-type <type>").hideHelp()).addOption(new Option3("--market").hideHelp()).addOption(new Option3("--max-price <usd/unit>").hideHelp()).addOption(new Option3("--max-price-per <unit>").hideHelp()).option("--api-key <key>").option("--base-url <url>").option("--allow-untrusted-host").option("--json", "print the raw response");
|
|
5264
5267
|
command2.action(async (opts) => {
|
|
5265
5268
|
try {
|
|
5266
5269
|
const c = await client(opts);
|