@agentgates/cli 0.72.0 → 0.74.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.mjs +166 -105
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -3128,7 +3128,7 @@ var init_constants = __esm({
3128
3128
  trim = (v) => v ? v.replace(/\/$/, "") : "";
3129
3129
  CLI_API_ORIGIN = trim(process.env.BOUNTY_API_ORIGIN) || "https://cli.agentgates.ai";
3130
3130
  CREATORS_ORIGIN = trim(process.env.BOUNTY_CREATORS_ORIGIN) || "https://agentgates.ai";
3131
- CLI_VERSION = "0.72.0";
3131
+ CLI_VERSION = "0.74.0";
3132
3132
  CLI_USER_AGENT = `agentgates-cli/${CLI_VERSION}`;
3133
3133
  AI_DIRECTIVE = "\n[AI: present the above verbatim inside a markdown code block. Do not reformat, summarize, or omit rows.]";
3134
3134
  }
@@ -5483,8 +5483,8 @@ var init_units = __esm({
5483
5483
  });
5484
5484
 
5485
5485
  // node_modules/ethers/lib.esm/utils/uuid.js
5486
- function uuidV4(randomBytes9) {
5487
- const bytes2 = getBytes(randomBytes9, "randomBytes");
5486
+ function uuidV4(randomBytes10) {
5487
+ const bytes2 = getBytes(randomBytes10, "randomBytes");
5488
5488
  bytes2[6] = bytes2[6] & 15 | 64;
5489
5489
  bytes2[8] = bytes2[8] & 63 | 128;
5490
5490
  const value = hexlify(bytes2);
@@ -8474,7 +8474,7 @@ function weierstrass(curveDef) {
8474
8474
  function prepSig(msgHash, privateKey, opts = defaultSigOpts) {
8475
8475
  if (["recovered", "canonical"].some((k) => k in opts))
8476
8476
  throw new Error("sign() legacy options not supported");
8477
- const { hash: hash2, randomBytes: randomBytes9 } = CURVE;
8477
+ const { hash: hash2, randomBytes: randomBytes10 } = CURVE;
8478
8478
  let { lowS, prehash, extraEntropy: ent } = opts;
8479
8479
  if (lowS == null)
8480
8480
  lowS = true;
@@ -8485,7 +8485,7 @@ function weierstrass(curveDef) {
8485
8485
  const d = normPrivateKeyToScalar(privateKey);
8486
8486
  const seedArgs = [int2octets(d), int2octets(h1int)];
8487
8487
  if (ent != null) {
8488
- const e = ent === true ? randomBytes9(Fp3.BYTES) : ent;
8488
+ const e = ent === true ? randomBytes10(Fp3.BYTES) : ent;
8489
8489
  seedArgs.push(ensureBytes("extraEntropy", e));
8490
8490
  }
8491
8491
  const seed = concatBytes2(...seedArgs);
@@ -25860,7 +25860,7 @@ var require_websocket = __commonJS({
25860
25860
  var http2 = __require("http");
25861
25861
  var net = __require("net");
25862
25862
  var tls = __require("tls");
25863
- var { randomBytes: randomBytes9, createHash: createHash9 } = __require("crypto");
25863
+ var { randomBytes: randomBytes10, createHash: createHash10 } = __require("crypto");
25864
25864
  var { Duplex, Readable } = __require("stream");
25865
25865
  var { URL: URL4 } = __require("url");
25866
25866
  var PerMessageDeflate = require_permessage_deflate();
@@ -26386,7 +26386,7 @@ var require_websocket = __commonJS({
26386
26386
  }
26387
26387
  }
26388
26388
  const defaultPort = isSecure ? 443 : 80;
26389
- const key = randomBytes9(16).toString("base64");
26389
+ const key = randomBytes10(16).toString("base64");
26390
26390
  const request = isSecure ? https2.request : http2.request;
26391
26391
  const protocolSet = /* @__PURE__ */ new Set();
26392
26392
  let perMessageDeflate;
@@ -26516,7 +26516,7 @@ var require_websocket = __commonJS({
26516
26516
  abortHandshake(websocket, socket, "Invalid Upgrade header");
26517
26517
  return;
26518
26518
  }
26519
- const digest = createHash9("sha1").update(key + GUID).digest("base64");
26519
+ const digest = createHash10("sha1").update(key + GUID).digest("base64");
26520
26520
  if (res.headers["sec-websocket-accept"] !== digest) {
26521
26521
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
26522
26522
  return;
@@ -26762,7 +26762,7 @@ var require_websocket_server = __commonJS({
26762
26762
  var EventEmitter = __require("events");
26763
26763
  var http2 = __require("http");
26764
26764
  var { Duplex } = __require("stream");
26765
- var { createHash: createHash9 } = __require("crypto");
26765
+ var { createHash: createHash10 } = __require("crypto");
26766
26766
  var extension = require_extension();
26767
26767
  var PerMessageDeflate = require_permessage_deflate();
26768
26768
  var subprotocol = require_subprotocol();
@@ -27057,7 +27057,7 @@ var require_websocket_server = __commonJS({
27057
27057
  );
27058
27058
  }
27059
27059
  if (this._state > RUNNING) return abortHandshake(socket, 503);
27060
- const digest = createHash9("sha1").update(key + GUID).digest("base64");
27060
+ const digest = createHash10("sha1").update(key + GUID).digest("base64");
27061
27061
  const headers = [
27062
27062
  "HTTP/1.1 101 Switching Protocols",
27063
27063
  "Upgrade: websocket",
@@ -32684,76 +32684,6 @@ var init_passwords_wire = __esm({
32684
32684
  }
32685
32685
  });
32686
32686
 
32687
- // package.json
32688
- var require_package = __commonJS({
32689
- "package.json"(exports, module) {
32690
- module.exports = {
32691
- name: "@agentgates/cli",
32692
- version: "0.72.0",
32693
- description: "Wallet operations for AI agents and humans",
32694
- keywords: [
32695
- "crypto",
32696
- "wallet",
32697
- "cli",
32698
- "ai-agent",
32699
- "agentgates",
32700
- "usdc",
32701
- "solana",
32702
- "ethereum",
32703
- "polygon",
32704
- "defi"
32705
- ],
32706
- license: "MIT",
32707
- homepage: "https://agentgates.ai",
32708
- repository: {
32709
- type: "git",
32710
- url: "git+https://github.com/Carlos-Sotop/agentgates-ai-cli.git"
32711
- },
32712
- author: "Agentgates",
32713
- type: "module",
32714
- bin: {
32715
- agentgates: "bin/agentgates"
32716
- },
32717
- files: [
32718
- "bin",
32719
- "dist/cli.mjs",
32720
- "scripts/postinstall.mjs",
32721
- "README.md"
32722
- ],
32723
- scripts: {
32724
- build: `esbuild src/main.ts --bundle --platform=node --format=esm --outfile=dist/cli.mjs --define:process.env.CLI_VERSION="\\"$npm_package_version\\"" --banner:js="import{createRequire}from'module';const require=createRequire(import.meta.url);"`,
32725
- "build:tsc": "tsc -p tsconfig.json",
32726
- postinstall: "node scripts/postinstall.mjs || exit 0",
32727
- prepare: "[ -x node_modules/.bin/esbuild ] && npm run build || true",
32728
- dev: "tsc -w -p tsconfig.json",
32729
- typecheck: "tsc --noEmit",
32730
- test: "tsc -p tsconfig.json && node --test test/*.test.mjs",
32731
- bounty: "node bin/bounty",
32732
- "sync:bounty-shared": "node scripts/sync-bounty-shared.mjs",
32733
- clean: "rm -rf dist"
32734
- },
32735
- engines: {
32736
- node: ">=20"
32737
- },
32738
- devDependencies: {
32739
- "@solana/web3.js": "^1.98.4",
32740
- "@types/node": "^22.10.0",
32741
- commander: "^12.1.0",
32742
- esbuild: "^0.28.0",
32743
- ethers: "^6.16.0",
32744
- open: "^10.1.0",
32745
- picocolors: "^1.1.1",
32746
- typescript: "^5.6.3"
32747
- },
32748
- dependencies: {
32749
- "@noble/ciphers": "^1.3.0",
32750
- "@noble/curves": "^1.9.7",
32751
- "@noble/hashes": "^1.8.0"
32752
- }
32753
- };
32754
- }
32755
- });
32756
-
32757
32687
  // node_modules/@noble/hashes/cryptoNode.js
32758
32688
  var require_cryptoNode = __commonJS({
32759
32689
  "node_modules/@noble/hashes/cryptoNode.js"(exports) {
@@ -32797,7 +32727,7 @@ var require_utils = __commonJS({
32797
32727
  exports.createHasher = createHasher2;
32798
32728
  exports.createOptHasher = createOptHasher;
32799
32729
  exports.createXOFer = createXOFer;
32800
- exports.randomBytes = randomBytes9;
32730
+ exports.randomBytes = randomBytes10;
32801
32731
  var crypto_1 = require_cryptoNode();
32802
32732
  function isBytes3(a) {
32803
32733
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
@@ -32995,7 +32925,7 @@ var require_utils = __commonJS({
32995
32925
  exports.wrapConstructor = createHasher2;
32996
32926
  exports.wrapConstructorWithOpts = createOptHasher;
32997
32927
  exports.wrapXOFConstructorWithOpts = createXOFer;
32998
- function randomBytes9(bytesLength = 32) {
32928
+ function randomBytes10(bytesLength = 32) {
32999
32929
  if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
33000
32930
  return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
33001
32931
  }
@@ -35167,7 +35097,7 @@ var require_edwards = __commonJS({
35167
35097
  });
35168
35098
  const { prehash } = eddsaOpts;
35169
35099
  const { BASE, Fp: Fp3, Fn: Fn2 } = Point2;
35170
- const randomBytes9 = eddsaOpts.randomBytes || utils_ts_1.randomBytes;
35100
+ const randomBytes10 = eddsaOpts.randomBytes || utils_ts_1.randomBytes;
35171
35101
  const adjustScalarBytes2 = eddsaOpts.adjustScalarBytes || ((bytes2) => bytes2);
35172
35102
  const domain = eddsaOpts.domain || ((data4, ctx2, phflag) => {
35173
35103
  (0, utils_ts_1._abool2)(phflag, "phflag");
@@ -35249,7 +35179,7 @@ var require_edwards = __commonJS({
35249
35179
  signature: 2 * _size,
35250
35180
  seed: _size
35251
35181
  };
35252
- function randomSecretKey(seed = randomBytes9(lengths.seed)) {
35182
+ function randomSecretKey(seed = randomBytes10(lengths.seed)) {
35253
35183
  return (0, utils_ts_1._abytes2)(seed, lengths.seed, "seed");
35254
35184
  }
35255
35185
  function keygen(seed) {
@@ -49757,7 +49687,7 @@ var require_websocket2 = __commonJS({
49757
49687
  var http2 = __require("http");
49758
49688
  var net = __require("net");
49759
49689
  var tls = __require("tls");
49760
- var { randomBytes: randomBytes9, createHash: createHash9 } = __require("crypto");
49690
+ var { randomBytes: randomBytes10, createHash: createHash10 } = __require("crypto");
49761
49691
  var { Duplex, Readable } = __require("stream");
49762
49692
  var { URL: URL4 } = __require("url");
49763
49693
  var PerMessageDeflate = require_permessage_deflate2();
@@ -50295,7 +50225,7 @@ var require_websocket2 = __commonJS({
50295
50225
  }
50296
50226
  }
50297
50227
  const defaultPort = isSecure ? 443 : 80;
50298
- const key = randomBytes9(16).toString("base64");
50228
+ const key = randomBytes10(16).toString("base64");
50299
50229
  const request = isSecure ? https2.request : http2.request;
50300
50230
  const protocolSet = /* @__PURE__ */ new Set();
50301
50231
  let perMessageDeflate;
@@ -50425,7 +50355,7 @@ var require_websocket2 = __commonJS({
50425
50355
  abortHandshake(websocket, socket, "Invalid Upgrade header");
50426
50356
  return;
50427
50357
  }
50428
- const digest = createHash9("sha1").update(key + GUID).digest("base64");
50358
+ const digest = createHash10("sha1").update(key + GUID).digest("base64");
50429
50359
  if (res.headers["sec-websocket-accept"] !== digest) {
50430
50360
  abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
50431
50361
  return;
@@ -50794,7 +50724,7 @@ var require_websocket_server2 = __commonJS({
50794
50724
  var EventEmitter = __require("events");
50795
50725
  var http2 = __require("http");
50796
50726
  var { Duplex } = __require("stream");
50797
- var { createHash: createHash9 } = __require("crypto");
50727
+ var { createHash: createHash10 } = __require("crypto");
50798
50728
  var extension = require_extension2();
50799
50729
  var PerMessageDeflate = require_permessage_deflate2();
50800
50730
  var subprotocol = require_subprotocol2();
@@ -51101,7 +51031,7 @@ var require_websocket_server2 = __commonJS({
51101
51031
  );
51102
51032
  }
51103
51033
  if (this._state > RUNNING) return abortHandshake(socket, 503);
51104
- const digest = createHash9("sha1").update(key + GUID).digest("base64");
51034
+ const digest = createHash10("sha1").update(key + GUID).digest("base64");
51105
51035
  const headers = [
51106
51036
  "HTTP/1.1 101 Switching Protocols",
51107
51037
  "Upgrade: websocket",
@@ -51568,14 +51498,14 @@ var init_v1ToV6 = __esm({
51568
51498
  });
51569
51499
 
51570
51500
  // node_modules/rpc-websockets/node_modules/uuid/dist-node/md5.js
51571
- import { createHash as createHash7 } from "node:crypto";
51501
+ import { createHash as createHash8 } from "node:crypto";
51572
51502
  function md52(bytes2) {
51573
51503
  if (Array.isArray(bytes2)) {
51574
51504
  bytes2 = Buffer.from(bytes2);
51575
51505
  } else if (typeof bytes2 === "string") {
51576
51506
  bytes2 = Buffer.from(bytes2, "utf8");
51577
51507
  }
51578
- return createHash7("md5").update(bytes2).digest();
51508
+ return createHash8("md5").update(bytes2).digest();
51579
51509
  }
51580
51510
  var md5_default2;
51581
51511
  var init_md52 = __esm({
@@ -51682,14 +51612,14 @@ var init_v42 = __esm({
51682
51612
  });
51683
51613
 
51684
51614
  // node_modules/rpc-websockets/node_modules/uuid/dist-node/sha1.js
51685
- import { createHash as createHash8 } from "node:crypto";
51615
+ import { createHash as createHash9 } from "node:crypto";
51686
51616
  function sha12(bytes2) {
51687
51617
  if (Array.isArray(bytes2)) {
51688
51618
  bytes2 = Buffer.from(bytes2);
51689
51619
  } else if (typeof bytes2 === "string") {
51690
51620
  bytes2 = Buffer.from(bytes2, "utf8");
51691
51621
  }
51692
- return createHash8("sha1").update(bytes2).digest();
51622
+ return createHash9("sha1").update(bytes2).digest();
51693
51623
  }
51694
51624
  var sha1_default2;
51695
51625
  var init_sha12 = __esm({
@@ -53912,7 +53842,7 @@ var require_weierstrass = __commonJS({
53912
53842
  bits2int: "function",
53913
53843
  bits2int_modN: "function"
53914
53844
  });
53915
- const randomBytes9 = ecdsaOpts.randomBytes || utils_ts_1.randomBytes;
53845
+ const randomBytes10 = ecdsaOpts.randomBytes || utils_ts_1.randomBytes;
53916
53846
  const hmac3 = ecdsaOpts.hmac || ((key, ...msgs) => (0, hmac_js_1.hmac)(hash2, key, (0, utils_ts_1.concatBytes)(...msgs)));
53917
53847
  const { Fp: Fp3, Fn: Fn2 } = Point2;
53918
53848
  const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn2;
@@ -54067,7 +53997,7 @@ var require_weierstrass = __commonJS({
54067
53997
  const d = _normFnElement(Fn2, privateKey);
54068
53998
  const seedArgs = [int2octets(d), int2octets(h1int)];
54069
53999
  if (extraEntropy != null && extraEntropy !== false) {
54070
- const e = extraEntropy === true ? randomBytes9(lengths.secretKey) : extraEntropy;
54000
+ const e = extraEntropy === true ? randomBytes10(lengths.secretKey) : extraEntropy;
54071
54001
  seedArgs.push((0, utils_ts_1.ensureBytes)("extraEntropy", e));
54072
54002
  }
54073
54003
  const seed = (0, utils_ts_1.concatBytes)(...seedArgs);
@@ -63672,6 +63602,9 @@ Message: ${transactionMessage}.
63672
63602
  }
63673
63603
  });
63674
63604
 
63605
+ // src/main.ts
63606
+ import { readFileSync as readFileSync3 } from "node:fs";
63607
+
63675
63608
  // node_modules/commander/esm.mjs
63676
63609
  var import_index = __toESM(require_commander(), 1);
63677
63610
  var {
@@ -68109,7 +68042,7 @@ function eddsa(Point2, cHash, eddsaOpts = {}) {
68109
68042
  });
68110
68043
  const { prehash } = eddsaOpts;
68111
68044
  const { BASE, Fp: Fp3, Fn: Fn2 } = Point2;
68112
- const randomBytes9 = eddsaOpts.randomBytes || randomBytes6;
68045
+ const randomBytes10 = eddsaOpts.randomBytes || randomBytes6;
68113
68046
  const adjustScalarBytes2 = eddsaOpts.adjustScalarBytes || ((bytes2) => bytes2);
68114
68047
  const domain = eddsaOpts.domain || ((data4, ctx2, phflag) => {
68115
68048
  _abool2(phflag, "phflag");
@@ -68191,7 +68124,7 @@ function eddsa(Point2, cHash, eddsaOpts = {}) {
68191
68124
  signature: 2 * _size,
68192
68125
  seed: _size
68193
68126
  };
68194
- function randomSecretKey(seed = randomBytes9(lengths.seed)) {
68127
+ function randomSecretKey(seed = randomBytes10(lengths.seed)) {
68195
68128
  return _abytes2(seed, lengths.seed, "seed");
68196
68129
  }
68197
68130
  function keygen(seed) {
@@ -72152,7 +72085,16 @@ import { existsSync, readFileSync as readFileSync2 } from "node:fs";
72152
72085
  import path4 from "node:path";
72153
72086
  import { spawn } from "node:child_process";
72154
72087
  var PKG = "@agentgates/cli";
72155
- var LOCAL_VERSION = require_package().version;
72088
+ var LOCAL_VERSION = (() => {
72089
+ for (const rel of ["../../package.json", "../package.json"]) {
72090
+ try {
72091
+ const v = JSON.parse(readFileSync2(new URL(rel, import.meta.url), "utf8")).version;
72092
+ if (typeof v === "string") return v;
72093
+ } catch {
72094
+ }
72095
+ }
72096
+ return "0.0.0";
72097
+ })();
72156
72098
  function olderThan(a, b2) {
72157
72099
  const num = (v) => v.replace(/^v/, "").split("-")[0].split(".").map((n2) => parseInt(n2, 10) || 0);
72158
72100
  const [x, y] = [num(a), num(b2)];
@@ -76174,6 +76116,7 @@ async function intentsNoShow(askId, opts) {
76174
76116
 
76175
76117
  // src/commands/integrations.ts
76176
76118
  var import_picocolors18 = __toESM(require_picocolors(), 1);
76119
+ import { createHash as createHash6, randomBytes as randomBytes9 } from "node:crypto";
76177
76120
  init_passwords_wire();
76178
76121
  function emit10(opts, data4, human) {
76179
76122
  if (opts.json || !process.stdout.isTTY) {
@@ -76405,6 +76348,107 @@ async function sitesList(opts) {
76405
76348
  fail6(opts, err);
76406
76349
  }
76407
76350
  }
76351
+ var CHANGE_ID_RE = /^[A-Za-z0-9_-]{22}$/;
76352
+ function cardAad(owner, card2) {
76353
+ return `AGENTGATES-CONVERSATION-v1|turn|${normalizeOwner2(owner)}|${card2.conversationId}|${card2.seq}|assistant|card|`;
76354
+ }
76355
+ async function sitesChange(changeId, opts) {
76356
+ try {
76357
+ if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
76358
+ const { wallet } = await requirePasswordsKey();
76359
+ const out = expectOk(await signedFetch(wallet, "GET", lanePath(`/sites/changes/${changeId}`)), "sites change");
76360
+ const key = await mailKeyFor(wallet).catch(() => null);
76361
+ const latest = [...out.rounds ?? []].reverse().find((r) => r.card) ?? null;
76362
+ let card2 = null;
76363
+ if (key && latest?.card) {
76364
+ try {
76365
+ card2 = JSON.parse(openText(key.dataKey, latest.card.ciphertext, cardAad(wallet.address, latest.card)));
76366
+ } catch {
76367
+ card2 = null;
76368
+ }
76369
+ }
76370
+ const c = out.change;
76371
+ emit10(opts, { ok: true, change: c, rounds: (out.rounds ?? []).map((r) => ({ id: r.id, round: r.round, state: r.state, cardRef: r.cardRef })), card: card2 ? { words: card2.words ?? null } : null }, () => {
76372
+ process.stdout.write(`
76373
+ ${import_picocolors18.default.bold(c.id)} ${c.state === "ready" ? import_picocolors18.default.green("ready") : import_picocolors18.default.yellow(c.state)} ${import_picocolors18.default.dim(`round ${c.round}`)}
76374
+ `);
76375
+ if (card2?.words) process.stdout.write(` ${card2.words}
76376
+ `);
76377
+ if (c.state === "ready") process.stdout.write(` ${import_picocolors18.default.dim(`ship it: agentgates sites ship ${c.id}`)}
76378
+ `);
76379
+ process.stdout.write("\n");
76380
+ });
76381
+ } catch (err) {
76382
+ fail6(opts, err);
76383
+ }
76384
+ }
76385
+ async function sitesShip(changeId, opts) {
76386
+ try {
76387
+ if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
76388
+ const { wallet } = await requirePasswordsKey();
76389
+ const read = expectOk(await signedFetch(wallet, "GET", lanePath(`/sites/changes/${changeId}`)), "sites change");
76390
+ const head = read.change?.headSha;
76391
+ if (read.change?.state !== "ready" || !head) throw new Error(`the change is ${read.change?.state ?? "unread"}: only a ready change ships`);
76392
+ const out = expectOk(await signedFetch(wallet, "POST", lanePath(`/sites/changes/${changeId}/ship/${head}`)), "sites ship");
76393
+ emit10(opts, { ok: true, change: out.change }, () => {
76394
+ process.stdout.write(`
76395
+ ${import_picocolors18.default.green(out.change.state)} ${import_picocolors18.default.dim(out.change.id)}
76396
+
76397
+ `);
76398
+ });
76399
+ } catch (err) {
76400
+ fail6(opts, err);
76401
+ }
76402
+ }
76403
+ async function sitesSkip(changeId, opts) {
76404
+ try {
76405
+ if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
76406
+ const { wallet } = await requirePasswordsKey();
76407
+ const out = expectOk(await signedFetch(wallet, "POST", lanePath(`/sites/changes/${changeId}/skip`)), "sites skip");
76408
+ emit10(opts, { ok: true, change: out.change }, () => {
76409
+ process.stdout.write(`
76410
+ ${import_picocolors18.default.yellow(out.change.state)} ${import_picocolors18.default.dim(out.change.id)}
76411
+
76412
+ `);
76413
+ });
76414
+ } catch (err) {
76415
+ fail6(opts, err);
76416
+ }
76417
+ }
76418
+ async function sitesUndo(changeId, opts) {
76419
+ try {
76420
+ if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
76421
+ const { wallet } = await requirePasswordsKey();
76422
+ const out = expectOk(await signedFetch(wallet, "POST", lanePath(`/sites/changes/${changeId}/undo`)), "sites undo");
76423
+ emit10(opts, { ok: true, change: out.change }, () => {
76424
+ process.stdout.write(`
76425
+ ${import_picocolors18.default.yellow(out.change.state)} ${import_picocolors18.default.dim(out.change.id)}
76426
+
76427
+ `);
76428
+ });
76429
+ } catch (err) {
76430
+ fail6(opts, err);
76431
+ }
76432
+ }
76433
+ async function sitesFix(changeId, opts) {
76434
+ try {
76435
+ if (!CHANGE_ID_RE.test(changeId)) throw new Error("a change id is 22 characters (the one the card's link ends in)");
76436
+ const { wallet } = await requirePasswordsKey();
76437
+ const read = expectOk(await signedFetch(wallet, "GET", lanePath(`/sites/changes/${changeId}`)), "sites change");
76438
+ if (read.change?.state !== "failed" || read.change.code !== "ship_check_failed") throw new Error(`the change is ${read.change?.state ?? "unread"}: only a change the live check stopped is fixed`);
76439
+ const body = { appId: read.change.appId, id: randomBytes9(16).toString("base64url") };
76440
+ const digest = createHash6("sha256").update(JSON.stringify(body), "utf8").digest("base64url");
76441
+ const out = expectOk(await signedFetch(wallet, "POST", lanePath(`/sites/changes/${changeId}/fix/${digest}`), body), "sites fix");
76442
+ emit10(opts, { ok: true, change: out.change }, () => {
76443
+ process.stdout.write(`
76444
+ ${import_picocolors18.default.green(out.change.state)} ${import_picocolors18.default.dim(`the fix is change ${out.change.id}`)}
76445
+
76446
+ `);
76447
+ });
76448
+ } catch (err) {
76449
+ fail6(opts, err);
76450
+ }
76451
+ }
76408
76452
 
76409
76453
  // src/commands/agent.ts
76410
76454
  init_lib2();
@@ -76413,12 +76457,12 @@ init_passwords_wire();
76413
76457
 
76414
76458
  // src/lib/ag-wire.ts
76415
76459
  init_constants();
76416
- import { createHash as createHash6 } from "node:crypto";
76460
+ import { createHash as createHash7 } from "node:crypto";
76417
76461
 
76418
76462
  // src/lib/conversation-seal.ts
76419
76463
  var CONVERSATION_SUITE = "AGENTGATES-CONVERSATION-v1";
76420
76464
  var JOURNAL_COPY_SUITE = "AGENTGATES-MEMORY-JOURNAL-v1";
76421
- var CONVERSATION_AUTHORS = ["person", "assistant", "agent", "act"];
76465
+ var CONVERSATION_AUTHORS = ["person", "assistant", "agent", "act", "card"];
76422
76466
  var CONVERSATION_CHANNELS = ["site", "telegram", "whatsapp", "mail", "sms", "voice", "mcp"];
76423
76467
  function isConversationAuthor(value) {
76424
76468
  return typeof value === "string" && CONVERSATION_AUTHORS.includes(value);
@@ -76431,7 +76475,8 @@ function roleOfAuthor(author) {
76431
76475
  }
76432
76476
  function readConversationOrigin(author, channel) {
76433
76477
  if (!isConversationAuthor(author)) return null;
76434
- if (channel === null || channel === void 0 || channel === "") return author === "act" ? { author, channel: null } : null;
76478
+ if (channel === null || channel === void 0 || channel === "") return author === "act" || author === "card" ? { author, channel: null } : null;
76479
+ if (author === "card") return null;
76435
76480
  return isConversationChannel(channel) ? { author, channel } : null;
76436
76481
  }
76437
76482
  function conversationOwner(address) {
@@ -76463,7 +76508,7 @@ function agMemoryKeyAad(ownerWallet, keyId) {
76463
76508
  return `${AG_SEAL_SUITE}|memory-key|${normalizeAgOwner(ownerWallet)}|${keyId}`;
76464
76509
  }
76465
76510
  function fleetBindingReportData(publicKey) {
76466
- return createHash6("sha512").update(Buffer.from(AG_REPORT_DATA_LABEL, "utf8")).update(Buffer.from(fromB64u2(publicKey))).digest("hex");
76511
+ return createHash7("sha512").update(Buffer.from(AG_REPORT_DATA_LABEL, "utf8")).update(Buffer.from(fromB64u2(publicKey))).digest("hex");
76467
76512
  }
76468
76513
  function parseAgAttestation(raw) {
76469
76514
  const a = raw && typeof raw === "object" ? raw : null;
@@ -76510,7 +76555,7 @@ function verifyAgFleetAttestation(body, opts) {
76510
76555
  now: opts.now
76511
76556
  });
76512
76557
  if (!proof.ok) return proof;
76513
- if (att.keyId !== createHash6("sha256").update(fromB64u2(att.publicKey)).digest("base64url")) {
76558
+ if (att.keyId !== createHash7("sha256").update(fromB64u2(att.publicKey)).digest("base64url")) {
76514
76559
  return { ok: false, reason: "the served key id is not the hash of the served key" };
76515
76560
  }
76516
76561
  return { ok: true, value: att };
@@ -81413,7 +81458,7 @@ async function deskSell(coinArg, amount, opts) {
81413
81458
  }
81414
81459
 
81415
81460
  // src/main.ts
81416
- var { version: VERSION } = require_package();
81461
+ var { version: VERSION } = JSON.parse(readFileSync3(new URL("../package.json", import.meta.url), "utf8"));
81417
81462
  var program2 = new Command();
81418
81463
  program2.name("agentgates").description(
81419
81464
  "Drive your non-custodial Agentgates wallet from the terminal.\nPair once with biometric; every send still requires biometric in your browser."
@@ -82159,9 +82204,25 @@ integrations.command("signup-report <signupId>").description("Report a signup's
82159
82204
  integrations.command("signup-handoff <signupId> <provider>").description("Hand the connect material back and connect the row: GitHub's install redirect (--code --installation-id), Vercel's (--code --configuration-id), or Neon's key sealed to the box (--sealed <file> with {grantCvm, cvmKeyId}).").option("--code <code>", "the provider's install redirect code").option("--installation-id <id>", "GitHub's installation id").option("--setup-action <action>", "GitHub's setup action (install|request)").option("--configuration-id <id>", "Vercel's configuration id").option("--team-id <id>", "Vercel's team id").option("--redirect-uri <url>", "the address the provider sent the browser back to").option("--sealed <file>", "a file holding {grantCvm, cvmKeyId} (Neon)").option("--grant-cvm <blob>", "the Neon grant sealed to the connections CVM").option("--cvm-key-id <id>", "the CVM key id the grant is sealed under").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (signupId, provider, opts) => {
82160
82205
  await integrationsSignupHandoff(signupId, provider, opts);
82161
82206
  });
82162
- program2.command("sites").description("The account's sites: one Vercel project each and the GitHub repo behind it; name, repo and address opened here.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (opts) => {
82207
+ var sites = program2.command("sites").description("The account's sites and the changes Agentgates AI makes to them.");
82208
+ sites.command("list", { isDefault: true }).description("The account's sites: one Vercel project each and the GitHub repo behind it; name, repo and address opened here.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (opts) => {
82163
82209
  await sitesList(opts);
82164
82210
  });
82211
+ sites.command("change <changeId>").description("One change to a site: where it stands, its rounds and its latest card, opened here with the account's data key.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
82212
+ await sitesChange(changeId, opts);
82213
+ });
82214
+ sites.command("ship <changeId>").description("Ship a ready change: the owner's signature over the change and the head its card stands for.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
82215
+ await sitesShip(changeId, opts);
82216
+ });
82217
+ sites.command("skip <changeId>").description("Close a change that has not shipped.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
82218
+ await sitesSkip(changeId, opts);
82219
+ });
82220
+ sites.command("undo <changeId>").description("Take back the site's latest live change: production goes back to the build before it and a revert is merged.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
82221
+ await sitesUndo(changeId, opts);
82222
+ });
82223
+ sites.command("fix <changeId>").description("A change Agentgates' live check stopped: the agent builds a new change whose ask is what failed.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (changeId, opts) => {
82224
+ await sitesFix(changeId, opts);
82225
+ });
82165
82226
  var memory = program2.command("memory").description("Sealed folders of markdown your agents read: names and bodies are sealed on this machine to the account's data key; the wire and the server carry ciphertext only.");
82166
82227
  memory.command("overview", { isDefault: true }).description("The folders, their counts, and what the plan allows.").option("--json", "machine-readable output (default when stdout is not a TTY)").action(async (opts) => {
82167
82228
  await memoryOverview(opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentgates/cli",
3
- "version": "0.72.0",
3
+ "version": "0.74.0",
4
4
  "description": "Wallet operations for AI agents and humans",
5
5
  "keywords": [
6
6
  "crypto",