agental 0.64.0 → 0.67.1
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 +165 -74
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7424,7 +7424,7 @@ function requestHeaders(given) {
|
|
|
7424
7424
|
|
|
7425
7425
|
// ../src/cli-build.ts
|
|
7426
7426
|
var PUBLISHED = true;
|
|
7427
|
-
var CLI_VERSION = true ? "0.
|
|
7427
|
+
var CLI_VERSION = true ? "0.67.1" : "dev";
|
|
7428
7428
|
var DEFAULT_API_URL = true ? "https://agental.io" : "http://127.0.0.1:8741";
|
|
7429
7429
|
var PACKAGE_NAME = "agental";
|
|
7430
7430
|
var USER_AGENT = `agental-cli/${CLI_VERSION}`;
|
|
@@ -7923,6 +7923,7 @@ var KEY_ACTIONS = [
|
|
|
7923
7923
|
"ssh",
|
|
7924
7924
|
"desktop",
|
|
7925
7925
|
"host",
|
|
7926
|
+
"site.open",
|
|
7926
7927
|
"network.write",
|
|
7927
7928
|
"secret.read",
|
|
7928
7929
|
"secret.write",
|
|
@@ -9445,7 +9446,7 @@ var COMMANDS = [
|
|
|
9445
9446
|
["-t, --template <template>", "what it starts from (default: your default template)"],
|
|
9446
9447
|
[" --snapshot <snapshot-id>", "start it from this snapshot's disk"],
|
|
9447
9448
|
[" --image <image>[@<build>]", "start it from your image: its newest ready build, or that build"],
|
|
9448
|
-
["-s, --size <size>", "tiny, small, medium or
|
|
9449
|
+
["-s, --size <size>", "tiny, small, medium, large or xlarge (default: the template's)"],
|
|
9449
9450
|
[" --region <region>", "where it runs; agental regions lists them"],
|
|
9450
9451
|
[" --ttl <time>", "stop it after this long, as 30m or 2h"],
|
|
9451
9452
|
[" --allow <addresses>", "reach only these addresses, comma-separated"],
|
|
@@ -9639,7 +9640,7 @@ var COMMANDS = [
|
|
|
9639
9640
|
"agental guild requests <guild> | claim <guild> <request> | answer <guild> <request> <text> | close <guild> <request>",
|
|
9640
9641
|
"agental guild notes <guild> [<identity>] [--text <notes>] | pause <guild> | resume <guild>",
|
|
9641
9642
|
"agental guild mail <guild> [<mail>]",
|
|
9642
|
-
"agental guild work <guild> --as <name> [--role <role>] [--parallel <n>] [--answer-chars <n>] -- <command> [args...]"
|
|
9643
|
+
"agental guild work <guild> --as <name> [--role <role>] [--parallel <n>] [--answer-chars <n>] [--once] -- <command> [args...]"
|
|
9643
9644
|
],
|
|
9644
9645
|
examples: [
|
|
9645
9646
|
'agental guild create marketing --roles "blog manager:1,reviewer:2" --brief "Reviewers answer pass or fail."',
|
|
@@ -9648,7 +9649,8 @@ var COMMANDS = [
|
|
|
9648
9649
|
'agental guild post marketing "Review a1b2c3, please." --to-role reviewer --request',
|
|
9649
9650
|
"agental guild read marketing --wait-seconds 30 --done",
|
|
9650
9651
|
"agental guild mail marketing",
|
|
9651
|
-
"agental guild work marketing --as builder-1 --role builder -- claude -p --permission-mode acceptEdits"
|
|
9652
|
+
"agental guild work marketing --as builder-1 --role builder -- claude -p --permission-mode acceptEdits",
|
|
9653
|
+
"agental guild work marketing --as builder-1 --once -- claude -p"
|
|
9652
9654
|
],
|
|
9653
9655
|
flags: [
|
|
9654
9656
|
["--roles <name[:seats],...>", "create: the roles, each with its seats; attach: the roles its sandboxes may take"],
|
|
@@ -9669,6 +9671,7 @@ var COMMANDS = [
|
|
|
9669
9671
|
["--as <name> --role <role>", "work: the identity it works as, joined in the role where it is not held yet"],
|
|
9670
9672
|
["--parallel <n>", "work: how many agents run at once; 1 by default"],
|
|
9671
9673
|
["--answer-chars <n>", "work: how much of the end of a run's output its answer keeps; 16000, the most, by default"],
|
|
9674
|
+
["--once", "work: answer what is owed now, then exit 0 once nothing is owed and nothing runs: the command of a job a request wakes"],
|
|
9672
9675
|
["-- <command> [args...]", "work: the agent run for each request, its prompt on stdin; what it prints last is its answer"]
|
|
9673
9676
|
]
|
|
9674
9677
|
},
|
|
@@ -9787,6 +9790,7 @@ var COMMANDS = [
|
|
|
9787
9790
|
["--input <NAME>=<value>", "run: a value for one of its inputs, over the default"],
|
|
9788
9791
|
["--after-job <job>[:succeeded|failed]", "add, update: run it when a run of that job ends (any end, or that one)"],
|
|
9789
9792
|
["--on-mail <sandbox>", "add, update: run it when mail arrives at that sandbox's address"],
|
|
9793
|
+
["--on-guild-request <guild>:<identity>", "add, update: run it when a request to that identity, one its sandbox holds, finds the sandbox stopped"],
|
|
9790
9794
|
["--no-events", "update: take away every event that starts it"],
|
|
9791
9795
|
["--name <name>", "update: a new name"],
|
|
9792
9796
|
["--wait[=<seconds>]", "run, again: wait for it to end, print its output, exit with its exit code"],
|
|
@@ -10342,7 +10346,7 @@ async function complete(typed, reference, operator, fetchJson) {
|
|
|
10342
10346
|
const usages = [...found?.usage ?? [], ...usageOf(reference).get(name) ?? []];
|
|
10343
10347
|
const flags2 = flagsOf(usages);
|
|
10344
10348
|
const last = before[before.length - 1];
|
|
10345
|
-
const valueOf = flags2.get(last) ?? (last === "-t" ? "<template>" : last === "-s" ? "tiny|small|medium|large" : void 0);
|
|
10349
|
+
const valueOf = flags2.get(last) ?? (last === "-t" ? "<template>" : last === "-s" ? "tiny|small|medium|large|xlarge" : void 0);
|
|
10346
10350
|
if (valueOf !== void 0 && valueOf !== null) {
|
|
10347
10351
|
if (TEMPLATE.test(valueOf)) {
|
|
10348
10352
|
return starting(await templates(fetchJson));
|
|
@@ -10943,8 +10947,9 @@ function afterOf(job2) {
|
|
|
10943
10947
|
switch (job2.after) {
|
|
10944
10948
|
case "delete":
|
|
10945
10949
|
return "deletes the sandbox, if the command exits 0";
|
|
10950
|
+
case "pause":
|
|
10946
10951
|
case "stop_with_memory":
|
|
10947
|
-
return "
|
|
10952
|
+
return "pauses it again if the run started it, keeping its memory";
|
|
10948
10953
|
default:
|
|
10949
10954
|
return "stops it again if the run started it, keeping its disk";
|
|
10950
10955
|
}
|
|
@@ -11100,13 +11105,14 @@ function runInputsOf(options) {
|
|
|
11100
11105
|
function eventsOf(options) {
|
|
11101
11106
|
const afterJob = options["after-job"] ?? [];
|
|
11102
11107
|
const onMail = options["on-mail"] ?? [];
|
|
11108
|
+
const onGuildRequest = options["on-guild-request"] ?? [];
|
|
11103
11109
|
if (options["no-events"]) {
|
|
11104
|
-
if (afterJob.length > 0 || onMail.length > 0) {
|
|
11105
|
-
throw new Error("--no-events takes away every event that starts the job: give it without --after-job and --on-
|
|
11110
|
+
if (afterJob.length > 0 || onMail.length > 0 || onGuildRequest.length > 0) {
|
|
11111
|
+
throw new Error("--no-events takes away every event that starts the job: give it without --after-job, --on-mail and --on-guild-request.");
|
|
11106
11112
|
}
|
|
11107
11113
|
return [];
|
|
11108
11114
|
}
|
|
11109
|
-
if (afterJob.length === 0 && onMail.length === 0) {
|
|
11115
|
+
if (afterJob.length === 0 && onMail.length === 0 && onGuildRequest.length === 0) {
|
|
11110
11116
|
return void 0;
|
|
11111
11117
|
}
|
|
11112
11118
|
return [
|
|
@@ -11118,7 +11124,15 @@ function eventsOf(options) {
|
|
|
11118
11124
|
}
|
|
11119
11125
|
return { on: "job.run_finished", job: job2, outcome };
|
|
11120
11126
|
}),
|
|
11121
|
-
...onMail.map((sandbox) => ({ on: "email.received", sandbox }))
|
|
11127
|
+
...onMail.map((sandbox) => ({ on: "email.received", sandbox })),
|
|
11128
|
+
...onGuildRequest.map((given) => {
|
|
11129
|
+
const colon = given.indexOf(":");
|
|
11130
|
+
const [guild2, member] = colon < 0 ? ["", ""] : [given.slice(0, colon), given.slice(colon + 1)];
|
|
11131
|
+
if (guild2 === "" || member === "") {
|
|
11132
|
+
throw new Error(`--on-guild-request is a guild and an identity its sandbox holds, each by its name or id, as --on-guild-request shop:builder-1: ${given} is not.`);
|
|
11133
|
+
}
|
|
11134
|
+
return { on: "guild.request", guild: guild2, member };
|
|
11135
|
+
})
|
|
11122
11136
|
];
|
|
11123
11137
|
}
|
|
11124
11138
|
function eventsOfJob(job2) {
|
|
@@ -11126,7 +11140,15 @@ function eventsOfJob(job2) {
|
|
|
11126
11140
|
if (events.length === 0) {
|
|
11127
11141
|
return null;
|
|
11128
11142
|
}
|
|
11129
|
-
return events.map((event) =>
|
|
11143
|
+
return events.map((event) => {
|
|
11144
|
+
if (event.on === "job.run_finished") {
|
|
11145
|
+
return `after ${event.jobName ?? event.job}${event.outcome === "any" ? "" : ` (${event.outcome})`}`;
|
|
11146
|
+
}
|
|
11147
|
+
if (event.on === "guild.request") {
|
|
11148
|
+
return `requests to ${event.memberName ?? event.member} in ${event.guildName ?? event.guild}`;
|
|
11149
|
+
}
|
|
11150
|
+
return `mail to ${event.sandboxName ?? event.sandbox}`;
|
|
11151
|
+
}).join(", ");
|
|
11130
11152
|
}
|
|
11131
11153
|
function waitSecondsOf(options) {
|
|
11132
11154
|
const given = options["wait-seconds"];
|
|
@@ -11315,8 +11337,8 @@ async function job(client, positionals, command3, options) {
|
|
|
11315
11337
|
if ((options.input !== void 0 || options["secret-input"] !== void 0) && !["add", "update", "run"].includes(what)) {
|
|
11316
11338
|
throw new Error("--input goes with job add, update or run, and --secret-input with add or update.");
|
|
11317
11339
|
}
|
|
11318
|
-
if ((options["after-job"] !== void 0 || options["on-mail"] !== void 0 || options["no-events"]) && !["add", "update"].includes(what)) {
|
|
11319
|
-
throw new Error("--after-job, --on-mail and --no-events go with job add or update.");
|
|
11340
|
+
if ((options["after-job"] !== void 0 || options["on-mail"] !== void 0 || options["on-guild-request"] !== void 0 || options["no-events"]) && !["add", "update"].includes(what)) {
|
|
11341
|
+
throw new Error("--after-job, --on-mail, --on-guild-request and --no-events go with job add or update.");
|
|
11320
11342
|
}
|
|
11321
11343
|
if (rest.length > (what === "logs" || what === "keep" || what === "again" ? 1 : 0)) {
|
|
11322
11344
|
throw new Error(what === "add" ? "job add takes its name, then its command after --: agental job add nightly --sandbox <sandbox> --every 1h -- npm test" : USAGE4);
|
|
@@ -11351,7 +11373,7 @@ async function job(client, positionals, command3, options) {
|
|
|
11351
11373
|
const changes = { ...fieldsOf(options), ...options.name === void 0 ? {} : { name: options.name }, ...command3 !== null && command3.length > 0 ? { command: commandLine(command3) } : {} };
|
|
11352
11374
|
if (Object.keys(changes).length === 0) {
|
|
11353
11375
|
throw new Error(
|
|
11354
|
-
"job update needs something to change: --sandbox, --template (and --size), --keep-failed-for, --every, --cron, --at, --tz, --timeout, --overlap, --if-stopped, --keep-memory, --delete-after or --disk-only, --retries, --alerts, --max-monthly-spend, --input or --secret-input, --after-job, --on-mail or --no-events, --name for a new name, or a new command after --."
|
|
11376
|
+
"job update needs something to change: --sandbox, --template (and --size), --keep-failed-for, --every, --cron, --at, --tz, --timeout, --overlap, --if-stopped, --keep-memory, --delete-after or --disk-only, --retries, --alerts, --max-monthly-spend, --input or --secret-input, --after-job, --on-mail, --on-guild-request or --no-events, --name for a new name, or a new command after --."
|
|
11355
11377
|
);
|
|
11356
11378
|
}
|
|
11357
11379
|
print3(await ask6(client, "PATCH", path9, changes), options.json);
|
|
@@ -12454,7 +12476,7 @@ async function writeStdin(client, sandbox, id, one) {
|
|
|
12454
12476
|
}
|
|
12455
12477
|
|
|
12456
12478
|
// ../src/cli-servers.ts
|
|
12457
|
-
var SERVER_USAGE = "server takes list, add, show, readings, token, drain, gone or remove. agental server --help shows each.";
|
|
12479
|
+
var SERVER_USAGE = "server takes list, add, show, readings, token, drain, open, gone or remove. agental server --help shows each.";
|
|
12458
12480
|
var SERVERS_USAGE = "servers takes nothing to list them, offload [on|off] [--over <percent>], or core-days [--month <yyyy-mm>].";
|
|
12459
12481
|
var READING_MINUTES = ["1", "5", "15", "60"];
|
|
12460
12482
|
async function ask8(client, method, pathname, body) {
|
|
@@ -12523,6 +12545,19 @@ function holdsOf(server2) {
|
|
|
12523
12545
|
}
|
|
12524
12546
|
return parts.join(", ");
|
|
12525
12547
|
}
|
|
12548
|
+
function smtOf(server2) {
|
|
12549
|
+
const smt = server2.smt;
|
|
12550
|
+
if (smt === void 0 || smt.on === null) {
|
|
12551
|
+
return "not read yet";
|
|
12552
|
+
}
|
|
12553
|
+
if (smt.allowed === null) {
|
|
12554
|
+
return `${smt.on ? "on, so it takes no new sandbox" : "off"}: whether it may be on is not said by this server's agent yet`;
|
|
12555
|
+
}
|
|
12556
|
+
if (!smt.allowed) {
|
|
12557
|
+
return smt.on ? "on, though installed with --smt off: it takes no new sandbox until it is off" : "off, installed with --smt off";
|
|
12558
|
+
}
|
|
12559
|
+
return smt.on ? "on" : "off (allowed on: the processor or the server has it off)";
|
|
12560
|
+
}
|
|
12526
12561
|
function describe3(server2) {
|
|
12527
12562
|
const rows = [
|
|
12528
12563
|
["id", server2.id],
|
|
@@ -12532,6 +12567,8 @@ function describe3(server2) {
|
|
|
12532
12567
|
["address", server2.publicAddress ?? "none yet"],
|
|
12533
12568
|
// Null for a joined server too, whose cores could not be told: it is not counted until a count is agreed with agental.
|
|
12534
12569
|
["cores", server2.cores !== null ? String(server2.cores) : server2.agent.state === "waiting" ? "counted once it joins" : "not known: not counted until a count is agreed with us"],
|
|
12570
|
+
["smt", smtOf(server2)],
|
|
12571
|
+
["ksm", server2.ksm?.on === true ? "on: it takes no new sandbox until it is off" : server2.ksm?.on === false ? "off" : "not read yet"],
|
|
12535
12572
|
["holds", holdsOf(server2)],
|
|
12536
12573
|
["added", utc(server2.addedAt)]
|
|
12537
12574
|
];
|
|
@@ -12549,6 +12586,7 @@ Run this as root on the server, with the disk for sandboxes in place of /dev/DIS
|
|
|
12549
12586
|
${joined.join.installCommand}
|
|
12550
12587
|
|
|
12551
12588
|
`);
|
|
12589
|
+
process.stdout.write("SMT stays on: the server holds only your own sandboxes. Add --smt off to the line for a server whose sandboxes run code of your own customers.\n\n");
|
|
12552
12590
|
process.stdout.write(`token: ${joined.join.token}
|
|
12553
12591
|
works once, until ${utc(joined.join.expiresAt)}
|
|
12554
12592
|
`);
|
|
@@ -12709,6 +12747,17 @@ async function server(client, positionals, options) {
|
|
|
12709
12747
|
process.stderr.write("It takes no new sandbox. Nothing on it was stopped or moved.\n");
|
|
12710
12748
|
return;
|
|
12711
12749
|
}
|
|
12750
|
+
case "open": {
|
|
12751
|
+
const found = await serverNamed(client, target, "open");
|
|
12752
|
+
const opened = await ask8(client, "POST", `/v1/servers/${encodeURIComponent(found.id)}/open`);
|
|
12753
|
+
if (options.json) {
|
|
12754
|
+
printJson2(opened);
|
|
12755
|
+
return;
|
|
12756
|
+
}
|
|
12757
|
+
process.stdout.write(describe3(opened));
|
|
12758
|
+
process.stderr.write("It takes new sandboxes again.\n");
|
|
12759
|
+
return;
|
|
12760
|
+
}
|
|
12712
12761
|
case "gone": {
|
|
12713
12762
|
const found = await serverNamed(client, target, "gone");
|
|
12714
12763
|
if (options.reason === void 0 || options.reason.trim().length < 3) {
|
|
@@ -12824,6 +12873,9 @@ var LIFECYCLE_EVENTS = [
|
|
|
12824
12873
|
"sandbox.created",
|
|
12825
12874
|
"sandbox.started",
|
|
12826
12875
|
"sandbox.stopped",
|
|
12876
|
+
// A stop that kept its memory, and the start that carried on from it, under their own names (docs/pause-resume.md).
|
|
12877
|
+
"sandbox.paused",
|
|
12878
|
+
"sandbox.resumed",
|
|
12827
12879
|
"sandbox.archived",
|
|
12828
12880
|
"sandbox.error",
|
|
12829
12881
|
"sandbox.moved",
|
|
@@ -12851,7 +12903,7 @@ var HEADROOM_EVENTS = [
|
|
|
12851
12903
|
var JOB_EVENTS = ["job.created", "job.updated", "job.deleted", "job.run_started", "job.run_finished", "job.run_failed", "job.recovered", "job.paused"];
|
|
12852
12904
|
var TAILSCALE_EVENTS = ["tailscale.node_down", "tailscale.disconnected"];
|
|
12853
12905
|
var GUILD_EVENTS = ["guild.message", "guild.request_open", "guild.member_joined", "guild.member_left", "guild.paused", "guild.resumed"];
|
|
12854
|
-
var CONNECTION_EVENTS = ["connection.connected", "connection.signed_out", "connection.removed", "connection.sign_in_failed", "connection.renewal_failed"];
|
|
12906
|
+
var CONNECTION_EVENTS = ["connection.connected", "connection.signed_out", "connection.removed", "connection.sign_in_failed", "connection.renewal_failed", "connection.request_refused", "connection.service_refused"];
|
|
12855
12907
|
var WEBHOOK_KINDS = [...WEBHOOK_EVENTS, ...EMAIL_EVENTS, ...MEMBER_EVENTS, ...TEMPLATE_EVENTS, ...HEADROOM_EVENTS, ...JOB_EVENTS, ...TAILSCALE_EVENTS, ...GUILD_EVENTS, ...CONNECTION_EVENTS];
|
|
12856
12908
|
var WEBHOOK_GROUPS = [...new Set(WEBHOOK_KINDS.map((kind) => kind.slice(0, kind.indexOf("."))))];
|
|
12857
12909
|
function closestEvent(asked2) {
|
|
@@ -13163,20 +13215,23 @@ var MACHINE_SIZES = {
|
|
|
13163
13215
|
tiny: { vcpu: 1, memoryMb: 2048, diskGb: 20 },
|
|
13164
13216
|
small: { vcpu: 2, memoryMb: 4096, diskGb: 40 },
|
|
13165
13217
|
medium: { vcpu: 4, memoryMb: 8192, diskGb: 80 },
|
|
13166
|
-
large: { vcpu: 8, memoryMb: 16384, diskGb: 160 }
|
|
13218
|
+
large: { vcpu: 8, memoryMb: 16384, diskGb: 160 },
|
|
13219
|
+
xlarge: { vcpu: 16, memoryMb: 32768, diskGb: 320 }
|
|
13167
13220
|
};
|
|
13168
|
-
var MACHINE_SIZE_NAMES = ["tiny", "small", "medium", "large"];
|
|
13221
|
+
var MACHINE_SIZE_NAMES = ["tiny", "small", "medium", "large", "xlarge"];
|
|
13169
13222
|
var LIST_PRICE_MICROS_PER_HOUR = {
|
|
13170
13223
|
tiny: 13500,
|
|
13171
13224
|
small: 27e3,
|
|
13172
13225
|
medium: 54e3,
|
|
13173
|
-
large: 108e3
|
|
13226
|
+
large: 108e3,
|
|
13227
|
+
xlarge: 216e3
|
|
13174
13228
|
};
|
|
13175
13229
|
var SPOT_PRICE_MICROS_PER_HOUR = {
|
|
13176
13230
|
tiny: LIST_PRICE_MICROS_PER_HOUR.tiny / 2,
|
|
13177
13231
|
small: LIST_PRICE_MICROS_PER_HOUR.small / 2,
|
|
13178
13232
|
medium: LIST_PRICE_MICROS_PER_HOUR.medium / 2,
|
|
13179
|
-
large: LIST_PRICE_MICROS_PER_HOUR.large / 2
|
|
13233
|
+
large: LIST_PRICE_MICROS_PER_HOUR.large / 2,
|
|
13234
|
+
xlarge: LIST_PRICE_MICROS_PER_HOUR.xlarge / 2
|
|
13180
13235
|
};
|
|
13181
13236
|
var SPOT_ON_RECLAIM = ["delete", "stop"];
|
|
13182
13237
|
var SPOT_ON_RECLAIM_READ = [...SPOT_ON_RECLAIM, "upgrade"];
|
|
@@ -13199,17 +13254,21 @@ var STOPPED_MAX_MICROS_PER_HOUR = {
|
|
|
13199
13254
|
tiny: stoppedMicrosPerHour(wholeStoredBytes("tiny", false)),
|
|
13200
13255
|
small: stoppedMicrosPerHour(wholeStoredBytes("small", false)),
|
|
13201
13256
|
medium: stoppedMicrosPerHour(wholeStoredBytes("medium", false)),
|
|
13202
|
-
large: stoppedMicrosPerHour(wholeStoredBytes("large", false))
|
|
13257
|
+
large: stoppedMicrosPerHour(wholeStoredBytes("large", false)),
|
|
13258
|
+
xlarge: stoppedMicrosPerHour(wholeStoredBytes("xlarge", false))
|
|
13203
13259
|
};
|
|
13204
13260
|
var STOPPED_WITH_MEMORY_MAX_MICROS_PER_HOUR = {
|
|
13205
13261
|
tiny: stoppedMicrosPerHour(wholeStoredBytes("tiny", true)),
|
|
13206
13262
|
small: stoppedMicrosPerHour(wholeStoredBytes("small", true)),
|
|
13207
13263
|
medium: stoppedMicrosPerHour(wholeStoredBytes("medium", true)),
|
|
13208
|
-
large: stoppedMicrosPerHour(wholeStoredBytes("large", true))
|
|
13264
|
+
large: stoppedMicrosPerHour(wholeStoredBytes("large", true)),
|
|
13265
|
+
xlarge: stoppedMicrosPerHour(wholeStoredBytes("xlarge", true))
|
|
13209
13266
|
};
|
|
13210
13267
|
var SANDBOX_STATUSES = ["creating", "running", "stopped", "error", "deleted"];
|
|
13211
|
-
var SHOWN_STATUSES = [...SANDBOX_STATUSES, "restoring", "migrating"];
|
|
13268
|
+
var SHOWN_STATUSES = [...SANDBOX_STATUSES, "restoring", "migrating", "paused"];
|
|
13212
13269
|
var OUTBOUND_MODES = ["open", "blocked", "allowlist"];
|
|
13270
|
+
var ON_TIMEOUT = ["delete", "stop", "pause"];
|
|
13271
|
+
var ON_TIMEOUT_SENT = [...ON_TIMEOUT, "stop_with_memory"];
|
|
13213
13272
|
function isMachineSize(value) {
|
|
13214
13273
|
return Object.hasOwn(MACHINE_SIZES, value);
|
|
13215
13274
|
}
|
|
@@ -14188,7 +14247,7 @@ function parseDockerfile(dockerfile, args = {}) {
|
|
|
14188
14247
|
refuse(`a heredoc (<<) in ${instruction} is not supported; put the text in a file in the build's folder and COPY it`);
|
|
14189
14248
|
}
|
|
14190
14249
|
const hash = createHash5("sha256").update(text).digest("hex");
|
|
14191
|
-
const word = (input) => expandWords(input, lookup, false, refuse)[0] ?? "";
|
|
14250
|
+
const word = (input) => expandWords(input, lookup, false, refuse)[0]?.value ?? "";
|
|
14192
14251
|
const words2 = (input) => expandWords(input, lookup, true, refuse);
|
|
14193
14252
|
switch (instruction) {
|
|
14194
14253
|
case "FROM":
|
|
@@ -14385,23 +14444,23 @@ function copyOf(rest, instruction, workdir, word, words2, refuse) {
|
|
|
14385
14444
|
refuse(`${instruction} --${name} is not supported; remove it`);
|
|
14386
14445
|
}
|
|
14387
14446
|
const argv = jsonArgv(remaining);
|
|
14388
|
-
const paths = argv === null ? words2(remaining) : argv.map(word);
|
|
14447
|
+
const paths = argv === null ? words2(remaining) : argv.map((written) => ({ value: word(written), written }));
|
|
14389
14448
|
if (paths.length < 2) refuse(`${instruction} needs a source in the build's folder and a destination`);
|
|
14390
|
-
const sources = paths.slice(0, -1).map((source) => {
|
|
14449
|
+
const sources = paths.slice(0, -1).map(({ value: source, written }) => {
|
|
14391
14450
|
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(source) || source.startsWith("git@")) {
|
|
14392
14451
|
refuse(`${instruction} of a URL is not supported; download it with RUN curl or RUN git clone`);
|
|
14393
14452
|
}
|
|
14394
|
-
if (source.startsWith("/")) refuse(`${instruction} ${
|
|
14453
|
+
if (source.startsWith("/")) refuse(`${instruction} ${written}: a source is a path in the build's folder, not an absolute path`);
|
|
14395
14454
|
const normalised = posix.normalize(source);
|
|
14396
14455
|
if (normalised === ".." || normalised.startsWith("../")) {
|
|
14397
|
-
refuse(`${instruction} ${
|
|
14456
|
+
refuse(`${instruction} ${written}: a source cannot leave the build's folder`);
|
|
14398
14457
|
}
|
|
14399
14458
|
if (instruction === "ADD" && ARCHIVE.test(normalised)) {
|
|
14400
|
-
refuse(`ADD of an archive (${
|
|
14459
|
+
refuse(`ADD of an archive (${written}) is not supported, since Docker would unpack it and agental does not; COPY it and unpack it with RUN tar or RUN unzip`);
|
|
14401
14460
|
}
|
|
14402
14461
|
return normalised;
|
|
14403
14462
|
});
|
|
14404
|
-
const given = paths.at(-1);
|
|
14463
|
+
const given = paths.at(-1).value;
|
|
14405
14464
|
const intoDirectory = given.endsWith("/") || /(^|\/)\.\.?$/.test(given);
|
|
14406
14465
|
if (sources.length > 1 && !intoDirectory) {
|
|
14407
14466
|
refuse(`${instruction} of more than one source needs a destination directory ending in /`);
|
|
@@ -14416,44 +14475,56 @@ function envOf2(rest, word, words2, refuse) {
|
|
|
14416
14475
|
if (!firstWord.includes("=")) {
|
|
14417
14476
|
const value = rest.slice(firstWord.length).trim();
|
|
14418
14477
|
if (firstWord === "" || value === "") refuse("ENV needs name=value, or a name and a value");
|
|
14419
|
-
variables = [{ name: firstWord, value: word(value) }];
|
|
14478
|
+
variables = [{ name: firstWord, value: word(value), written: firstWord }];
|
|
14420
14479
|
} else {
|
|
14421
14480
|
variables = words2(rest).map((pair) => {
|
|
14422
|
-
const equals = pair.indexOf("=");
|
|
14423
|
-
if (equals < 0) refuse(`ENV ${pair} has no value; write ${pair}=value`);
|
|
14424
|
-
return { name: pair.slice(0, equals), value: pair.slice(equals + 1) };
|
|
14481
|
+
const equals = pair.value.indexOf("=");
|
|
14482
|
+
if (equals < 0) refuse(`ENV ${pair.written} has no value; write ${pair.written}=value`);
|
|
14483
|
+
return { name: pair.value.slice(0, equals), value: pair.value.slice(equals + 1), written: nameAsWritten(pair) };
|
|
14425
14484
|
});
|
|
14426
14485
|
}
|
|
14427
|
-
for (const { name } of variables) {
|
|
14428
|
-
if (!NAME.test(name)) refuse(`ENV ${
|
|
14486
|
+
for (const { name, written } of variables) {
|
|
14487
|
+
if (!NAME.test(name)) refuse(`ENV ${written} is not a name a variable can have: letters, digits and _, not starting with a digit`);
|
|
14429
14488
|
}
|
|
14430
|
-
return variables;
|
|
14489
|
+
return variables.map(({ name, value }) => ({ name, value }));
|
|
14431
14490
|
}
|
|
14432
14491
|
function argsOf(declarations, given, refuse) {
|
|
14433
14492
|
if (declarations.length === 0) refuse("ARG needs a name");
|
|
14434
14493
|
return declarations.map((declaration) => {
|
|
14435
|
-
const equals = declaration.indexOf("=");
|
|
14436
|
-
const name = equals < 0 ? declaration : declaration.slice(0, equals);
|
|
14437
|
-
if (!NAME.test(name)) refuse(`ARG ${
|
|
14438
|
-
const fallback = equals < 0 ? null : declaration.slice(equals + 1);
|
|
14494
|
+
const equals = declaration.value.indexOf("=");
|
|
14495
|
+
const name = equals < 0 ? declaration.value : declaration.value.slice(0, equals);
|
|
14496
|
+
if (!NAME.test(name)) refuse(`ARG ${nameAsWritten(declaration)} is not a name a variable can have: letters, digits and _, not starting with a digit`);
|
|
14497
|
+
const fallback = equals < 0 ? null : declaration.value.slice(equals + 1);
|
|
14439
14498
|
return { name, value: Object.hasOwn(given, name) ? given[name] : fallback };
|
|
14440
14499
|
});
|
|
14441
14500
|
}
|
|
14501
|
+
function nameAsWritten(pair) {
|
|
14502
|
+
const equals = pair.written.indexOf("=");
|
|
14503
|
+
return equals < 0 ? pair.written : pair.written.slice(0, equals);
|
|
14504
|
+
}
|
|
14442
14505
|
function portsOf(given, refuse) {
|
|
14443
14506
|
if (given.length === 0) refuse("EXPOSE needs a port");
|
|
14444
|
-
return given.map((written) => {
|
|
14445
|
-
const port = /^([0-9]+)(?:\/(tcp|udp))?$/i.exec(
|
|
14507
|
+
return given.map(({ value, written }) => {
|
|
14508
|
+
const port = /^([0-9]+)(?:\/(tcp|udp))?$/i.exec(value);
|
|
14446
14509
|
if (port === null) refuse(`EXPOSE ${written} is not supported; list each port as a number, with /tcp or /udp`);
|
|
14447
14510
|
const number = Number(port[1]);
|
|
14448
14511
|
if (number < 1 || number > 65535) refuse(`EXPOSE ${written}: a port is from 1 to 65535`);
|
|
14449
14512
|
return { port: number, protocol: port[2]?.toLowerCase() ?? "tcp" };
|
|
14450
14513
|
});
|
|
14451
14514
|
}
|
|
14515
|
+
var EXPANDED_MOST = 65536;
|
|
14452
14516
|
function expandWords(input, lookup, split, refuse) {
|
|
14453
14517
|
const words2 = [];
|
|
14454
14518
|
let word = "";
|
|
14455
14519
|
let inWord = false;
|
|
14520
|
+
let start2 = 0;
|
|
14456
14521
|
let at5 = 0;
|
|
14522
|
+
const capped = (grown) => {
|
|
14523
|
+
if (grown.length > EXPANDED_MOST) {
|
|
14524
|
+
refuse(`a word expands to more than ${EXPANDED_MOST} characters; no step of a build takes one so long`);
|
|
14525
|
+
}
|
|
14526
|
+
return grown;
|
|
14527
|
+
};
|
|
14457
14528
|
const variable = () => {
|
|
14458
14529
|
at5++;
|
|
14459
14530
|
if (input[at5] !== "{") {
|
|
@@ -14495,7 +14566,7 @@ function expandWords(input, lookup, split, refuse) {
|
|
|
14495
14566
|
text += input[at5 + 1];
|
|
14496
14567
|
at5 += 2;
|
|
14497
14568
|
} else if (input[at5] === "$") {
|
|
14498
|
-
text
|
|
14569
|
+
text = capped(text + variable());
|
|
14499
14570
|
} else {
|
|
14500
14571
|
text += input[at5];
|
|
14501
14572
|
at5++;
|
|
@@ -14508,12 +14579,13 @@ function expandWords(input, lookup, split, refuse) {
|
|
|
14508
14579
|
while (at5 < input.length) {
|
|
14509
14580
|
const char = input[at5];
|
|
14510
14581
|
if (split && /\s/.test(char)) {
|
|
14511
|
-
if (inWord) words2.push(word);
|
|
14582
|
+
if (inWord) words2.push({ value: word, written: input.slice(start2, at5) });
|
|
14512
14583
|
word = "";
|
|
14513
14584
|
inWord = false;
|
|
14514
14585
|
at5++;
|
|
14515
14586
|
continue;
|
|
14516
14587
|
}
|
|
14588
|
+
if (!inWord) start2 = at5;
|
|
14517
14589
|
inWord = true;
|
|
14518
14590
|
if (char === "\\") {
|
|
14519
14591
|
word += at5 + 1 < input.length ? input[at5 + 1] : char;
|
|
@@ -14530,7 +14602,7 @@ function expandWords(input, lookup, split, refuse) {
|
|
|
14530
14602
|
word += input[at5 + 1];
|
|
14531
14603
|
at5 += 2;
|
|
14532
14604
|
} else if (input[at5] === "$") {
|
|
14533
|
-
word
|
|
14605
|
+
word = capped(word + variable());
|
|
14534
14606
|
} else {
|
|
14535
14607
|
word += input[at5];
|
|
14536
14608
|
at5++;
|
|
@@ -14539,13 +14611,13 @@ function expandWords(input, lookup, split, refuse) {
|
|
|
14539
14611
|
if (at5 >= input.length) refuse('a " is not closed');
|
|
14540
14612
|
at5++;
|
|
14541
14613
|
} else if (char === "$") {
|
|
14542
|
-
word
|
|
14614
|
+
word = capped(word + variable());
|
|
14543
14615
|
} else {
|
|
14544
14616
|
word += char;
|
|
14545
14617
|
at5++;
|
|
14546
14618
|
}
|
|
14547
14619
|
}
|
|
14548
|
-
if (inWord) words2.push(word);
|
|
14620
|
+
if (inWord) words2.push({ value: word, written: input.slice(start2, at5) });
|
|
14549
14621
|
return words2;
|
|
14550
14622
|
}
|
|
14551
14623
|
|
|
@@ -15785,7 +15857,8 @@ async function work(options) {
|
|
|
15785
15857
|
});
|
|
15786
15858
|
};
|
|
15787
15859
|
const take = async (request2) => {
|
|
15788
|
-
const
|
|
15860
|
+
const mine = (await call3("GET", "/v1/guilds/mine")).body.guilds ?? [];
|
|
15861
|
+
const guild2 = mine.find((each) => each.guild.name === options.guild)?.guild ?? {};
|
|
15789
15862
|
const notes = (await call3("GET", `${at5}/members/${encodeURIComponent(identity.id)}/notes`)).body.text ?? "";
|
|
15790
15863
|
let claimMinutes = null;
|
|
15791
15864
|
if (request2.toRole !== null) {
|
|
@@ -15926,6 +15999,10 @@ async function work(options) {
|
|
|
15926
15999
|
await sleep4(backoffMs, done2);
|
|
15927
16000
|
continue;
|
|
15928
16001
|
}
|
|
16002
|
+
if (options.once === true && runs.size === 0 && pending.length === 0) {
|
|
16003
|
+
say("Nothing is owed and nothing runs: done.");
|
|
16004
|
+
return 0;
|
|
16005
|
+
}
|
|
15929
16006
|
const nextDue = Math.min(...pending.map((one) => one.dueAt));
|
|
15930
16007
|
await rest(Math.max(0, Math.min(timing.recheckMs, nextDue - Date.now())));
|
|
15931
16008
|
}
|
|
@@ -16338,6 +16415,7 @@ ${list7.map((one) => ` ${messageLine(one)}`).join("")}` : "";
|
|
|
16338
16415
|
role: options.role,
|
|
16339
16416
|
parallel: wholeNumber(options.parallel, "--parallel", 1, 1, 1e3),
|
|
16340
16417
|
answerChars: wholeNumber(options.answerChars, "--answer-chars", ANSWER_CHARS, FEWEST_ANSWER_CHARS, ANSWER_CHARS),
|
|
16418
|
+
once: options.once === true,
|
|
16341
16419
|
command: command3,
|
|
16342
16420
|
stop: stop.signal,
|
|
16343
16421
|
env,
|
|
@@ -17397,6 +17475,7 @@ function whereQuery(text, query = new URLSearchParams()) {
|
|
|
17397
17475
|
query.append("status", "error");
|
|
17398
17476
|
} else if (each === "archived") {
|
|
17399
17477
|
query.append("status", "stopped");
|
|
17478
|
+
query.append("status", "paused");
|
|
17400
17479
|
query.set("archived", "true");
|
|
17401
17480
|
} else {
|
|
17402
17481
|
query.append("status", each);
|
|
@@ -17673,6 +17752,7 @@ async function main() {
|
|
|
17673
17752
|
// agental job add and update: the events that start a job, another job's run ending and mail to a sandbox; or none.
|
|
17674
17753
|
"after-job": { type: "string", multiple: true },
|
|
17675
17754
|
"on-mail": { type: "string", multiple: true },
|
|
17755
|
+
"on-guild-request": { type: "string", multiple: true },
|
|
17676
17756
|
"no-events": { type: "boolean", default: false },
|
|
17677
17757
|
// agental job apply: delete the jobs the file does not name, or say what it would do and change nothing.
|
|
17678
17758
|
prune: { type: "boolean", default: false },
|
|
@@ -17772,6 +17852,8 @@ async function main() {
|
|
|
17772
17852
|
// agental guild work: how many agents run at once, and how much of a run's output its answer keeps.
|
|
17773
17853
|
parallel: { type: "string" },
|
|
17774
17854
|
"answer-chars": { type: "string" },
|
|
17855
|
+
// agental guild work --once: end once nothing is owed and nothing runs, as a job a request wakes runs it.
|
|
17856
|
+
once: { type: "boolean" },
|
|
17775
17857
|
"revoke-keys": { type: "boolean", default: false },
|
|
17776
17858
|
// agental list in a terminal: every column, as piped.
|
|
17777
17859
|
wide: { type: "boolean", default: false },
|
|
@@ -17954,6 +18036,7 @@ async function main() {
|
|
|
17954
18036
|
...values.text === void 0 ? {} : { text: values.text },
|
|
17955
18037
|
...values.parallel === void 0 ? {} : { parallel: values.parallel },
|
|
17956
18038
|
...values["answer-chars"] === void 0 ? {} : { answerChars: values["answer-chars"] },
|
|
18039
|
+
...values.once === void 0 ? {} : { once: values.once },
|
|
17957
18040
|
...command4 === null ? {} : { command: command4 }
|
|
17958
18041
|
}
|
|
17959
18042
|
);
|
|
@@ -18117,7 +18200,7 @@ async function create(values) {
|
|
|
18117
18200
|
throw new Error("--on-timeout is delete, stop or stop-with-memory: what the sandbox's time limit does when it runs out");
|
|
18118
18201
|
}
|
|
18119
18202
|
if (values.size !== void 0 && !isMachineSize(values.size)) {
|
|
18120
|
-
throw new Error("--size must be tiny, small, medium or
|
|
18203
|
+
throw new Error("--size must be tiny, small, medium, large or xlarge");
|
|
18121
18204
|
}
|
|
18122
18205
|
if (!values.spot && (values["on-reclaim"] !== void 0 || values["warn-at"] !== void 0)) {
|
|
18123
18206
|
throw new Error("--on-reclaim and --warn-at are for a spot sandbox: add --spot.");
|
|
@@ -18679,13 +18762,13 @@ async function lifecycle(action, id, headers = {}, sent) {
|
|
|
18679
18762
|
}
|
|
18680
18763
|
async function resize(id, size2, now, cancel, maxBurstFee, asJson) {
|
|
18681
18764
|
if (!id) {
|
|
18682
|
-
throw new Error("resize requires <sandbox-id> and its new size: tiny, small, medium or
|
|
18765
|
+
throw new Error("resize requires <sandbox-id> and its new size: tiny, small, medium, large or xlarge");
|
|
18683
18766
|
}
|
|
18684
18767
|
if (cancel && (size2 !== void 0 || now)) {
|
|
18685
18768
|
throw new Error("--cancel takes away a size that waits for the next start, and goes with no size and no --now");
|
|
18686
18769
|
}
|
|
18687
18770
|
if (!cancel && (size2 === void 0 || !isMachineSize(size2))) {
|
|
18688
|
-
throw new Error("resize takes the new size: tiny, small, medium or
|
|
18771
|
+
throw new Error("resize takes the new size: tiny, small, medium, large or xlarge");
|
|
18689
18772
|
}
|
|
18690
18773
|
if (maxBurstFee !== void 0 && !now) {
|
|
18691
18774
|
throw new Error("--max-burst-fee goes with --now: it caps what the restart's start pays in burst fees");
|
|
@@ -18739,7 +18822,7 @@ async function stoppedAfter(id, operationId) {
|
|
|
18739
18822
|
const deadline = Date.now() + 6e5;
|
|
18740
18823
|
for (; ; ) {
|
|
18741
18824
|
const sandbox = await call2(`/v1/sandboxes/${encodeURIComponent(id)}`, { method: "GET" });
|
|
18742
|
-
if (sandbox["status"] === "stopped") {
|
|
18825
|
+
if (sandbox["status"] === "stopped" || sandbox["status"] === "paused") {
|
|
18743
18826
|
return sandbox;
|
|
18744
18827
|
}
|
|
18745
18828
|
if (operationId !== null) {
|
|
@@ -19493,7 +19576,7 @@ async function template(positionals, values) {
|
|
|
19493
19576
|
throw new Error("--snapshot, --image and --new-machine say two things: give one.");
|
|
19494
19577
|
}
|
|
19495
19578
|
if (values.size !== void 0 && !isMachineSize(values.size)) {
|
|
19496
|
-
throw new Error("--size must be tiny, small, medium or
|
|
19579
|
+
throw new Error("--size must be tiny, small, medium, large or xlarge");
|
|
19497
19580
|
}
|
|
19498
19581
|
const ttlSeconds = ttlOption(values.ttl);
|
|
19499
19582
|
if (values.spot && values.standard) {
|
|
@@ -19929,7 +20012,7 @@ async function dataRetention(positionals, asJson) {
|
|
|
19929
20012
|
}
|
|
19930
20013
|
async function ci(positionals, options) {
|
|
19931
20014
|
const [what, repo, ...rest] = positionals;
|
|
19932
|
-
const usage = "ci takes nothing, jobs [<owner/repo>] [--limit <n>], set <owner/repo> [--size tiny|small|medium|large | --size default] [--pool <n> | --pool default] [--template <template> | --template default], or reset <owner/repo>";
|
|
20015
|
+
const usage = "ci takes nothing, jobs [<owner/repo>] [--limit <n>], set <owner/repo> [--size tiny|small|medium|large|xlarge | --size default] [--pool <n> | --pool default] [--template <template> | --template default], or reset <owner/repo>";
|
|
19933
20016
|
if (rest.length > 0 || what === void 0 && repo !== void 0 || what !== void 0 && what !== "set" && what !== "reset" && what !== "jobs") {
|
|
19934
20017
|
throw new Error(usage);
|
|
19935
20018
|
}
|
|
@@ -20011,8 +20094,8 @@ async function ci(positionals, options) {
|
|
|
20011
20094
|
let size2;
|
|
20012
20095
|
if (options.size !== void 0) {
|
|
20013
20096
|
size2 = options.size === "default" ? null : options.size;
|
|
20014
|
-
if (size2 !== null && !["tiny", "small", "medium", "large"].includes(size2)) {
|
|
20015
|
-
throw new Error("--size is tiny, small, medium or
|
|
20097
|
+
if (size2 !== null && !["tiny", "small", "medium", "large", "xlarge"].includes(size2)) {
|
|
20098
|
+
throw new Error("--size is tiny, small, medium, large or xlarge, or default.");
|
|
20016
20099
|
}
|
|
20017
20100
|
}
|
|
20018
20101
|
let templateId = before?.templateId ?? null;
|
|
@@ -20245,6 +20328,9 @@ function wholeOrCents(micros) {
|
|
|
20245
20328
|
return micros % 1e6 === 0 ? wholeMoney(micros) : money(micros);
|
|
20246
20329
|
}
|
|
20247
20330
|
function money(micros) {
|
|
20331
|
+
if (micros > 0 && micros < 5e3) {
|
|
20332
|
+
return "<$0.01";
|
|
20333
|
+
}
|
|
20248
20334
|
return `$${(micros / 1e6).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
20249
20335
|
}
|
|
20250
20336
|
var REPLAY_WHY = {
|
|
@@ -20506,7 +20592,7 @@ function pricesForPeople(body) {
|
|
|
20506
20592
|
],
|
|
20507
20593
|
[
|
|
20508
20594
|
...body.free ? [`Free needs a card saved, charged nothing; it runs ${body.free.unpaidUnits} units at once until your first top-up.`] : [],
|
|
20509
|
-
...body.tiers.some((tier) => tier.runningUnits !== void 0) ? ["Counted in units: a tiny sandbox is 1, a small 2, a medium 4, a large 8."] : []
|
|
20595
|
+
...body.tiers.some((tier) => tier.runningUnits !== void 0) ? ["Counted in units: a tiny sandbox is 1, a small 2, a medium 4, a large 8, an xlarge 16."] : []
|
|
20510
20596
|
]
|
|
20511
20597
|
);
|
|
20512
20598
|
}
|
|
@@ -20567,7 +20653,7 @@ function describePrices(body) {
|
|
|
20567
20653
|
);
|
|
20568
20654
|
}
|
|
20569
20655
|
if (body.tiers.some((tier) => tier.runningUnits !== void 0)) {
|
|
20570
|
-
out2.push(" Counted in units: a tiny sandbox is 1, a small 2, a medium 4, a large 8. Free starts are in any 15 minutes.");
|
|
20656
|
+
out2.push(" Counted in units: a tiny sandbox is 1, a small 2, a medium 4, a large 8, an xlarge 16. Free starts are in any 15 minutes.");
|
|
20571
20657
|
}
|
|
20572
20658
|
}
|
|
20573
20659
|
if (body.burstFee) {
|
|
@@ -20673,7 +20759,7 @@ function describeLimits(body, today, endsNow) {
|
|
|
20673
20759
|
};
|
|
20674
20760
|
const range = today ? "today (UTC)" : `from ${String(answer6["from"] ?? "")} to ${String(answer6["to"] ?? "")}`;
|
|
20675
20761
|
const lines = [
|
|
20676
|
-
`running: ${units(number(now, "runningMb"))} of ${number(now, "runningUnits").toLocaleString("en-US")} units (a tiny is 1, a small 2, a medium 4, a large 8); at the running count ${duration(number(answer6, "atRunningCountMs"))} ${range}`
|
|
20762
|
+
`running: ${units(number(now, "runningMb"))} of ${number(now, "runningUnits").toLocaleString("en-US")} units (a tiny is 1, a small 2, a medium 4, a large 8, an xlarge 16); at the running count ${duration(number(answer6, "atRunningCountMs"))} ${range}`
|
|
20677
20763
|
];
|
|
20678
20764
|
const bursts = Array.isArray(answer6["bursts"]) ? answer6["bursts"] : [];
|
|
20679
20765
|
const open2 = endsNow ? bursts.find((one) => one["endedAt"] === null && typeof one["startedAt"] === "string") : void 0;
|
|
@@ -20814,8 +20900,8 @@ function sandboxesForPeople(sandboxes2, names2, sorted) {
|
|
|
20814
20900
|
const status = (sandbox) => {
|
|
20815
20901
|
const word = text(sandbox["status"]) || "unknown";
|
|
20816
20902
|
const stops = word === "running" ? until(text(sandbox["autoStopAt"])) : null;
|
|
20817
|
-
const stopped = word === "stopped" ? ago(text(sandbox["stoppedAt"])) : null;
|
|
20818
|
-
return stops ? `running, stops ${stops}` : stopped ?
|
|
20903
|
+
const stopped = word === "stopped" || word === "paused" ? ago(text(sandbox["stoppedAt"])) : null;
|
|
20904
|
+
return stops ? `running, stops ${stops}` : stopped ? `${word} ${stopped}` : word;
|
|
20819
20905
|
};
|
|
20820
20906
|
const rows = [
|
|
20821
20907
|
["", "ID", "NAME", "SIZE", "TEMPLATE", "STATUS", ...showSpot ? ["SPOT"] : [], ...showVm ? ["VM"] : [], ...showOutbound ? ["OUTBOUND"] : [], ...showTags ? ["TAGS"] : []],
|
|
@@ -21006,7 +21092,7 @@ Setting up
|
|
|
21006
21092
|
agental completion zsh|bash|fish
|
|
21007
21093
|
|
|
21008
21094
|
Usage
|
|
21009
|
-
agental create [--name <name>] [--template <template>] [--snapshot <snapshot-id> | --image <image>] [--size tiny|small|medium|large] [--region <region>[,<region>...]] [--ttl <time> | --ttl default] [--on-timeout delete|stop|stop-with-memory] [--idempotency-key <key>]
|
|
21095
|
+
agental create [--name <name>] [--template <template>] [--snapshot <snapshot-id> | --image <image>] [--size tiny|small|medium|large|xlarge] [--region <region>[,<region>...]] [--ttl <time> | --ttl default] [--on-timeout delete|stop|stop-with-memory] [--idempotency-key <key>]
|
|
21010
21096
|
[--spot [--on-reclaim delete|stop] [--warn-at <chance>] | --standard]
|
|
21011
21097
|
${operator ? "[--box <name-or-id>] " : ""}[--allow <address>[,<address>...]] [--egress box | residential:<country>[:sticky|rotating]] [--max-burst-fee <dollars>]
|
|
21012
21098
|
[--ssh-key <public-key-or-file>]... [--tag <tag>[,<tag>...]]... [--meta <key>=<value>]...
|
|
@@ -21036,7 +21122,7 @@ Usage
|
|
|
21036
21122
|
agental delete --where '<words>' [--confirm <count>] asks for the count to be typed
|
|
21037
21123
|
agental bulk-actions [list | show <id> | cancel <id>] [--json]
|
|
21038
21124
|
agental recover <sandbox-id> [--max-burst-fee <dollars>]
|
|
21039
|
-
agental resize <sandbox-id> tiny|small|medium|large [--now] [--max-burst-fee <dollars>] [--json]
|
|
21125
|
+
agental resize <sandbox-id> tiny|small|medium|large|xlarge [--now] [--max-burst-fee <dollars>] [--json]
|
|
21040
21126
|
agental resize <sandbox-id> --cancel [--json] a size that waits for its next start, taken away
|
|
21041
21127
|
agental auto-stop <sandbox-id> [--in <time> | --at <date-time> | --never] [--json]
|
|
21042
21128
|
agental network <sandbox-id> [--allow <address-or-name>[,<address-or-name>...] | --none] [--json]
|
|
@@ -21051,7 +21137,7 @@ Usage
|
|
|
21051
21137
|
agental template show <template> [--json]
|
|
21052
21138
|
agental template rename <template> <new-name>
|
|
21053
21139
|
agental template delete <template> [--pause-jobs]
|
|
21054
|
-
agental template start <template> [--size tiny|small|medium|large] [--snapshot <snapshot-id> | --image <image> | --new-machine] [--ttl <time> | --ttl default] [--region <region> | --region default] [--spot [--on-reclaim delete|stop] [--warn-at <chance>] | --standard]
|
|
21140
|
+
agental template start <template> [--size tiny|small|medium|large|xlarge] [--snapshot <snapshot-id> | --image <image> | --new-machine] [--ttl <time> | --ttl default] [--region <region> | --region default] [--spot [--on-reclaim delete|stop] [--warn-at <chance>] | --standard]
|
|
21055
21141
|
agental template network <template> [open | blocked | allowlist <address-or-name>...] [--json]
|
|
21056
21142
|
agental template egress <template> [box | residential <country> [sticky | rotating]] [--json]
|
|
21057
21143
|
agental template tailnet <template> [join --tag <tag>... [--accept <range>]... [--exit-node <ip>] [--keep-address] | off] [--json]
|
|
@@ -21072,24 +21158,24 @@ Usage
|
|
|
21072
21158
|
agental metrics <sandbox-id> [--since <date-time>] [--until <date-time>] [--step <seconds>] [--json]
|
|
21073
21159
|
agental metrics --running [--since <date-time>] [--until <date-time>] [--step <seconds>] [--json]
|
|
21074
21160
|
agental telemetry [set <endpoint> [-H <name>=<value>]... | test | unset] [--json]
|
|
21075
|
-
agental ci [jobs [<owner/repo>] [--limit <n>] | set <owner/repo> [--size tiny|small|medium|large | --size default] [--pool <n> | --pool default] [--template <template> | --template default] | reset <owner/repo>] [--json]
|
|
21161
|
+
agental ci [jobs [<owner/repo>] [--limit <n>] | set <owner/repo> [--size tiny|small|medium|large|xlarge | --size default] [--pool <n> | --pool default] [--template <template> | --template default] | reset <owner/repo>] [--json]
|
|
21076
21162
|
agental data-retention [1 | 7 | 30 | 90 | never] [--json]
|
|
21077
21163
|
agental jobs [--sandbox <sandbox-id> | --template <template>] [--json]
|
|
21078
21164
|
agental job add [<name>] --sandbox <sandbox-id> [--every 1m|15m|1h|1d | --cron "<m h dom mon dow>" [--tz <zone>] | --at <date-time>] [--timeout <time>]
|
|
21079
21165
|
[--if-stopped start|skip] [--keep-memory | --delete-after] [--overlap skip|replace|parallel] [--retries <0-5>] [--alerts email|webhook|both|none]
|
|
21080
21166
|
[--max-monthly-spend <dollars>]
|
|
21081
|
-
[--input <NAME>[=<default>]]... [--secret-input <NAME>[=<default>]]... [--after-job <job>[:succeeded|failed]]... [--on-mail <sandbox>]...
|
|
21167
|
+
[--input <NAME>[=<default>]]... [--secret-input <NAME>[=<default>]]... [--after-job <job>[:succeeded|failed]]... [--on-mail <sandbox>]... [--on-guild-request <guild>:<identity>]...
|
|
21082
21168
|
[--json] -- <command> [args...]
|
|
21083
|
-
agental job add [<name>] --template <template> [--size tiny|small|medium|large] [--keep-failed-for 0|30m|24h|7d] [--every 1m|15m|1h|1d | --cron "<m h dom mon dow>" [--tz <zone>] | --at <date-time>]
|
|
21169
|
+
agental job add [<name>] --template <template> [--size tiny|small|medium|large|xlarge] [--keep-failed-for 0|30m|24h|7d] [--every 1m|15m|1h|1d | --cron "<m h dom mon dow>" [--tz <zone>] | --at <date-time>]
|
|
21084
21170
|
[--timeout <time>] [--overlap skip|replace|parallel] [--retries <0-5>] [--alerts email|webhook|both|none] [--max-monthly-spend <dollars>]
|
|
21085
|
-
[--input <NAME>[=<default>]]... [--secret-input <NAME>[=<default>]]... [--after-job <job>[:succeeded|failed]]... [--on-mail <sandbox>]...
|
|
21171
|
+
[--input <NAME>[=<default>]]... [--secret-input <NAME>[=<default>]]... [--after-job <job>[:succeeded|failed]]... [--on-mail <sandbox>]... [--on-guild-request <guild>:<identity>]...
|
|
21086
21172
|
[--json] -- <command> [args...] a fresh sandbox for each run
|
|
21087
21173
|
agental job list [--sandbox <sandbox-id> | --template <template>] [--json]
|
|
21088
21174
|
agental job get|delete|pause|resume <job> [--json]
|
|
21089
21175
|
agental job update <job> [--sandbox <sandbox-id> | --template <template> [--size <size>]] [--keep-failed-for <time>] [--every <time> | --cron "<expr>" | --at <date-time>] [--tz <zone>]
|
|
21090
21176
|
[--name <name>] [--timeout <time>] [--if-stopped start|skip] [--keep-memory | --delete-after | --disk-only] [--overlap skip|replace|parallel]
|
|
21091
21177
|
[--retries <0-5>] [--alerts email|webhook|both|none] [--max-monthly-spend <dollars>|none] [--input <NAME>[=<default>]]... [--secret-input <NAME>[=<default>]]...
|
|
21092
|
-
[--after-job <job>[:succeeded|failed]]... [--on-mail <sandbox>]... [--no-events] [--json] [-- <command> [args...]]
|
|
21178
|
+
[--after-job <job>[:succeeded|failed]]... [--on-mail <sandbox>]... [--on-guild-request <guild>:<identity>]... [--no-events] [--json] [-- <command> [args...]]
|
|
21093
21179
|
agental job run <job> [--input <NAME>=<value>]... [--wait[=<seconds>]] [--json]
|
|
21094
21180
|
agental job again <job> <run-id> [--wait[=<seconds>]] [--json] run it again with what that run was given
|
|
21095
21181
|
agental job runs <job> [--limit <n>] [--json]
|
|
@@ -21129,6 +21215,7 @@ Usage
|
|
|
21129
21215
|
agental server readings <server> [--since <date-time>] [--until <date-time>] [--every 1|5|15|60] [--json]
|
|
21130
21216
|
agental server token <server> [--json] a new join token; the old one stops at once
|
|
21131
21217
|
agental server drain <server> [--json]
|
|
21218
|
+
agental server open <server> [--json] takes new sandboxes again after a drain
|
|
21132
21219
|
agental server gone <server> --reason <text> [--yes] [--json] cannot be undone
|
|
21133
21220
|
agental server remove <server> [--json]
|
|
21134
21221
|
agental claude [--json]
|
|
@@ -21361,9 +21448,13 @@ to update, they replace the ones the job had. A run by the clock is given the de
|
|
|
21361
21448
|
one of its runs was given, secret values too.
|
|
21362
21449
|
Events start a job too: add and update take --after-job JOB to run it when a run of JOB ends,
|
|
21363
21450
|
--after-job JOB:succeeded or JOB:failed for one end alone (failed: for good, after its retries),
|
|
21364
|
-
|
|
21365
|
-
|
|
21366
|
-
|
|
21451
|
+
--on-mail SANDBOX to run it when mail arrives at that sandbox's address, and --on-guild-request
|
|
21452
|
+
GUILD:IDENTITY, an identity its sandbox holds, to start the stopped sandbox for a request to it
|
|
21453
|
+
(for a role, one stopped holder alone, and none while a holder runs), its command then as
|
|
21454
|
+
agental guild work GUILD --as IDENTITY --once -- claude -p. Its command is told what started it:
|
|
21455
|
+
AGENTAL_TRIGGER_JOB, AGENTAL_TRIGGER_RUN and AGENTAL_TRIGGER_OUTCOME; AGENTAL_TRIGGER_SANDBOX and
|
|
21456
|
+
AGENTAL_TRIGGER_EMAIL, the message's id; or AGENTAL_TRIGGER_GUILD, AGENTAL_TRIGGER_MEMBER and
|
|
21457
|
+
AGENTAL_TRIGGER_REQUEST. Given to update, they replace
|
|
21367
21458
|
the events the job had; --no-events takes them all away. A chain that comes back to the job is
|
|
21368
21459
|
refused, and events that start 60 runs of a job in a minute pause it.
|
|
21369
21460
|
--max-monthly-spend 25 gives a job a spending limit in dollars: once its runs this calendar month
|
|
@@ -21425,7 +21516,7 @@ the one-time token in that line, shown this once; it needs an Enterprise contrac
|
|
|
21425
21516
|
gives a server that has not joined a new token, and the old one stops working. A <server> is its id
|
|
21426
21517
|
or its label. show says how it stands; readings is its memory, CPU and disk over the last day, a
|
|
21427
21518
|
line an hour unless --every says otherwise, noting the times it did not answer. drain takes it out
|
|
21428
|
-
of placement and stops or moves nothing. remove removes one that holds nothing and prints the line
|
|
21519
|
+
of placement and stops or moves nothing, and open puts it back. remove removes one that holds nothing and prints the line
|
|
21429
21520
|
that takes its agent off. gone says a server is gone for good, once it is drained and its agent has
|
|
21430
21521
|
been away 24 hours: its sandboxes are said lost, and it cannot be undone, so it asks first unless
|
|
21431
21522
|
--yes, and --reason says why. servers offload says whether a new sandbox that names no region
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agental",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.1",
|
|
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",
|