@moxxy/cli 0.41.0 → 0.41.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/bin.js +583 -279
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -27147,16 +27147,6 @@ function abytes(value2, length, title = "") {
27147
27147
  }
27148
27148
  return value2;
27149
27149
  }
27150
- function ahash(h) {
27151
- if (typeof h !== "function" || typeof h.create !== "function")
27152
- throw new TypeError("Hash must wrapped by utils.createHasher");
27153
- anumber(h.outputLen);
27154
- anumber(h.blockLen);
27155
- if (h.outputLen < 1)
27156
- throw new Error('"outputLen" must be >= 1');
27157
- if (h.blockLen < 1)
27158
- throw new Error('"blockLen" must be >= 1');
27159
- }
27160
27150
  function aexists(instance, checkFinished = true) {
27161
27151
  if (instance.destroyed)
27162
27152
  throw new Error("Hash instance has been destroyed");
@@ -27178,9 +27168,6 @@ function clean(...arrays) {
27178
27168
  function createView(arr) {
27179
27169
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
27180
27170
  }
27181
- function rotr(word, shift) {
27182
- return word << 32 - shift | word >>> shift;
27183
- }
27184
27171
  function bytesToHex(bytes) {
27185
27172
  abytes(bytes);
27186
27173
  if (hasHexBuiltin)
@@ -27280,13 +27267,7 @@ var init_utils = __esm({
27280
27267
  });
27281
27268
 
27282
27269
  // ../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_md.js
27283
- function Chi(a, b, c) {
27284
- return a & b ^ ~a & c;
27285
- }
27286
- function Maj(a, b, c) {
27287
- return a & b ^ a & c ^ b & c;
27288
- }
27289
- var HashMD, SHA256_IV, SHA512_IV;
27270
+ var HashMD, SHA512_IV;
27290
27271
  var init_md = __esm({
27291
27272
  "../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/_md.js"() {
27292
27273
  init_utils();
@@ -27386,16 +27367,6 @@ var init_md = __esm({
27386
27367
  return this._cloneInto();
27387
27368
  }
27388
27369
  };
27389
- SHA256_IV = /* @__PURE__ */ Uint32Array.from([
27390
- 1779033703,
27391
- 3144134277,
27392
- 1013904242,
27393
- 2773480762,
27394
- 1359893119,
27395
- 2600822924,
27396
- 528734635,
27397
- 1541459225
27398
- ]);
27399
27370
  SHA512_IV = /* @__PURE__ */ Uint32Array.from([
27400
27371
  1779033703,
27401
27372
  4089235720,
@@ -27458,157 +27429,12 @@ var init_u64 = __esm({
27458
27429
  });
27459
27430
 
27460
27431
  // ../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/sha2.js
27461
- var SHA256_K, SHA256_W, SHA2_32B, _SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA2_64B, _SHA512, sha2562, sha512;
27432
+ var K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA2_64B, _SHA512, sha512;
27462
27433
  var init_sha2 = __esm({
27463
27434
  "../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/sha2.js"() {
27464
27435
  init_md();
27465
27436
  init_u64();
27466
27437
  init_utils();
27467
- SHA256_K = /* @__PURE__ */ Uint32Array.from([
27468
- 1116352408,
27469
- 1899447441,
27470
- 3049323471,
27471
- 3921009573,
27472
- 961987163,
27473
- 1508970993,
27474
- 2453635748,
27475
- 2870763221,
27476
- 3624381080,
27477
- 310598401,
27478
- 607225278,
27479
- 1426881987,
27480
- 1925078388,
27481
- 2162078206,
27482
- 2614888103,
27483
- 3248222580,
27484
- 3835390401,
27485
- 4022224774,
27486
- 264347078,
27487
- 604807628,
27488
- 770255983,
27489
- 1249150122,
27490
- 1555081692,
27491
- 1996064986,
27492
- 2554220882,
27493
- 2821834349,
27494
- 2952996808,
27495
- 3210313671,
27496
- 3336571891,
27497
- 3584528711,
27498
- 113926993,
27499
- 338241895,
27500
- 666307205,
27501
- 773529912,
27502
- 1294757372,
27503
- 1396182291,
27504
- 1695183700,
27505
- 1986661051,
27506
- 2177026350,
27507
- 2456956037,
27508
- 2730485921,
27509
- 2820302411,
27510
- 3259730800,
27511
- 3345764771,
27512
- 3516065817,
27513
- 3600352804,
27514
- 4094571909,
27515
- 275423344,
27516
- 430227734,
27517
- 506948616,
27518
- 659060556,
27519
- 883997877,
27520
- 958139571,
27521
- 1322822218,
27522
- 1537002063,
27523
- 1747873779,
27524
- 1955562222,
27525
- 2024104815,
27526
- 2227730452,
27527
- 2361852424,
27528
- 2428436474,
27529
- 2756734187,
27530
- 3204031479,
27531
- 3329325298
27532
- ]);
27533
- SHA256_W = /* @__PURE__ */ new Uint32Array(64);
27534
- SHA2_32B = class extends HashMD {
27535
- constructor(outputLen) {
27536
- super(64, outputLen, 8, false);
27537
- }
27538
- get() {
27539
- const { A, B: B2, C: C2, D: D2, E, F, G: G2, H: H3 } = this;
27540
- return [A, B2, C2, D2, E, F, G2, H3];
27541
- }
27542
- // prettier-ignore
27543
- set(A, B2, C2, D2, E, F, G2, H3) {
27544
- this.A = A | 0;
27545
- this.B = B2 | 0;
27546
- this.C = C2 | 0;
27547
- this.D = D2 | 0;
27548
- this.E = E | 0;
27549
- this.F = F | 0;
27550
- this.G = G2 | 0;
27551
- this.H = H3 | 0;
27552
- }
27553
- process(view, offset) {
27554
- for (let i = 0; i < 16; i++, offset += 4)
27555
- SHA256_W[i] = view.getUint32(offset, false);
27556
- for (let i = 16; i < 64; i++) {
27557
- const W15 = SHA256_W[i - 15];
27558
- const W22 = SHA256_W[i - 2];
27559
- const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
27560
- const s1 = rotr(W22, 17) ^ rotr(W22, 19) ^ W22 >>> 10;
27561
- SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
27562
- }
27563
- let { A, B: B2, C: C2, D: D2, E, F, G: G2, H: H3 } = this;
27564
- for (let i = 0; i < 64; i++) {
27565
- const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
27566
- const T1 = H3 + sigma1 + Chi(E, F, G2) + SHA256_K[i] + SHA256_W[i] | 0;
27567
- const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
27568
- const T2 = sigma0 + Maj(A, B2, C2) | 0;
27569
- H3 = G2;
27570
- G2 = F;
27571
- F = E;
27572
- E = D2 + T1 | 0;
27573
- D2 = C2;
27574
- C2 = B2;
27575
- B2 = A;
27576
- A = T1 + T2 | 0;
27577
- }
27578
- A = A + this.A | 0;
27579
- B2 = B2 + this.B | 0;
27580
- C2 = C2 + this.C | 0;
27581
- D2 = D2 + this.D | 0;
27582
- E = E + this.E | 0;
27583
- F = F + this.F | 0;
27584
- G2 = G2 + this.G | 0;
27585
- H3 = H3 + this.H | 0;
27586
- this.set(A, B2, C2, D2, E, F, G2, H3);
27587
- }
27588
- roundClean() {
27589
- clean(SHA256_W);
27590
- }
27591
- destroy() {
27592
- this.destroyed = true;
27593
- this.set(0, 0, 0, 0, 0, 0, 0, 0);
27594
- clean(this.buffer);
27595
- }
27596
- };
27597
- _SHA256 = class extends SHA2_32B {
27598
- // We cannot use array here since array allows indexing by variable
27599
- // which means optimizer/compiler cannot use registers.
27600
- A = SHA256_IV[0] | 0;
27601
- B = SHA256_IV[1] | 0;
27602
- C = SHA256_IV[2] | 0;
27603
- D = SHA256_IV[3] | 0;
27604
- E = SHA256_IV[4] | 0;
27605
- F = SHA256_IV[5] | 0;
27606
- G = SHA256_IV[6] | 0;
27607
- H = SHA256_IV[7] | 0;
27608
- constructor() {
27609
- super(32);
27610
- }
27611
- };
27612
27438
  K512 = /* @__PURE__ */ (() => split([
27613
27439
  "0x428a2f98d728ae22",
27614
27440
  "0x7137449123ef65cd",
@@ -27812,10 +27638,6 @@ var init_sha2 = __esm({
27812
27638
  super(64);
27813
27639
  }
27814
27640
  };
27815
- sha2562 = /* @__PURE__ */ createHasher(
27816
- () => new _SHA256(),
27817
- /* @__PURE__ */ oidNist(1)
27818
- );
27819
27641
  sha512 = /* @__PURE__ */ createHasher(
27820
27642
  () => new _SHA512(),
27821
27643
  /* @__PURE__ */ oidNist(3)
@@ -28858,7 +28680,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
28858
28680
  if (outputLen !== expectedLen)
28859
28681
  throw new Error(`hash.outputLen must be ${expectedLen}, got ${outputLen}`);
28860
28682
  }
28861
- const randomBytes8 = opts.randomBytes === void 0 ? randomBytes4 : opts.randomBytes;
28683
+ const randomBytes9 = opts.randomBytes === void 0 ? randomBytes4 : opts.randomBytes;
28862
28684
  const adjustScalarBytes2 = opts.adjustScalarBytes === void 0 ? (bytes) => bytes : opts.adjustScalarBytes;
28863
28685
  const domain2 = opts.domain === void 0 ? (data, ctx, phflag) => {
28864
28686
  abool(phflag, "phflag");
@@ -28944,7 +28766,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
28944
28766
  seed: _size
28945
28767
  };
28946
28768
  function randomSecretKey(seed) {
28947
- seed = seed === void 0 ? randomBytes8(lengths.seed) : seed;
28769
+ seed = seed === void 0 ? randomBytes9(lengths.seed) : seed;
28948
28770
  return abytes2(seed, lengths.seed, "seed");
28949
28771
  }
28950
28772
  function isValidSecretKey(key) {
@@ -29441,6 +29263,466 @@ var init_ed25519 = __esm({
29441
29263
  }
29442
29264
  });
29443
29265
 
29266
+ // ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_u64.js
29267
+ function setU64FromNum(view, byteOffset, n, isLE2) {
29268
+ const h = fromNumH(n);
29269
+ const l = fromNumL(n);
29270
+ view.setUint32(byteOffset, isLE2 ? l : h, isLE2);
29271
+ view.setUint32(byteOffset + 4, isLE2 ? h : l, isLE2);
29272
+ }
29273
+ var fromNumH, fromNumL;
29274
+ var init_u642 = __esm({
29275
+ "../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_u64.js"() {
29276
+ fromNumH = (n) => n / 2 ** 32 | 0;
29277
+ fromNumL = (n) => n >>> 0;
29278
+ }
29279
+ });
29280
+
29281
+ // ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js
29282
+ function isBytes3(a) {
29283
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
29284
+ }
29285
+ function anumber3(n, title = "") {
29286
+ if (typeof n !== "number")
29287
+ throw new TypeError(atitle(title) + "expected number, got " + typeof n);
29288
+ if (!Number.isSafeInteger(n) || n < 0)
29289
+ throw new RangeError(atitle(title) + "expected integer >= 0, got " + n);
29290
+ return n;
29291
+ }
29292
+ function abytes3(value2, length, title = "") {
29293
+ if (isBytes3(value2) && (length === void 0))
29294
+ return value2;
29295
+ const bytes = isBytes3(value2);
29296
+ const ofLen = "";
29297
+ const got = bytes ? `length=${value2.length}` : `type=${typeof value2}`;
29298
+ const message = atitle(title) + "expected Uint8Array" + ofLen + ", got " + got;
29299
+ if (!bytes)
29300
+ throw new TypeError(message);
29301
+ throw new RangeError(message);
29302
+ }
29303
+ function ahash(h) {
29304
+ if (typeof h !== "function" || typeof h.create !== "function")
29305
+ throw new TypeError("expected hash wrapped by utils.createHasher");
29306
+ anumber3(h.outputLen);
29307
+ anumber3(h.blockLen);
29308
+ if (h.outputLen < 1 || h.blockLen < 1)
29309
+ throw new Error("hash blockLen / outputLen must be >= 1");
29310
+ }
29311
+ function aexists2(instance, checkFinished = true) {
29312
+ if (instance.destroyed)
29313
+ throw new Error("hash was destroyed");
29314
+ if (checkFinished && instance.finished)
29315
+ throw new Error("digest() was already called");
29316
+ }
29317
+ function aoutput2(out, instance) {
29318
+ abytes3(out, void 0, "output");
29319
+ const min = instance.outputLen;
29320
+ if (!(out.length >= min)) {
29321
+ throw new RangeError('"output" expected length >= ' + min);
29322
+ }
29323
+ }
29324
+ function clean2(...arrays) {
29325
+ for (let i = 0; i < arrays.length; i++) {
29326
+ arrays[i].fill(0);
29327
+ }
29328
+ }
29329
+ function createView2(arr) {
29330
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
29331
+ }
29332
+ function rotr2(word, shift) {
29333
+ return word << 32 - shift | word >>> shift;
29334
+ }
29335
+ function bytesToHex3(bytes) {
29336
+ abytes3(bytes);
29337
+ if (hasHexBuiltin2)
29338
+ return bytes.toHex();
29339
+ let hex = "";
29340
+ for (let i = 0; i < bytes.length; i++) {
29341
+ hex += hexes2[bytes[i]];
29342
+ }
29343
+ return hex;
29344
+ }
29345
+ function asciiToBase162(ch) {
29346
+ return ch >= 48 && ch <= 57 ? ch - 48 : ch >= 65 && ch <= 70 ? ch - (65 - 10) : ch >= 97 && ch <= 102 ? ch - (97 - 10) : void 0;
29347
+ }
29348
+ function hexToBytes3(hex) {
29349
+ if (typeof hex !== "string")
29350
+ throw new TypeError("hex string expected, got " + typeof hex);
29351
+ if (hasHexBuiltin2) {
29352
+ try {
29353
+ return Uint8Array.fromHex(hex);
29354
+ } catch (error) {
29355
+ if (error instanceof SyntaxError)
29356
+ throw new RangeError(error.message);
29357
+ throw error;
29358
+ }
29359
+ }
29360
+ const hl = hex.length;
29361
+ const al = hl / 2;
29362
+ if (hl % 2)
29363
+ throw new RangeError("hex string expected, got unpadded hex of length " + hl);
29364
+ const array = new Uint8Array(al);
29365
+ for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
29366
+ const n1 = asciiToBase162(hex.charCodeAt(hi));
29367
+ const n2 = asciiToBase162(hex.charCodeAt(hi + 1));
29368
+ if (n1 === void 0 || n2 === void 0) {
29369
+ const char = hex[hi] + hex[hi + 1];
29370
+ throw new RangeError('hex string expected, got non-hex character "' + char + '" at index ' + hi);
29371
+ }
29372
+ array[ai] = n1 * 16 + n2;
29373
+ }
29374
+ return array;
29375
+ }
29376
+ function checkOpts(defaults, opts, title = "opts") {
29377
+ aopts(defaults, "defaults");
29378
+ if (opts !== void 0)
29379
+ aopts(opts, title);
29380
+ const merged = Object.assign(/* @__PURE__ */ Object.create(null), defaults, opts);
29381
+ return merged;
29382
+ }
29383
+ function createHasher3(hashCons, info = {}) {
29384
+ if (typeof hashCons !== "function")
29385
+ throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons);
29386
+ info = checkOpts({}, info, "info");
29387
+ const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
29388
+ const tmp = hashCons(void 0);
29389
+ hashC.outputLen = tmp.outputLen;
29390
+ hashC.blockLen = tmp.blockLen;
29391
+ hashC.canXOF = tmp.canXOF;
29392
+ hashC.create = (opts) => hashCons(opts);
29393
+ Object.assign(hashC, info);
29394
+ return Object.freeze(hashC);
29395
+ }
29396
+ function randomBytes5(bytesLength = 32) {
29397
+ anumber3(bytesLength, "bytesLength");
29398
+ const cr = typeof globalThis === "object" ? globalThis.crypto : null;
29399
+ if (typeof cr?.getRandomValues !== "function")
29400
+ throw new Error("crypto.getRandomValues must be defined");
29401
+ if (bytesLength > 65536)
29402
+ throw new RangeError(`"bytesLength" expected <= 65536, got ${bytesLength}`);
29403
+ return cr.getRandomValues(new Uint8Array(bytesLength));
29404
+ }
29405
+ var atitle, aobject, aopts, hasHexBuiltin2, hexes2, oidNist2;
29406
+ var init_utils3 = __esm({
29407
+ "../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/utils.js"() {
29408
+ atitle = (title) => title ? `"${title}" ` : "";
29409
+ aobject = (value2, label3) => {
29410
+ if (value2 === null || typeof value2 !== "object" || Array.isArray(value2))
29411
+ throw new TypeError((label3 === "object" ? "" : `"${label3}" `) + "expected object, got type=" + typeof value2);
29412
+ };
29413
+ aopts = (value2, label3) => {
29414
+ aobject(value2, label3);
29415
+ const proto2 = Object.getPrototypeOf(value2);
29416
+ if (proto2 !== Object.prototype && proto2 !== null)
29417
+ throw new TypeError(`"${label3}" expected plain object`);
29418
+ if (Object.hasOwn(value2, "__proto__"))
29419
+ throw new TypeError(`"${label3}.__proto__" is not allowed`);
29420
+ };
29421
+ hasHexBuiltin2 = /* @__PURE__ */ (() => (
29422
+ // @ts-ignore
29423
+ typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
29424
+ ))();
29425
+ hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_2, i) => i.toString(16).padStart(2, "0"));
29426
+ oidNist2 = (suffix) => ({
29427
+ // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.
29428
+ // Larger suffix values would need base-128 OID encoding and a different length byte.
29429
+ oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, suffix])
29430
+ });
29431
+ }
29432
+ });
29433
+
29434
+ // ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_md.js
29435
+ function Chi2(a, b, c) {
29436
+ return a & b ^ ~a & c;
29437
+ }
29438
+ function Maj2(a, b, c) {
29439
+ return a & b ^ a & c ^ b & c;
29440
+ }
29441
+ var HashMD2, SHA256_IV2;
29442
+ var init_md2 = __esm({
29443
+ "../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/_md.js"() {
29444
+ init_u642();
29445
+ init_utils3();
29446
+ HashMD2 = class {
29447
+ blockLen;
29448
+ outputLen;
29449
+ canXOF = false;
29450
+ padOffset;
29451
+ isLE;
29452
+ // For partial updates less than block size
29453
+ buffer;
29454
+ view;
29455
+ finished = false;
29456
+ length = 0;
29457
+ pos = 0;
29458
+ destroyed = false;
29459
+ constructor(blockLen, outputLen, padOffset, isLE2) {
29460
+ this.blockLen = blockLen;
29461
+ this.outputLen = outputLen;
29462
+ this.padOffset = padOffset;
29463
+ this.isLE = isLE2;
29464
+ this.buffer = new Uint8Array(blockLen);
29465
+ this.view = createView2(this.buffer);
29466
+ }
29467
+ update(data) {
29468
+ aexists2(this);
29469
+ abytes3(data);
29470
+ const { view, buffer, blockLen } = this;
29471
+ const len = data.length;
29472
+ let processed = false;
29473
+ for (let pos = 0; pos < len; ) {
29474
+ const take = Math.min(blockLen - this.pos, len - pos);
29475
+ if (take === blockLen) {
29476
+ const dataView = createView2(data);
29477
+ for (; blockLen <= len - pos; pos += blockLen)
29478
+ this.process(dataView, pos);
29479
+ processed = true;
29480
+ continue;
29481
+ }
29482
+ buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
29483
+ this.pos += take;
29484
+ pos += take;
29485
+ if (this.pos === blockLen) {
29486
+ this.process(view, 0);
29487
+ this.pos = 0;
29488
+ processed = true;
29489
+ }
29490
+ }
29491
+ this.length += data.length;
29492
+ if (processed)
29493
+ this.roundClean();
29494
+ return this;
29495
+ }
29496
+ digestInto(out) {
29497
+ aexists2(this);
29498
+ aoutput2(out, this);
29499
+ this.finished = true;
29500
+ const { buffer, view, blockLen, isLE: isLE2 } = this;
29501
+ let { pos } = this;
29502
+ buffer[pos++] = 128;
29503
+ buffer.fill(0, pos);
29504
+ if (this.padOffset > blockLen - pos) {
29505
+ this.process(view, 0);
29506
+ buffer.fill(0);
29507
+ }
29508
+ setU64FromNum(view, blockLen - 8, this.length * 8, isLE2);
29509
+ this.process(view, 0);
29510
+ this.roundClean();
29511
+ const oview = out === buffer ? view : createView2(out);
29512
+ const len = this.outputLen;
29513
+ const outLen = len / 4;
29514
+ const state = this.get();
29515
+ if (len % 4 || outLen > state.length)
29516
+ throw new Error("invalid outputLen");
29517
+ for (let i = 0; i < outLen; i++)
29518
+ oview.setUint32(4 * i, state[i], isLE2);
29519
+ }
29520
+ digest() {
29521
+ const { buffer, outputLen } = this;
29522
+ this.digestInto(buffer);
29523
+ const res = buffer.slice(0, outputLen);
29524
+ this.destroy();
29525
+ return res;
29526
+ }
29527
+ _cloneIntoMeta(to) {
29528
+ const { buffer, length, finished, destroyed, pos } = this;
29529
+ to.destroyed = destroyed;
29530
+ to.finished = finished;
29531
+ to.length = length;
29532
+ to.pos = pos;
29533
+ if (pos)
29534
+ to.buffer.set(buffer);
29535
+ return to;
29536
+ }
29537
+ clone() {
29538
+ return this._cloneInto();
29539
+ }
29540
+ };
29541
+ SHA256_IV2 = /* @__PURE__ */ Uint32Array.from([
29542
+ 1779033703,
29543
+ 3144134277,
29544
+ 1013904242,
29545
+ 2773480762,
29546
+ 1359893119,
29547
+ 2600822924,
29548
+ 528734635,
29549
+ 1541459225
29550
+ ]);
29551
+ }
29552
+ });
29553
+
29554
+ // ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/sha2.js
29555
+ var SHA256_K, SHA256_W, SHA2_32B, _SHA256, sha2562;
29556
+ var init_sha22 = __esm({
29557
+ "../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/sha2.js"() {
29558
+ init_md2();
29559
+ init_utils3();
29560
+ SHA256_K = /* @__PURE__ */ Uint32Array.from([
29561
+ 1116352408,
29562
+ 1899447441,
29563
+ 3049323471,
29564
+ 3921009573,
29565
+ 961987163,
29566
+ 1508970993,
29567
+ 2453635748,
29568
+ 2870763221,
29569
+ 3624381080,
29570
+ 310598401,
29571
+ 607225278,
29572
+ 1426881987,
29573
+ 1925078388,
29574
+ 2162078206,
29575
+ 2614888103,
29576
+ 3248222580,
29577
+ 3835390401,
29578
+ 4022224774,
29579
+ 264347078,
29580
+ 604807628,
29581
+ 770255983,
29582
+ 1249150122,
29583
+ 1555081692,
29584
+ 1996064986,
29585
+ 2554220882,
29586
+ 2821834349,
29587
+ 2952996808,
29588
+ 3210313671,
29589
+ 3336571891,
29590
+ 3584528711,
29591
+ 113926993,
29592
+ 338241895,
29593
+ 666307205,
29594
+ 773529912,
29595
+ 1294757372,
29596
+ 1396182291,
29597
+ 1695183700,
29598
+ 1986661051,
29599
+ 2177026350,
29600
+ 2456956037,
29601
+ 2730485921,
29602
+ 2820302411,
29603
+ 3259730800,
29604
+ 3345764771,
29605
+ 3516065817,
29606
+ 3600352804,
29607
+ 4094571909,
29608
+ 275423344,
29609
+ 430227734,
29610
+ 506948616,
29611
+ 659060556,
29612
+ 883997877,
29613
+ 958139571,
29614
+ 1322822218,
29615
+ 1537002063,
29616
+ 1747873779,
29617
+ 1955562222,
29618
+ 2024104815,
29619
+ 2227730452,
29620
+ 2361852424,
29621
+ 2428436474,
29622
+ 2756734187,
29623
+ 3204031479,
29624
+ 3329325298
29625
+ ]);
29626
+ SHA256_W = /* @__PURE__ */ new Uint32Array(64);
29627
+ SHA2_32B = class extends HashMD2 {
29628
+ // We cannot use array here since array allows indexing by variable
29629
+ // which means optimizer/compiler cannot use registers.
29630
+ // Numeric initializers matter: starting the fields as `undefined` changes
29631
+ // V8's field representation and makes sha256 3x slower (measured).
29632
+ A = 0;
29633
+ B = 0;
29634
+ C = 0;
29635
+ D = 0;
29636
+ E = 0;
29637
+ F = 0;
29638
+ G = 0;
29639
+ H = 0;
29640
+ constructor(outputLen, IV) {
29641
+ super(64, outputLen, 8, false);
29642
+ this.A = IV[0] | 0;
29643
+ this.B = IV[1] | 0;
29644
+ this.C = IV[2] | 0;
29645
+ this.D = IV[3] | 0;
29646
+ this.E = IV[4] | 0;
29647
+ this.F = IV[5] | 0;
29648
+ this.G = IV[6] | 0;
29649
+ this.H = IV[7] | 0;
29650
+ }
29651
+ get() {
29652
+ const { A, B: B2, C: C2, D: D2, E, F, G: G2, H: H3 } = this;
29653
+ return [A, B2, C2, D2, E, F, G2, H3];
29654
+ }
29655
+ // prettier-ignore
29656
+ set(A, B2, C2, D2, E, F, G2, H3) {
29657
+ this.A = A | 0;
29658
+ this.B = B2 | 0;
29659
+ this.C = C2 | 0;
29660
+ this.D = D2 | 0;
29661
+ this.E = E | 0;
29662
+ this.F = F | 0;
29663
+ this.G = G2 | 0;
29664
+ this.H = H3 | 0;
29665
+ }
29666
+ _cloneInto(to) {
29667
+ (to ||= new this.constructor()).set(...this.get());
29668
+ return this._cloneIntoMeta(to);
29669
+ }
29670
+ process(view, offset) {
29671
+ for (let i = 0; i < 16; i++, offset += 4)
29672
+ SHA256_W[i] = view.getUint32(offset, false);
29673
+ for (let i = 16; i < 64; i++) {
29674
+ const W15 = SHA256_W[i - 15];
29675
+ const W22 = SHA256_W[i - 2];
29676
+ const s0 = rotr2(W15, 7) ^ rotr2(W15, 18) ^ W15 >>> 3;
29677
+ const s1 = rotr2(W22, 17) ^ rotr2(W22, 19) ^ W22 >>> 10;
29678
+ SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
29679
+ }
29680
+ let { A, B: B2, C: C2, D: D2, E, F, G: G2, H: H3 } = this;
29681
+ for (let i = 0; i < 64; i++) {
29682
+ const sigma1 = rotr2(E, 6) ^ rotr2(E, 11) ^ rotr2(E, 25);
29683
+ const T1 = H3 + sigma1 + Chi2(E, F, G2) + SHA256_K[i] + SHA256_W[i] | 0;
29684
+ const sigma0 = rotr2(A, 2) ^ rotr2(A, 13) ^ rotr2(A, 22);
29685
+ const T2 = sigma0 + Maj2(A, B2, C2) | 0;
29686
+ H3 = G2;
29687
+ G2 = F;
29688
+ F = E;
29689
+ E = D2 + T1 | 0;
29690
+ D2 = C2;
29691
+ C2 = B2;
29692
+ B2 = A;
29693
+ A = T1 + T2 | 0;
29694
+ }
29695
+ A = A + this.A | 0;
29696
+ B2 = B2 + this.B | 0;
29697
+ C2 = C2 + this.C | 0;
29698
+ D2 = D2 + this.D | 0;
29699
+ E = E + this.E | 0;
29700
+ F = F + this.F | 0;
29701
+ G2 = G2 + this.G | 0;
29702
+ H3 = H3 + this.H | 0;
29703
+ this.set(A, B2, C2, D2, E, F, G2, H3);
29704
+ }
29705
+ roundClean() {
29706
+ clean2(SHA256_W);
29707
+ }
29708
+ destroy() {
29709
+ this.destroyed = true;
29710
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
29711
+ clean2(this.buffer);
29712
+ }
29713
+ };
29714
+ _SHA256 = class extends SHA2_32B {
29715
+ constructor() {
29716
+ super(32, SHA256_IV2);
29717
+ }
29718
+ };
29719
+ sha2562 = /* @__PURE__ */ createHasher3(
29720
+ () => new _SHA256(),
29721
+ /* @__PURE__ */ oidNist2(1)
29722
+ );
29723
+ }
29724
+ });
29725
+
29444
29726
  // ../e2e/dist/bytes.js
29445
29727
  function concatBytes3(...parts) {
29446
29728
  let total = 0;
@@ -29498,11 +29780,11 @@ function base64urlDecode(s) {
29498
29780
  const lut = new Int16Array(128).fill(-1);
29499
29781
  for (let i = 0; i < B64URL.length; i++)
29500
29782
  lut[B64URL.charCodeAt(i)] = i;
29501
- const clean3 = s.trim();
29783
+ const clean4 = s.trim();
29502
29784
  const out = [];
29503
29785
  let buf = 0;
29504
29786
  let bits = 0;
29505
- for (const ch of clean3) {
29787
+ for (const ch of clean4) {
29506
29788
  const code = ch.charCodeAt(0);
29507
29789
  const v = code < 128 ? lut[code] : -1;
29508
29790
  if (v === void 0 || v < 0)
@@ -29561,17 +29843,17 @@ var UUID_LABEL_LENGTH;
29561
29843
  var init_identity = __esm({
29562
29844
  "../e2e/dist/identity.js"() {
29563
29845
  init_ed25519();
29564
- init_sha2();
29846
+ init_sha22();
29565
29847
  init_bytes();
29566
29848
  UUID_LABEL_LENGTH = 16;
29567
29849
  }
29568
29850
  });
29569
29851
 
29570
- // ../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/hmac.js
29852
+ // ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/hmac.js
29571
29853
  var _HMAC, hmac;
29572
29854
  var init_hmac = __esm({
29573
- "../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/hmac.js"() {
29574
- init_utils();
29855
+ "../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/hmac.js"() {
29856
+ init_utils3();
29575
29857
  _HMAC = class {
29576
29858
  oHash;
29577
29859
  iHash;
@@ -29582,10 +29864,10 @@ var init_hmac = __esm({
29582
29864
  destroyed = false;
29583
29865
  constructor(hash, key) {
29584
29866
  ahash(hash);
29585
- abytes(key, void 0, "key");
29867
+ abytes3(key, void 0, "key");
29586
29868
  this.iHash = hash.create();
29587
29869
  if (typeof this.iHash.update !== "function")
29588
- throw new Error("Expected instance of class which extends utils.Hash");
29870
+ throw new Error("expected Hash instance");
29589
29871
  this.blockLen = this.iHash.blockLen;
29590
29872
  this.outputLen = this.iHash.outputLen;
29591
29873
  const blockLen = this.blockLen;
@@ -29598,16 +29880,16 @@ var init_hmac = __esm({
29598
29880
  for (let i = 0; i < pad.length; i++)
29599
29881
  pad[i] ^= 54 ^ 92;
29600
29882
  this.oHash.update(pad);
29601
- clean(pad);
29883
+ clean2(pad);
29602
29884
  }
29603
29885
  update(buf) {
29604
- aexists(this);
29886
+ aexists2(this);
29605
29887
  this.iHash.update(buf);
29606
29888
  return this;
29607
29889
  }
29608
29890
  digestInto(out) {
29609
- aexists(this);
29610
- aoutput(out, this);
29891
+ aexists2(this);
29892
+ aoutput2(out, this);
29611
29893
  this.finished = true;
29612
29894
  const buf = out.subarray(0, this.outputLen);
29613
29895
  this.iHash.digestInto(buf);
@@ -29622,12 +29904,13 @@ var init_hmac = __esm({
29622
29904
  }
29623
29905
  _cloneInto(to) {
29624
29906
  to ||= Object.create(Object.getPrototypeOf(this), {});
29625
- const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;
29907
+ const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;
29626
29908
  to = to;
29627
29909
  to.finished = finished;
29628
29910
  to.destroyed = destroyed;
29629
29911
  to.blockLen = blockLen;
29630
29912
  to.outputLen = outputLen;
29913
+ to.canXOF = canXOF;
29631
29914
  to.oHash = oHash._cloneInto(to.oHash);
29632
29915
  to.iHash = iHash._cloneInto(to.iHash);
29633
29916
  return to;
@@ -29649,17 +29932,11 @@ var init_hmac = __esm({
29649
29932
  }
29650
29933
  });
29651
29934
 
29652
- // ../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/hkdf.js
29653
- function extract(hash, ikm, salt) {
29654
- ahash(hash);
29655
- if (salt === void 0)
29656
- salt = new Uint8Array(hash.outputLen);
29657
- return hmac(hash, salt, ikm);
29658
- }
29659
- function expand2(hash, prk, info, length = 32) {
29935
+ // ../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/hkdf.js
29936
+ function expand2(hash, prk, info, length = 32, _recycled) {
29660
29937
  ahash(hash);
29661
- anumber(length, "length");
29662
- abytes(prk, void 0, "prk");
29938
+ anumber3(length, "length");
29939
+ abytes3(prk, void 0, "prk");
29663
29940
  const olen = hash.outputLen;
29664
29941
  if (prk.length < olen)
29665
29942
  throw new Error('"prk" must be at least HashLen octets');
@@ -29669,30 +29946,57 @@ function expand2(hash, prk, info, length = 32) {
29669
29946
  if (info === void 0)
29670
29947
  info = EMPTY_BUFFER;
29671
29948
  else
29672
- abytes(info, void 0, "info");
29673
- const okm = new Uint8Array(blocks * olen);
29674
- const HMAC = hmac.create(hash, prk);
29675
- const HMACTmp = HMAC._cloneInto();
29676
- const T2 = new Uint8Array(HMAC.outputLen);
29677
- for (let counter = 0; counter < blocks; counter++) {
29949
+ abytes3(info, void 0, "info");
29950
+ if (!blocks) {
29951
+ if (_recycled)
29952
+ clean2(prk);
29953
+ return new Uint8Array();
29954
+ }
29955
+ const okm = _recycled && blocks === 1 ? prk : new Uint8Array(blocks * olen);
29956
+ const { iHash, oHash } = hmac.create(hash, prk);
29957
+ const T2 = _recycled ? prk : new Uint8Array(olen);
29958
+ const worker = blocks > 1 ? _recycled?.iHash || hash.create() : void 0;
29959
+ for (let counter = 0; counter < blocks - 1; counter++) {
29678
29960
  HKDF_COUNTER[0] = counter + 1;
29679
- HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T2).update(info).update(HKDF_COUNTER).digestInto(T2);
29961
+ const iWork = iHash._cloneInto(worker);
29962
+ if (counter)
29963
+ iWork.update(T2);
29964
+ iWork.update(info).update(HKDF_COUNTER).digestInto(T2);
29965
+ oHash._cloneInto(worker).update(T2).digestInto(T2);
29680
29966
  okm.set(T2, olen * counter);
29681
- HMAC._cloneInto(HMACTmp);
29682
29967
  }
29683
- HMAC.destroy();
29684
- HMACTmp.destroy();
29685
- clean(T2, HKDF_COUNTER);
29686
- return okm.slice(0, length);
29968
+ HKDF_COUNTER[0] = blocks;
29969
+ if (blocks > 1)
29970
+ iHash.update(T2);
29971
+ iHash.update(info).update(HKDF_COUNTER).digestInto(T2);
29972
+ oHash.update(T2).digestInto(T2);
29973
+ okm.set(T2, olen * (blocks - 1));
29974
+ iHash.destroy();
29975
+ oHash.destroy();
29976
+ worker?.destroy();
29977
+ if (T2 !== okm)
29978
+ clean2(T2);
29979
+ clean2(HKDF_COUNTER);
29980
+ if (length === okm.length)
29981
+ return okm;
29982
+ const res = okm.slice(0, length);
29983
+ clean2(okm);
29984
+ return res;
29687
29985
  }
29688
29986
  var HKDF_COUNTER, EMPTY_BUFFER, hkdf;
29689
29987
  var init_hkdf = __esm({
29690
- "../../node_modules/.pnpm/@noble+hashes@2.2.0/node_modules/@noble/hashes/hkdf.js"() {
29988
+ "../../node_modules/.pnpm/@noble+hashes@2.4.0/node_modules/@noble/hashes/hkdf.js"() {
29691
29989
  init_hmac();
29692
- init_utils();
29990
+ init_utils3();
29693
29991
  HKDF_COUNTER = /* @__PURE__ */ Uint8Array.of(0);
29694
29992
  EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
29695
- hkdf = (hash, ikm, salt, info, length) => expand2(hash, extract(hash, ikm, salt), info, length);
29993
+ hkdf = (hash, ikm, salt, info, length) => {
29994
+ ahash(hash);
29995
+ if (salt === void 0)
29996
+ salt = new Uint8Array(hash.outputLen);
29997
+ const HMAC = hmac.create(hash, salt).update(ikm);
29998
+ return expand2(hash, HMAC.digest(), info, length, HMAC);
29999
+ };
29696
30000
  }
29697
30001
  });
29698
30002
 
@@ -29711,7 +30015,7 @@ function respond(clientHello, identity) {
29711
30015
  const ephIPub = clientHello.slice(0, X_PUB);
29712
30016
  const nC = clientHello.slice(X_PUB, X_PUB + HS_NONCE);
29713
30017
  const { secretKey: ephSecret, publicKey: ephRPub } = x25519.keygen();
29714
- const nS = randomBytes3(HS_NONCE);
30018
+ const nS = randomBytes5(HS_NONCE);
29715
30019
  const sig = sign(transcript(ephIPub, ephRPub, nC, nS), identity.secretKey);
29716
30020
  const shared = x25519.getSharedSecret(ephSecret, ephIPub);
29717
30021
  const { i2r, r2i } = deriveKeys(shared, nC, nS);
@@ -29725,8 +30029,8 @@ var init_handshake = __esm({
29725
30029
  "../e2e/dist/handshake.js"() {
29726
30030
  init_ed25519();
29727
30031
  init_hkdf();
29728
- init_sha2();
29729
- init_utils();
30032
+ init_sha22();
30033
+ init_utils3();
29730
30034
  init_bytes();
29731
30035
  init_identity();
29732
30036
  LABEL = utf8("moxxy/proxy-e2e/v1");
@@ -29737,21 +30041,21 @@ var init_handshake = __esm({
29737
30041
  });
29738
30042
 
29739
30043
  // ../../node_modules/.pnpm/@noble+ciphers@2.2.0/node_modules/@noble/ciphers/utils.js
29740
- function isBytes3(a) {
30044
+ function isBytes4(a) {
29741
30045
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
29742
30046
  }
29743
30047
  function abool2(b) {
29744
30048
  if (typeof b !== "boolean")
29745
30049
  throw new TypeError(`boolean expected, not ${b}`);
29746
30050
  }
29747
- function anumber3(n) {
30051
+ function anumber4(n) {
29748
30052
  if (typeof n !== "number")
29749
30053
  throw new TypeError("number expected, got " + typeof n);
29750
30054
  if (!Number.isSafeInteger(n) || n < 0)
29751
30055
  throw new RangeError("positive integer expected, got " + n);
29752
30056
  }
29753
- function abytes3(value2, length, title = "") {
29754
- const bytes = isBytes3(value2);
30057
+ function abytes4(value2, length, title = "") {
30058
+ const bytes = isBytes4(value2);
29755
30059
  const len = value2?.length;
29756
30060
  const needsLen = length !== void 0;
29757
30061
  if (!bytes || needsLen && len !== length) {
@@ -29765,14 +30069,14 @@ function abytes3(value2, length, title = "") {
29765
30069
  }
29766
30070
  return value2;
29767
30071
  }
29768
- function aexists2(instance, checkFinished = true) {
30072
+ function aexists3(instance, checkFinished = true) {
29769
30073
  if (instance.destroyed)
29770
30074
  throw new Error("Hash instance has been destroyed");
29771
30075
  if (checkFinished && instance.finished)
29772
30076
  throw new Error("Hash#digest() has already been called");
29773
30077
  }
29774
- function aoutput2(out, instance, onlyAligned = false) {
29775
- abytes3(out, void 0, "output");
30078
+ function aoutput3(out, instance, onlyAligned = false) {
30079
+ abytes4(out, void 0, "output");
29776
30080
  const min = instance.outputLen;
29777
30081
  if (out.length < min) {
29778
30082
  throw new RangeError("digestInto() expects output buffer of length at least " + min);
@@ -29783,15 +30087,15 @@ function aoutput2(out, instance, onlyAligned = false) {
29783
30087
  function u32(arr) {
29784
30088
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
29785
30089
  }
29786
- function clean2(...arrays) {
30090
+ function clean3(...arrays) {
29787
30091
  for (let i = 0; i < arrays.length; i++) {
29788
30092
  arrays[i].fill(0);
29789
30093
  }
29790
30094
  }
29791
- function createView2(arr) {
30095
+ function createView3(arr) {
29792
30096
  return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
29793
30097
  }
29794
- function checkOpts(defaults, opts) {
30098
+ function checkOpts2(defaults, opts) {
29795
30099
  if (opts == null || typeof opts !== "object")
29796
30100
  throw new Error("options must be defined");
29797
30101
  const merged = Object.assign(defaults, opts);
@@ -29818,7 +30122,7 @@ function wrapMacConstructor(keyLen, macCons, fromMsg) {
29818
30122
  function getOutput(expectedLength, out, onlyAligned = true) {
29819
30123
  if (out === void 0)
29820
30124
  return new Uint8Array(expectedLength);
29821
- abytes3(out, void 0, "output");
30125
+ abytes4(out, void 0, "output");
29822
30126
  if (out.length !== expectedLength)
29823
30127
  throw new Error('"output" expected Uint8Array of length ' + expectedLength + ", got: " + out.length);
29824
30128
  if (onlyAligned && !isAligned32(out))
@@ -29826,11 +30130,11 @@ function getOutput(expectedLength, out, onlyAligned = true) {
29826
30130
  return out;
29827
30131
  }
29828
30132
  function u64Lengths(dataLength, aadLength, isLE2) {
29829
- anumber3(dataLength);
29830
- anumber3(aadLength);
30133
+ anumber4(dataLength);
30134
+ anumber4(aadLength);
29831
30135
  abool2(isLE2);
29832
30136
  const num = new Uint8Array(16);
29833
- const view = createView2(num);
30137
+ const view = createView3(num);
29834
30138
  view.setBigUint64(0, BigInt(aadLength), isLE2);
29835
30139
  view.setBigUint64(8, BigInt(dataLength), isLE2);
29836
30140
  return num;
@@ -29839,10 +30143,10 @@ function isAligned32(bytes) {
29839
30143
  return bytes.byteOffset % 4 === 0;
29840
30144
  }
29841
30145
  function copyBytes2(bytes) {
29842
- return Uint8Array.from(abytes3(bytes));
30146
+ return Uint8Array.from(abytes4(bytes));
29843
30147
  }
29844
30148
  var isLE, byteSwap, swap8IfBE, byteSwap32, swap32IfBE, wrapCipher;
29845
- var init_utils3 = __esm({
30149
+ var init_utils4 = __esm({
29846
30150
  "../../node_modules/.pnpm/@noble+ciphers@2.2.0/node_modules/@noble/ciphers/utils.js"() {
29847
30151
  isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
29848
30152
  byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
@@ -29855,20 +30159,20 @@ var init_utils3 = __esm({
29855
30159
  swap32IfBE = isLE ? (u) => u : byteSwap32;
29856
30160
  wrapCipher = /* @__NO_SIDE_EFFECTS__ */ (params, constructor) => {
29857
30161
  function wrappedCipher(key, ...args) {
29858
- abytes3(key, void 0, "key");
30162
+ abytes4(key, void 0, "key");
29859
30163
  if (params.nonceLength !== void 0) {
29860
30164
  const nonce = args[0];
29861
- abytes3(nonce, params.varSizeNonce ? void 0 : params.nonceLength, "nonce");
30165
+ abytes4(nonce, params.varSizeNonce ? void 0 : params.nonceLength, "nonce");
29862
30166
  }
29863
30167
  const tagl = params.tagLength;
29864
30168
  if (tagl && args[1] !== void 0)
29865
- abytes3(args[1], void 0, "AAD");
30169
+ abytes4(args[1], void 0, "AAD");
29866
30170
  const cipher = constructor(key, ...args);
29867
30171
  const checkOutput = (fnLength, output) => {
29868
30172
  if (output !== void 0) {
29869
30173
  if (fnLength !== 2)
29870
30174
  throw new Error("cipher output not supported");
29871
- abytes3(output, void 0, "output");
30175
+ abytes4(output, void 0, "output");
29872
30176
  }
29873
30177
  };
29874
30178
  let called = false;
@@ -29877,12 +30181,12 @@ var init_utils3 = __esm({
29877
30181
  if (called)
29878
30182
  throw new Error("cannot encrypt() twice with same key + nonce");
29879
30183
  called = true;
29880
- abytes3(data);
30184
+ abytes4(data);
29881
30185
  checkOutput(cipher.encrypt.length, output);
29882
30186
  return cipher.encrypt(data, output);
29883
30187
  },
29884
30188
  decrypt(data, output) {
29885
- abytes3(data);
30189
+ abytes4(data);
29886
30190
  if (tagl && data.length < tagl)
29887
30191
  throw new Error('"ciphertext" expected length bigger than tagLength=' + tagl);
29888
30192
  checkOutput(cipher.decrypt.length, output);
@@ -29947,20 +30251,20 @@ function runCipher(core, sigma, key, nonce, data, output, counter, rounds) {
29947
30251
  }
29948
30252
  }
29949
30253
  function createCipher(core, opts) {
29950
- const { allowShortKeys, extendNonceFn, counterLength, counterRight, rounds } = checkOpts({ allowShortKeys: false, counterLength: 8, counterRight: false, rounds: 20 }, opts);
30254
+ const { allowShortKeys, extendNonceFn, counterLength, counterRight, rounds } = checkOpts2({ allowShortKeys: false, counterLength: 8, counterRight: false, rounds: 20 }, opts);
29951
30255
  if (typeof core !== "function")
29952
30256
  throw new Error("core must be a function");
29953
- anumber3(counterLength);
29954
- anumber3(rounds);
30257
+ anumber4(counterLength);
30258
+ anumber4(rounds);
29955
30259
  abool2(counterRight);
29956
30260
  abool2(allowShortKeys);
29957
30261
  return (key, nonce, data, output, counter = 0) => {
29958
- abytes3(key, void 0, "key");
29959
- abytes3(nonce, void 0, "nonce");
29960
- abytes3(data, void 0, "data");
30262
+ abytes4(key, void 0, "key");
30263
+ abytes4(nonce, void 0, "nonce");
30264
+ abytes4(data, void 0, "data");
29961
30265
  const len = data.length;
29962
30266
  output = getOutput(len, output, false);
29963
- anumber3(counter);
30267
+ anumber4(counter);
29964
30268
  if (counter < 0 || counter >= MAX_COUNTER)
29965
30269
  throw new Error("arx: counter overflow");
29966
30270
  const toClean = [];
@@ -29977,7 +30281,7 @@ function createCipher(core, opts) {
29977
30281
  sigma = sigma16_32;
29978
30282
  toClean.push(k2);
29979
30283
  } else {
29980
- abytes3(key, 32, "arx key");
30284
+ abytes4(key, 32, "arx key");
29981
30285
  throw new Error("invalid key size");
29982
30286
  }
29983
30287
  if (!isLE || !isAligned32(nonce))
@@ -29992,7 +30296,7 @@ function createCipher(core, opts) {
29992
30296
  else {
29993
30297
  const sigmaRaw = swap32IfBE(Uint32Array.from(sigma));
29994
30298
  extendNonceFn(sigmaRaw, k32, u32(n16), k32);
29995
- clean2(sigmaRaw);
30299
+ clean3(sigmaRaw);
29996
30300
  swap32IfBE(k32);
29997
30301
  }
29998
30302
  nonce = nonce.subarray(16);
@@ -30012,14 +30316,14 @@ function createCipher(core, opts) {
30012
30316
  runCipher(core, sigma, k32, n32, data, output, counter, rounds);
30013
30317
  return output;
30014
30318
  } finally {
30015
- clean2(...toClean);
30319
+ clean3(...toClean);
30016
30320
  }
30017
30321
  };
30018
30322
  }
30019
30323
  var encodeStr, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY;
30020
30324
  var init_arx = __esm({
30021
30325
  "../../node_modules/.pnpm/@noble+ciphers@2.2.0/node_modules/@noble/ciphers/_arx.js"() {
30022
- init_utils3();
30326
+ init_utils4();
30023
30327
  encodeStr = (str) => Uint8Array.from(str.split(""), (c) => c.charCodeAt(0));
30024
30328
  sigma16_32 = /* @__PURE__ */ (() => swap32IfBE(u32(encodeStr("expand 16-byte k"))))();
30025
30329
  sigma32_32 = /* @__PURE__ */ (() => swap32IfBE(u32(encodeStr("expand 32-byte k"))))();
@@ -30037,7 +30341,7 @@ function u8to16(a, i) {
30037
30341
  var Poly1305, poly1305;
30038
30342
  var init_poly1305 = __esm({
30039
30343
  "../../node_modules/.pnpm/@noble+ciphers@2.2.0/node_modules/@noble/ciphers/_poly1305.js"() {
30040
- init_utils3();
30344
+ init_utils4();
30041
30345
  Poly1305 = class {
30042
30346
  blockLen = 16;
30043
30347
  outputLen = 16;
@@ -30051,7 +30355,7 @@ var init_poly1305 = __esm({
30051
30355
  destroyed = false;
30052
30356
  // Can be speed-up using BigUint64Array, at the cost of complexity
30053
30357
  constructor(key) {
30054
- key = copyBytes2(abytes3(key, 32, "key"));
30358
+ key = copyBytes2(abytes4(key, 32, "key"));
30055
30359
  const t0 = u8to16(key, 0);
30056
30360
  const t1 = u8to16(key, 2);
30057
30361
  const t2 = u8to16(key, 4);
@@ -30227,11 +30531,11 @@ var init_poly1305 = __esm({
30227
30531
  f = (h[i] + pad[i] | 0) + (f >>> 16) | 0;
30228
30532
  h[i] = f & 65535;
30229
30533
  }
30230
- clean2(g);
30534
+ clean3(g);
30231
30535
  }
30232
30536
  update(data) {
30233
- aexists2(this);
30234
- abytes3(data);
30537
+ aexists3(this);
30538
+ abytes4(data);
30235
30539
  data = copyBytes2(data);
30236
30540
  const { buffer, blockLen } = this;
30237
30541
  const len = data.length;
@@ -30254,11 +30558,11 @@ var init_poly1305 = __esm({
30254
30558
  }
30255
30559
  destroy() {
30256
30560
  this.destroyed = true;
30257
- clean2(this.h, this.r, this.buffer, this.pad);
30561
+ clean3(this.h, this.r, this.buffer, this.pad);
30258
30562
  }
30259
30563
  digestInto(out) {
30260
- aexists2(this);
30261
- aoutput2(out, this);
30564
+ aexists3(this);
30565
+ aoutput3(out, this);
30262
30566
  this.finished = true;
30263
30567
  const { buffer, h } = this;
30264
30568
  let { pos } = this;
@@ -30456,7 +30760,7 @@ function hchacha(s, k2, i, out) {
30456
30760
  }
30457
30761
  function computeTag(fn, key, nonce, ciphertext, AAD) {
30458
30762
  if (AAD !== void 0)
30459
- abytes3(AAD, void 0, "AAD");
30763
+ abytes4(AAD, void 0, "AAD");
30460
30764
  const authKey = fn(key, nonce, ZEROS32);
30461
30765
  const lengths = u64Lengths(ciphertext.length, AAD ? AAD.length : 0, true);
30462
30766
  const h = poly1305.create(authKey);
@@ -30465,7 +30769,7 @@ function computeTag(fn, key, nonce, ciphertext, AAD) {
30465
30769
  updatePadded(h, ciphertext);
30466
30770
  h.update(lengths);
30467
30771
  const res = h.digest();
30468
- clean2(authKey, lengths);
30772
+ clean3(authKey, lengths);
30469
30773
  return res;
30470
30774
  }
30471
30775
  var xchacha20, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, xchacha20poly1305;
@@ -30473,7 +30777,7 @@ var init_chacha = __esm({
30473
30777
  "../../node_modules/.pnpm/@noble+ciphers@2.2.0/node_modules/@noble/ciphers/chacha.js"() {
30474
30778
  init_arx();
30475
30779
  init_poly1305();
30476
- init_utils3();
30780
+ init_utils4();
30477
30781
  xchacha20 = /* @__PURE__ */ createCipher(chachaCore, {
30478
30782
  counterRight: false,
30479
30783
  counterLength: 8,
@@ -30499,7 +30803,7 @@ var init_chacha = __esm({
30499
30803
  xorStream(key, nonce, oPlain, oPlain, 1);
30500
30804
  const tag2 = computeTag(xorStream, key, nonce, oPlain, AAD);
30501
30805
  output.set(tag2, plength);
30502
- clean2(tag2);
30806
+ clean3(tag2);
30503
30807
  return output;
30504
30808
  },
30505
30809
  decrypt(ciphertext, output) {
@@ -30508,12 +30812,12 @@ var init_chacha = __esm({
30508
30812
  const passedTag = ciphertext.subarray(-tagLength);
30509
30813
  const tag2 = computeTag(xorStream, key, nonce, data, AAD);
30510
30814
  if (!equalBytes2(passedTag, tag2)) {
30511
- clean2(tag2);
30815
+ clean3(tag2);
30512
30816
  throw new Error("invalid tag");
30513
30817
  }
30514
30818
  output.set(ciphertext.subarray(0, -tagLength));
30515
30819
  xorStream(key, nonce, output, output, 1);
30516
- clean2(tag2);
30820
+ clean3(tag2);
30517
30821
  return output;
30518
30822
  }
30519
30823
  };
@@ -30530,7 +30834,7 @@ var SEQ, NONCE, HEADER, FrameSealer, FrameOpener;
30530
30834
  var init_frame = __esm({
30531
30835
  "../e2e/dist/frame.js"() {
30532
30836
  init_chacha();
30533
- init_utils();
30837
+ init_utils3();
30534
30838
  init_bytes();
30535
30839
  SEQ = 8;
30536
30840
  NONCE = 24;
@@ -30543,7 +30847,7 @@ var init_frame = __esm({
30543
30847
  }
30544
30848
  seal(plaintext) {
30545
30849
  const seqBytes = u64be(this.seq);
30546
- const nonce = randomBytes3(NONCE);
30850
+ const nonce = randomBytes5(NONCE);
30547
30851
  const ct3 = xchacha20poly1305(this.key, nonce, seqBytes).encrypt(plaintext);
30548
30852
  this.seq += 1;
30549
30853
  return concatBytes3(seqBytes, nonce, ct3);
@@ -30663,7 +30967,7 @@ async function loadOrCreateIdentity(path72 = defaultIdentityPath()) {
30663
30967
  }
30664
30968
  if (hex !== null) {
30665
30969
  try {
30666
- const secretKey = hexToBytes(hex);
30970
+ const secretKey = hexToBytes3(hex);
30667
30971
  if (secretKey.length === 32) {
30668
30972
  return { secretKey, publicKey: publicKeyFromSecret(secretKey) };
30669
30973
  }
@@ -30671,12 +30975,12 @@ async function loadOrCreateIdentity(path72 = defaultIdentityPath()) {
30671
30975
  }
30672
30976
  }
30673
30977
  const identity = generateIdentity();
30674
- await writeFileAtomic(path72, bytesToHex(identity.secretKey), { mode: 384 });
30978
+ await writeFileAtomic(path72, bytesToHex3(identity.secretKey), { mode: 384 });
30675
30979
  return identity;
30676
30980
  }
30677
30981
  var init_node2 = __esm({
30678
30982
  "../e2e/dist/node.js"() {
30679
- init_utils();
30983
+ init_utils3();
30680
30984
  init_identity();
30681
30985
  }
30682
30986
  });
@@ -32919,7 +33223,7 @@ var require_websocket = __commonJS({
32919
33223
  var http = __require("http");
32920
33224
  var net3 = __require("net");
32921
33225
  var tls = __require("tls");
32922
- var { randomBytes: randomBytes8, createHash: createHash10 } = __require("crypto");
33226
+ var { randomBytes: randomBytes9, createHash: createHash10 } = __require("crypto");
32923
33227
  var { Duplex, Readable } = __require("stream");
32924
33228
  var { URL: URL2 } = __require("url");
32925
33229
  var PerMessageDeflate2 = require_permessage_deflate();
@@ -33457,7 +33761,7 @@ var require_websocket = __commonJS({
33457
33761
  }
33458
33762
  }
33459
33763
  const defaultPort = isSecure ? 443 : 80;
33460
- const key = randomBytes8(16).toString("base64");
33764
+ const key = randomBytes9(16).toString("base64");
33461
33765
  const request = isSecure ? https.request : http.request;
33462
33766
  const protocolSet = /* @__PURE__ */ new Set();
33463
33767
  let perMessageDeflate;
@@ -44743,8 +45047,8 @@ function planChapter(events, live, opts) {
44743
45047
  let to = -1;
44744
45048
  for (let i = 0; i < candidates.length; i++) {
44745
45049
  const next = candidates[i];
44746
- const clean3 = events.every((e2) => !isProjected(e2) || e2.seq < candidates[0].from || e2.seq > next.to || covered(e2.seq));
44747
- if (!clean3)
45050
+ const clean4 = events.every((e2) => !isProjected(e2) || e2.seq < candidates[0].from || e2.seq > next.to || covered(e2.seq));
45051
+ if (!clean4)
44748
45052
  break;
44749
45053
  taken = i + 1;
44750
45054
  to = next.to;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/cli",
3
- "version": "0.41.0",
3
+ "version": "0.41.1",
4
4
  "description": "moxxy command-line agent: TUI, one-shot prompts, setup, services, and API-key or installed-CLI subscription providers.",
5
5
  "keywords": [
6
6
  "moxxy",
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "undici": "^6.28.0",
51
51
  "zod": "^3.25.76",
52
- "@moxxy/sdk": "0.41.0"
52
+ "@moxxy/sdk": "0.41.1"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@napi-rs/keyring": "^1.3.0"