agental 0.14.0 → 0.15.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.
- package/dist/cli.js +169 -26
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -39,14 +39,14 @@ var init_cli_operator = __esm({
|
|
|
39
39
|
|
|
40
40
|
// ../src/cli.ts
|
|
41
41
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
42
|
-
import { readFileSync as
|
|
42
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
43
43
|
import os6 from "node:os";
|
|
44
44
|
import { readFile } from "node:fs/promises";
|
|
45
45
|
import { parseArgs } from "node:util";
|
|
46
46
|
|
|
47
47
|
// ../src/cli-build.ts
|
|
48
48
|
var PUBLISHED = true;
|
|
49
|
-
var CLI_VERSION = true ? "0.
|
|
49
|
+
var CLI_VERSION = true ? "0.15.0" : "dev";
|
|
50
50
|
var DEFAULT_API_URL = true ? "https://agental.io" : "http://127.0.0.1:8741";
|
|
51
51
|
var PACKAGE_NAME = "agental";
|
|
52
52
|
var USER_AGENT = `agental-cli/${CLI_VERSION}`;
|
|
@@ -1001,7 +1001,7 @@ async function readAll(stream) {
|
|
|
1001
1001
|
// ../src/cli-onboard.ts
|
|
1002
1002
|
import { execFile, spawnSync as spawnSync3 } from "node:child_process";
|
|
1003
1003
|
import { randomUUID, randomBytes as randomBytes3 } from "node:crypto";
|
|
1004
|
-
import { existsSync as existsSync2, realpathSync, statSync } from "node:fs";
|
|
1004
|
+
import { existsSync as existsSync2, readFileSync as readFileSync3, realpathSync, statSync } from "node:fs";
|
|
1005
1005
|
import os4 from "node:os";
|
|
1006
1006
|
import path3 from "node:path";
|
|
1007
1007
|
import { createInterface } from "node:readline/promises";
|
|
@@ -1524,6 +1524,21 @@ async function hourly(base, key2, size) {
|
|
|
1524
1524
|
return typeof micros === "number" ? micros : null;
|
|
1525
1525
|
}
|
|
1526
1526
|
var perHour = (micros) => `$${(micros / 1e6).toFixed(micros < 1e5 ? 4 : 3)} an hour`;
|
|
1527
|
+
function completionStep(shell2 = process.env["SHELL"], home = os4.homedir()) {
|
|
1528
|
+
const name = path3.basename(shell2 ?? "");
|
|
1529
|
+
const config = name === "zsh" ? ".zshrc" : name === "bash" ? ".bashrc" : name === "fish" ? ".config/fish/config.fish" : null;
|
|
1530
|
+
if (config === null) {
|
|
1531
|
+
return null;
|
|
1532
|
+
}
|
|
1533
|
+
try {
|
|
1534
|
+
if (readFileSync3(path3.join(home, config), "utf8").includes("agental completion")) {
|
|
1535
|
+
return null;
|
|
1536
|
+
}
|
|
1537
|
+
} catch {
|
|
1538
|
+
}
|
|
1539
|
+
const line = name === "fish" ? "agental completion fish | source" : `source <(agental completion ${name})`;
|
|
1540
|
+
return [`echo '${line}' >> ~/${config}`, "Tab completion, from your next terminal"];
|
|
1541
|
+
}
|
|
1527
1542
|
function nextSteps(term, rows) {
|
|
1528
1543
|
const width = Math.max(...rows.map(([command2]) => command2.length));
|
|
1529
1544
|
term.say(`
|
|
@@ -1567,11 +1582,13 @@ async function onboard(base, options) {
|
|
|
1567
1582
|
};
|
|
1568
1583
|
if (!options.sandbox) {
|
|
1569
1584
|
await report();
|
|
1585
|
+
const completion = term.interactive ? completionStep() : null;
|
|
1570
1586
|
nextSteps(term, [
|
|
1571
1587
|
["npx agental@latest sh", "make a sandbox and open a shell in it"],
|
|
1572
1588
|
["agental list", "your sandboxes"],
|
|
1573
1589
|
["agental ssh <id>", "a shell in one; add a command to run just that"],
|
|
1574
|
-
["agental help", "everything else"]
|
|
1590
|
+
["agental help", "everything else; agental <command> --help for one"],
|
|
1591
|
+
...completion ? [completion] : []
|
|
1575
1592
|
]);
|
|
1576
1593
|
return;
|
|
1577
1594
|
}
|
|
@@ -1634,7 +1651,7 @@ async function onboard(base, options) {
|
|
|
1634
1651
|
|
|
1635
1652
|
// ../src/cli-completion.ts
|
|
1636
1653
|
import { createHash as createHash2 } from "node:crypto";
|
|
1637
|
-
import { mkdirSync as mkdirSync3, readFileSync as
|
|
1654
|
+
import { mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
|
|
1638
1655
|
import os5 from "node:os";
|
|
1639
1656
|
import path4 from "node:path";
|
|
1640
1657
|
|
|
@@ -1687,17 +1704,58 @@ var COMMANDS = [
|
|
|
1687
1704
|
]
|
|
1688
1705
|
},
|
|
1689
1706
|
{ name: "summary", summary: "Count your sandboxes by status, size, template, tag or any field.", examples: ["agental summary", "agental summary --facets size,status"] },
|
|
1690
|
-
{
|
|
1707
|
+
{
|
|
1708
|
+
name: "exec",
|
|
1709
|
+
summary: "Run a command in a sandbox and print what it prints.",
|
|
1710
|
+
examples: ["agental exec sbx_2a9a47e50daec64a -- ls -la", "agental exec sbx_2a9a47e50daec64a -- npm test"],
|
|
1711
|
+
flags: [
|
|
1712
|
+
["-- <command> [args...]", "what to run; everything after -- is the command's own"]
|
|
1713
|
+
]
|
|
1714
|
+
},
|
|
1691
1715
|
{ name: "shell", summary: "Open a login shell in a sandbox, in this terminal, with no SSH key or port.", examples: ["agental shell sbx_2a9a47e50daec64a"] },
|
|
1692
|
-
{
|
|
1716
|
+
{
|
|
1717
|
+
name: "ssh",
|
|
1718
|
+
summary: "Open a shell in a sandbox, or run a command there, over SSH.",
|
|
1719
|
+
examples: ["agental ssh sbx_2a9a47e50daec64a", "agental ssh sbx_2a9a47e50daec64a --tmux"],
|
|
1720
|
+
flags: [
|
|
1721
|
+
["--tmux", "keep the shell in a tmux session, to come back to after a lost connection"],
|
|
1722
|
+
["[ssh options]", "anything ssh itself takes, as -L 8080:localhost:8080"]
|
|
1723
|
+
]
|
|
1724
|
+
},
|
|
1693
1725
|
{ name: "scp", summary: "Copy files to or from a sandbox over SSH.", examples: ["agental scp ./build.tar.gz sbx_2a9a47e50daec64a:/tmp/"] },
|
|
1694
1726
|
{ name: "ssh-config", summary: "Print a Host block for ~/.ssh/config, so anything that speaks SSH reaches a sandbox by its id.", examples: ["agental ssh-config sbx_2a9a47e50daec64a >> ~/.ssh/config"] },
|
|
1695
1727
|
{ name: "ssh-connect", summary: "Reach a sandbox for ssh: what the Host block ssh-config prints runs. It is not typed by hand." },
|
|
1696
1728
|
{ name: "ssh-keys", summary: "List or remove the SSH keys a sandbox lets in." },
|
|
1697
1729
|
{ name: "ssh-off", summary: "Turn SSH off for a sandbox and close its port." },
|
|
1698
|
-
{
|
|
1699
|
-
|
|
1700
|
-
|
|
1730
|
+
{
|
|
1731
|
+
name: "start",
|
|
1732
|
+
summary: "Start a stopped sandbox, or every one --where finds.",
|
|
1733
|
+
examples: ["agental start sbx_2a9a47e50daec64a"],
|
|
1734
|
+
flags: [
|
|
1735
|
+
["--where '<words>'", "every sandbox the words find, as one job"],
|
|
1736
|
+
["--yes", "with --where: start them without asking"],
|
|
1737
|
+
["--max-burst-fee <dollars>", "the most this start may pay in burst fees"]
|
|
1738
|
+
]
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
name: "stop",
|
|
1742
|
+
summary: "Stop a sandbox, or every one --where finds. Its disk is kept.",
|
|
1743
|
+
examples: ["agental stop sbx_2a9a47e50daec64a", "agental stop sbx_2a9a47e50daec64a --keep-memory", "agental stop --where 'bench'"],
|
|
1744
|
+
flags: [
|
|
1745
|
+
["--keep-memory", "keep what runs in memory too, so it carries on from where it was"],
|
|
1746
|
+
["--where '<words>'", "every sandbox the words find, as one job"],
|
|
1747
|
+
["--yes", "with --where: stop them without asking"]
|
|
1748
|
+
]
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
name: "delete",
|
|
1752
|
+
summary: "Delete a sandbox, or every one --where finds. It cannot be undone.",
|
|
1753
|
+
examples: ["agental delete sbx_2a9a47e50daec64a"],
|
|
1754
|
+
flags: [
|
|
1755
|
+
["--where '<words>'", "every sandbox the words find, as one job"],
|
|
1756
|
+
["--confirm <count>", "with --where: how many it finds, typed so that none are deleted by mistake"]
|
|
1757
|
+
]
|
|
1758
|
+
},
|
|
1701
1759
|
{ name: "recover", summary: "Get a stuck sandbox going again: what runs in it is killed, its disk is kept." },
|
|
1702
1760
|
{ name: "auto-stop", summary: "Say when a running sandbox stops by itself, or that it never does.", examples: ["agental auto-stop sbx_2a9a47e50daec64a --in 2h", "agental auto-stop sbx_2a9a47e50daec64a --never"] },
|
|
1703
1761
|
{ name: "jobs", summary: "Follow or cancel the work started on many sandboxes at once." },
|
|
@@ -1713,10 +1771,51 @@ var COMMANDS = [
|
|
|
1713
1771
|
{ name: "network", summary: "Say what a sandbox may reach outside itself.", examples: ["agental network sbx_2a9a47e50daec64a --allow github.com,registry.npmjs.org", "agental network sbx_2a9a47e50daec64a --none"] },
|
|
1714
1772
|
{ name: "egress", summary: "Say where a sandbox's web traffic leaves from, or read your residential egress.", examples: ["agental egress sbx_2a9a47e50daec64a residential de"] },
|
|
1715
1773
|
{ name: "templates", summary: "List your templates: what new sandboxes start from." },
|
|
1716
|
-
{
|
|
1717
|
-
|
|
1774
|
+
{
|
|
1775
|
+
name: "template",
|
|
1776
|
+
summary: "Make, read, change and start templates.",
|
|
1777
|
+
examples: ["agental template create my-env", "agental template start my-env --size medium", "agental template put my-env sbx_2a9a47e50daec64a"],
|
|
1778
|
+
flags: [
|
|
1779
|
+
["--size <size>", "start: the size its sandboxes start as"],
|
|
1780
|
+
["--snapshot <snapshot-id>", "start: start them from this snapshot"],
|
|
1781
|
+
["--new-machine", "start: start them as a new machine, from no snapshot"],
|
|
1782
|
+
["--ttl <time> | default", "start: stop them after this long, as 2h"],
|
|
1783
|
+
["--tag <tag>, --meta <key>=<value>", "create: label it (may be given again)"],
|
|
1784
|
+
["--json", "print as JSON"]
|
|
1785
|
+
]
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
name: "secrets",
|
|
1789
|
+
summary: "Keep values and files out of a sandbox, or out of every sandbox of a template.",
|
|
1790
|
+
examples: ["agental secrets --template default set GITHUB_TOKEN=ghp_\u2026 --host github.com,api.github.com", "agental secrets sbx_2a9a47e50daec64a"],
|
|
1791
|
+
flags: [
|
|
1792
|
+
["--template <template>", "the template's secrets, for every sandbox made from it"],
|
|
1793
|
+
["--host <host>[,<host>...]", "set, hosts: keep the value out of the sandbox, sent only to these hosts"],
|
|
1794
|
+
["--plain", "set: a variable the sandbox sees, where its template keeps one out"],
|
|
1795
|
+
["--text <text>", "put-file: the file's content, in place of a local file"],
|
|
1796
|
+
["--json", "print as JSON"]
|
|
1797
|
+
]
|
|
1798
|
+
},
|
|
1718
1799
|
{ name: "schedules", summary: "List a sandbox's schedules." },
|
|
1719
|
-
{
|
|
1800
|
+
{
|
|
1801
|
+
name: "schedule",
|
|
1802
|
+
summary: "Run a command in a sandbox on a timer, or once at a time.",
|
|
1803
|
+
examples: ["agental schedule add sbx_2a9a47e50daec64a --every 1h -- npm test", "agental schedule runs sbx_2a9a47e50daec64a nightly"],
|
|
1804
|
+
flags: [
|
|
1805
|
+
["--every 5m|15m|1h|1d", "add, update: how often, counted from now"],
|
|
1806
|
+
['--cron "<m h dom mon dow>"', "add, update: when, as cron says it, in UTC unless --tz says"],
|
|
1807
|
+
["--tz <zone>", "the time zone --cron is read in, as Europe/Sofia"],
|
|
1808
|
+
["--at <date-time>", "add, update: once, at that moment"],
|
|
1809
|
+
["--name <name>", "what to call it, for show, run and the rest"],
|
|
1810
|
+
["--timeout <time>", "how long a run may take (default 10m, at most 6h)"],
|
|
1811
|
+
["--if-stopped start|skip", "start a stopped sandbox for the run and stop it after (start), or skip"],
|
|
1812
|
+
["--keep-memory", "when the run stops the sandbox again, keep its memory too"],
|
|
1813
|
+
["--overlap skip|replace|parallel", "when the last run still goes: skip this one, stop that one, or run both"],
|
|
1814
|
+
["--delete-after", "with --at: delete the sandbox after a run that exits 0"],
|
|
1815
|
+
["--limit <n>", "runs: how many to list"],
|
|
1816
|
+
["--json", "print as JSON"]
|
|
1817
|
+
]
|
|
1818
|
+
},
|
|
1720
1819
|
{ name: "metrics", summary: "Read CPU, memory and disk, of each sandbox now or of one over time.", examples: ["agental metrics", "agental metrics sbx_2a9a47e50daec64a --since 2h"] },
|
|
1721
1820
|
{ name: "email", summary: "Give a sandbox an email address of its own, and read and send its mail." },
|
|
1722
1821
|
{ name: "desktop", summary: "Turn on a screen in a sandbox, watch it, and drive it." },
|
|
@@ -1728,11 +1827,25 @@ var COMMANDS = [
|
|
|
1728
1827
|
{ name: "webhooks", summary: "List the addresses your account's events are sent to." },
|
|
1729
1828
|
{ name: "webhook", summary: "Add, change and remove the addresses your account's events are sent to.", examples: ["agental webhook add https://example.com/agental --all"] },
|
|
1730
1829
|
{ name: "keys", summary: "List your account's API keys." },
|
|
1731
|
-
{
|
|
1830
|
+
{
|
|
1831
|
+
name: "key",
|
|
1832
|
+
summary: "Make, read, limit and delete API keys.",
|
|
1833
|
+
examples: ["agental key add ci --preset ci", "agental key add reader --preset read-only --expires 30d"],
|
|
1834
|
+
flags: [
|
|
1835
|
+
["--preset <preset>", "add: read-only, full-sandbox, ci or admin"],
|
|
1836
|
+
["--actions <action>[,...]", "add: exactly these actions, in place of a preset"],
|
|
1837
|
+
["--sandbox <sandbox-id>", "add: reach only these sandboxes (may be given again)"],
|
|
1838
|
+
["--template <template>", "add: reach only these templates and their sandboxes (may be given again)"],
|
|
1839
|
+
["--expires <date> | <n>d | <n>h", "add: stop working then, as 2026-12-31 or 30d"],
|
|
1840
|
+
["--allow-from <address-or-range>", "add, allow-from: be used only from these addresses (may be given again)"],
|
|
1841
|
+
["--anywhere", "allow-from: lift the limit"],
|
|
1842
|
+
["--json", "print as JSON"]
|
|
1843
|
+
]
|
|
1844
|
+
},
|
|
1732
1845
|
{ name: "org", summary: "List, switch and make the accounts you belong to." },
|
|
1733
1846
|
{ name: "members", summary: "List or remove the members of a team." },
|
|
1734
1847
|
{ name: "invite", summary: "Invite someone to your team by email." },
|
|
1735
|
-
{ name: "billing", summary: "Your plan, credits, invoices and card, and buying credits.", examples: ["agental billing", "agental billing invoices", "agental billing top-up 500"] },
|
|
1848
|
+
{ name: "billing", summary: "Your plan, credits, invoices and card, and buying credits.", examples: ["agental billing", "agental billing invoices", "agental billing details", "agental billing top-up 500"] },
|
|
1736
1849
|
{ name: "headroom", summary: "How close you run to your plan's limits, and your burst budget." },
|
|
1737
1850
|
{ name: "account", summary: "Export everything agental keeps about your account and you." },
|
|
1738
1851
|
{ name: "login", summary: "Sign in through the browser, or with a key from standard input." },
|
|
@@ -1779,7 +1892,14 @@ var COMMANDS = [
|
|
|
1779
1892
|
"agental secret get-file|rm-file (<sandbox-id> | --template <template>) <path>"
|
|
1780
1893
|
],
|
|
1781
1894
|
examples: ["agental secret set --template default GITHUB_TOKEN=ghp_\u2026 --host github.com,api.github.com", "agental secret list sbx_2a9a47e50daec64a"],
|
|
1782
|
-
also: "secrets <sandbox-id> <verb>"
|
|
1895
|
+
also: "secrets <sandbox-id> <verb>",
|
|
1896
|
+
flags: [
|
|
1897
|
+
["--template <template>", "the template's secrets, for every sandbox made from it"],
|
|
1898
|
+
["--host <host>[,<host>...]", "set, hosts: keep the value out of the sandbox, sent only to these hosts"],
|
|
1899
|
+
["--plain", "set: a variable the sandbox sees, where its template keeps one out"],
|
|
1900
|
+
["--text <text>", "put-file: the file's content, in place of a local file"],
|
|
1901
|
+
["--json", "print as JSON"]
|
|
1902
|
+
]
|
|
1783
1903
|
},
|
|
1784
1904
|
{ name: "job", summary: "Follow or cancel the work started on many sandboxes at once.", usage: ["agental job list [--json]", "agental job show <job-id> [--json]", "agental job cancel <job-id>"], also: "jobs" },
|
|
1785
1905
|
{
|
|
@@ -2062,7 +2182,7 @@ function sandboxIn(words2, valued = []) {
|
|
|
2062
2182
|
// ../src/cli-completion.ts
|
|
2063
2183
|
var SHELLS = ["zsh", "bash", "fish"];
|
|
2064
2184
|
var SUBCOMMANDS = {
|
|
2065
|
-
billing: ["prices", "invoices", "card", "top-up", "auto-reload"],
|
|
2185
|
+
billing: ["prices", "invoices", "card", "details", "top-up", "auto-reload"],
|
|
2066
2186
|
// Each thing that lists as its plural lists as itself too.
|
|
2067
2187
|
template: ["list"],
|
|
2068
2188
|
key: ["list"],
|
|
@@ -2232,7 +2352,7 @@ async function cached(what, as, ask8) {
|
|
|
2232
2352
|
const folder = path4.join(process.env["XDG_CACHE_HOME"] || path4.join(os5.homedir(), ".cache"), "agental");
|
|
2233
2353
|
const file = path4.join(folder, `complete-${what}-${createHash2("sha256").update(as).digest("hex").slice(0, 16)}.json`);
|
|
2234
2354
|
try {
|
|
2235
|
-
const kept2 = JSON.parse(
|
|
2355
|
+
const kept2 = JSON.parse(readFileSync4(file, "utf8"));
|
|
2236
2356
|
if (Date.now() - kept2.at < KEPT_MS) {
|
|
2237
2357
|
return kept2.body;
|
|
2238
2358
|
}
|
|
@@ -4185,7 +4305,7 @@ function publicKeysFrom(given) {
|
|
|
4185
4305
|
const file = each.startsWith("~/") ? `${os6.homedir()}${each.slice(1)}` : each;
|
|
4186
4306
|
let text;
|
|
4187
4307
|
try {
|
|
4188
|
-
text =
|
|
4308
|
+
text = readFileSync5(file, "utf8");
|
|
4189
4309
|
} catch {
|
|
4190
4310
|
throw new Error(`${each} is neither a public key nor a file that can be read. Give a key line, as ssh-ed25519 AAAA... you@laptop, or its file, as ~/.ssh/id_ed25519.pub.`);
|
|
4191
4311
|
}
|
|
@@ -4760,7 +4880,7 @@ async function clipboard(id, text) {
|
|
|
4760
4880
|
process.stdout.write(String(body.text ?? ""));
|
|
4761
4881
|
return;
|
|
4762
4882
|
}
|
|
4763
|
-
const given = text === "-" ?
|
|
4883
|
+
const given = text === "-" ? readFileSync5(0, "utf8") : text;
|
|
4764
4884
|
const response = await request(at4, { method: "PUT", body: JSON.stringify({ text: given }) });
|
|
4765
4885
|
if (!response.ok) {
|
|
4766
4886
|
fail(response.status, await readBody(response));
|
|
@@ -5733,9 +5853,9 @@ async function telemetry(positionals, given, asJson) {
|
|
|
5733
5853
|
}
|
|
5734
5854
|
async function billing(positionals, asJson, limit) {
|
|
5735
5855
|
const [what, amount, ...rest] = positionals;
|
|
5736
|
-
const kinds = ["prices", "invoices", "card", "top-up", "auto-reload"];
|
|
5856
|
+
const kinds = ["prices", "invoices", "card", "details", "top-up", "auto-reload"];
|
|
5737
5857
|
const near = what !== void 0 && !kinds.includes(what) ? nearest(what, kinds) : null;
|
|
5738
|
-
const usage = `${near ? `billing has no ${what}: did you mean billing ${near}? ` : ""}billing takes nothing, prices, invoices, card, card save, top-up <dollars>, or auto-reload <dollars | off>`;
|
|
5858
|
+
const usage = `${near ? `billing has no ${what}: did you mean billing ${near}? ` : ""}billing takes nothing, prices, invoices, card, card save, details, top-up <dollars>, or auto-reload <dollars | off>`;
|
|
5739
5859
|
if (rest.length > 0 || what !== "top-up" && what !== "auto-reload" && !(what === "card" && amount === "save") && amount !== void 0) {
|
|
5740
5860
|
throw new Error(usage);
|
|
5741
5861
|
}
|
|
@@ -5754,6 +5874,11 @@ async function billing(positionals, asJson, limit) {
|
|
|
5754
5874
|
await invoices(asJson, limit);
|
|
5755
5875
|
return;
|
|
5756
5876
|
}
|
|
5877
|
+
case "details": {
|
|
5878
|
+
const body = await asked("/v1/billing/details", { method: "GET" });
|
|
5879
|
+
print4(body, () => describeDetails(body.details));
|
|
5880
|
+
return;
|
|
5881
|
+
}
|
|
5757
5882
|
case "prices": {
|
|
5758
5883
|
const body = await asked("/v1/billing/plans", { method: "GET" });
|
|
5759
5884
|
print4(body, () => isTerminal(process.stdout) ? pricesForPeople(body) : describePrices(body));
|
|
@@ -5916,6 +6041,23 @@ function describeCard(card) {
|
|
|
5916
6041
|
const wallet = card.wallet ? `, through ${WALLETS[card.wallet] ?? card.wallet}` : "";
|
|
5917
6042
|
return `${brand}${ending}${expires}${wallet}. It is changed in the console, under Billing.`;
|
|
5918
6043
|
}
|
|
6044
|
+
function describeDetails(details) {
|
|
6045
|
+
if (!details) {
|
|
6046
|
+
return "No billing details yet: they are kept once you save a card or pay, and changed in the console, under Billing.\n";
|
|
6047
|
+
}
|
|
6048
|
+
const where = details.address;
|
|
6049
|
+
const address = where ? [where.line1, where.line2, [where.postalCode, where.city].filter(Boolean).join(" "), where.state, where.country].filter((part) => part).join(", ") : "";
|
|
6050
|
+
const lines = [
|
|
6051
|
+
["Invoices to", details.email ?? "not set"],
|
|
6052
|
+
// With no name, the address is what they are billed to.
|
|
6053
|
+
["Billed to", details.name ?? (address || "not set")],
|
|
6054
|
+
...details.name && address ? [["", address]] : [],
|
|
6055
|
+
...details.taxIds.length > 0 ? details.taxIds.map((id, index) => [index === 0 ? "Tax ID" : "", `${id.value}${id.verification ? ` (${id.verification})` : ""}`]) : [["Tax ID", "not set"]]
|
|
6056
|
+
];
|
|
6057
|
+
return `${lines.filter(([label, value]) => label !== "" || value !== "").map(([label, value]) => `${label.padEnd(14)}${value}
|
|
6058
|
+
`).join("")}They are changed in the console, under Billing, and the next invoice carries them.
|
|
6059
|
+
`;
|
|
6060
|
+
}
|
|
5919
6061
|
async function invoices(asJson, limit) {
|
|
5920
6062
|
if (limit !== void 0 && (!/^\d+$/.test(limit) || Number(limit) < 1 || Number(limit) > 100)) {
|
|
5921
6063
|
throw new Error("billing invoices --limit takes how many of the newest invoices to list, a whole number from 1 to 100.");
|
|
@@ -6546,7 +6688,7 @@ Usage
|
|
|
6546
6688
|
agental key show <key> [--json]
|
|
6547
6689
|
agental key allow-from <key> (<address-or-range>... | --anywhere) [--json]
|
|
6548
6690
|
agental key delete <key>
|
|
6549
|
-
agental billing [prices | card [save] | top-up <dollars> | auto-reload <dollars | off>] [--json]
|
|
6691
|
+
agental billing [prices | card [save] | details | top-up <dollars> | auto-reload <dollars | off>] [--json]
|
|
6550
6692
|
agental billing invoices [--limit <n>] [--json]
|
|
6551
6693
|
agental headroom [--from <day or date-time>] [--to <day or date-time>] [--step 10m|hour|day] [--json]
|
|
6552
6694
|
agental headroom budget <dollars> | budget default [--json]
|
|
@@ -6743,10 +6885,11 @@ what is left of the month's credits, what is left of the top-ups, which are used
|
|
|
6743
6885
|
after it and do not expire, and the card it pays with. invoices lists the account's invoices,
|
|
6744
6886
|
newest first, each with its day, number, state, total and what it was for, and where to pay
|
|
6745
6887
|
one that is not paid yet; --limit lists that many of the newest, and --json gives each one's
|
|
6746
|
-
page and PDF to the account's owner.
|
|
6888
|
+
page and PDF to the account's owner. details says who the invoices are made out to: the email
|
|
6889
|
+
they go to, the name, address and tax ids on them, to the account's owner alone. The free plan costs nothing a month and pays for what runs from
|
|
6747
6890
|
credits alone; it makes tiny and small sandboxes. prices lists the plans with the sizes each
|
|
6748
|
-
makes, the top-ups with their bonus and the hourly price of each size. card
|
|
6749
|
-
of a page to save
|
|
6891
|
+
makes, the top-ups with their bonus and the hourly price of each size. card names the card the account
|
|
6892
|
+
pays with, and card save prints the address of a page to save one for the free plan: nothing is charged, and once it is saved the account
|
|
6750
6893
|
is given $10 of credit, once. Until it buys a top-up it runs 2 small sandboxes at once, then 20.
|
|
6751
6894
|
top-up <dollars> starts buying credits for
|
|
6752
6895
|
any whole number of dollars from 15 to 100,000, and prints the address of the page to pay on.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agental",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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",
|