agental 0.33.0 → 0.34.0

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.
Files changed (2) hide show
  1. package/dist/cli.js +17 -15
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7411,7 +7411,7 @@ import { parseArgs } from "node:util";
7411
7411
 
7412
7412
  // ../src/cli-build.ts
7413
7413
  var PUBLISHED = true;
7414
- var CLI_VERSION = true ? "0.33.0" : "dev";
7414
+ var CLI_VERSION = true ? "0.34.0" : "dev";
7415
7415
  var DEFAULT_API_URL = true ? "https://agental.io" : "http://127.0.0.1:8741";
7416
7416
  var PACKAGE_NAME = "agental";
7417
7417
  var USER_AGENT = `agental-cli/${CLI_VERSION}`;
@@ -9515,8 +9515,8 @@ var COMMANDS = [
9515
9515
  { name: "egress", summary: "Say where a sandbox's web traffic leaves from, or read your residential egress.", examples: ["agental egress sbx_2a9a47e50daec64a residential de"] },
9516
9516
  {
9517
9517
  name: "spot",
9518
- summary: "Read a spot sandbox's chance of being stopped, change what a reclaim does to it, or make it normal.",
9519
- examples: ["agental spot sbx_2a9a47e50daec64a", "agental spot sbx_2a9a47e50daec64a --on-reclaim upgrade --warn-at 30%", "agental spot sbx_2a9a47e50daec64a normal"]
9518
+ summary: "Read a spot sandbox's chance of being stopped, change what a reclaim does to it, or turn off spot.",
9519
+ examples: ["agental spot sbx_2a9a47e50daec64a", "agental spot sbx_2a9a47e50daec64a --on-reclaim upgrade --warn-at 30%", "agental spot sbx_2a9a47e50daec64a off"]
9520
9520
  },
9521
9521
  { name: "templates", summary: "List your templates: what new sandboxes start from." },
9522
9522
  {
@@ -12474,6 +12474,7 @@ var HOURS_PER_MONTH = 730;
12474
12474
  var STOPPED_MICROS_PER_GB_MONTH = 5e4;
12475
12475
  var BYTES_PER_GB = 1e9;
12476
12476
  var NEVER_PAID_MAX_STORED_BYTES = 20 * BYTES_PER_GB;
12477
+ var STOPPED_DELETION_NOTICE_MS = 3 * 864e5;
12477
12478
  function stoppedMicrosPerHour(storedBytes) {
12478
12479
  if (storedBytes <= 0) {
12479
12480
  return 0;
@@ -14289,29 +14290,30 @@ function spotSettingsFrom(values) {
14289
14290
  function spotInWords(sandbox) {
14290
14291
  const spot2 = sandbox?.["spot"];
14291
14292
  if (!spot2) {
14292
- return "a normal sandbox, at the list price";
14293
+ return "spot off: a standard sandbox, at the list price";
14293
14294
  }
14294
14295
  const done2 = {
14295
14296
  delete: "deleted when its room is taken back",
14296
14297
  stop: "stopped when its room is taken back, its disk kept",
14297
- upgrade: "made normal at the list price when its room is taken back, or stopped where that frees nothing"
14298
+ upgrade: "made standard at the list price when its room is taken back, or stopped where that frees nothing"
14298
14299
  };
14299
14300
  const chance = typeof spot2.reclaimChance === "number" ? `${Math.round(spot2.reclaimChance * 100)}% chance of being stopped in the next minute` : "no chance worked out while it is not running";
14300
14301
  const warnAt = typeof spot2.warnAt === "number" ? `, warned at ${Math.round(spot2.warnAt * 100)}%` : "";
14301
14302
  return `spot, ${done2[String(spot2.onReclaim)] ?? String(spot2.onReclaim)}; ${chance}${warnAt}`;
14302
14303
  }
14303
14304
  async function spot(positionals, values) {
14304
- const [id, word, ...rest] = positionals;
14305
- const how = "spot takes <sandbox-id>, and then nothing, normal, or --on-reclaim delete|stop|upgrade and --warn-at <chance>, as agental spot sbx_2a9a47e50daec64a --on-reclaim upgrade.";
14306
- if (id === void 0 || rest.length > 0 || word !== void 0 && word !== "normal") {
14305
+ const [id, given, ...rest] = positionals;
14306
+ const word = given === "normal" ? "off" : given;
14307
+ const how = "spot takes <sandbox-id>, and then nothing, off, or --on-reclaim delete|stop|upgrade and --warn-at <chance>, as agental spot sbx_2a9a47e50daec64a --on-reclaim upgrade.";
14308
+ if (id === void 0 || rest.length > 0 || word !== void 0 && word !== "off") {
14307
14309
  throw new Error(how);
14308
14310
  }
14309
14311
  const settings = spotSettingsFrom(values);
14310
- if (word === "normal" && Object.keys(settings).length > 0) {
14312
+ if (word === "off" && Object.keys(settings).length > 0) {
14311
14313
  throw new Error(how);
14312
14314
  }
14313
14315
  const path6 = `/v1/sandboxes/${encodeURIComponent(id)}`;
14314
- const change = word === "normal" ? { spot: null } : Object.keys(settings).length > 0 ? { spot: settings } : null;
14316
+ const change = word === "off" ? { spot: null } : Object.keys(settings).length > 0 ? { spot: settings } : null;
14315
14317
  const body = await call2(path6, change === null ? { method: "GET" } : { method: "PATCH", body: JSON.stringify(change) });
14316
14318
  process.stdout.write(values.json ? `${JSON.stringify(body?.["spot"] ?? null, null, 2)}
14317
14319
  ` : `${id}: ${spotInWords(body)}
@@ -15179,7 +15181,7 @@ function describeBilling(body, card = null) {
15179
15181
  if (free.cardSaved) {
15180
15182
  lines.push([
15181
15183
  "Allowance",
15182
- allowance > 0 ? `${money(allowance)}, ${money(Math.max(0, allowance - (free.allowanceUsedMicros ?? 0)))} left. It starts again on the 1st.` : "none: the card you saved had the free allowance on another account."
15184
+ allowance > 0 ? `${money(allowance)}, ${money(Math.max(0, allowance - (free.allowanceUsedMicros ?? 0)))} left. It starts again ${body.period ? `on ${dayOf(body.period.end)}` : "next month"}.` : "none: the card you saved had the free allowance on another account."
15183
15185
  ]);
15184
15186
  }
15185
15187
  lines.push(["Credits left", `${money(body.topUpMicros)} of top-ups, used after the free allowance. They do not expire.`]);
@@ -15860,7 +15862,7 @@ Usage
15860
15862
  agental auto-stop <sandbox-id> [--in <time> | --at <date-time> | --never] [--json]
15861
15863
  agental network <sandbox-id> [--allow <address>[,<address>...] | --none] [--json]
15862
15864
  agental egress <sandbox-id> [box | residential <country> [sticky | rotating]] [--json]
15863
- agental spot <sandbox-id> [normal] [--on-reclaim delete|stop|upgrade] [--warn-at <chance>] [--json]
15865
+ agental spot <sandbox-id> [off] [--on-reclaim delete|stop|upgrade] [--warn-at <chance>] [--json]
15864
15866
  agental templates [--json]
15865
15867
  agental template create <name> [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
15866
15868
  agental template show <template> [--json]
@@ -16018,13 +16020,13 @@ memory_needs_top_up); agental stop always keeps the disk. auto-stop
16018
16020
  says when a running sandbox is to be stopped, with --in or --at moves that stop, later or sooner,
16019
16021
  for the run under way, and with --never takes its time limit away, for this run and the next.
16020
16022
  create --spot makes a spot sandbox: half the list price, in room on our servers nobody else is
16021
- paying for, taken back when a normal sandbox needs it. --on-reclaim says what is then done to it:
16023
+ paying for, taken back when a standard sandbox needs it. --on-reclaim says what is then done to it:
16022
16024
  stop (the default) stops it and keeps its disk, never its memory; delete deletes it; upgrade
16023
- makes it a normal sandbox at the list price and keeps it running, where that frees what was
16025
+ makes it a standard sandbox at the list price and keeps it running, where that frees what was
16024
16026
  needed, and stops it otherwise. It is not counted in the plan's running count, and comes with
16025
16027
  the account's first top-up. agental spot shows its chance of being stopped in the next minute, a
16026
16028
  hint and not a promise, and with --warn-at sets the chance at which sandbox.reclaim_chance is sent
16027
- (0.5 when left out); agental spot <sandbox-id> normal makes it a normal sandbox from then on.
16029
+ (0.5 when left out); agental spot <sandbox-id> off turns off spot: a standard sandbox from then on.
16028
16030
  ${operator ? operator.OPERATOR_HELP : ""}template network says what a sandbox on a template may reach outside itself, and with open,
16029
16031
  blocked or allowlist sets it: everything, nothing, or only the addresses that follow, which are
16030
16032
  IPv4 addresses and ranges such as 203.0.113.7 and 198.51.100.0/24. The rule that is given takes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agental",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "The agental command: Linux sandboxes for your agents, from the terminal. npx agental@latest signs you in and installs the agent skills.",
5
5
  "license": "MIT",
6
6
  "author": "VERTIXER LTD",