agental 0.37.0 → 0.39.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 +27 -23
  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.37.0" : "dev";
7414
+ var CLI_VERSION = true ? "0.39.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}`;
@@ -9634,7 +9634,7 @@ var COMMANDS = [
9634
9634
  { name: "members", summary: "List or remove the members of a team." },
9635
9635
  { name: "invite", summary: "Invite someone to your team by email." },
9636
9636
  { name: "billing", summary: "Your plan, credits, invoices and card, and buying credits.", examples: ["agental billing", "agental billing compare", "agental billing invoices", "agental billing top-up 500"] },
9637
- { name: "headroom", summary: "How close you run to your plan's limits, and your burst budget." },
9637
+ { name: "limits", summary: "How close you run to your plan's limits, and your burst budget." },
9638
9638
  { name: "account", summary: "Export everything agental keeps about your account and you." },
9639
9639
  { name: "login", summary: "Sign in through the browser, or with a key from standard input." },
9640
9640
  { name: "logout", summary: "Delete this computer's key from your account and from here." },
@@ -9738,7 +9738,7 @@ var MAP = [
9738
9738
  [
9739
9739
  ["template", "what new sandboxes start from"],
9740
9740
  ["billing", "plan, credits, invoices and card"],
9741
- ["headroom", "how close you run to your plan's limits"],
9741
+ ["limits", "how close you run to your plan's limits"],
9742
9742
  ["key", "API keys"],
9743
9743
  ["org, member", "teams"],
9744
9744
  ["webhook", "events sent to an address of yours"],
@@ -9978,7 +9978,7 @@ var SUBCOMMANDS = {
9978
9978
  key: ["list"],
9979
9979
  webhook: ["list"],
9980
9980
  job: ["list"],
9981
- headroom: ["budget"],
9981
+ limits: ["budget"],
9982
9982
  egress: ["budget", "use-case"],
9983
9983
  telemetry: ["set", "test", "unset"],
9984
9984
  ci: ["set", "reset"],
@@ -12841,7 +12841,7 @@ async function main() {
12841
12841
  raw: { type: "boolean", default: false },
12842
12842
  subject: { type: "string" },
12843
12843
  from: { type: "string" },
12844
- // agental headroom: where its range ends (--from is where it begins).
12844
+ // agental limits: where its range ends (--from is where it begins).
12845
12845
  to: { type: "string" },
12846
12846
  "from-name": { type: "string" },
12847
12847
  "reply-to": { type: "string" },
@@ -13172,8 +13172,8 @@ async function main() {
13172
13172
  case "billing":
13173
13173
  await billing(positionals.slice(1), values.json, values.limit);
13174
13174
  return;
13175
- case "headroom":
13176
- await headroom(positionals.slice(1), { json: values.json, from: values.from, to: values.to, step: values.step });
13175
+ case "limits":
13176
+ await showLimits(positionals.slice(1), { json: values.json, from: values.from, to: values.to, step: values.step });
13177
13177
  return;
13178
13178
  case "account":
13179
13179
  await account2(positionals.slice(1), values.out);
@@ -13281,7 +13281,7 @@ function maxBurstFeeHeaders(given) {
13281
13281
  function sayBurstFee(response) {
13282
13282
  const micros = Number(response.headers.get("Agental-Burst-Fee") ?? "0");
13283
13283
  if (micros > 0) {
13284
- process.stderr.write(`This start cost a burst fee of ${money(micros)}: the account started more than its plan's free starts in the last 15 minutes. Starts are free again within 15 minutes; agental headroom says the minute.
13284
+ process.stderr.write(`This start cost a burst fee of ${money(micros)}: the account started more than its plan's free starts in the last 15 minutes. Starts are free again within 15 minutes; agental limits says the minute.
13285
13285
  `);
13286
13286
  }
13287
13287
  }
@@ -14930,6 +14930,10 @@ async function ci(positionals, options) {
14930
14930
  `${item.repository} pool ${item.poolMax ?? `${body.defaultPoolMax} (default)`} template ${item.templateId ?? "runs-on (empty)"} agental is ${item.size} ${item.sandboxes.length} sandboxes, ${busy} busy
14931
14931
  `
14932
14932
  );
14933
+ for (const job2 of item.waiting ?? []) {
14934
+ process.stdout.write(` job ${job2.jobId} waiting since ${job2.since}: ${job2.message}
14935
+ `);
14936
+ }
14933
14937
  }
14934
14938
  return;
14935
14939
  }
@@ -15440,7 +15444,7 @@ function pricesForPeople(body) {
15440
15444
  if (also.length > 0) {
15441
15445
  out.push(strong("Also"), ...fitted(also).trimEnd().split("\n").map((line) => ` ${line}`), "");
15442
15446
  }
15443
- out.push(faint("agental billing top-up <dollars> \xB7 agental headroom budget <dollars> \xB7 https://agental.io/pricing"));
15447
+ out.push(faint("agental billing top-up <dollars> \xB7 agental limits budget <dollars> \xB7 https://agental.io/pricing"));
15444
15448
  return `${out.join("\n")}
15445
15449
  `;
15446
15450
  }
@@ -15467,7 +15471,7 @@ function describePrices(body) {
15467
15471
  }
15468
15472
  if (body.burstFee) {
15469
15473
  out.push(
15470
- `A start past your free starts in any ${body.burstFee.windowMinutes} minutes costs one hour of its price: $${body.burstFee.feeMicrosPerUnit / 1e6} a unit, $0.027 a small, $0.108 a large. At most ${wholeMoney(body.burstFee.defaultBudgetMicros)} a month unless you set another budget: agental headroom budget <dollars>.`
15474
+ `A start past your free starts in any ${body.burstFee.windowMinutes} minutes costs one hour of its price: $${body.burstFee.feeMicrosPerUnit / 1e6} a unit, $0.027 a small, $0.108 a large. At most ${wholeMoney(body.burstFee.defaultBudgetMicros)} a month unless you set another budget: agental limits budget <dollars>.`
15471
15475
  );
15472
15476
  }
15473
15477
  if (body.topUps?.length) {
@@ -15506,17 +15510,17 @@ function stoppedWords(storage) {
15506
15510
  return `A stopped sandbox is free for ${storage.stoppedFreeDays} days after each stop, then $${storage.stoppedMicrosPerGbMonth / 1e6} a GB a month of what it stores, by the second.`;
15507
15511
  }
15508
15512
  var BURST_DOCS = "https://agental.io/docs/usage#bursts";
15509
- async function headroom(positionals, options) {
15513
+ async function showLimits(positionals, options) {
15510
15514
  if (positionals[0] === "budget") {
15511
15515
  const given = positionals[1];
15512
15516
  if (given === void 0 || positionals.length > 2) {
15513
- throw new Error("headroom budget takes the most to spend on burst fees in a month, in US dollars, as agental headroom budget 20, or default.");
15517
+ throw new Error("limits budget takes the most to spend on burst fees in a month, in US dollars, as agental limits budget 20, or default.");
15514
15518
  }
15515
15519
  const dollars = Number(given.replace(/^\$/, ""));
15516
15520
  if (given !== "default" && (!Number.isFinite(dollars) || dollars < 0)) {
15517
- throw new Error(`headroom budget takes US dollars, as 20 or 0, or default. It was given ${given}.`);
15521
+ throw new Error(`limits budget takes US dollars, as 20 or 0, or default. It was given ${given}.`);
15518
15522
  }
15519
- const body2 = await asked("/v1/headroom/budget", { method: "PUT", body: JSON.stringify({ budgetMicros: given === "default" ? null : Math.round(dollars * 1e6) }) });
15523
+ const body2 = await asked("/v1/limits/budget", { method: "PUT", body: JSON.stringify({ budgetMicros: given === "default" ? null : Math.round(dollars * 1e6) }) });
15520
15524
  if (options.json) {
15521
15525
  process.stdout.write(`${JSON.stringify(body2, null, 2)}
15522
15526
  `);
@@ -15530,7 +15534,7 @@ async function headroom(positionals, options) {
15530
15534
  return;
15531
15535
  }
15532
15536
  if (positionals.length > 0) {
15533
- throw new Error(`headroom takes nothing, or budget <dollars>: it is the account's. It was given ${positionals.join(" ")}.`);
15537
+ throw new Error(`limits takes nothing, or budget <dollars>: it is the account's. It was given ${positionals.join(" ")}.`);
15534
15538
  }
15535
15539
  if (options.step !== void 0 && !["10m", "hour", "day"].includes(options.step)) {
15536
15540
  throw new Error(`--step is 10m, hour or day. It was given ${options.step}.`);
@@ -15542,15 +15546,15 @@ async function headroom(positionals, options) {
15542
15546
  }
15543
15547
  }
15544
15548
  const asks = query.toString();
15545
- const body = await asked(`/v1/headroom${asks === "" ? "" : `?${asks}`}`, { method: "GET" });
15549
+ const body = await asked(`/v1/limits${asks === "" ? "" : `?${asks}`}`, { method: "GET" });
15546
15550
  if (options.json) {
15547
15551
  process.stdout.write(`${JSON.stringify(body, null, 2)}
15548
15552
  `);
15549
15553
  return;
15550
15554
  }
15551
- process.stdout.write(describeHeadroom(body, options.from === void 0 && options.to === void 0, options.to === void 0));
15555
+ process.stdout.write(describeLimits(body, options.from === void 0 && options.to === void 0, options.to === void 0));
15552
15556
  }
15553
- function describeHeadroom(body, today, endsNow) {
15557
+ function describeLimits(body, today, endsNow) {
15554
15558
  const answer3 = body && typeof body === "object" ? body : {};
15555
15559
  const now = answer3["now"] && typeof answer3["now"] === "object" ? answer3["now"] : {};
15556
15560
  const number = (from, name) => typeof from[name] === "number" ? from[name] : 0;
@@ -15810,12 +15814,12 @@ function refusedWords(body) {
15810
15814
  if (!isApiError(body)) {
15811
15815
  return "";
15812
15816
  }
15813
- const { refusedLastHour, headroomUrl } = body.error;
15814
- if (typeof refusedLastHour !== "number" || typeof headroomUrl !== "string") {
15817
+ const { refusedLastHour, limitsUrl } = body.error;
15818
+ if (typeof refusedLastHour !== "number" || typeof limitsUrl !== "string") {
15815
15819
  return "";
15816
15820
  }
15817
15821
  return `Refused this way in the last hour: ${refusedLastHour.toLocaleString("en-US")}.
15818
- ${headroomUrl}
15822
+ ${limitsUrl}
15819
15823
  `;
15820
15824
  }
15821
15825
  async function readBody(response) {
@@ -15966,8 +15970,8 @@ Usage
15966
15970
  agental key delete <key>
15967
15971
  agental billing [prices | compare | card [save] | details | top-up <dollars> | auto-reload <dollars | off> | email-copy] [--json]
15968
15972
  agental billing invoices [--limit <n>] [--json]
15969
- agental headroom [--from <day or date-time>] [--to <day or date-time>] [--step 10m|hour|day] [--json]
15970
- agental headroom budget <dollars> | budget default [--json]
15973
+ agental limits [--from <day or date-time>] [--to <day or date-time>] [--step 10m|hour|day] [--json]
15974
+ agental limits budget <dollars> | budget default [--json]
15971
15975
  agental egress [budget <dollars> | budget default] [--json]
15972
15976
  agental egress use-case "<what your sandboxes will use it for>" [--json]
15973
15977
  agental account export [--out <file>]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agental",
3
- "version": "0.37.0",
3
+ "version": "0.39.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",