agental 0.60.0 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +27 -23
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -7411,7 +7411,7 @@ import { parseArgs } from "node:util";
7411
7411
 
7412
7412
  // ../src/cli-build.ts
7413
7413
  var PUBLISHED = true;
7414
- var CLI_VERSION = true ? "0.60.0" : "dev";
7414
+ var CLI_VERSION = true ? "0.61.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,9 @@ var KEY_ACTIONS = [
7924
7924
  "template.write",
7925
7925
  "bucket.read",
7926
7926
  "bucket.write",
7927
+ "image.read",
7928
+ "image.build",
7929
+ "image.delete",
7927
7930
  "guild.read",
7928
7931
  "guild.write",
7929
7932
  "guild.join",
@@ -7950,10 +7953,10 @@ var FULL_SANDBOX = [
7950
7953
  ];
7951
7954
  var PRESETS = {
7952
7955
  // 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"],
7956
+ "read-only": ["sandbox.read", "file.read", "job.read", "snapshot.read", "template.read", "bucket.read", "image.read", "guild.read", "account.read"],
7954
7957
  "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"],
7958
+ // A CI system runs the jobs it is given and reads how they went; it does not make them. It builds images, and deletes none.
7959
+ ci: [...FULL_SANDBOX, "sandbox.create", "sandbox.fork", "sandbox.resume", "sandbox.delete-own", "job.read", "job.run", "image.read", "image.build"],
7957
7960
  admin: [ALL_ACTIONS]
7958
7961
  };
7959
7962
  var PRESET_NAMES = Object.keys(PRESETS);
