@computesdk/cli 2.6.22 → 2.6.23
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 +11 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"bin": "compute",
|
|
4
4
|
"package": "@computesdk/cli",
|
|
5
|
-
"version": "2.6.
|
|
5
|
+
"version": "2.6.23",
|
|
6
6
|
"source": {
|
|
7
7
|
"repo": "computesdk/computesdk",
|
|
8
8
|
"released": false
|
|
@@ -1804,6 +1804,8 @@
|
|
|
1804
1804
|
"--byok",
|
|
1805
1805
|
"--managed",
|
|
1806
1806
|
"--size",
|
|
1807
|
+
"--region-class",
|
|
1808
|
+
"--region-only",
|
|
1807
1809
|
"--label",
|
|
1808
1810
|
"--image",
|
|
1809
1811
|
"--snapshot-id",
|
|
@@ -1876,6 +1878,8 @@
|
|
|
1876
1878
|
"--memory-mb",
|
|
1877
1879
|
"--disk-mb",
|
|
1878
1880
|
"--region",
|
|
1881
|
+
"--region-class",
|
|
1882
|
+
"--region-only",
|
|
1879
1883
|
"--timeout-ms",
|
|
1880
1884
|
"--api-key",
|
|
1881
1885
|
"--base-url",
|
|
@@ -2030,6 +2034,8 @@
|
|
|
2030
2034
|
"--byok",
|
|
2031
2035
|
"--managed",
|
|
2032
2036
|
"--size",
|
|
2037
|
+
"--region-class",
|
|
2038
|
+
"--region-only",
|
|
2033
2039
|
"--label",
|
|
2034
2040
|
"--image",
|
|
2035
2041
|
"--snapshot-id",
|
|
@@ -2727,6 +2733,8 @@
|
|
|
2727
2733
|
"--byok",
|
|
2728
2734
|
"--managed",
|
|
2729
2735
|
"--size",
|
|
2736
|
+
"--region-class",
|
|
2737
|
+
"--region-only",
|
|
2730
2738
|
"--label",
|
|
2731
2739
|
"--image",
|
|
2732
2740
|
"--snapshot-id",
|
|
@@ -2843,6 +2851,8 @@
|
|
|
2843
2851
|
"--byok",
|
|
2844
2852
|
"--managed",
|
|
2845
2853
|
"--size",
|
|
2854
|
+
"--region-class",
|
|
2855
|
+
"--region-only",
|
|
2846
2856
|
"--label",
|
|
2847
2857
|
"--image",
|
|
2848
2858
|
"--snapshot-id",
|
package/dist/index.js
CHANGED
|
@@ -4929,7 +4929,25 @@ function resolveTwoArgTarget(argId, resourceId, opts, label) {
|
|
|
4929
4929
|
return { resolved: resolveSandbox(argId, opts), resource: resourceId };
|
|
4930
4930
|
}
|
|
4931
4931
|
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").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("--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), []);
|
|
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").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-class <areas>", REGION_CLASS_HELP).option("--region-only", REGION_ONLY_HELP).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
|
+
var REGION_CLASS_HELP = "standard areas to prefer, in order: us, us-east, us-central, us-south, us-west (e.g. us-west,us-east); default: your router's region rules";
|
|
4935
|
+
var REGION_ONLY_HELP = "place only in the --region-class areas; fail if none fits";
|
|
4936
|
+
function regionFields(opts) {
|
|
4937
|
+
if (opts.regionClass === void 0) {
|
|
4938
|
+
if (opts.regionOnly) throw new Error("--region-only needs --region-class.");
|
|
4939
|
+
return {};
|
|
4940
|
+
}
|
|
4941
|
+
const areas = opts.regionClass.split(",").map((area) => area.trim()).filter(Boolean);
|
|
4942
|
+
if (areas.length === 0) throw new Error(`--region-class "${opts.regionClass}" names no areas.`);
|
|
4943
|
+
return { regionClass: areas, ...opts.regionOnly ? { regionMode: "only" } : {} };
|
|
4944
|
+
}
|
|
4945
|
+
function regionParams(opts) {
|
|
4946
|
+
const fields = regionFields(opts);
|
|
4947
|
+
return {
|
|
4948
|
+
...fields.regionClass === void 0 ? {} : { regionClass: fields.regionClass.join(",") },
|
|
4949
|
+
...fields.regionMode === void 0 ? {} : { regionMode: fields.regionMode }
|
|
4950
|
+
};
|
|
4933
4951
|
}
|
|
4934
4952
|
function providerNames(value) {
|
|
4935
4953
|
const names = value.split(",").map((name) => name.trim()).filter(Boolean);
|
|
@@ -4957,6 +4975,7 @@ function buildCreateBody(opts) {
|
|
|
4957
4975
|
}
|
|
4958
4976
|
if (opts.order) body.providerOrder = opts.order.split(",").map((s) => s.trim());
|
|
4959
4977
|
if (opts.size) body.size = opts.size;
|
|
4978
|
+
Object.assign(body, regionFields(opts));
|
|
4960
4979
|
if (opts.label) body.label = opts.label;
|
|
4961
4980
|
if (opts.image) body.image = opts.image;
|
|
4962
4981
|
if (opts.snapshotId) body.snapshotId = opts.snapshotId;
|
|
@@ -5117,7 +5136,8 @@ async function previewPlacement(c, opts) {
|
|
|
5117
5136
|
ephemeralDiskMb: opts.diskMb,
|
|
5118
5137
|
timeoutMs: opts.timeoutMs,
|
|
5119
5138
|
only: opts.provider === void 0 ? void 0 : providerNames(opts.provider).join(","),
|
|
5120
|
-
byok: mode
|
|
5139
|
+
byok: mode,
|
|
5140
|
+
...regionParams(opts)
|
|
5121
5141
|
};
|
|
5122
5142
|
let quote;
|
|
5123
5143
|
try {
|
|
@@ -5193,7 +5213,7 @@ function registerSandboxOperations(cmd) {
|
|
|
5193
5213
|
}
|
|
5194
5214
|
});
|
|
5195
5215
|
for (const name of ["route", "quote"]) {
|
|
5196
|
-
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("--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 <region>", "pin the placement region").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");
|
|
5216
|
+
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("--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 <region>", "pin the placement region").option("--region-class <areas>", REGION_CLASS_HELP).option("--region-only", REGION_ONLY_HELP).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");
|
|
5197
5217
|
command2.action(async (opts) => {
|
|
5198
5218
|
try {
|
|
5199
5219
|
const c = await client(opts);
|
|
@@ -5205,6 +5225,7 @@ function registerSandboxOperations(cmd) {
|
|
|
5205
5225
|
memoryMb: opts.memoryMb,
|
|
5206
5226
|
ephemeralDiskMb: opts.diskMb,
|
|
5207
5227
|
region: opts.region,
|
|
5228
|
+
...regionParams(opts),
|
|
5208
5229
|
timeoutMs: opts.timeoutMs,
|
|
5209
5230
|
orderType: opts.market ? "market" : opts.orderType
|
|
5210
5231
|
};
|