agental 0.60.0 → 0.62.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 +33 -26
- 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.62.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}`;
|
|
@@ -7924,6 +7924,10 @@ var KEY_ACTIONS = [
|
|
|
7924
7924
|
"template.write",
|
|
7925
7925
|
"bucket.read",
|
|
7926
7926
|
"bucket.write",
|
|
7927
|
+
"image.read",
|
|
7928
|
+
"image.build",
|
|
7929
|
+
"image.cancel",
|
|
7930
|
+
"image.delete",
|
|
7927
7931
|
"guild.read",
|
|
7928
7932
|
"guild.write",
|
|
7929
7933
|
"guild.join",
|
|
@@ -7950,10 +7954,10 @@ var FULL_SANDBOX = [
|
|
|
7950
7954
|
];
|
|
7951
7955
|
var PRESETS = {
|
|
7952
7956
|
// Every read, apart from secrets and mail, which are the two an agent should be given by name.
|
|
7953
|
-
"read-only": ["sandbox.read", "file.read", "job.read", "snapshot.read", "template.read", "bucket.read", "guild.read", "account.read"],
|
|
7957
|
+
"read-only": ["sandbox.read", "file.read", "job.read", "snapshot.read", "template.read", "bucket.read", "image.read", "guild.read", "account.read"],
|
|
7954
7958
|
"full-sandbox": [...FULL_SANDBOX, "job.read", "job.write", "job.run"],
|
|
7955
|
-
// A CI system runs the jobs it is given and reads how they went; it does not make them.
|
|
7956
|
-
ci: [...FULL_SANDBOX, "sandbox.create", "sandbox.fork", "sandbox.resume", "sandbox.delete-own", "job.read", "job.run"],
|
|
7959
|
+
// A CI system runs the jobs it is given and reads how they went; it does not make them. It builds images and cancels its builds, and deletes none.
|
|
7960
|
+
ci: [...FULL_SANDBOX, "sandbox.create", "sandbox.fork", "sandbox.resume", "sandbox.delete-own", "job.read", "job.run", "image.read", "image.build", "image.cancel"],
|
|
7957
7961
|
admin: [ALL_ACTIONS]
|
|
7958
7962
|
};
|
|
7959
7963
|
var PRESET_NAMES = Object.keys(PRESETS);
|
|
@@ -9699,7 +9703,7 @@ var COMMANDS = [
|
|
|
9699
9703
|
{
|
|
9700
9704
|
name: "secrets",
|
|
9701
9705
|
summary: "Keep values and files out of a sandbox, or out of every sandbox of a template.",
|
|
9702
|
-
examples: ["agental secrets --template default set
|
|
9706
|
+
examples: ["agental secrets --template default set NODE_ENV=development", "agental secrets sbx_2a9a47e50daec64a"],
|
|
9703
9707
|
flags: [
|
|
9704
9708
|
["--template <template>", "the template's secrets, for every sandbox made from it"],
|
|
9705
9709
|
["--host <host>[,<host>...]", "set, hosts: keep the value out of the sandbox, sent only to these hosts"],
|
|
@@ -12749,7 +12753,8 @@ var LIFECYCLE_EVENTS = [
|
|
|
12749
12753
|
"sandbox.low_cpu",
|
|
12750
12754
|
"sandbox.upgraded",
|
|
12751
12755
|
"sandbox.reclaim_chance",
|
|
12752
|
-
"sandbox.lost"
|
|
12756
|
+
"sandbox.lost",
|
|
12757
|
+
"sandbox.restart_planned"
|
|
12753
12758
|
];
|
|
12754
12759
|
var WEBHOOK_EVENTS = [...LIFECYCLE_EVENTS, "prompt.created"];
|
|
12755
12760
|
var EMAIL_EVENTS = ["email.received", "email.delivered", "email.bounced"];
|
|
@@ -12766,7 +12771,8 @@ var HEADROOM_EVENTS = [
|
|
|
12766
12771
|
var JOB_EVENTS = ["job.created", "job.updated", "job.deleted", "job.run_started", "job.run_finished", "job.run_failed", "job.recovered", "job.paused"];
|
|
12767
12772
|
var TAILSCALE_EVENTS = ["tailscale.node_down", "tailscale.disconnected"];
|
|
12768
12773
|
var GUILD_EVENTS = ["guild.message", "guild.request_open", "guild.member_joined", "guild.member_left", "guild.paused", "guild.resumed"];
|
|
12769
|
-
var
|
|
12774
|
+
var CONNECTION_EVENTS = ["connection.connected", "connection.signed_out", "connection.removed"];
|
|
12775
|
+
var WEBHOOK_KINDS = [...WEBHOOK_EVENTS, ...EMAIL_EVENTS, ...MEMBER_EVENTS, ...TEMPLATE_EVENTS, ...HEADROOM_EVENTS, ...JOB_EVENTS, ...TAILSCALE_EVENTS, ...GUILD_EVENTS, ...CONNECTION_EVENTS];
|
|
12770
12776
|
var WEBHOOK_GROUPS = [...new Set(WEBHOOK_KINDS.map((kind) => kind.slice(0, kind.indexOf("."))))];
|
|
12771
12777
|
function closestEvent(asked2) {
|
|
12772
12778
|
if (asked2.length > 64) {
|
|
@@ -14007,7 +14013,7 @@ async function actingAs(client, guild2, given) {
|
|
|
14007
14013
|
return null;
|
|
14008
14014
|
}
|
|
14009
14015
|
function messageLine(message) {
|
|
14010
|
-
const to = message.toRole ? ` to ${message.toRole}` : message.to ? ` to ${message.to.length} identit${message.to.length === 1 ? "y" : "ies"}` : "";
|
|
14016
|
+
const to = message.kind === "answer" ? "" : message.toRole ? ` to ${message.toRole}` : message.to ? ` to ${message.to.length} identit${message.to.length === 1 ? "y" : "ies"}` : "";
|
|
14011
14017
|
const what = message.kind === "request" ? ` request ${message.id}${message.request?.open ? message.request.claimedBy ? ", taken" : ", open" : `, ${message.request?.closedReason ?? "closed"}`}` : message.kind === "answer" ? ` answer to ${message.answers ?? ""}` : "";
|
|
14012
14018
|
return `#${message.seq} ${message.from.name}${to}${what}: ${message.text}
|
|
14013
14019
|
`;
|
|
@@ -17569,8 +17575,11 @@ async function secrets(positionals, values) {
|
|
|
17569
17575
|
if (hosts !== void 0 && values.plain) {
|
|
17570
17576
|
throw new Error("--host and --plain say two things: give one.");
|
|
17571
17577
|
}
|
|
17572
|
-
if (hosts !== void 0
|
|
17573
|
-
|
|
17578
|
+
if (hosts !== void 0) {
|
|
17579
|
+
const where = sandboxId === void 0 ? `--template ${values.template ?? "<template>"}` : `--sandbox ${sandboxId}`;
|
|
17580
|
+
throw new Error(
|
|
17581
|
+
`secrets set --host sent the value as it is, and is retired: a value kept out of the sandbox is one of the account's secrets, sealed on this computer. Run agental secret set <NAME> --host <host>, then agental secret use <NAME> ${where}. Nothing was sent.`
|
|
17582
|
+
);
|
|
17574
17583
|
}
|
|
17575
17584
|
const pairs = args.map((arg) => {
|
|
17576
17585
|
const at5 = arg.indexOf("=");
|
|
@@ -17585,23 +17594,20 @@ async function secrets(positionals, values) {
|
|
|
17585
17594
|
for (const [name] of pairs) {
|
|
17586
17595
|
if (await keptOutNow(path6(name))) {
|
|
17587
17596
|
throw new Error(
|
|
17588
|
-
`${name} is kept out of the sandbox. Set without --host it would be plain, and its commands would read its value.
|
|
17597
|
+
`${name} is kept out of the sandbox. Set without --host it would be plain, and its commands would read its value. To keep a new value out, use agental secret set and agental secret use; --plain says its commands are to read it. Nothing was set.`
|
|
17589
17598
|
);
|
|
17590
17599
|
}
|
|
17591
17600
|
if (byTemplate.includes(name)) {
|
|
17592
17601
|
throw new Error(
|
|
17593
|
-
`${name} is kept out of the sandbox by its template. Set as the sandbox's own without --host, it would be used in place of the template's, and its commands would read its value.
|
|
17602
|
+
`${name} is kept out of the sandbox by its template. Set as the sandbox's own without --host, it would be used in place of the template's, and its commands would read its value. To keep the sandbox's own out, use agental secret set and agental secret use; --plain says its commands are to read it. Nothing was set.`
|
|
17594
17603
|
);
|
|
17595
17604
|
}
|
|
17596
17605
|
}
|
|
17597
17606
|
}
|
|
17598
17607
|
for (const [name, value] of pairs) {
|
|
17599
|
-
|
|
17600
|
-
process.stdout.write(
|
|
17601
|
-
|
|
17602
|
-
` : `set ${name}
|
|
17603
|
-
`
|
|
17604
|
-
);
|
|
17608
|
+
await call2(path6(name), { method: "PUT", body: JSON.stringify({ value }) });
|
|
17609
|
+
process.stdout.write(`set ${name}
|
|
17610
|
+
`);
|
|
17605
17611
|
}
|
|
17606
17612
|
return;
|
|
17607
17613
|
}
|
|
@@ -18916,7 +18922,7 @@ Usage
|
|
|
18916
18922
|
agental template put <template> <sandbox-id>
|
|
18917
18923
|
agental secrets (<sandbox-id> | --template <template>) [--json]
|
|
18918
18924
|
agental secrets (<sandbox-id> | --template <template>) get <NAME> [--json] | unset <NAME>...
|
|
18919
|
-
agental secrets (<sandbox-id> | --template <template>) set <NAME>=<value>... [--
|
|
18925
|
+
agental secrets (<sandbox-id> | --template <template>) set <NAME>=<value>... [--plain]
|
|
18920
18926
|
agental secrets (<sandbox-id> | --template <template>) hosts <NAME> --host <host>[,<host>...] [--json]
|
|
18921
18927
|
agental secrets (<sandbox-id> | --template <template>) get-file <path> | put-file <path> (<local-file> | --text <text>) | rm-file <path>
|
|
18922
18928
|
agental metrics [--at <date-time>] [--json]
|
|
@@ -19117,8 +19123,10 @@ when template apply names it, or names none, which is every running sandbox on i
|
|
|
19117
19123
|
template put puts a sandbox on another template: it has that template's from its next command.
|
|
19118
19124
|
secrets lists a sandbox's own variables and files, or with --template a template's, and says
|
|
19119
19125
|
which variables are kept out of the sandbox. get prints a variable's value, and set sets one.
|
|
19120
|
-
|
|
19121
|
-
|
|
19126
|
+
A value kept out of the sandbox is one of the account's secrets: agental secret set seals it
|
|
19127
|
+
here and agental secret use gives it to a sandbox or a template; set with --host, which sent the
|
|
19128
|
+
value as it is, is refused. A variable kept out that way before stays so: its commands see a
|
|
19129
|
+
stand-in in place of its value, and the proxy on the sandbox's server puts the value in place of the stand-in on
|
|
19122
19130
|
HTTPS requests to those hosts, and nowhere else. Sent anywhere else, the stand-in is worth
|
|
19123
19131
|
nothing. A host is a name such as api.github.com, or *.example.com for every name under
|
|
19124
19132
|
example.com, with no scheme, port or path, and a variable has 1 to 10 of them. A name on the
|
|
@@ -19126,11 +19134,10 @@ Public Suffix List, such as github.io, is refused, and so is a wildcard over one
|
|
|
19126
19134
|
or *.co.uk. The value is never given back, to you or anyone: get prints the stand-in and the
|
|
19127
19135
|
hosts instead. The stand-in stays the same when the value is replaced, so a file that holds it
|
|
19128
19136
|
keeps working. hosts narrows the hosts without sending the value again: a host it is not sent
|
|
19129
|
-
to now is refused
|
|
19137
|
+
to now is refused. Set without --host, a
|
|
19130
19138
|
variable kept out would be plain, and its commands would read its value, and a sandbox's own
|
|
19131
19139
|
plain one would be used in place of one its template keeps out: set refuses both unless --plain
|
|
19132
|
-
says it is meant. Hosts do not open the template's outbound rule.
|
|
19133
|
-
/v1/policy says hiddenVariables.
|
|
19140
|
+
says it is meant. Hosts do not open the template's outbound rule.
|
|
19134
19141
|
metrics says what each of your sandboxes read at one moment, a line a sandbox: its CPU as a
|
|
19135
19142
|
percent, its memory and its disk as what is in use of what there is, and what its network
|
|
19136
19143
|
received and sent a second. The moment is now, or the one --at names. A sandbox that was stopped
|
|
@@ -19273,8 +19280,8 @@ owner or admin and a member's own for a member: what each may do, what it reache
|
|
|
19273
19280
|
the addresses it may be used from, and when and from where it was last used. key add makes one
|
|
19274
19281
|
that may do what --preset gives it, or what --actions names, and nothing more. The presets are
|
|
19275
19282
|
read-only, every read but secrets and mail; full-sandbox, the use of sandboxes that are there,
|
|
19276
|
-
stopping them included; ci, that and making, forking and resuming sandboxes
|
|
19277
|
-
own; and admin, everything. The actions are ${KEY_ACTIONS.join(", ")}, or * for every one.
|
|
19283
|
+
stopping them included; ci, that and making, forking and resuming sandboxes, deleting its
|
|
19284
|
+
own and building images; and admin, everything. The actions are ${KEY_ACTIONS.join(", ")}, or * for every one.
|
|
19278
19285
|
A preset is written out into its actions as the key is made, so a preset that grows later does
|
|
19279
19286
|
not widen it. --sandbox limits the key to those sandboxes, and --template to those templates
|
|
19280
19287
|
and the sandboxes on them; it reaches the sandboxes it makes as well. --expires stops it
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agental",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.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",
|