@computesdk/cli 2.6.10 → 2.6.11
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 +22 -6
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -237,13 +237,20 @@ var BYOK_MODE_HELP = {
|
|
|
237
237
|
fallback: "managed accounts first, then your keys",
|
|
238
238
|
only: "your keys only, never managed accounts"
|
|
239
239
|
};
|
|
240
|
+
var MANAGED_STRATEGIES = ["computesdk", "cheapest"];
|
|
241
|
+
var STRATEGY_LABEL = {
|
|
242
|
+
computesdk: "ComputeSDK (recommended)",
|
|
243
|
+
cheapest: "Cheapest",
|
|
244
|
+
custom: "Custom"
|
|
245
|
+
};
|
|
240
246
|
var arrow = (list) => list.join(" \u2192 ");
|
|
241
247
|
function printLaneRouting(r, lane) {
|
|
242
248
|
const label = (text) => text.padEnd(12);
|
|
243
249
|
const managed = r.managed.length > 0 ? arrow(r.managed) : pc2.dim("no managed account is live");
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
);
|
|
250
|
+
const strategy = r.strategy ?? (r.routing === "default" ? "computesdk" : "custom");
|
|
251
|
+
const size = r.size !== void 0 && strategy === "cheapest" ? pc2.dim(` (priced at ${r.size})`) : "";
|
|
252
|
+
console.log(`${label("Routing")}${STRATEGY_LABEL[strategy]}`);
|
|
253
|
+
console.log(`${label("Order")}${managed}${size}`);
|
|
247
254
|
console.log(`${label("BYOK")}${r.byok.mode} ${pc2.dim(`(${BYOK_MODE_HELP[r.byok.mode]})`)}`);
|
|
248
255
|
if (r.byok.mode !== "off") {
|
|
249
256
|
const list = r.byok.order.length > 0 ? arrow(r.byok.order) : "\u2014";
|
|
@@ -329,8 +336,8 @@ function registerSettingsCommands(group, lane, common2, deps) {
|
|
|
329
336
|
});
|
|
330
337
|
const set = common2(
|
|
331
338
|
settings.command("set").description(`Change the ${routerName} router (owner/admin)`).option(
|
|
332
|
-
"--routing <
|
|
333
|
-
|
|
339
|
+
"--routing <strategy|providers>",
|
|
340
|
+
"managed routing: computesdk (default) | cheapest | your own managed-account order (e.g. daytona,e2b)"
|
|
334
341
|
).option("--byok <mode>", `use your own keys: ${BYOK_MODES.join(" | ")}`).option(
|
|
335
342
|
"--byok-order <providers>",
|
|
336
343
|
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)"
|
|
@@ -360,7 +367,7 @@ function registerSettingsCommands(group, lane, common2, deps) {
|
|
|
360
367
|
try {
|
|
361
368
|
const routing = {};
|
|
362
369
|
if (opts.routing !== void 0) {
|
|
363
|
-
routing.routing = opts.routing === "default" ?
|
|
370
|
+
routing.routing = opts.routing === "default" || MANAGED_STRATEGIES.includes(opts.routing) ? opts.routing : providerList("--routing", opts.routing);
|
|
364
371
|
}
|
|
365
372
|
if (opts.byok !== void 0) {
|
|
366
373
|
if (!BYOK_MODES.includes(opts.byok)) {
|
|
@@ -3785,6 +3792,11 @@ function listQuery(opts) {
|
|
|
3785
3792
|
cursor: opts.cursor
|
|
3786
3793
|
};
|
|
3787
3794
|
}
|
|
3795
|
+
var STRATEGY_LINE = {
|
|
3796
|
+
computesdk: "ComputeSDK's recommended order",
|
|
3797
|
+
cheapest: "cheapest first",
|
|
3798
|
+
custom: "your own order"
|
|
3799
|
+
};
|
|
3788
3800
|
var BYOK_MODE_LINE = {
|
|
3789
3801
|
off: "managed accounts only",
|
|
3790
3802
|
first: "your keys first, then managed accounts",
|
|
@@ -3823,6 +3835,10 @@ function printSandboxOptions(o) {
|
|
|
3823
3835
|
}
|
|
3824
3836
|
console.log("");
|
|
3825
3837
|
console.log(`Router: ${BYOK_MODE_LINE[o.byokMode]} (BYOK ${o.byokMode}).`);
|
|
3838
|
+
if (o.strategy !== void 0 && o.byokMode !== "only") {
|
|
3839
|
+
const size = o.strategy === "cheapest" && o.size !== void 0 ? ` at ${o.size}` : "";
|
|
3840
|
+
console.log(`Managed accounts: ${STRATEGY_LINE[o.strategy]}${size} \u2014 change with compute sandboxes settings set --routing <computesdk|cheapest|providers>.`);
|
|
3841
|
+
}
|
|
3826
3842
|
if (first !== null) console.log(pc11.dim(`A plain \`compute new\` lands on ${first}. Pick one: compute new --${first} --size <size>`));
|
|
3827
3843
|
}
|
|
3828
3844
|
async function showSandboxOptions(opts) {
|