@agentgates/cli 0.11.0 → 0.11.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +366 -111
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -5037,15 +5037,15 @@ var require_curve = __commonJS({
5037
5037
  windowSize = wbits - 2;
5038
5038
  else if (wbits > 0)
5039
5039
  windowSize = 2;
5040
- const MASK = (0, utils_ts_1.bitMask)(windowSize);
5041
- const buckets = new Array(Number(MASK) + 1).fill(zero);
5040
+ const MASK2 = (0, utils_ts_1.bitMask)(windowSize);
5041
+ const buckets = new Array(Number(MASK2) + 1).fill(zero);
5042
5042
  const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;
5043
5043
  let sum = zero;
5044
5044
  for (let i = lastBits; i >= 0; i -= windowSize) {
5045
5045
  buckets.fill(zero);
5046
5046
  for (let j = 0; j < slength; j++) {
5047
5047
  const scalar = scalars[j];
5048
- const wbits2 = Number(scalar >> BigInt(i) & MASK);
5048
+ const wbits2 = Number(scalar >> BigInt(i) & MASK2);
5049
5049
  buckets[wbits2] = buckets[wbits2].add(points[j]);
5050
5050
  }
5051
5051
  let resI = zero;
@@ -5066,7 +5066,7 @@ var require_curve = __commonJS({
5066
5066
  const zero = c.ZERO;
5067
5067
  const tableSize = 2 ** windowSize - 1;
5068
5068
  const chunks = Math.ceil(fieldN.BITS / windowSize);
5069
- const MASK = (0, utils_ts_1.bitMask)(windowSize);
5069
+ const MASK2 = (0, utils_ts_1.bitMask)(windowSize);
5070
5070
  const tables = points.map((p) => {
5071
5071
  const res = [];
5072
5072
  for (let i = 0, acc = p; i < tableSize; i++) {
@@ -5087,7 +5087,7 @@ var require_curve = __commonJS({
5087
5087
  const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize);
5088
5088
  for (let j = 0; j < scalars.length; j++) {
5089
5089
  const n = scalars[j];
5090
- const curr = Number(n >> shiftBy & MASK);
5090
+ const curr = Number(n >> shiftBy & MASK2);
5091
5091
  if (!curr)
5092
5092
  continue;
5093
5093
  res = res.add(tables[j][curr - 1]);
@@ -5176,7 +5176,7 @@ var require_edwards = __commonJS({
5176
5176
  let CURVE = validated.CURVE;
5177
5177
  const { h: cofactor } = CURVE;
5178
5178
  (0, utils_ts_1._validateObject)(extraOpts, {}, { uvRatio: "function" });
5179
- const MASK = _2n << BigInt(Fn.BYTES * 8) - _1n;
5179
+ const MASK2 = _2n << BigInt(Fn.BYTES * 8) - _1n;
5180
5180
  const modP = (n) => Fp.create(n);
5181
5181
  const uvRatio = extraOpts.uvRatio || ((u, v) => {
5182
5182
  try {
@@ -5189,7 +5189,7 @@ var require_edwards = __commonJS({
5189
5189
  throw new Error("bad curve params: generator point");
5190
5190
  function acoord(title, n, banZero = false) {
5191
5191
  const min = banZero ? _1n : _0n;
5192
- (0, utils_ts_1.aInRange)("coordinate " + title, n, min, MASK);
5192
+ (0, utils_ts_1.aInRange)("coordinate " + title, n, min, MASK2);
5193
5193
  return n;
5194
5194
  }
5195
5195
  function aextpoint(other) {
@@ -5259,7 +5259,7 @@ var require_edwards = __commonJS({
5259
5259
  const lastByte = bytes[len - 1];
5260
5260
  normed[len - 1] = lastByte & ~128;
5261
5261
  const y = (0, utils_ts_1.bytesToNumberLE)(normed);
5262
- const max = zip215 ? MASK : Fp.ORDER;
5262
+ const max = zip215 ? MASK2 : Fp.ORDER;
5263
5263
  (0, utils_ts_1.aInRange)("point.y", y, _0n, max);
5264
5264
  const y2 = modP(y * y);
5265
5265
  const u = modP(y2 - _1n);
@@ -10417,31 +10417,31 @@ var require_Layout = __commonJS({
10417
10417
  return name;
10418
10418
  }
10419
10419
  exports.nameWithProperty = nameWithProperty;
10420
- function bindConstructorLayout(Class, layout) {
10420
+ function bindConstructorLayout(Class, layout2) {
10421
10421
  if ("function" !== typeof Class) {
10422
10422
  throw new TypeError("Class must be constructor");
10423
10423
  }
10424
10424
  if (Object.prototype.hasOwnProperty.call(Class, "layout_")) {
10425
10425
  throw new Error("Class is already bound to a layout");
10426
10426
  }
10427
- if (!(layout && layout instanceof Layout)) {
10427
+ if (!(layout2 && layout2 instanceof Layout)) {
10428
10428
  throw new TypeError("layout must be a Layout");
10429
10429
  }
10430
- if (Object.prototype.hasOwnProperty.call(layout, "boundConstructor_")) {
10430
+ if (Object.prototype.hasOwnProperty.call(layout2, "boundConstructor_")) {
10431
10431
  throw new Error("layout is already bound to a constructor");
10432
10432
  }
10433
- Class.layout_ = layout;
10434
- layout.boundConstructor_ = Class;
10435
- layout.makeDestinationObject = (() => new Class());
10433
+ Class.layout_ = layout2;
10434
+ layout2.boundConstructor_ = Class;
10435
+ layout2.makeDestinationObject = (() => new Class());
10436
10436
  Object.defineProperty(Class.prototype, "encode", {
10437
10437
  value(b, offset) {
10438
- return layout.encode(this, b, offset);
10438
+ return layout2.encode(this, b, offset);
10439
10439
  },
10440
10440
  writable: true
10441
10441
  });
10442
10442
  Object.defineProperty(Class, "decode", {
10443
10443
  value(b, offset) {
10444
- return layout.decode(b, offset);
10444
+ return layout2.decode(b, offset);
10445
10445
  },
10446
10446
  writable: true
10447
10447
  });
@@ -10489,15 +10489,15 @@ var require_Layout = __commonJS({
10489
10489
  };
10490
10490
  exports.GreedyCount = GreedyCount;
10491
10491
  var OffsetLayout = class extends ExternalLayout {
10492
- constructor(layout, offset = 0, property) {
10493
- if (!(layout instanceof Layout)) {
10492
+ constructor(layout2, offset = 0, property) {
10493
+ if (!(layout2 instanceof Layout)) {
10494
10494
  throw new TypeError("layout must be a Layout");
10495
10495
  }
10496
10496
  if (!Number.isInteger(offset)) {
10497
10497
  throw new TypeError("offset must be integer or undefined");
10498
10498
  }
10499
- super(layout.span, property || layout.property);
10500
- this.layout = layout;
10499
+ super(layout2.span, property || layout2.property);
10500
+ this.layout = layout2;
10501
10501
  this.offset = offset;
10502
10502
  }
10503
10503
  /** @override */
@@ -10974,12 +10974,12 @@ var require_Layout = __commonJS({
10974
10974
  };
10975
10975
  exports.UnionDiscriminator = UnionDiscriminator;
10976
10976
  var UnionLayoutDiscriminator = class extends UnionDiscriminator {
10977
- constructor(layout, property) {
10978
- if (!(layout instanceof ExternalLayout && layout.isCount())) {
10977
+ constructor(layout2, property) {
10978
+ if (!(layout2 instanceof ExternalLayout && layout2.isCount())) {
10979
10979
  throw new TypeError("layout must be an unsigned integer ExternalLayout");
10980
10980
  }
10981
- super(property || layout.property || "variant");
10982
- this.layout = layout;
10981
+ super(property || layout2.property || "variant");
10982
+ this.layout = layout2;
10983
10983
  }
10984
10984
  /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */
10985
10985
  decode(b, offset) {
@@ -11154,8 +11154,8 @@ var require_Layout = __commonJS({
11154
11154
  * Layout#property|property}.
11155
11155
  *
11156
11156
  * @return {VariantLayout} */
11157
- addVariant(variant, layout, property) {
11158
- const rv = new VariantLayout(this, variant, layout, property);
11157
+ addVariant(variant, layout2, property) {
11158
+ const rv = new VariantLayout(this, variant, layout2, property);
11159
11159
  this.registry[variant] = rv;
11160
11160
  return rv;
11161
11161
  }
@@ -11185,22 +11185,22 @@ var require_Layout = __commonJS({
11185
11185
  };
11186
11186
  exports.Union = Union;
11187
11187
  var VariantLayout = class extends Layout {
11188
- constructor(union, variant, layout, property) {
11188
+ constructor(union, variant, layout2, property) {
11189
11189
  if (!(union instanceof Union)) {
11190
11190
  throw new TypeError("union must be a Union");
11191
11191
  }
11192
11192
  if (!Number.isInteger(variant) || 0 > variant) {
11193
11193
  throw new TypeError("variant must be a (non-negative) integer");
11194
11194
  }
11195
- if ("string" === typeof layout && void 0 === property) {
11196
- property = layout;
11197
- layout = null;
11195
+ if ("string" === typeof layout2 && void 0 === property) {
11196
+ property = layout2;
11197
+ layout2 = null;
11198
11198
  }
11199
- if (layout) {
11200
- if (!(layout instanceof Layout)) {
11199
+ if (layout2) {
11200
+ if (!(layout2 instanceof Layout)) {
11201
11201
  throw new TypeError("layout must be a Layout");
11202
11202
  }
11203
- if (null !== union.defaultLayout && 0 <= layout.span && layout.span > union.defaultLayout.span) {
11203
+ if (null !== union.defaultLayout && 0 <= layout2.span && layout2.span > union.defaultLayout.span) {
11204
11204
  throw new Error("variant span exceeds span of containing union");
11205
11205
  }
11206
11206
  if ("string" !== typeof property) {
@@ -11209,7 +11209,7 @@ var require_Layout = __commonJS({
11209
11209
  }
11210
11210
  let span = union.span;
11211
11211
  if (0 > union.span) {
11212
- span = layout ? layout.span : 0;
11212
+ span = layout2 ? layout2.span : 0;
11213
11213
  if (0 <= span && union.usesPrefixDiscriminator) {
11214
11214
  span += union.discriminator.layout.span;
11215
11215
  }
@@ -11217,7 +11217,7 @@ var require_Layout = __commonJS({
11217
11217
  super(span, property);
11218
11218
  this.union = union;
11219
11219
  this.variant = variant;
11220
- this.layout = layout || null;
11220
+ this.layout = layout2 || null;
11221
11221
  }
11222
11222
  /** @override */
11223
11223
  getSpan(b, offset = 0) {
@@ -11610,7 +11610,7 @@ var require_Layout = __commonJS({
11610
11610
  };
11611
11611
  exports.Constant = Constant;
11612
11612
  exports.greedy = ((elementSpan, property) => new GreedyCount(elementSpan, property));
11613
- exports.offset = ((layout, offset, property) => new OffsetLayout(layout, offset, property));
11613
+ exports.offset = ((layout2, offset, property) => new OffsetLayout(layout2, offset, property));
11614
11614
  exports.u8 = ((property) => new UInt(1, property));
11615
11615
  exports.u16 = ((property) => new UInt(2, property));
11616
11616
  exports.u24 = ((property) => new UInt(3, property));
@@ -11645,7 +11645,7 @@ var require_Layout = __commonJS({
11645
11645
  exports.bits = ((word, msb, property) => new BitStructure(word, msb, property));
11646
11646
  exports.seq = ((elementLayout, count, property) => new Sequence(elementLayout, count, property));
11647
11647
  exports.union = ((discr, defaultLayout, property) => new Union(discr, defaultLayout, property));
11648
- exports.unionLayoutDiscriminator = ((layout, property) => new UnionLayoutDiscriminator(layout, property));
11648
+ exports.unionLayoutDiscriminator = ((layout2, property) => new UnionLayoutDiscriminator(layout2, property));
11649
11649
  exports.blob = ((length, property) => new Blob2(length, property));
11650
11650
  exports.cstr = ((property) => new CString(property));
11651
11651
  exports.utf8 = ((maxSpan, property) => new UTF8(maxSpan, property));
@@ -27144,10 +27144,10 @@ Message: ${transactionMessage}.
27144
27144
  }
27145
27145
  };
27146
27146
  function u64(property) {
27147
- const layout = BufferLayout.blob(8, property);
27148
- const decode = layout.decode.bind(layout);
27149
- const encode = layout.encode.bind(layout);
27150
- const bigIntLayout = layout;
27147
+ const layout2 = BufferLayout.blob(8, property);
27148
+ const decode = layout2.decode.bind(layout2);
27149
+ const encode = layout2.encode.bind(layout2);
27150
+ const bigIntLayout = layout2;
27151
27151
  const codec = codecsNumbers.getU64Codec();
27152
27152
  bigIntLayout.decode = (buffer2, offset) => {
27153
27153
  const src = decode(buffer2, offset);
@@ -27173,8 +27173,8 @@ Message: ${transactionMessage}.
27173
27173
  const instructionTypeLayout = BufferLayout__namespace.u32("instruction");
27174
27174
  const typeIndex = instructionTypeLayout.decode(instruction.data);
27175
27175
  let type;
27176
- for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {
27177
- if (layout.index == typeIndex) {
27176
+ for (const [ixType, layout2] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {
27177
+ if (layout2.index == typeIndex) {
27178
27178
  type = ixType;
27179
27179
  break;
27180
27180
  }
@@ -32364,8 +32364,8 @@ Message: ${transactionMessage}.
32364
32364
  const instructionTypeLayout = BufferLayout__namespace.u32("instruction");
32365
32365
  const index = instructionTypeLayout.decode(instruction.data);
32366
32366
  let type;
32367
- for (const [layoutType, layout] of Object.entries(LOOKUP_TABLE_INSTRUCTION_LAYOUTS)) {
32368
- if (layout.index == index) {
32367
+ for (const [layoutType, layout2] of Object.entries(LOOKUP_TABLE_INSTRUCTION_LAYOUTS)) {
32368
+ if (layout2.index == index) {
32369
32369
  type = layoutType;
32370
32370
  break;
32371
32371
  }
@@ -32585,8 +32585,8 @@ Message: ${transactionMessage}.
32585
32585
  const instructionTypeLayout = BufferLayout__namespace.u8("instruction");
32586
32586
  const typeIndex = instructionTypeLayout.decode(instruction.data);
32587
32587
  let type;
32588
- for (const [ixType, layout] of Object.entries(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS)) {
32589
- if (layout.index == typeIndex) {
32588
+ for (const [ixType, layout2] of Object.entries(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS)) {
32589
+ if (layout2.index == typeIndex) {
32590
32590
  type = ixType;
32591
32591
  break;
32592
32592
  }
@@ -32986,8 +32986,8 @@ Message: ${transactionMessage}.
32986
32986
  const instructionTypeLayout = BufferLayout__namespace.u32("instruction");
32987
32987
  const typeIndex = instructionTypeLayout.decode(instruction.data);
32988
32988
  let type;
32989
- for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {
32990
- if (layout.index == typeIndex) {
32989
+ for (const [ixType, layout2] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {
32990
+ if (layout2.index == typeIndex) {
32991
32991
  type = ixType;
32992
32992
  break;
32993
32993
  }
@@ -33649,8 +33649,8 @@ Message: ${transactionMessage}.
33649
33649
  const instructionTypeLayout = BufferLayout__namespace.u32("instruction");
33650
33650
  const typeIndex = instructionTypeLayout.decode(instruction.data);
33651
33651
  let type;
33652
- for (const [ixType, layout] of Object.entries(VOTE_INSTRUCTION_LAYOUTS)) {
33653
- if (layout.index == typeIndex) {
33652
+ for (const [ixType, layout2] of Object.entries(VOTE_INSTRUCTION_LAYOUTS)) {
33653
+ if (layout2.index == typeIndex) {
33654
33654
  type = ixType;
33655
33655
  break;
33656
33656
  }
@@ -34297,7 +34297,7 @@ var require_package = __commonJS({
34297
34297
  "package.json"(exports, module) {
34298
34298
  module.exports = {
34299
34299
  name: "@agentgates/cli",
34300
- version: "0.11.0",
34300
+ version: "0.11.1",
34301
34301
  description: "Wallet operations for AI agents and humans",
34302
34302
  keywords: [
34303
34303
  "crypto",
@@ -35349,6 +35349,138 @@ function shortAddress(addr) {
35349
35349
  var import_picocolors5 = __toESM(require_picocolors(), 1);
35350
35350
  import { createInterface } from "node:readline/promises";
35351
35351
 
35352
+ // src/lib/water.ts
35353
+ var RAMP = ".:-=+*#%@";
35354
+ var FONT = {
35355
+ a: [" ", " ", " ### ", " #", " ####", "# #", " ####", " "],
35356
+ g: [" ", " ", " ####", "# #", "# #", " ####", " #", " ### "],
35357
+ e: [" ", " ", " ### ", "# #", "#####", "# ", " ####", " "],
35358
+ n: [" ", " ", "# ## ", "## #", "# #", "# #", "# #", " "],
35359
+ t: [" # ", " # ", "#####", " # ", " # ", " # ", " ## ", " "],
35360
+ s: [" ", " ", " ####", "# ", " ### ", " #", "#### ", " "]
35361
+ };
35362
+ var WORD = "agentgates";
35363
+ var MARGIN = 2;
35364
+ var MASK_ROWS = 8;
35365
+ function buildMask() {
35366
+ const rows = Array.from({ length: MASK_ROWS }, () => []);
35367
+ for (let r = 0; r < MASK_ROWS; r++) {
35368
+ rows[r].push(...Array(MARGIN).fill(false));
35369
+ for (const ch of WORD) {
35370
+ const glyph = FONT[ch];
35371
+ for (const cell of glyph[r]) rows[r].push(cell === "#");
35372
+ rows[r].push(false);
35373
+ }
35374
+ }
35375
+ return rows;
35376
+ }
35377
+ var MASK = buildMask();
35378
+ var COLS = MASK[0].length;
35379
+ var STOPS = [
35380
+ [0, [16, 62, 138]],
35381
+ [0.45, [36, 120, 200]],
35382
+ [0.75, [66, 186, 232]],
35383
+ [1, [168, 240, 248]]
35384
+ ];
35385
+ function rgb(b) {
35386
+ for (let i = 1; i < STOPS.length; i++) {
35387
+ if (b <= STOPS[i][0]) {
35388
+ const [b0, c0] = STOPS[i - 1];
35389
+ const [b1, c1] = STOPS[i];
35390
+ const f = (b - b0) / (b1 - b0);
35391
+ return [0, 1, 2].map((k) => Math.round(c0[k] + f * (c1[k] - c0[k])));
35392
+ }
35393
+ }
35394
+ return STOPS[STOPS.length - 1][1];
35395
+ }
35396
+ var RAMP256 = [17, 18, 24, 25, 31, 38, 44, 51, 87, 123, 159];
35397
+ function brightness(x, y, t, scale) {
35398
+ const w1 = Math.sin((x * 0.28 + y * 0.55) / scale + t * 2);
35399
+ const w2 = Math.sin(x * 0.11 / scale - t * 1.35 + Math.sin(y * 0.9 / scale + t * 0.6));
35400
+ const b = 0.5 + 0.27 * w1 + 0.23 * w2;
35401
+ return b < 0 ? 0 : b > 1 ? 1 : b;
35402
+ }
35403
+ function waterMode() {
35404
+ if (!process.stdout.isTTY) return null;
35405
+ if (process.env.NO_COLOR) return null;
35406
+ const term = process.env.TERM ?? "";
35407
+ if (term === "dumb") return null;
35408
+ const cols = process.stdout.columns || 80;
35409
+ if (cols < COLS + 1) return null;
35410
+ if (/truecolor|24bit/i.test(process.env.COLORTERM ?? "")) return "truecolor";
35411
+ if (/256color/.test(term)) return "256";
35412
+ return null;
35413
+ }
35414
+ function layout() {
35415
+ const cols = process.stdout.columns || 80;
35416
+ const lines = process.stdout.rows || 24;
35417
+ const scale = cols >= COLS * 2 + 1 && lines >= 30 ? 2 : 1;
35418
+ return { scale, width: COLS * scale, rows: MASK_ROWS * scale };
35419
+ }
35420
+ function frame(t, mode, L) {
35421
+ const out = [];
35422
+ for (let y = 0; y < L.rows; y++) {
35423
+ let line = "";
35424
+ let last = "";
35425
+ const my = Math.floor(y / L.scale);
35426
+ for (let x = 0; x < L.width; x++) {
35427
+ if (!MASK[my][Math.floor(x / L.scale)]) {
35428
+ line += " ";
35429
+ continue;
35430
+ }
35431
+ const b = brightness(x, y, t, L.scale);
35432
+ const g = RAMP[Math.max(1, Math.round(b * (RAMP.length - 1)))];
35433
+ const color = mode === "truecolor" ? `\x1B[38;2;${rgb(b).join(";")}m` : `\x1B[38;5;${RAMP256[Math.round(b * (RAMP256.length - 1))]}m`;
35434
+ line += (color === last ? "" : color) + g;
35435
+ last = color;
35436
+ }
35437
+ out.push(line + "\x1B[0m");
35438
+ }
35439
+ return out;
35440
+ }
35441
+ var cursorHookArmed = false;
35442
+ function armCursorHook() {
35443
+ if (cursorHookArmed) return;
35444
+ cursorHookArmed = true;
35445
+ process.on("exit", () => process.stdout.write("\x1B[?25h"));
35446
+ }
35447
+ function water() {
35448
+ const mode = waterMode();
35449
+ if (!mode) return null;
35450
+ armCursorHook();
35451
+ const L = layout();
35452
+ let below = 0;
35453
+ let t = 0;
35454
+ process.stdout.write("\x1B[?25l" + frame(t, mode, L).join("\n") + "\n");
35455
+ const rawStderrWrite = process.stderr.write.bind(process.stderr);
35456
+ process.stderr.write = ((chunk, ...rest) => {
35457
+ const s = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
35458
+ for (const ch of s) if (ch === "\n") below++;
35459
+ return rawStderrWrite(chunk, ...rest);
35460
+ });
35461
+ const timer = setInterval(() => {
35462
+ if ((process.stdout.columns || 80) < L.width + 1) {
35463
+ stop();
35464
+ return;
35465
+ }
35466
+ t += 0.09;
35467
+ const up = below + L.rows;
35468
+ const body = frame(t, mode, L).join("\x1B[1B\r");
35469
+ process.stdout.write(`\x1B7\x1B[${up}A\r` + body + "\x1B8");
35470
+ }, 90);
35471
+ function stop() {
35472
+ clearInterval(timer);
35473
+ process.stderr.write = rawStderrWrite;
35474
+ process.stdout.write("\x1B[?25h");
35475
+ }
35476
+ return {
35477
+ wrote(s) {
35478
+ for (const ch of s) if (ch === "\n") below++;
35479
+ },
35480
+ stop
35481
+ };
35482
+ }
35483
+
35352
35484
  // src/commands/compute.ts
35353
35485
  var import_picocolors3 = __toESM(require_picocolors(), 1);
35354
35486
  var SITE = (process.env.AGENTGATES_ORIGIN || "https://agentgates.ai").replace(/\/$/, "");
@@ -35368,7 +35500,7 @@ async function computePlans(opts) {
35368
35500
  return;
35369
35501
  }
35370
35502
  process.stdout.write(`
35371
- ${import_picocolors3.default.bold("MACHINES")} ${import_picocolors3.default.dim("confidential VMs, memory encrypted in use")}
35503
+ ${import_picocolors3.default.bold("CONFIDENTIAL VIRTUAL MACHINES")} ${import_picocolors3.default.dim("memory encrypted in use")}
35372
35504
 
35373
35505
  `);
35374
35506
  for (const p of plans) {
@@ -35401,35 +35533,61 @@ async function computeBuy() {
35401
35533
  // src/commands/inference.ts
35402
35534
  var import_picocolors4 = __toESM(require_picocolors(), 1);
35403
35535
  var SITE2 = (process.env.AGENTGATES_ORIGIN || "https://agentgates.ai").replace(/\/$/, "");
35536
+ function applyFilters(models, f) {
35537
+ let out = models;
35538
+ if (f.tier === "confidential") out = out.filter((m) => m.confidential);
35539
+ else if (f.tier === "open") out = out.filter((m) => !m.confidential);
35540
+ for (const t of f.tag ?? []) out = out.filter((m) => (m.tags ?? []).includes(t.toLowerCase()));
35541
+ if (f.org) out = out.filter((m) => (m.org ?? "").toLowerCase() === f.org.toLowerCase());
35542
+ if (f.search) {
35543
+ const q = f.search.toLowerCase();
35544
+ out = out.filter((m) => m.id.toLowerCase().includes(q) || m.name.toLowerCase().includes(q));
35545
+ }
35546
+ return out;
35547
+ }
35548
+ var hasFilters = (f) => Boolean(f.tier || (f.tag ?? []).length || f.org || f.search);
35404
35549
  var ctx = (n) => n >= 1e6 ? `${Math.round(n / 1e6)}M` : `${Math.round(n / 1e3)}k`;
35405
35550
  async function inferenceModels(opts) {
35406
35551
  const res = await fetch(`${SITE2}/api/inference/catalog`, { headers: { accept: "application/json" } });
35407
35552
  if (!res.ok) throw new Error(`inference catalog: HTTP ${res.status}`);
35408
35553
  const body = await res.json();
35554
+ const all = body.models ?? [];
35555
+ const filtered = hasFilters(opts);
35556
+ const matched = applyFilters(all, opts);
35409
35557
  if (opts.json) {
35410
- process.stdout.write(JSON.stringify(body, null, 2) + "\n");
35558
+ process.stdout.write(JSON.stringify({ ...body, models: matched }, null, 2) + "\n");
35411
35559
  return;
35412
35560
  }
35413
- const models = body.models ?? [];
35414
- const shown = opts.all ? models : models.filter((m) => m.confidential).slice(0, 12);
35415
- process.stdout.write(
35416
- `
35417
- ${import_picocolors4.default.bold("MODELS")} ${import_picocolors4.default.dim(opts.all ? `all ${models.length}` : `${shown.length} confidential of ${models.length}`)}
35561
+ const shown = opts.all || filtered ? matched : matched.filter((m) => m.confidential).slice(0, 12);
35562
+ const headline = filtered ? `${matched.length} of ${all.length} match` : opts.all ? `all ${all.length}` : `${shown.length} confidential of ${all.length}`;
35563
+ process.stdout.write(`
35564
+ ${import_picocolors4.default.bold("MODELS")} ${import_picocolors4.default.dim(headline)}
35418
35565
 
35419
- `
35420
- );
35566
+ `);
35567
+ if (filtered && matched.length === 0) {
35568
+ const vocab = [...new Set(all.flatMap((m) => m.tags ?? []))].sort().join(", ");
35569
+ process.stdout.write(` ${import_picocolors4.default.dim(`nothing matches. tags on this board: ${vocab || "none"}; tiers: confidential, open`)}
35570
+
35571
+ `);
35572
+ return;
35573
+ }
35421
35574
  for (const m of shown) {
35422
35575
  const tier = m.confidential ? import_picocolors4.default.cyan("attested") : import_picocolors4.default.dim("open");
35423
35576
  const ask = m.typicalAskUsd ? `~$${Number(m.typicalAskUsd).toFixed(3)}/ask` : "";
35424
- process.stdout.write(` ${import_picocolors4.default.bold(m.name.padEnd(22))} ${import_picocolors4.default.dim(`${ctx(m.contextLength)} ctx`.padEnd(9))} ${tier.padEnd(18)} ${import_picocolors4.default.cyan(ask)}
35577
+ const tags = (m.tags ?? []).join(" ");
35578
+ process.stdout.write(` ${import_picocolors4.default.bold(m.name.padEnd(22))} ${import_picocolors4.default.dim(`${ctx(m.contextLength)} ctx`.padEnd(9))} ${tier.padEnd(18)} ${import_picocolors4.default.cyan(ask)}${tags ? ` ${import_picocolors4.default.dim(tags)}` : ""}
35425
35579
  `);
35426
35580
  process.stdout.write(` ${import_picocolors4.default.dim(m.id.padEnd(22))} ${import_picocolors4.default.dim(`$${m.priceInUsdPerMTokens} in \xB7 $${m.priceOutUsdPerMTokens} out /M`)}
35427
35581
 
35428
35582
  `);
35429
35583
  }
35430
- if (!opts.all) process.stdout.write(` ${import_picocolors4.default.dim("agentgates inference models --all \xB7 the whole board")}
35584
+ if (!opts.all && !filtered) {
35585
+ process.stdout.write(` ${import_picocolors4.default.dim("agentgates inference models --all \xB7 the whole board")}
35586
+ `);
35587
+ process.stdout.write(` ${import_picocolors4.default.dim("filters: --tier confidential|open \xB7 --tag frontier \xB7 --org anthropic \xB7 --search gpt")}
35431
35588
 
35432
35589
  `);
35590
+ }
35433
35591
  }
35434
35592
  async function inferenceAsk() {
35435
35593
  process.stdout.write(
@@ -35450,78 +35608,175 @@ var WORDMARK = [
35450
35608
  " \\__,_\\__, \\___|_||_\\__\\__, \\__,_|\\__\\___/__/",
35451
35609
  " |___/ |___/"
35452
35610
  ].join("\n");
35453
- var TAGLINE = "Confidential compute and inference, paid per use in USDC.";
35611
+ var TAGLINE = "Confidential virtual machines and inference, paid per use in USDC.";
35612
+ function makePut(w) {
35613
+ return (s) => {
35614
+ process.stdout.write(s);
35615
+ w?.wrote(s);
35616
+ };
35617
+ }
35454
35618
  function banner() {
35455
- process.stdout.write("\n" + import_picocolors5.default.cyan(WORDMARK) + "\n\n");
35456
- process.stdout.write(` ${import_picocolors5.default.dim(TAGLINE)}
35619
+ const w = water();
35620
+ if (!w) process.stdout.write("\n" + import_picocolors5.default.cyan(WORDMARK) + "\n\n");
35621
+ const put = makePut(w);
35622
+ put(` ${import_picocolors5.default.dim(TAGLINE)}
35623
+
35624
+ `);
35625
+ return { w, put };
35626
+ }
35627
+ var MENU = {
35628
+ compute: { label: "see virtual machine pricing" },
35629
+ models: { label: "see inference pricing" },
35630
+ docs: { label: "read the docs" },
35631
+ poke: { label: "nothing, I'll poke around" },
35632
+ wallet: { label: "pair my wallet", hint: "(members only)" }
35633
+ };
35634
+ function menuOrder(lane) {
35635
+ const browse = lane === "inference" ? ["models", "compute"] : ["compute", "models"];
35636
+ return [...browse, "docs", "poke", "wallet"];
35637
+ }
35638
+ function printMenu(put, order, first) {
35639
+ put(` ${import_picocolors5.default.bold(first ? "choose how to start:" : "what next:")}
35640
+ `);
35641
+ order.forEach((k, i) => {
35642
+ const item = MENU[k];
35643
+ put(` ${import_picocolors5.default.cyan(`${i + 1}.`)} ${item.label}${item.hint ? ` ${import_picocolors5.default.dim(item.hint)}` : ""}
35644
+ `);
35645
+ });
35646
+ }
35647
+ async function printDocs(put, lane) {
35648
+ const lead = lane === "inference" ? "inference" : "compute";
35649
+ const other = lead === "inference" ? "compute" : "inference";
35650
+ const name = (l) => l === "compute" ? "virtual machines" : "inference";
35651
+ try {
35652
+ const res = await fetch(`${CREATORS_ORIGIN}/api/${lead}/docs`, {
35653
+ headers: { accept: "text/markdown, text/plain" }
35654
+ });
35655
+ if (!res.ok) throw new Error(String(res.status));
35656
+ const md = (await res.text()).replace(/\s+$/, "");
35657
+ put(`
35658
+ ${import_picocolors5.default.bold(`THE ${name(lead).toUpperCase()} CONTRACT`)} ${import_picocolors5.default.dim(`${CREATORS_ORIGIN}/api/${lead}/docs`)}
35659
+
35660
+ `);
35661
+ put(md + "\n\n");
35662
+ put(` ${import_picocolors5.default.dim(`the ${name(other)} contract:`)} ${CREATORS_ORIGIN}/api/${other}/docs
35663
+
35664
+ `);
35665
+ } catch {
35666
+ put(` ${import_picocolors5.default.red("\u2715")} could not fetch the contract; the URLs:
35667
+ `);
35668
+ put(` ${import_picocolors5.default.cyan("virtual machines")} ${CREATORS_ORIGIN}/api/compute/docs
35669
+ `);
35670
+ put(` ${import_picocolors5.default.cyan("inference")} ${CREATORS_ORIGIN}/api/inference/docs
35457
35671
 
35458
35672
  `);
35673
+ }
35459
35674
  }
35460
35675
  async function onboard(opts = {}) {
35461
35676
  const profileName = opts.profile ?? DEFAULT_PROFILE;
35462
- banner();
35677
+ const { w, put } = banner();
35463
35678
  const existing = await loadProfile(profileName).catch(() => null);
35464
35679
  if (existing) {
35465
- process.stdout.write(` ${import_picocolors5.default.green("\u2713")} already paired as ${import_picocolors5.default.bold(existing.walletAddress ?? existing.userId)}
35680
+ put(` ${import_picocolors5.default.green("\u2713")} already paired as ${import_picocolors5.default.bold(existing.walletAddress ?? existing.userId)}
35466
35681
 
35467
35682
  `);
35468
- printNext();
35469
- return;
35470
35683
  }
35471
35684
  if (!process.stdin.isTTY) {
35472
- process.stdout.write(` Run ${import_picocolors5.default.bold("agentgates onboard")} to pair your wallet.
35685
+ put(` No terminal attached, so no menu. The machine door:
35473
35686
 
35474
35687
  `);
35475
- printNext();
35476
- return;
35477
- }
35478
- process.stdout.write(` ${import_picocolors5.default.bold("choose how to start:")}
35688
+ put(` agentgates compute plans --json ${import_picocolors5.default.dim("\xB7 virtual machine pricing, JSON")}
35689
+ `);
35690
+ put(` agentgates inference models --json ${import_picocolors5.default.dim("\xB7 model pricing, JSON; --tier --tag --org --search filter it")}
35479
35691
  `);
35480
- process.stdout.write(` ${import_picocolors5.default.cyan("1.")} pair my wallet ${import_picocolors5.default.dim("(opens your browser, one biometric)")}
35692
+ put(` ${CREATORS_ORIGIN}/api/compute/docs ${import_picocolors5.default.dim("\xB7 the buy/read/renew/destroy contract")}
35481
35693
  `);
35482
- process.stdout.write(` ${import_picocolors5.default.cyan("2.")} see what compute costs
35694
+ put(` ${CREATORS_ORIGIN}/api/inference/docs ${import_picocolors5.default.dim("\xB7 the chat contract, x402 or Bearer")}
35483
35695
  `);
35484
- process.stdout.write(` ${import_picocolors5.default.cyan("3.")} see the models
35696
+ put(` ${CREATORS_ORIGIN}/llms.txt ${import_picocolors5.default.dim("\xB7 the whole surface")}
35697
+
35485
35698
  `);
35486
- process.stdout.write(` ${import_picocolors5.default.cyan("4.")} nothing, I'll poke around
35699
+ if (!existing) {
35700
+ put(` Pairing a wallet needs a human at a browser: ${import_picocolors5.default.bold("agentgates onboard")} in a real terminal.
35701
+
35487
35702
  `);
35703
+ }
35704
+ return;
35705
+ }
35706
+ const order = menuOrder(opts.lane).filter((k) => existing ? k !== "wallet" : true);
35707
+ printMenu(put, order, true);
35488
35708
  const rl = createInterface({ input: process.stdin, output: process.stdout });
35489
- let choice = "4";
35709
+ const exitDefault = String(order.indexOf("poke") + 1);
35710
+ let first = true;
35711
+ let plain = put;
35490
35712
  try {
35491
- choice = (await rl.question(` ${import_picocolors5.default.dim("choice [1]:")} `)).trim() || "1";
35492
- } catch {
35493
- process.stdout.write("\n");
35494
- printNext();
35495
- return;
35713
+ for (; ; ) {
35714
+ const fallback = first ? "1" : exitDefault;
35715
+ let choice;
35716
+ try {
35717
+ choice = (await rl.question(` ${import_picocolors5.default.dim(`choice [${fallback}]:`)} `)).trim() || fallback;
35718
+ } catch {
35719
+ if (first) w?.stop();
35720
+ process.stdout.write("\n");
35721
+ printNext(makePut(null));
35722
+ return;
35723
+ }
35724
+ if (first) {
35725
+ w?.stop();
35726
+ plain = makePut(null);
35727
+ first = false;
35728
+ }
35729
+ process.stdout.write("\n");
35730
+ const key = order[parseInt(choice, 10) - 1] ?? "poke";
35731
+ if (key === "poke") {
35732
+ printNext(plain);
35733
+ return;
35734
+ }
35735
+ switch (key) {
35736
+ case "wallet":
35737
+ try {
35738
+ await runLoginFlow({ profile: profileName, jsonMode: false, ttyHeader: "Pairing this terminal with your wallet\u2026" });
35739
+ process.stdout.write("\n");
35740
+ } catch {
35741
+ plain(` ${import_picocolors5.default.red("\u2715")} pairing didn't complete
35742
+
35743
+ `);
35744
+ }
35745
+ break;
35746
+ case "compute":
35747
+ try {
35748
+ await computePlans({});
35749
+ } catch {
35750
+ plain(` ${import_picocolors5.default.red("\u2715")} could not read the compute catalog
35751
+
35752
+ `);
35753
+ }
35754
+ break;
35755
+ case "models":
35756
+ try {
35757
+ await inferenceModels({});
35758
+ } catch {
35759
+ plain(` ${import_picocolors5.default.red("\u2715")} could not read the model catalog
35760
+
35761
+ `);
35762
+ }
35763
+ break;
35764
+ case "docs":
35765
+ await printDocs(plain, opts.lane);
35766
+ break;
35767
+ }
35768
+ printMenu(plain, order, false);
35769
+ }
35496
35770
  } finally {
35497
35771
  rl.close();
35498
35772
  }
35499
- process.stdout.write("\n");
35500
- switch (choice) {
35501
- case "1":
35502
- await runLoginFlow({ profile: profileName, jsonMode: false, ttyHeader: "Pairing this terminal with your wallet\u2026" });
35503
- process.stdout.write("\n");
35504
- printNext();
35505
- return;
35506
- case "2":
35507
- await computePlans({});
35508
- printNext();
35509
- return;
35510
- case "3":
35511
- await inferenceModels({});
35512
- printNext();
35513
- return;
35514
- default:
35515
- printNext();
35516
- return;
35517
- }
35518
35773
  }
35519
- function printNext() {
35520
- process.stdout.write(` ${import_picocolors5.default.dim("agentgates compute plans")} ${import_picocolors5.default.dim("\xB7 machines by the hour")}
35774
+ function printNext(put) {
35775
+ put(` ${import_picocolors5.default.dim("agentgates compute plans")} ${import_picocolors5.default.dim("\xB7 virtual machines by the hour")}
35521
35776
  `);
35522
- process.stdout.write(` ${import_picocolors5.default.dim("agentgates inference models")} ${import_picocolors5.default.dim("\xB7 models by the token")}
35777
+ put(` ${import_picocolors5.default.dim("agentgates inference models")} ${import_picocolors5.default.dim("\xB7 models by the token")}
35523
35778
  `);
35524
- process.stdout.write(` ${import_picocolors5.default.dim("agentgates --help")} ${import_picocolors5.default.dim("\xB7 everything else")}
35779
+ put(` ${import_picocolors5.default.dim("agentgates --help")} ${import_picocolors5.default.dim("\xB7 everything else")}
35525
35780
 
35526
35781
  `);
35527
35782
  }
@@ -40517,10 +40772,10 @@ desk.command("buy").description("Buy a launch coin with desk USDC credit (sessio
40517
40772
  desk.command("sell").description("Sell desk coin credit back to the curve (session signs; sells uncapped by design \u2014 proceeds only ever land in the owner's vault)").argument("<coin>", "coin ticker or base58 mint address").argument("<amount>", 'coin amount, a percentage like "50%" (resolved from the state read), or "all"').option("--min-out <usdc>", "explicit min-out in USDC (overrides the server-owned guard)").option("--json", "machine-readable output").action(async (coin, amount, opts) => {
40518
40773
  await deskSell(coin, amount, opts);
40519
40774
  });
40520
- program2.command("onboard").description("Welcome screen: pair your wallet, or look at what is for sale. Run by the installer.").option("--profile <name>", "named profile (default: 'default')").action(async (opts) => {
40775
+ program2.command("onboard").description("Welcome screen: look at what is for sale, or pair your wallet. Run by the installer.").option("--profile <name>", "named profile (default: 'default')").option("--lane <lane>", "which lane leads the menu: compute | inference").action(async (opts) => {
40521
40776
  await onboard(opts);
40522
40777
  });
40523
- var compute = program2.command("compute").description("Confidential VMs by the hour, USDC per payment");
40778
+ var compute = program2.command("compute").description("Confidential virtual machines by the hour, USDC per payment");
40524
40779
  compute.command("plans").description("Live plans and the price ladder. Public read: no key, no account, no payment.").option("--json", "machine-readable output (the raw catalog)").action(async (opts) => {
40525
40780
  await computePlans(opts);
40526
40781
  });
@@ -40528,7 +40783,7 @@ compute.command("buy").description("Rent a machine (needs an x402 signature this
40528
40783
  await computeBuy();
40529
40784
  });
40530
40785
  var inference = program2.command("inference").description("Attested confidential models, plus an open tier, USDC per request");
40531
- inference.command("models").description("Live models and per-token prices. Public read: no key, no account, no payment.").option("--all", "every model, not just the attested tier").option("--json", "machine-readable output (the raw catalog)").action(async (opts) => {
40786
+ inference.command("models").description("Live models and per-token prices. Public read: no key, no account, no payment.").option("--all", "every model, not just the attested tier").option("--tier <tier>", "confidential | open").option("--tag <tag>", "filter by tag, repeatable (the board carries: reasoning, multimodal, frontier)", (v, prev) => prev.concat(v), []).option("--org <org>", "filter by maker org (openai, anthropic, qwen, ...)").option("--search <text>", "match against model id and name").option("--json", "machine-readable output (the catalog, filters applied)").action(async (opts) => {
40532
40787
  await inferenceModels(opts);
40533
40788
  });
40534
40789
  inference.command("ask").description("One paid ask (needs an x402 signature this CLI does not have yet)").action(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentgates/cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Wallet operations for AI agents and humans",
5
5
  "keywords": [
6
6
  "crypto",