agental 0.34.0 → 0.36.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 +31 -17
  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.34.0" : "dev";
7414
+ var CLI_VERSION = true ? "0.36.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}`;
@@ -9389,7 +9389,7 @@ var COMMANDS = [
9389
9389
  [" --allow <addresses>", "reach only these addresses, comma-separated"],
9390
9390
  [" --egress <egress>", "box, or residential:<country>[:sticky|rotating]"],
9391
9391
  [" --spot", "half the price, in spare room taken back when needed"],
9392
- [" --on-reclaim <what>", "with --spot: stop (default), delete or upgrade"],
9392
+ [" --on-reclaim <what>", "with --spot: stop (default) or delete"],
9393
9393
  [" --warn-at <chance>", "with --spot: warn at this chance, as 0.5 or 50%"],
9394
9394
  [" --ssh-key <key or file>", "let this key in over SSH (may be given again)"],
9395
9395
  [" --tag <tag>", "label it (may be given again)"],
@@ -9516,7 +9516,7 @@ var COMMANDS = [
9516
9516
  {
9517
9517
  name: "spot",
9518
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"]
9519
+ examples: ["agental spot sbx_2a9a47e50daec64a", "agental spot sbx_2a9a47e50daec64a --on-reclaim delete --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
  {
@@ -12470,6 +12470,9 @@ var SPOT_PRICE_MICROS_PER_HOUR = {
12470
12470
  medium: LIST_PRICE_MICROS_PER_HOUR.medium / 2,
12471
12471
  large: LIST_PRICE_MICROS_PER_HOUR.large / 2
12472
12472
  };
12473
+ var SPOT_ON_RECLAIM = ["delete", "stop"];
12474
+ var SPOT_ON_RECLAIM_READ = [...SPOT_ON_RECLAIM, "upgrade"];
12475
+ var SPOT_RUN_LIMIT_SECONDS = 24 * 60 * 60;
12473
12476
  var HOURS_PER_MONTH = 730;
12474
12477
  var STOPPED_MICROS_PER_GB_MONTH = 5e4;
12475
12478
  var BYTES_PER_GB = 1e9;
@@ -13893,7 +13896,7 @@ async function autoStop(id, inText, at4, never, asJson) {
13893
13896
  );
13894
13897
  return;
13895
13898
  }
13896
- const by = body.setBy === "sandbox" ? "as the sandbox itself set" : body.setBy === "account" ? "as moved from its account" : `its last start and ${body.ttlSeconds === null ? "the deployment's time limit" : timeInWords(body.ttlSeconds)}`;
13899
+ const by = body.setBy === "spot_limit" ? "a spot sandbox runs at most 24 hours at a time; agental spot <sandbox-id> off runs it on at the list price" : body.setBy === "sandbox" ? "as the sandbox itself set" : body.setBy === "account" ? "as moved from its account" : `its last start and ${body.ttlSeconds === null ? "the deployment's time limit" : timeInWords(body.ttlSeconds)}`;
13897
13900
  process.stdout.write(`${body.sandboxId} stops at ${body.autoStopAt}, in ${timeInWords(body.secondsLeft ?? 0)}: ${by}.
13898
13901
  `);
13899
13902
  }
@@ -14277,8 +14280,8 @@ async function egress(positionals, values) {
14277
14280
  }
14278
14281
  function spotSettingsFrom(values) {
14279
14282
  const onReclaim = values["on-reclaim"];
14280
- if (onReclaim !== void 0 && onReclaim !== "delete" && onReclaim !== "stop" && onReclaim !== "upgrade") {
14281
- throw new Error("--on-reclaim is delete, stop or upgrade: what is done to a spot sandbox when its room is taken back.");
14283
+ if (onReclaim !== void 0 && onReclaim !== "delete" && onReclaim !== "stop") {
14284
+ throw new Error("--on-reclaim is delete or stop: what is done to a spot sandbox when its room is taken back.");
14282
14285
  }
14283
14286
  const given = values["warn-at"];
14284
14287
  const percent = given?.endsWith("%") ? Number(given.slice(0, -1)) / 100 : Number(given);
@@ -14294,8 +14297,7 @@ function spotInWords(sandbox) {
14294
14297
  }
14295
14298
  const done2 = {
14296
14299
  delete: "deleted when its room is taken back",
14297
- stop: "stopped when its room is taken back, its disk kept",
14298
- upgrade: "made standard at the list price when its room is taken back, or stopped where that frees nothing"
14300
+ stop: "stopped when its room is taken back, its disk kept"
14299
14301
  };
14300
14302
  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";
14301
14303
  const warnAt = typeof spot2.warnAt === "number" ? `, warned at ${Math.round(spot2.warnAt * 100)}%` : "";
@@ -14304,7 +14306,7 @@ function spotInWords(sandbox) {
14304
14306
  async function spot(positionals, values) {
14305
14307
  const [id, given, ...rest] = positionals;
14306
14308
  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.";
14309
+ const how = "spot takes <sandbox-id>, and then nothing, off, or --on-reclaim delete|stop and --warn-at <chance>, as agental spot sbx_2a9a47e50daec64a --on-reclaim delete.";
14308
14310
  if (id === void 0 || rest.length > 0 || word !== void 0 && word !== "off") {
14309
14311
  throw new Error(how);
14310
14312
  }
@@ -15028,9 +15030,9 @@ async function telemetry(positionals, given, asJson) {
15028
15030
  }
15029
15031
  async function billing(positionals, asJson, limit) {
15030
15032
  const [what, amount, ...rest] = positionals;
15031
- const kinds = ["prices", "compare", "invoices", "card", "details", "top-up", "auto-reload"];
15033
+ const kinds = ["prices", "compare", "invoices", "card", "details", "top-up", "auto-reload", "email-copy"];
15032
15034
  const near = what !== void 0 && !kinds.includes(what) ? nearest(what, kinds) : null;
15033
- const usage = `${near ? `billing has no ${what}: did you mean billing ${near}? ` : ""}billing takes nothing, prices, compare, invoices, card, card save, details, top-up <dollars>, or auto-reload <dollars | off>`;
15035
+ const usage = `${near ? `billing has no ${what}: did you mean billing ${near}? ` : ""}billing takes nothing, prices, compare, invoices, card, card save, details, top-up <dollars>, auto-reload <dollars | off>, or email-copy`;
15034
15036
  if (rest.length > 0 || what !== "top-up" && what !== "auto-reload" && !(what === "card" && amount === "save") && amount !== void 0) {
15035
15037
  throw new Error(usage);
15036
15038
  }
@@ -15113,6 +15115,17 @@ Nothing is charged until it is paid. agental billing shows it within a minute of
15113
15115
  `);
15114
15116
  return;
15115
15117
  }
15118
+ case "email-copy": {
15119
+ const body = await asked("/v1/billing/email-copy", { method: "GET" });
15120
+ print4(
15121
+ body,
15122
+ () => body.address === null ? "Billing emails go to the owners alone. An owner can add an address for a copy of each under Billing in the console.\n" : body.confirmed === false ? `${body.address} gets no copies yet: it has to confirm by the link sent to it. An owner can send a new one under Billing in the console.
15123
+ ` : body.waiting === true ? `${body.address} gets no copies for now: whoever set it is no longer an owner. An owner keeps it or removes it under Billing in the console.
15124
+ ` : `Billing emails also go to ${body.address}: out of credit, reloads, a failed payment, the free allowance. An owner changes it under Billing in the console.
15125
+ `
15126
+ );
15127
+ return;
15128
+ }
15116
15129
  default:
15117
15130
  throw new Error(usage);
15118
15131
  }
@@ -15836,7 +15849,7 @@ Setting up
15836
15849
 
15837
15850
  Usage
15838
15851
  agental create [--name <name>] [--template <template>] [--size tiny|small|medium|large] [--region <region>[,<region>...]] [--ttl <time> | --ttl default] [--on-timeout delete|stop|stop-with-memory] [--idempotency-key <key>]
15839
- [--spot [--on-reclaim delete|stop|upgrade] [--warn-at <chance>]]
15852
+ [--spot [--on-reclaim delete|stop] [--warn-at <chance>]]
15840
15853
  ${operator ? "[--box <name-or-id>] " : ""}[--allow <address>[,<address>...]] [--egress box | residential:<country>[:sticky|rotating]] [--max-burst-fee <dollars>]
15841
15854
  [--ssh-key <public-key-or-file>]... [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
15842
15855
  agental summary [--where '<words>'] [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]... [--facets <field>[,<field>...]] [--json]
@@ -15862,7 +15875,7 @@ Usage
15862
15875
  agental auto-stop <sandbox-id> [--in <time> | --at <date-time> | --never] [--json]
15863
15876
  agental network <sandbox-id> [--allow <address>[,<address>...] | --none] [--json]
15864
15877
  agental egress <sandbox-id> [box | residential <country> [sticky | rotating]] [--json]
15865
- agental spot <sandbox-id> [off] [--on-reclaim delete|stop|upgrade] [--warn-at <chance>] [--json]
15878
+ agental spot <sandbox-id> [off] [--on-reclaim delete|stop] [--warn-at <chance>] [--json]
15866
15879
  agental templates [--json]
15867
15880
  agental template create <name> [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
15868
15881
  agental template show <template> [--json]
@@ -15944,7 +15957,7 @@ Usage
15944
15957
  agental key show <key> [--json]
15945
15958
  agental key allow-from <key> (<address-or-range>... | --anywhere) [--json]
15946
15959
  agental key delete <key>
15947
- agental billing [prices | compare | card [save] | details | top-up <dollars> | auto-reload <dollars | off>] [--json]
15960
+ agental billing [prices | compare | card [save] | details | top-up <dollars> | auto-reload <dollars | off> | email-copy] [--json]
15948
15961
  agental billing invoices [--limit <n>] [--json]
15949
15962
  agental headroom [--from <day or date-time>] [--to <day or date-time>] [--step 10m|hour|day] [--json]
15950
15963
  agental headroom budget <dollars> | budget default [--json]
@@ -16021,9 +16034,8 @@ says when a running sandbox is to be stopped, with --in or --at moves that stop,
16021
16034
  for the run under way, and with --never takes its time limit away, for this run and the next.
16022
16035
  create --spot makes a spot sandbox: half the list price, in room on our servers nobody else is
16023
16036
  paying for, taken back when a standard sandbox needs it. --on-reclaim says what is then done to it:
16024
- stop (the default) stops it and keeps its disk, never its memory; delete deletes it; upgrade
16025
- makes it a standard sandbox at the list price and keeps it running, where that frees what was
16026
- needed, and stops it otherwise. It is not counted in the plan's running count, and comes with
16037
+ stop (the default) stops it and keeps its disk, never its memory; delete deletes it. One run
16038
+ lasts at most 24 hours, and is then stopped with its disk. It is not counted in the plan's running count, and comes with
16027
16039
  the account's first top-up. agental spot shows its chance of being stopped in the next minute, a
16028
16040
  hint and not a promise, and with --warn-at sets the chance at which sandbox.reclaim_chance is sent
16029
16041
  (0.5 when left out); agental spot <sandbox-id> off turns off spot: a standard sandbox from then on.
@@ -16229,6 +16241,8 @@ Nothing is charged until it is paid there. auto-reload <dollars> has the card sa
16229
16241
  last purchase charged for a top-up of that much, with tax, when your credits run out, and the
16230
16242
  credits added before any sandbox is stopped: at most three times a day, and not again for a
16231
16243
  day after a card that would not pay. auto-reload off turns it off.
16244
+ email-copy shows the address a copy of each billing email goes to, beside the owner, if any:
16245
+ an owner sets it under Billing in the console.
16232
16246
  account export prints everything agental keeps about your account and you, as JSON: the
16233
16247
  account, its sessions with the address and browser each began from, its keys by name, billing,
16234
16248
  payments, usage, and what it has made. Secrets are named, never given. --out writes it to a file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agental",
3
- "version": "0.34.0",
3
+ "version": "0.36.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",