agental 0.82.0 → 0.83.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 +22 -5
  2. 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.82.0" : "dev";
7427
+ var CLI_VERSION = true ? "0.83.0" : "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}`;
@@ -7482,6 +7482,13 @@ function removeCredentials(env = process.env) {
7482
7482
  rmSync(credentialsPath(env), { force: true });
7483
7483
  }
7484
7484
  function guildTokenHere(fallbackUrl, env = process.env) {
7485
+ if (env["AGENTAL_API_KEY"]?.trim()) {
7486
+ return null;
7487
+ }
7488
+ const guildToken = env["AGENTAL_GUILD_TOKEN"]?.trim();
7489
+ if (guildToken) {
7490
+ return guildToken;
7491
+ }
7485
7492
  const token = env["AGENTAL_SANDBOX_TOKEN"]?.trim();
7486
7493
  const named = env["AGENTAL_API_URL"]?.trim();
7487
7494
  if (!token || !named || resolveApi(fallbackUrl, null, env).key !== null) {
@@ -9736,7 +9743,7 @@ var COMMANDS = [
9736
9743
  "agental guild attach <guild> <template|sandbox> [--roles <role,...>] | detach <guild> <template|sandbox>",
9737
9744
  "agental guild mine",
9738
9745
  "agental guild join <guild> --as <name> --role <role> [--answer <key=value>]...",
9739
- "agental guild members <guild> | leave <guild> <identity> | handover <guild> <identity> <sandbox>",
9746
+ "agental guild members <guild> | token <guild> <identity> | leave <guild> <identity> | handover <guild> <identity> <sandbox>",
9740
9747
  "agental guild post <guild> <text> [--as <identity>] [--to <identity,...> | --to-role <role>] [--request] [--answers <request>]",
9741
9748
  "agental guild read <guild> [--as <identity>] [--wait-seconds <n>] [--done]",
9742
9749
  "agental guild requests <guild> | claim <guild> <request> | answer <guild> <request> <text> | close <guild> <request>",
@@ -10451,7 +10458,7 @@ var SUBCOMMANDS = {
10451
10458
  limits: ["budget"],
10452
10459
  egress: ["budget", "use-case"],
10453
10460
  tailscale: ["status", "connect", "disconnect"],
10454
- guild: ["list", "show", "plan", "create", "delete", "attach", "detach", "mine", "join", "members", "leave", "handover", "post", "read", "requests", "claim", "answer", "close", "notes", "pause", "resume", "work"],
10461
+ guild: ["list", "show", "plan", "create", "delete", "attach", "detach", "mine", "join", "members", "token", "leave", "handover", "post", "read", "requests", "claim", "answer", "close", "notes", "pause", "resume", "work"],
10455
10462
  subscriptions: ["list", "sign-in", "delete"],
10456
10463
  connection: ["list", "add", "link", "show", "remove"],
10457
10464
  telemetry: ["set", "test", "unset"],
@@ -16665,7 +16672,7 @@ async function work(options) {
16665
16672
  }
16666
16673
 
16667
16674
  // ../src/cli-guilds.ts
16668
- var USAGE10 = "guild takes list, show, plan, create, delete, attach, detach, mine, join, members, leave, handover, post, read, requests, request, claim, answer, received, close, notes, pause, resume, mail or work. agental guild --help shows each.";
16675
+ var USAGE10 = "guild takes list, show, plan, create, delete, attach, detach, mine, join, members, token, leave, handover, post, read, requests, request, claim, answer, received, close, notes, pause, resume, mail or work. agental guild --help shows each.";
16669
16676
  async function ask12(client, method, pathname, body) {
16670
16677
  const response = await client.request(pathname, { method, ...body === void 0 ? {} : { body: JSON.stringify(body) } });
16671
16678
  let answered = null;
@@ -16939,7 +16946,9 @@ ${held}`;
16939
16946
  });
16940
16947
  const waiting = joined["waiting"];
16941
16948
  const owed = waiting && waiting.requests > 0 ? ` ${waiting.requests} request${waiting.requests === 1 ? "" : "s"} wait${waiting.requests === 1 ? "s" : ""} for you${waiting.byMail > 0 ? `, ${waiting.byMail} by mail` : ""}: agental guild requests ${String(name)}.` : "";
16942
- print4(options.json, joined, `You are ${String(joined["name"])}, ${String(joined["role"])} of ${String(name)} (${String(joined["id"])}).${owed}
16949
+ const tokenLine = typeof joined["memberToken"] === "string" ? `
16950
+ AGENTAL_GUILD_TOKEN=${joined["memberToken"]}` : "";
16951
+ print4(options.json, joined, `You are ${String(joined["name"])}, ${String(joined["role"])} of ${String(name)} (${String(joined["id"])}).${owed}${tokenLine}
16943
16952
  `);
16944
16953
  return;
16945
16954
  }
@@ -16948,6 +16957,14 @@ ${held}`;
16948
16957
  print4(options.json, members2, members2.map(memberLine).join("") || "No identities yet.\n");
16949
16958
  return;
16950
16959
  }
16960
+ case "token": {
16961
+ const guildName = needed(name, "token takes a guild and an identity");
16962
+ const member = await memberNamed2(client, guildName, needed(third, "token takes a guild and an identity"));
16963
+ const minted = await ask12(client, "POST", `${at4(guildName)}/members/${encodeURIComponent(member.id)}/token`);
16964
+ print4(options.json, minted, `AGENTAL_GUILD_TOKEN=${String(minted["token"])}
16965
+ `);
16966
+ return;
16967
+ }
16951
16968
  case "leave": {
16952
16969
  const guildName = needed(name, "leave takes a guild and an identity");
16953
16970
  const member = await memberNamed2(client, guildName, needed(third, "leave takes a guild and an identity"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agental",
3
- "version": "0.82.0",
3
+ "version": "0.83.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",