agental 0.34.0 → 0.37.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 +49 -28
- 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.
|
|
7414
|
+
var CLI_VERSION = true ? "0.37.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}`;
|
|
@@ -8538,12 +8538,14 @@ function placesFrom(env = process.env) {
|
|
|
8538
8538
|
home,
|
|
8539
8539
|
config: env["XDG_CONFIG_HOME"]?.trim() || path2.join(home, ".config"),
|
|
8540
8540
|
claudeDir: env["CLAUDE_CONFIG_DIR"]?.trim() || path2.join(home, ".claude"),
|
|
8541
|
-
codexDir: env["CODEX_HOME"]?.trim() || path2.join(home, ".codex")
|
|
8541
|
+
codexDir: env["CODEX_HOME"]?.trim() || path2.join(home, ".codex"),
|
|
8542
|
+
grokDir: env["GROK_HOME"]?.trim() || path2.join(home, ".grok")
|
|
8542
8543
|
};
|
|
8543
8544
|
}
|
|
8544
8545
|
var SIGN_IN = {
|
|
8545
8546
|
"Claude Code": "/mcp, then agental, then Authenticate",
|
|
8546
8547
|
Codex: "codex mcp login agental",
|
|
8548
|
+
"Grok Build": "/mcps in grok, then agental",
|
|
8547
8549
|
Cursor: "Settings \u203A MCP, turn agental on, then log in",
|
|
8548
8550
|
Windsurf: "its MCP servers list, then agental",
|
|
8549
8551
|
"Gemini CLI": "/mcp auth agental",
|
|
@@ -8606,30 +8608,30 @@ function addToJson(agent, places, url) {
|
|
|
8606
8608
|
`);
|
|
8607
8609
|
return { agent: agent.agent, did: "added" };
|
|
8608
8610
|
}
|
|
8609
|
-
function
|
|
8611
|
+
function tomlHasConnector(text) {
|
|
8610
8612
|
const has = /^\s*\[\s*mcp_servers\s*\.\s*["']?agental["']?\s*[\].]/m.test(text) || /^\s*mcp_servers\s*\.\s*["']?agental["']?\s*[.=]/m.test(text) || /^\s*\[\s*mcp_servers\s*\]/m.test(text) && /^\s*["']?agental["']?\s*[.=]/m.test(text);
|
|
8611
8613
|
if (has) {
|
|
8612
8614
|
return "agental";
|
|
8613
8615
|
}
|
|
8614
8616
|
return /^\s*mcp_servers\s*=/m.test(text) ? "inline" : null;
|
|
8615
8617
|
}
|
|
8616
|
-
function
|
|
8617
|
-
if (!existsSync(
|
|
8618
|
+
function addToToml(agent, folder, url) {
|
|
8619
|
+
if (!existsSync(folder)) {
|
|
8618
8620
|
return null;
|
|
8619
8621
|
}
|
|
8620
|
-
const file = path2.join(
|
|
8622
|
+
const file = path2.join(folder, "config.toml");
|
|
8621
8623
|
const text = existsSync(file) ? readFileSync2(file, "utf8") : "";
|
|
8622
|
-
const has =
|
|
8624
|
+
const has = tomlHasConnector(text);
|
|
8623
8625
|
if (has === "agental") {
|
|
8624
|
-
return { agent
|
|
8626
|
+
return { agent, did: "already" };
|
|
8625
8627
|
}
|
|
8626
8628
|
if (has === "inline") {
|
|
8627
|
-
return { agent
|
|
8629
|
+
return { agent, did: "left", why: `${file} lists its servers inline, so it was left as it is: add agental = { url = "${url}" } to them` };
|
|
8628
8630
|
}
|
|
8629
8631
|
const eol = text.includes("\r\n") ? "\r\n" : "\n";
|
|
8630
8632
|
const lead = text === "" ? "" : text.endsWith("\n") ? eol : eol + eol;
|
|
8631
8633
|
replaceFile(file, `${text}${lead}[mcp_servers.${CONNECTOR_NAME}]${eol}url = "${url}"${eol}`);
|
|
8632
|
-
return { agent
|
|
8634
|
+
return { agent, did: "added" };
|
|
8633
8635
|
}
|
|
8634
8636
|
function run(command2, args, cwd) {
|
|
8635
8637
|
return new Promise((resolve) => {
|
|
@@ -8667,7 +8669,11 @@ async function step(agent, add) {
|
|
|
8667
8669
|
}
|
|
8668
8670
|
}
|
|
8669
8671
|
async function addConnector(url, places = placesFrom()) {
|
|
8670
|
-
const outcomes = [
|
|
8672
|
+
const outcomes = [
|
|
8673
|
+
await step("Claude Code", () => addToClaudeCode(places, url)),
|
|
8674
|
+
await step("Codex", () => addToToml("Codex", places.codexDir, url)),
|
|
8675
|
+
await step("Grok Build", () => addToToml("Grok Build", places.grokDir, url))
|
|
8676
|
+
];
|
|
8671
8677
|
for (const agent of JSON_AGENTS) {
|
|
8672
8678
|
outcomes.push(await step(agent.agent, () => addToJson(agent, places, url)));
|
|
8673
8679
|
}
|
|
@@ -9389,7 +9395,7 @@ var COMMANDS = [
|
|
|
9389
9395
|
[" --allow <addresses>", "reach only these addresses, comma-separated"],
|
|
9390
9396
|
[" --egress <egress>", "box, or residential:<country>[:sticky|rotating]"],
|
|
9391
9397
|
[" --spot", "half the price, in spare room taken back when needed"],
|
|
9392
|
-
[" --on-reclaim <what>", "with --spot: stop (default)
|
|
9398
|
+
[" --on-reclaim <what>", "with --spot: stop (default) or delete"],
|
|
9393
9399
|
[" --warn-at <chance>", "with --spot: warn at this chance, as 0.5 or 50%"],
|
|
9394
9400
|
[" --ssh-key <key or file>", "let this key in over SSH (may be given again)"],
|
|
9395
9401
|
[" --tag <tag>", "label it (may be given again)"],
|
|
@@ -9516,7 +9522,7 @@ var COMMANDS = [
|
|
|
9516
9522
|
{
|
|
9517
9523
|
name: "spot",
|
|
9518
9524
|
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
|
|
9525
|
+
examples: ["agental spot sbx_2a9a47e50daec64a", "agental spot sbx_2a9a47e50daec64a --on-reclaim delete --warn-at 30%", "agental spot sbx_2a9a47e50daec64a off"]
|
|
9520
9526
|
},
|
|
9521
9527
|
{ name: "templates", summary: "List your templates: what new sandboxes start from." },
|
|
9522
9528
|
{
|
|
@@ -11503,7 +11509,8 @@ var LIFECYCLE_EVENTS = [
|
|
|
11503
11509
|
"sandbox.labels_changed",
|
|
11504
11510
|
"sandbox.low_cpu",
|
|
11505
11511
|
"sandbox.upgraded",
|
|
11506
|
-
"sandbox.reclaim_chance"
|
|
11512
|
+
"sandbox.reclaim_chance",
|
|
11513
|
+
"sandbox.lost"
|
|
11507
11514
|
];
|
|
11508
11515
|
var WEBHOOK_EVENTS = [...LIFECYCLE_EVENTS, "prompt.created"];
|
|
11509
11516
|
var EMAIL_EVENTS = ["email.received", "email.delivered", "email.bounced"];
|
|
@@ -12470,6 +12477,9 @@ var SPOT_PRICE_MICROS_PER_HOUR = {
|
|
|
12470
12477
|
medium: LIST_PRICE_MICROS_PER_HOUR.medium / 2,
|
|
12471
12478
|
large: LIST_PRICE_MICROS_PER_HOUR.large / 2
|
|
12472
12479
|
};
|
|
12480
|
+
var SPOT_ON_RECLAIM = ["delete", "stop"];
|
|
12481
|
+
var SPOT_ON_RECLAIM_READ = [...SPOT_ON_RECLAIM, "upgrade"];
|
|
12482
|
+
var SPOT_RUN_LIMIT_SECONDS = 24 * 60 * 60;
|
|
12473
12483
|
var HOURS_PER_MONTH = 730;
|
|
12474
12484
|
var STOPPED_MICROS_PER_GB_MONTH = 5e4;
|
|
12475
12485
|
var BYTES_PER_GB = 1e9;
|
|
@@ -13893,7 +13903,7 @@ async function autoStop(id, inText, at4, never, asJson) {
|
|
|
13893
13903
|
);
|
|
13894
13904
|
return;
|
|
13895
13905
|
}
|
|
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)}`;
|
|
13906
|
+
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
13907
|
process.stdout.write(`${body.sandboxId} stops at ${body.autoStopAt}, in ${timeInWords(body.secondsLeft ?? 0)}: ${by}.
|
|
13898
13908
|
`);
|
|
13899
13909
|
}
|
|
@@ -14277,8 +14287,8 @@ async function egress(positionals, values) {
|
|
|
14277
14287
|
}
|
|
14278
14288
|
function spotSettingsFrom(values) {
|
|
14279
14289
|
const onReclaim = values["on-reclaim"];
|
|
14280
|
-
if (onReclaim !== void 0 && onReclaim !== "delete" && onReclaim !== "stop"
|
|
14281
|
-
throw new Error("--on-reclaim is delete
|
|
14290
|
+
if (onReclaim !== void 0 && onReclaim !== "delete" && onReclaim !== "stop") {
|
|
14291
|
+
throw new Error("--on-reclaim is delete or stop: what is done to a spot sandbox when its room is taken back.");
|
|
14282
14292
|
}
|
|
14283
14293
|
const given = values["warn-at"];
|
|
14284
14294
|
const percent = given?.endsWith("%") ? Number(given.slice(0, -1)) / 100 : Number(given);
|
|
@@ -14294,8 +14304,7 @@ function spotInWords(sandbox) {
|
|
|
14294
14304
|
}
|
|
14295
14305
|
const done2 = {
|
|
14296
14306
|
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"
|
|
14307
|
+
stop: "stopped when its room is taken back, its disk kept"
|
|
14299
14308
|
};
|
|
14300
14309
|
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
14310
|
const warnAt = typeof spot2.warnAt === "number" ? `, warned at ${Math.round(spot2.warnAt * 100)}%` : "";
|
|
@@ -14304,7 +14313,7 @@ function spotInWords(sandbox) {
|
|
|
14304
14313
|
async function spot(positionals, values) {
|
|
14305
14314
|
const [id, given, ...rest] = positionals;
|
|
14306
14315
|
const word = given === "normal" ? "off" : given;
|
|
14307
|
-
const how = "spot takes <sandbox-id>, and then nothing, off, or --on-reclaim delete|stop
|
|
14316
|
+
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
14317
|
if (id === void 0 || rest.length > 0 || word !== void 0 && word !== "off") {
|
|
14309
14318
|
throw new Error(how);
|
|
14310
14319
|
}
|
|
@@ -15028,9 +15037,9 @@ async function telemetry(positionals, given, asJson) {
|
|
|
15028
15037
|
}
|
|
15029
15038
|
async function billing(positionals, asJson, limit) {
|
|
15030
15039
|
const [what, amount, ...rest] = positionals;
|
|
15031
|
-
const kinds = ["prices", "compare", "invoices", "card", "details", "top-up", "auto-reload"];
|
|
15040
|
+
const kinds = ["prices", "compare", "invoices", "card", "details", "top-up", "auto-reload", "email-copy"];
|
|
15032
15041
|
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>,
|
|
15042
|
+
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
15043
|
if (rest.length > 0 || what !== "top-up" && what !== "auto-reload" && !(what === "card" && amount === "save") && amount !== void 0) {
|
|
15035
15044
|
throw new Error(usage);
|
|
15036
15045
|
}
|
|
@@ -15113,6 +15122,17 @@ Nothing is charged until it is paid. agental billing shows it within a minute of
|
|
|
15113
15122
|
`);
|
|
15114
15123
|
return;
|
|
15115
15124
|
}
|
|
15125
|
+
case "email-copy": {
|
|
15126
|
+
const body = await asked("/v1/billing/email-copy", { method: "GET" });
|
|
15127
|
+
print4(
|
|
15128
|
+
body,
|
|
15129
|
+
() => 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.
|
|
15130
|
+
` : 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.
|
|
15131
|
+
` : `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.
|
|
15132
|
+
`
|
|
15133
|
+
);
|
|
15134
|
+
return;
|
|
15135
|
+
}
|
|
15116
15136
|
default:
|
|
15117
15137
|
throw new Error(usage);
|
|
15118
15138
|
}
|
|
@@ -15836,7 +15856,7 @@ Setting up
|
|
|
15836
15856
|
|
|
15837
15857
|
Usage
|
|
15838
15858
|
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
|
|
15859
|
+
[--spot [--on-reclaim delete|stop] [--warn-at <chance>]]
|
|
15840
15860
|
${operator ? "[--box <name-or-id>] " : ""}[--allow <address>[,<address>...]] [--egress box | residential:<country>[:sticky|rotating]] [--max-burst-fee <dollars>]
|
|
15841
15861
|
[--ssh-key <public-key-or-file>]... [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
|
|
15842
15862
|
agental summary [--where '<words>'] [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]... [--facets <field>[,<field>...]] [--json]
|
|
@@ -15862,7 +15882,7 @@ Usage
|
|
|
15862
15882
|
agental auto-stop <sandbox-id> [--in <time> | --at <date-time> | --never] [--json]
|
|
15863
15883
|
agental network <sandbox-id> [--allow <address>[,<address>...] | --none] [--json]
|
|
15864
15884
|
agental egress <sandbox-id> [box | residential <country> [sticky | rotating]] [--json]
|
|
15865
|
-
agental spot <sandbox-id> [off] [--on-reclaim delete|stop
|
|
15885
|
+
agental spot <sandbox-id> [off] [--on-reclaim delete|stop] [--warn-at <chance>] [--json]
|
|
15866
15886
|
agental templates [--json]
|
|
15867
15887
|
agental template create <name> [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
|
|
15868
15888
|
agental template show <template> [--json]
|
|
@@ -15944,7 +15964,7 @@ Usage
|
|
|
15944
15964
|
agental key show <key> [--json]
|
|
15945
15965
|
agental key allow-from <key> (<address-or-range>... | --anywhere) [--json]
|
|
15946
15966
|
agental key delete <key>
|
|
15947
|
-
agental billing [prices | compare | card [save] | details | top-up <dollars> | auto-reload <dollars | off>] [--json]
|
|
15967
|
+
agental billing [prices | compare | card [save] | details | top-up <dollars> | auto-reload <dollars | off> | email-copy] [--json]
|
|
15948
15968
|
agental billing invoices [--limit <n>] [--json]
|
|
15949
15969
|
agental headroom [--from <day or date-time>] [--to <day or date-time>] [--step 10m|hour|day] [--json]
|
|
15950
15970
|
agental headroom budget <dollars> | budget default [--json]
|
|
@@ -16021,9 +16041,8 @@ says when a running sandbox is to be stopped, with --in or --at moves that stop,
|
|
|
16021
16041
|
for the run under way, and with --never takes its time limit away, for this run and the next.
|
|
16022
16042
|
create --spot makes a spot sandbox: half the list price, in room on our servers nobody else is
|
|
16023
16043
|
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
|
|
16025
|
-
|
|
16026
|
-
needed, and stops it otherwise. It is not counted in the plan's running count, and comes with
|
|
16044
|
+
stop (the default) stops it and keeps its disk, never its memory; delete deletes it. One run
|
|
16045
|
+
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
16046
|
the account's first top-up. agental spot shows its chance of being stopped in the next minute, a
|
|
16028
16047
|
hint and not a promise, and with --warn-at sets the chance at which sandbox.reclaim_chance is sent
|
|
16029
16048
|
(0.5 when left out); agental spot <sandbox-id> off turns off spot: a standard sandbox from then on.
|
|
@@ -16229,6 +16248,8 @@ Nothing is charged until it is paid there. auto-reload <dollars> has the card sa
|
|
|
16229
16248
|
last purchase charged for a top-up of that much, with tax, when your credits run out, and the
|
|
16230
16249
|
credits added before any sandbox is stopped: at most three times a day, and not again for a
|
|
16231
16250
|
day after a card that would not pay. auto-reload off turns it off.
|
|
16251
|
+
email-copy shows the address a copy of each billing email goes to, beside the owner, if any:
|
|
16252
|
+
an owner sets it under Billing in the console.
|
|
16232
16253
|
account export prints everything agental keeps about your account and you, as JSON: the
|
|
16233
16254
|
account, its sessions with the address and browser each began from, its keys by name, billing,
|
|
16234
16255
|
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.
|
|
3
|
+
"version": "0.37.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",
|