@@ -9699,7 +9702,7 @@ var COMMANDS = [
9699
9702
  {
9700
9703
  name: "secrets",
9701
9704
  summary: "Keep values and files out of a sandbox, or out of every sandbox of a template.",
9702
- examples: ["agental secrets --template default set GITHUB_TOKEN=ghp_\u2026 --host github.com,api.github.com", "agental secrets sbx_2a9a47e50daec64a"],
9705
+ examples: ["agental secrets --template default set NODE_ENV=development", "agental secrets sbx_2a9a47e50daec64a"],
9703
9706
  flags: [
9704
9707
  ["--template <template>", "the template's secrets, for every sandbox made from it"],
9705
9708
  ["--host <host>[,<host>...]", "set, hosts: keep the value out of the sandbox, sent only to these hosts"],
@@ -17569,8 +17572,11 @@ async function secrets(positionals, values) {
17569
17572
  if (hosts !== void 0 && values.plain) {
17570
17573
  throw new Error("--host and --plain say two things: give one.");
17571
17574
  }
17572
- if (hosts !== void 0 && hosts.length === 0) {
17573
- throw new Error("--host takes a host, as --host api.github.com");
17575
+ if (hosts !== void 0) {
17576
+ const where = sandboxId === void 0 ? `--template ${values.template ?? "<template>"}` : `--sandbox ${sandboxId}`;
17577
+ throw new Error(
17578
+ `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.`
17579
+ );
17574
17580
  }
17575
17581
  const pairs = args.map((arg) => {
17576
17582
  const at5 = arg.indexOf("=");
@@ -17585,23 +17591,20 @@ async function secrets(positionals, values) {
17585
17591
  for (const [name] of pairs) {
17586
17592
  if (await keptOutNow(path6(name))) {
17587
17593
  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. Give its hosts again with --host to keep it out, or --plain for its commands to read it. Nothing was set.`
17594
+ `${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
17595
  );
17590
17596
  }
17591
17597
  if (byTemplate.includes(name)) {
17592
17598
  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. Give it hosts with --host to keep it out, or --plain for its commands to read it. Nothing was set.`
17599
+ `${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
17600
  );
17595
17601
  }
17596
17602
  }
17597
17603
  }
17598
17604
  for (const [name, value] of pairs) {
17599
- const body = await call2(path6(name), { method: "PUT", body: JSON.stringify(hosts === void 0 ? { value } : { value, hosts }) });
17600
- process.stdout.write(
17601
- body.hidden === true ? `set ${name}, kept out of the sandbox: its commands see ${body.standIn}, and its value is sent only to ${body.hosts.join(", ")}
17602
- ` : `set ${name}
17603
- `
17604
- );
17605
+ await call2(path6(name), { method: "PUT", body: JSON.stringify({ value }) });
17606
+ process.stdout.write(`set ${name}
17607
+ `);
17605
17608
  }
17606
17609
  return;
17607
17610
  }
@@ -18916,7 +18919,7 @@ Usage
18916
18919
  agental template put <template> <sandbox-id>
18917
18920
  agental secrets (<sandbox-id> | --template <template>) [--json]
18918
18921
  agental secrets (<sandbox-id> | --template <template>) get <NAME> [--json] | unset <NAME>...
18919
- agental secrets (<sandbox-id> | --template <template>) set <NAME>=<value>... [--host <host>[,<host>...] | --plain]
18922
+ agental secrets (<sandbox-id> | --template <template>) set <NAME>=<value>... [--plain]
18920
18923
  agental secrets (<sandbox-id> | --template <template>) hosts <NAME> --host <host>[,<host>...] [--json]
18921
18924
  agental secrets (<sandbox-id> | --template <template>) get-file <path> | put-file <path> (<local-file> | --text <text>) | rm-file <path>
18922
18925
  agental metrics [--at <date-time>] [--json]
@@ -19117,8 +19120,10 @@ when template apply names it, or names none, which is every running sandbox on i
19117
19120
  template put puts a sandbox on another template: it has that template's from its next command.
19118
19121
  secrets lists a sandbox's own variables and files, or with --template a template's, and says
19119
19122
  which variables are kept out of the sandbox. get prints a variable's value, and set sets one.
19120
- set with --host keeps a variable out of the sandbox: its commands see a stand-in in place of
19121
- its value, and the proxy on the sandbox's server puts the value in place of the stand-in on
19123
+ A value kept out of the sandbox is one of the account's secrets: agental secret set seals it
19124
+ here and agental secret use gives it to a sandbox or a template; set with --host, which sent the
19125
+ value as it is, is refused. A variable kept out that way before stays so: its commands see a
19126
+ 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
19127
  HTTPS requests to those hosts, and nowhere else. Sent anywhere else, the stand-in is worth
19123
19128
  nothing. A host is a name such as api.github.com, or *.example.com for every name under
19124
19129
  example.com, with no scheme, port or path, and a variable has 1 to 10 of them. A name on the
@@ -19126,11 +19131,10 @@ Public Suffix List, such as github.io, is refused, and so is a wildcard over one
19126
19131
  or *.co.uk. The value is never given back, to you or anyone: get prints the stand-in and the
19127
19132
  hosts instead. The stand-in stays the same when the value is replaced, so a file that holds it
19128
19133
  keeps working. hosts narrows the hosts without sending the value again: a host it is not sent
19129
- to now is refused, and needs set with the value. Set without --host, a
19134
+ to now is refused. Set without --host, a
19130
19135
  variable kept out would be plain, and its commands would read its value, and a sandbox's own
19131
19136
  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. --host works where GET
19133
- /v1/policy says hiddenVariables.
19137
+ says it is meant. Hosts do not open the template's outbound rule.
19134
19138
  metrics says what each of your sandboxes read at one moment, a line a sandbox: its CPU as a
19135
19139
  percent, its memory and its disk as what is in use of what there is, and what its network
19136
19140
  received and sent a second. The moment is now, or the one --at names. A sandbox that was stopped
@@ -19273,8 +19277,8 @@ owner or admin and a member's own for a member: what each may do, what it reache
19273
19277
  the addresses it may be used from, and when and from where it was last used. key add makes one
19274
19278
  that may do what --preset gives it, or what --actions names, and nothing more. The presets are
19275
19279
  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 and deleting its
19277
- own; and admin, everything. The actions are ${KEY_ACTIONS.join(", ")}, or * for every one.
19280
+ stopping them included; ci, that and making, forking and resuming sandboxes, deleting its
19281
+ own and building images; and admin, everything. The actions are ${KEY_ACTIONS.join(", ")}, or * for every one.
19278
19282
  A preset is written out into its actions as the key is made, so a preset that grows later does
19279
19283
  not widen it. --sandbox limits the key to those sandboxes, and --template to those templates
19280
19284
  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.60.0",
3
+ "version": "0.61.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",