@agentvault/claude-bridge 0.8.17 → 0.8.19

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.
package/dist/index.js CHANGED
@@ -2801,14 +2801,14 @@ function base58Encode(bytes) {
2801
2801
  else
2802
2802
  break;
2803
2803
  }
2804
- let num = BigInt(0);
2804
+ let num2 = BigInt(0);
2805
2805
  for (const b22 of bytes) {
2806
- num = num * 256n + BigInt(b22);
2806
+ num2 = num2 * 256n + BigInt(b22);
2807
2807
  }
2808
2808
  let result = "";
2809
- while (num > 0n) {
2810
- const remainder = Number(num % 58n);
2811
- num = num / 58n;
2809
+ while (num2 > 0n) {
2810
+ const remainder = Number(num2 % 58n);
2811
+ num2 = num2 / 58n;
2812
2812
  result = BASE58_ALPHABET[remainder] + result;
2813
2813
  }
2814
2814
  return "1".repeat(zeros) + result;
@@ -2821,14 +2821,14 @@ function base58Decode(str) {
2821
2821
  else
2822
2822
  break;
2823
2823
  }
2824
- let num = BigInt(0);
2824
+ let num2 = BigInt(0);
2825
2825
  for (const c22 of str.slice(zeros)) {
2826
2826
  const idx = BASE58_ALPHABET.indexOf(c22);
2827
2827
  if (idx === -1)
2828
2828
  throw new Error(`Invalid base58 character: ${c22}`);
2829
- num = num * 58n + BigInt(idx);
2829
+ num2 = num2 * 58n + BigInt(idx);
2830
2830
  }
2831
- const hex32 = num === 0n ? "" : num.toString(16).padStart(2, "0");
2831
+ const hex32 = num2 === 0n ? "" : num2.toString(16).padStart(2, "0");
2832
2832
  const paddedHex = hex32.length % 2 ? "0" + hex32 : hex32;
2833
2833
  const dataBytes = new Uint8Array((paddedHex.match(/.{2}/g) ?? []).map((b22) => parseInt(b22, 16)));
2834
2834
  const result = new Uint8Array(zeros + dataBytes.length);
@@ -2996,14 +2996,14 @@ function base58Encode2(bytes) {
2996
2996
  else
2997
2997
  break;
2998
2998
  }
2999
- let num = BigInt(0);
2999
+ let num2 = BigInt(0);
3000
3000
  for (const b22 of bytes) {
3001
- num = num * 256n + BigInt(b22);
3001
+ num2 = num2 * 256n + BigInt(b22);
3002
3002
  }
3003
3003
  let result = "";
3004
- while (num > 0n) {
3005
- const remainder = Number(num % 58n);
3006
- num = num / 58n;
3004
+ while (num2 > 0n) {
3005
+ const remainder = Number(num2 % 58n);
3006
+ num2 = num2 / 58n;
3007
3007
  result = BASE58_ALPHABET2[remainder] + result;
3008
3008
  }
3009
3009
  return "1".repeat(zeros) + result;
@@ -3016,14 +3016,14 @@ function base58Decode2(str) {
3016
3016
  else
3017
3017
  break;
3018
3018
  }
3019
- let num = BigInt(0);
3019
+ let num2 = BigInt(0);
3020
3020
  for (const c22 of str.slice(zeros)) {
3021
3021
  const idx = BASE58_ALPHABET2.indexOf(c22);
3022
3022
  if (idx === -1)
3023
3023
  throw new Error(`Invalid base58 character: ${c22}`);
3024
- num = num * 58n + BigInt(idx);
3024
+ num2 = num2 * 58n + BigInt(idx);
3025
3025
  }
3026
- const hex32 = num === 0n ? "" : num.toString(16).padStart(2, "0");
3026
+ const hex32 = num2 === 0n ? "" : num2.toString(16).padStart(2, "0");
3027
3027
  const paddedHex = hex32.length % 2 ? "0" + hex32 : hex32;
3028
3028
  const dataBytes = new Uint8Array((paddedHex.match(/.{2}/g) ?? []).map((b22) => parseInt(b22, 16)));
3029
3029
  const result = new Uint8Array(zeros + dataBytes.length);
@@ -3398,7 +3398,10 @@ function buildLlmSpan(opts) {
3398
3398
  "gen_ai.request.model": opts.model,
3399
3399
  "gen_ai.usage.input_tokens": opts.tokensInput,
3400
3400
  "gen_ai.usage.output_tokens": opts.tokensOutput,
3401
- "gen_ai.operation.name": "chat"
3401
+ "gen_ai.operation.name": "chat",
3402
+ // AgentVault extensions the backend ledger reads (telemetry_service.py
3403
+ // _fan_in_genai_ledger) — the same names the Hermes plugin sends.
3404
+ "av.genai.latency_ms": opts.latencyMs
3402
3405
  };
3403
3406
  if (opts.provider !== void 0) {
3404
3407
  attributes["ai.agent.llm.provider"] = opts.provider;
@@ -3407,6 +3410,7 @@ function buildLlmSpan(opts) {
3407
3410
  if (opts.costUsd !== void 0) {
3408
3411
  attributes["ai.agent.llm.cost_usd"] = opts.costUsd;
3409
3412
  attributes["gen_ai.usage.cost_usd"] = opts.costUsd;
3413
+ attributes["av.genai.cost_usd"] = opts.costUsd;
3410
3414
  }
3411
3415
  applySkillName(attributes, opts.skillName);
3412
3416
  const isError = opts.status === "error";
@@ -4018,6 +4022,9 @@ function spanToOtlp(span) {
4018
4022
  }
4019
4023
  return otlp;
4020
4024
  }
4025
+ function isRetryableStatus(status) {
4026
+ return status >= 500 || status === 408 || status === 429;
4027
+ }
4021
4028
  async function generateBackupCode() {
4022
4029
  await libsodium_wrappers_default.ready;
4023
4030
  const bytes = libsodium_wrappers_default.randombytes_buf(13);
@@ -7599,11 +7606,11 @@ function getOutput(expectedLength, out, onlyAligned = true) {
7599
7606
  }
7600
7607
  function u64Lengths(dataLength, aadLength, isLE5) {
7601
7608
  abool(isLE5);
7602
- const num = new Uint8Array(16);
7603
- const view = createView3(num);
7609
+ const num2 = new Uint8Array(16);
7610
+ const view = createView3(num2);
7604
7611
  view.setBigUint64(0, BigInt(aadLength), isLE5);
7605
7612
  view.setBigUint64(8, BigInt(dataLength), isLE5);
7606
- return num;
7613
+ return num2;
7607
7614
  }
7608
7615
  function isAligned32(bytes) {
7609
7616
  return bytes.byteOffset % 4 === 0;
@@ -8257,8 +8264,8 @@ function _abytes2(value, length, title = "") {
8257
8264
  }
8258
8265
  return value;
8259
8266
  }
8260
- function numberToHexUnpadded(num) {
8261
- const hex32 = num.toString(16);
8267
+ function numberToHexUnpadded(num2) {
8268
+ const hex32 = num2.toString(16);
8262
8269
  return hex32.length & 1 ? "0" + hex32 : hex32;
8263
8270
  }
8264
8271
  function hexToNumber3(hex32) {
@@ -8554,15 +8561,15 @@ function validateField(field) {
8554
8561
  _validateObject(field, opts);
8555
8562
  return field;
8556
8563
  }
8557
- function FpPow(Fp3, num, power) {
8564
+ function FpPow(Fp3, num2, power) {
8558
8565
  if (power < _0n3)
8559
8566
  throw new Error("invalid exponent, negatives unsupported");
8560
8567
  if (power === _0n3)
8561
8568
  return Fp3.ONE;
8562
8569
  if (power === _1n3)
8563
- return num;
8570
+ return num2;
8564
8571
  let p2 = Fp3.ONE;
8565
- let d22 = num;
8572
+ let d22 = num2;
8566
8573
  while (power > _0n3) {
8567
8574
  if (power & _1n3)
8568
8575
  p2 = Fp3.mul(p2, d22);
@@ -8573,18 +8580,18 @@ function FpPow(Fp3, num, power) {
8573
8580
  }
8574
8581
  function FpInvertBatch(Fp3, nums, passZero = false) {
8575
8582
  const inverted = new Array(nums.length).fill(passZero ? Fp3.ZERO : void 0);
8576
- const multipliedAcc = nums.reduce((acc, num, i2) => {
8577
- if (Fp3.is0(num))
8583
+ const multipliedAcc = nums.reduce((acc, num2, i2) => {
8584
+ if (Fp3.is0(num2))
8578
8585
  return acc;
8579
8586
  inverted[i2] = acc;
8580
- return Fp3.mul(acc, num);
8587
+ return Fp3.mul(acc, num2);
8581
8588
  }, Fp3.ONE);
8582
8589
  const invertedAcc = Fp3.inv(multipliedAcc);
8583
- nums.reduceRight((acc, num, i2) => {
8584
- if (Fp3.is0(num))
8590
+ nums.reduceRight((acc, num2, i2) => {
8591
+ if (Fp3.is0(num2))
8585
8592
  return acc;
8586
8593
  inverted[i2] = Fp3.mul(acc, inverted[i2]);
8587
- return Fp3.mul(acc, num);
8594
+ return Fp3.mul(acc, num2);
8588
8595
  }, invertedAcc);
8589
8596
  return inverted;
8590
8597
  }
@@ -8644,36 +8651,36 @@ function Field(ORDER, bitLenOrOpts, isLE5 = false, opts = {}) {
8644
8651
  ZERO: _0n3,
8645
8652
  ONE: _1n3,
8646
8653
  allowedLengths,
8647
- create: (num) => mod3(num, ORDER),
8648
- isValid: (num) => {
8649
- if (typeof num !== "bigint")
8650
- throw new Error("invalid field element: expected bigint, got " + typeof num);
8651
- return _0n3 <= num && num < ORDER;
8654
+ create: (num2) => mod3(num2, ORDER),
8655
+ isValid: (num2) => {
8656
+ if (typeof num2 !== "bigint")
8657
+ throw new Error("invalid field element: expected bigint, got " + typeof num2);
8658
+ return _0n3 <= num2 && num2 < ORDER;
8652
8659
  },
8653
- is0: (num) => num === _0n3,
8660
+ is0: (num2) => num2 === _0n3,
8654
8661
  // is valid and invertible
8655
- isValidNot0: (num) => !f22.is0(num) && f22.isValid(num),
8656
- isOdd: (num) => (num & _1n3) === _1n3,
8657
- neg: (num) => mod3(-num, ORDER),
8662
+ isValidNot0: (num2) => !f22.is0(num2) && f22.isValid(num2),
8663
+ isOdd: (num2) => (num2 & _1n3) === _1n3,
8664
+ neg: (num2) => mod3(-num2, ORDER),
8658
8665
  eql: (lhs, rhs) => lhs === rhs,
8659
- sqr: (num) => mod3(num * num, ORDER),
8666
+ sqr: (num2) => mod3(num2 * num2, ORDER),
8660
8667
  add: (lhs, rhs) => mod3(lhs + rhs, ORDER),
8661
8668
  sub: (lhs, rhs) => mod3(lhs - rhs, ORDER),
8662
8669
  mul: (lhs, rhs) => mod3(lhs * rhs, ORDER),
8663
- pow: (num, power) => FpPow(f22, num, power),
8670
+ pow: (num2, power) => FpPow(f22, num2, power),
8664
8671
  div: (lhs, rhs) => mod3(lhs * invert(rhs, ORDER), ORDER),
8665
8672
  // Same as above, but doesn't normalize
8666
- sqrN: (num) => num * num,
8673
+ sqrN: (num2) => num2 * num2,
8667
8674
  addN: (lhs, rhs) => lhs + rhs,
8668
8675
  subN: (lhs, rhs) => lhs - rhs,
8669
8676
  mulN: (lhs, rhs) => lhs * rhs,
8670
- inv: (num) => invert(num, ORDER),
8677
+ inv: (num2) => invert(num2, ORDER),
8671
8678
  sqrt: _sqrt || ((n22) => {
8672
8679
  if (!sqrtP)
8673
8680
  sqrtP = FpSqrt(ORDER);
8674
8681
  return sqrtP(f22, n22);
8675
8682
  }),
8676
- toBytes: (num) => isLE5 ? numberToBytesLE2(num, BYTES) : numberToBytesBE2(num, BYTES),
8683
+ toBytes: (num2) => isLE5 ? numberToBytesLE2(num2, BYTES) : numberToBytesBE2(num2, BYTES),
8677
8684
  fromBytes: (bytes, skipValidation = true) => {
8678
8685
  if (allowedLengths) {
8679
8686
  if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) {
@@ -8724,8 +8731,8 @@ function mapHashToField(key, fieldOrder, isLE5 = false) {
8724
8731
  const minLen = getMinHashLength(fieldOrder);
8725
8732
  if (len < 16 || len < minLen || len > 1024)
8726
8733
  throw new Error("expected " + minLen + "-1024 bytes of input, got " + len);
8727
- const num = isLE5 ? bytesToNumberLE2(key) : bytesToNumberBE(key);
8728
- const reduced = mod3(num, fieldOrder - _1n3) + _1n3;
8734
+ const num2 = isLE5 ? bytesToNumberLE2(key) : bytesToNumberBE(key);
8735
+ const reduced = mod3(num2, fieldOrder - _1n3) + _1n3;
8729
8736
  return isLE5 ? numberToBytesLE2(reduced, fieldLen) : numberToBytesBE2(reduced, fieldLen);
8730
8737
  }
8731
8738
  function negateCt(condition, item) {
@@ -9454,8 +9461,8 @@ function hash_to_field(msg, count, options) {
9454
9461
  function createHasher4(Point, mapToCurve, defaults) {
9455
9462
  if (typeof mapToCurve !== "function")
9456
9463
  throw new Error("mapToCurve() must be defined");
9457
- function map22(num) {
9458
- return Point.fromAffine(mapToCurve(num));
9464
+ function map22(num2) {
9465
+ return Point.fromAffine(mapToCurve(num2));
9459
9466
  }
9460
9467
  function clear(initial) {
9461
9468
  const P22 = initial.clearCofactor();
@@ -9978,20 +9985,20 @@ function validateSigOpts(opts, def) {
9978
9985
  }
9979
9986
  function _normFnElement(Fn3, key) {
9980
9987
  const { BYTES: expected } = Fn3;
9981
- let num;
9988
+ let num2;
9982
9989
  if (typeof key === "bigint") {
9983
- num = key;
9990
+ num2 = key;
9984
9991
  } else {
9985
9992
  let bytes = ensureBytes("private key", key);
9986
9993
  try {
9987
- num = Fn3.fromBytes(bytes);
9994
+ num2 = Fn3.fromBytes(bytes);
9988
9995
  } catch (error210) {
9989
9996
  throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`);
9990
9997
  }
9991
9998
  }
9992
- if (!Fn3.isValidNot0(num))
9999
+ if (!Fn3.isValidNot0(num2))
9993
10000
  throw new Error("invalid private key: out of range [1..N-1]");
9994
- return num;
10001
+ return num2;
9995
10002
  }
9996
10003
  function weierstrassN(params, extraOpts = {}) {
9997
10004
  const validated = _createCurveFields("weierstrass", params, extraOpts);
@@ -10646,10 +10653,10 @@ function ecdsa(Point, hash22, ecdsaOpts = {}) {
10646
10653
  const HALF = CURVE_ORDER >> _1n10;
10647
10654
  return number32 > HALF;
10648
10655
  }
10649
- function validateRS(title, num) {
10650
- if (!Fn3.isValidNot0(num))
10656
+ function validateRS(title, num2) {
10657
+ if (!Fn3.isValidNot0(num2))
10651
10658
  throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`);
10652
- return num;
10659
+ return num2;
10653
10660
  }
10654
10661
  function validateSigLength(bytes, format2) {
10655
10662
  validateSigFormat(format2);
@@ -10759,17 +10766,17 @@ function ecdsa(Point, hash22, ecdsaOpts = {}) {
10759
10766
  const bits2int = ecdsaOpts.bits2int || function bits2int_def(bytes) {
10760
10767
  if (bytes.length > 8192)
10761
10768
  throw new Error("input is too large");
10762
- const num = bytesToNumberBE(bytes);
10769
+ const num2 = bytesToNumberBE(bytes);
10763
10770
  const delta = bytes.length * 8 - fnBits;
10764
- return delta > 0 ? num >> BigInt(delta) : num;
10771
+ return delta > 0 ? num2 >> BigInt(delta) : num2;
10765
10772
  };
10766
10773
  const bits2int_modN = ecdsaOpts.bits2int_modN || function bits2int_modN_def(bytes) {
10767
10774
  return Fn3.create(bits2int(bytes));
10768
10775
  };
10769
10776
  const ORDER_MASK = bitMask(fnBits);
10770
- function int2octets(num) {
10771
- aInRange2("num < 2^" + fnBits, num, _0n9, ORDER_MASK);
10772
- return Fn3.toBytes(num);
10777
+ function int2octets(num2) {
10778
+ aInRange2("num < 2^" + fnBits, num2, _0n9, ORDER_MASK);
10779
+ return Fn3.toBytes(num2);
10773
10780
  }
10774
10781
  function validateMsgAndHash(message, prehash) {
10775
10782
  _abytes2(message, void 0, "message");
@@ -11272,11 +11279,11 @@ function computeTag2(fn, isLE5, key, data, AAD) {
11272
11279
  const h22 = fn.create(key, data.length + aadLength);
11273
11280
  if (AAD)
11274
11281
  h22.update(AAD);
11275
- const num = u64Lengths(8 * data.length, 8 * aadLength, isLE5);
11282
+ const num2 = u64Lengths(8 * data.length, 8 * aadLength, isLE5);
11276
11283
  h22.update(data);
11277
- h22.update(num);
11284
+ h22.update(num2);
11278
11285
  const res = h22.digest();
11279
- clean3(num);
11286
+ clean3(num2);
11280
11287
  return res;
11281
11288
  }
11282
11289
  function isBytes32(a2) {
@@ -11662,11 +11669,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11662
11669
  return null;
11663
11670
  }
11664
11671
  function ownIdentity() {
11665
- const v22 = true ? "0.23.45" : FALLBACK;
11672
+ const v22 = true ? "0.23.47" : FALLBACK;
11666
11673
  return `${PACKAGE}@${v22}`;
11667
11674
  }
11668
11675
  function buildSha() {
11669
- const raw = true ? "af0ab83" : "";
11676
+ const raw = true ? "f1debc4" : "";
11670
11677
  const cleaned = (raw ?? "").trim();
11671
11678
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11672
11679
  }
@@ -12172,6 +12179,25 @@ async function runHistoryRecoveryCommand(input) {
12172
12179
  });
12173
12180
  output("Agent history recovery: configured");
12174
12181
  }
12182
+ function decisionReplyFromEnvelope(parsed) {
12183
+ if (parsed === null || typeof parsed !== "object") return void 0;
12184
+ const decision = parsed.decision;
12185
+ if (decision === null || typeof decision !== "object") return void 0;
12186
+ const d22 = decision;
12187
+ if (typeof d22.decision_id !== "string" || d22.decision_id.length === 0) return void 0;
12188
+ if (Array.isArray(d22.options)) return void 0;
12189
+ const selected = typeof d22.selected_option_id === "string" ? d22.selected_option_id : void 0;
12190
+ const action = typeof d22.action === "string" && ACTIONS.has(d22.action) ? d22.action : void 0;
12191
+ if (selected === void 0 && action === void 0) return void 0;
12192
+ const reply = { decision_id: d22.decision_id };
12193
+ if (selected !== void 0) reply.selected_option_id = selected;
12194
+ if (action !== void 0) reply.action = action;
12195
+ if (typeof d22.resolved_at === "string") reply.resolved_at = d22.resolved_at;
12196
+ if (typeof d22.defer_until === "string") reply.defer_until = d22.defer_until;
12197
+ if (typeof d22.defer_reason === "string") reply.defer_reason = d22.defer_reason;
12198
+ if (typeof d22.reason === "string") reply.reason = d22.reason;
12199
+ return reply;
12200
+ }
12175
12201
  async function readBoundedRestoreJson(response, signal, checkpoint) {
12176
12202
  const contentLength = response.headers?.get("content-length");
12177
12203
  if (contentLength && /^\d+$/.test(contentLength)) {
@@ -17160,7 +17186,7 @@ function writeFromReadableStream(stream, writable) {
17160
17186
  }
17161
17187
  return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
17162
17188
  }
17163
- var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, U32_MASK64, _32n, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, B2B_IV, BBUF, _BLAKE2, _BLAKE2b, blake2b, init_blake2, CROCKFORD2, SALT_BYTES2, NONCE_BYTES2, KEY_BYTES2, TAG_BYTES, ENVELOPE_OVERHEAD, AAD_PREFIX, UUID_RE, UUID_V4_RE, DIGEST_ID_RE, TIMESTAMP_RE, encoder, decoder, HISTORY_MAGIC, HISTORY_ARCHIVE_VERSION, HISTORY_MAX_ENTRIES, HISTORY_MAX_BLOB_BYTES, HISTORY_KDF_OPSLIMIT, HISTORY_KDF_MEMLIMIT, HistoryEntryTooLargeError, init_history_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE2, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md2, U32_MASK642, _32n2, init_u642, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE3, wrapCipher, init_utils2, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto2, init_cryptoNode, isLE4, swap32IfBE3, hasHexBuiltin2, hexes2, asciis, Hash, init_utils3, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils4, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES3, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE2, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE3, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
17189
+ var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, U32_MASK64, _32n, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, B2B_IV, BBUF, _BLAKE2, _BLAKE2b, blake2b, init_blake2, CROCKFORD2, SALT_BYTES2, NONCE_BYTES2, KEY_BYTES2, TAG_BYTES, ENVELOPE_OVERHEAD, AAD_PREFIX, UUID_RE, UUID_V4_RE, DIGEST_ID_RE, TIMESTAMP_RE, encoder, decoder, HISTORY_MAGIC, HISTORY_ARCHIVE_VERSION, HISTORY_MAX_ENTRIES, HISTORY_MAX_BLOB_BYTES, HISTORY_KDF_OPSLIMIT, HISTORY_KDF_MEMLIMIT, HistoryEntryTooLargeError, init_history_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE2, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md2, U32_MASK642, _32n2, init_u642, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE3, wrapCipher, init_utils2, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto2, init_cryptoNode, isLE4, swap32IfBE3, hasHexBuiltin2, hexes2, asciis, Hash, init_utils3, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils4, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES3, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE2, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE3, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, OPENROUTER_PRICING, init_llm_pricing_openrouter, LEGACY_PRICING, PRICING, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
17164
17190
  var init_dist = __esm({
17165
17191
  async "../plugin/dist/index.js"() {
17166
17192
  "use strict";
@@ -59983,7 +60009,11 @@ var init_dist = __esm({
59983
60009
  _agentName;
59984
60010
  _agentVersion;
59985
60011
  _pluginVersion;
60012
+ _maxRetries;
60013
+ _maxBufferedSpans;
59986
60014
  _buffer = [];
60015
+ /** Failed send attempts per buffered span. */
60016
+ _attempts = /* @__PURE__ */ new WeakMap();
59987
60017
  _timer = null;
59988
60018
  constructor(config22) {
59989
60019
  this._apiBase = config22.apiBase.replace(/\/+$/, "");
@@ -59993,6 +60023,8 @@ var init_dist = __esm({
59993
60023
  this._agentName = config22.agentName ?? "unknown";
59994
60024
  this._agentVersion = config22.agentVersion ?? "0.0.0";
59995
60025
  this._pluginVersion = config22.pluginVersion ?? "0.0.0";
60026
+ this._maxRetries = Math.max(1, config22.maxRetries ?? 5);
60027
+ this._maxBufferedSpans = Math.max(1, config22.maxBufferedSpans ?? 1e3);
59996
60028
  }
59997
60029
  /** Number of spans waiting to be flushed. */
59998
60030
  get pendingCount() {
@@ -60040,7 +60072,9 @@ var init_dist = __esm({
60040
60072
  * POST all buffered spans to the backend ingest endpoint.
60041
60073
  *
60042
60074
  * - On success (HTTP 2xx): clears the buffer.
60043
- * - On failure: keeps spans in the buffer for retry.
60075
+ * - On a retryable failure (network, 5xx, 408, 429): keeps spans for retry,
60076
+ * bounded by `maxRetries` per span and `maxBufferedSpans` overall.
60077
+ * - On any other 4xx: drops the batch (it can never be accepted).
60044
60078
  * - Never throws — telemetry is best-effort.
60045
60079
  */
60046
60080
  async flush() {
@@ -60069,13 +60103,23 @@ var init_dist = __esm({
60069
60103
  spans: spans.map(spanToOtlp)
60070
60104
  })
60071
60105
  });
60072
- if (!response.ok) {
60073
- this._buffer = spans.concat(this._buffer);
60106
+ if (!response.ok && isRetryableStatus(response.status)) {
60107
+ this._requeue(spans);
60074
60108
  }
60075
60109
  } catch {
60076
- this._buffer = spans.concat(this._buffer);
60110
+ this._requeue(spans);
60077
60111
  }
60078
60112
  }
60113
+ /** Put a failed batch back in front of newer spans, within both caps. */
60114
+ _requeue(spans) {
60115
+ const retained = spans.filter((span) => {
60116
+ const attempts = (this._attempts.get(span) ?? 0) + 1;
60117
+ this._attempts.set(span, attempts);
60118
+ return attempts < this._maxRetries;
60119
+ });
60120
+ const merged = retained.concat(this._buffer);
60121
+ this._buffer = merged.length > this._maxBufferedSpans ? merged.slice(merged.length - this._maxBufferedSpans) : merged;
60122
+ }
60079
60123
  // -- Auto-flush -------------------------------------------------------------
60080
60124
  /**
60081
60125
  * Start a periodic flush timer.
@@ -66492,7 +66536,7 @@ var init_dist = __esm({
66492
66536
  _8n = /* @__PURE__ */ BigInt(8);
66493
66537
  _9n = /* @__PURE__ */ BigInt(9);
66494
66538
  _16n = /* @__PURE__ */ BigInt(16);
66495
- isNegativeLE = (num, modulo) => (mod3(num, modulo) & _1n3) === _1n3;
66539
+ isNegativeLE = (num2, modulo) => (mod3(num2, modulo) & _1n3) === _1n3;
66496
66540
  FIELD_FIELDS = [
66497
66541
  "create",
66498
66542
  "isValid",
@@ -67428,7 +67472,7 @@ var init_dist = __esm({
67428
67472
  init_utils4();
67429
67473
  init_curve2();
67430
67474
  init_modular2();
67431
- divNearest = (num, den) => (num + (num >= 0 ? den : -den) / _2n8) / den;
67475
+ divNearest = (num2, den) => (num2 + (num2 >= 0 ? den : -den) / _2n8) / den;
67432
67476
  DERErr = class extends Error {
67433
67477
  constructor(m22 = "") {
67434
67478
  super(m22);
@@ -67494,11 +67538,11 @@ var init_dist = __esm({
67494
67538
  // - add zero byte if exists
67495
67539
  // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
67496
67540
  _int: {
67497
- encode(num) {
67541
+ encode(num2) {
67498
67542
  const { Err: E22 } = DER;
67499
- if (num < _0n9)
67543
+ if (num2 < _0n9)
67500
67544
  throw new E22("integer: negative integers are not allowed");
67501
- let hex32 = numberToHexUnpadded(num);
67545
+ let hex32 = numberToHexUnpadded(num2);
67502
67546
  if (Number.parseInt(hex32[0], 16) & 8)
67503
67547
  hex32 = "00" + hex32;
67504
67548
  if (hex32.length & 1)
@@ -68243,9 +68287,9 @@ var init_dist = __esm({
68243
68287
  let o0 = 0, o1 = 0, o22 = 0, o32 = 0;
68244
68288
  const mask = (1 << W22) - 1;
68245
68289
  let w2 = 0;
68246
- for (const num of [s02, s1, s22, s32]) {
68290
+ for (const num2 of [s02, s1, s22, s32]) {
68247
68291
  for (let bytePos = 0; bytePos < 4; bytePos++) {
68248
- const byte = num >>> 8 * bytePos & 255;
68292
+ const byte = num2 >>> 8 * bytePos & 255;
68249
68293
  for (let bitPos = 8 / W22 - 1; bitPos >= 0; bitPos--) {
68250
68294
  const bit = byte >>> W22 * bitPos & mask;
68251
68295
  const { s0: e02, s1: e12, s2: e22, s3: e32 } = t22[w2 * windowSize + bit];
@@ -69597,6 +69641,12 @@ var init_dist = __esm({
69597
69641
  };
69598
69642
  }
69599
69643
  });
69644
+ init_decision_reply = __esm2({
69645
+ "src/decision-reply.ts"() {
69646
+ "use strict";
69647
+ ACTIONS = /* @__PURE__ */ new Set(["approve", "deny", "defer", "cancel"]);
69648
+ }
69649
+ });
69600
69650
  history_backup_client_exports = {};
69601
69651
  __export2(history_backup_client_exports, {
69602
69652
  HISTORY_RESTORE_RESPONSE_MAX_BYTES: () => HISTORY_RESTORE_RESPONSE_MAX_BYTES,
@@ -69940,6 +69990,7 @@ var init_dist = __esm({
69940
69990
  init_mls_membership_probe();
69941
69991
  init_history_backup_scheduler();
69942
69992
  await init_history_recovery_code();
69993
+ init_decision_reply();
69943
69994
  ROOM_AGENT_TYPES = /* @__PURE__ */ new Set([
69944
69995
  "message",
69945
69996
  "text",
@@ -70225,9 +70276,12 @@ ${text}`;
70225
70276
  // Reset at the start of every `_connect`.
70226
70277
  _authFailedThisSession = false;
70227
70278
  // Last observed WebSocket close code, captured by the ws.on("close", ...)
70228
- // handler. Used by the rapid-disconnect classifier to surface
70229
- // server-driven "session_replaced" events (close codes 4000 / 4001).
70279
+ // handler. Used by the rapid-disconnect classifier: 4001 = server rejected
70280
+ // the credentials (auth_failed); 4000 = reserved "session_replaced".
70230
70281
  _lastCloseCode = null;
70282
+ // True while a once("ready") listener is waiting to honour config.httpPort,
70283
+ // so repeated start() calls do not stack listeners.
70284
+ _httpPortListenerArmed = false;
70231
70285
  // Liveness detection: server sends app-level {"event":"ping"} every 30s.
70232
70286
  // We check every 30s; if no data received in 90s (3 missed pings), connection is dead.
70233
70287
  static PING_INTERVAL_MS = 3e4;
@@ -70529,10 +70583,19 @@ ${text}`;
70529
70583
  async start() {
70530
70584
  await this._stateSaveQueue;
70531
70585
  this._stopped = false;
70586
+ this._clearSuspendedWait();
70532
70587
  this._lifecycleGeneration += 1;
70533
70588
  this._historyBackupScheduler.stop();
70534
70589
  this._historyBackupScheduler = this._createHistoryBackupScheduler();
70535
70590
  await libsodium_wrappers_default.ready;
70591
+ const httpPort = this.config.httpPort;
70592
+ if (typeof httpPort === "number" && !this._httpPortListenerArmed) {
70593
+ this._httpPortListenerArmed = true;
70594
+ this.once("ready", () => {
70595
+ this._httpPortListenerArmed = false;
70596
+ if (!this._stopped) this.startHttpServer(httpPort);
70597
+ });
70598
+ }
70536
70599
  if (this._forceReEnroll) {
70537
70600
  console.log("[SecureChannel] forceReEnroll set \u2014 clearing cached credentials, will enroll fresh");
70538
70601
  await clearState(this.config.dataDir);
@@ -70875,7 +70938,24 @@ ${text}`;
70875
70938
  salt = libsodium_wrappers_default.randombytes_buf(16);
70876
70939
  }
70877
70940
  checkpoint();
70878
- const archive = buildHistoryArchive(state.hubId, state.messageHistory ?? []);
70941
+ const history = state.messageHistory ?? [];
70942
+ if (!Array.isArray(history)) throw new Error("entries must be an array");
70943
+ const snapshotEntries = /* @__PURE__ */ new Map();
70944
+ for (let index = 0; index < history.length; index += 1) {
70945
+ if (!(index in history)) throw new Error("entries must not be sparse");
70946
+ const entry = history[index];
70947
+ const legacyId = legacyHistoryEntryId(entry);
70948
+ const id = entry.id ?? legacyId;
70949
+ const previous = snapshotEntries.get(id);
70950
+ if (previous) {
70951
+ if (previous.sender !== entry.sender || previous.text !== entry.text || previous.ts !== entry.ts || previous.topicId !== entry.topicId) {
70952
+ throw new Error("History archive contains duplicate entry IDs");
70953
+ }
70954
+ continue;
70955
+ }
70956
+ snapshotEntries.set(id, { ...entry, id });
70957
+ }
70958
+ const archive = buildHistoryArchive(state.hubId, [...snapshotEntries.values()]);
70879
70959
  const requestedSaltHex = Buffer.from(salt).toString("hex");
70880
70960
  const cacheIdentity = `${state.hubId}:${codeHashHex}:${requestedSaltHex}`;
70881
70961
  checkpoint();
@@ -71605,7 +71685,7 @@ ${text}`;
71605
71685
  */
71606
71686
  sendActivitySpan(spanData) {
71607
71687
  if (!this._ws || this._ws.readyState !== WebSocket2.OPEN) return;
71608
- const pluginVersion = true ? "0.23.45" : "0.0.0-dev";
71688
+ const pluginVersion = true ? "0.23.47" : "0.0.0-dev";
71609
71689
  const agentName = this.config.agentName ?? "Agent";
71610
71690
  const resource = {
71611
71691
  "service.name": "agentvault-agent",
@@ -71684,16 +71764,27 @@ ${text}`;
71684
71764
  }
71685
71765
  /**
71686
71766
  * Wait for a decision response matching the given decisionId.
71687
- * Listens on the "message" event for messages where
71688
- * metadata.messageType === "decision_response" and the parsed plaintext
71689
- * contains a matching decision.decision_id.
71767
+ * Listens on the "message" event. Resolves when either:
71768
+ * - metadata.decision carries an answer for this decisionId — what every
71769
+ * receive path now lifts out of the app's envelope (an option selected,
71770
+ * or action "defer" / "cancel"); or
71771
+ * - legacy: metadata.messageType === "decision_response" and the
71772
+ * plaintext is the JSON envelope with a matching decision.decision_id.
71690
71773
  * Optional timeout rejects with an Error.
71691
71774
  */
71692
71775
  waitForDecision(decisionId, timeoutMs) {
71693
71776
  return new Promise((resolve42, reject) => {
71694
71777
  let timer = null;
71695
71778
  const handler = (plaintext, metadata) => {
71696
- if (metadata.messageType !== "decision_response") return;
71779
+ if (metadata?.roomId) return;
71780
+ const reply = metadata?.decision;
71781
+ if (reply && reply.decision_id === decisionId) {
71782
+ if (timer) clearTimeout(timer);
71783
+ this.removeListener("message", handler);
71784
+ resolve42(reply);
71785
+ return;
71786
+ }
71787
+ if (metadata?.messageType !== "decision_response") return;
71697
71788
  try {
71698
71789
  const parsed = JSON.parse(plaintext);
71699
71790
  if (parsed.decision?.decision_id === decisionId) {
@@ -72692,6 +72783,7 @@ ${text}`;
72692
72783
  clearTimeout(this._reconnectTimer);
72693
72784
  this._reconnectTimer = null;
72694
72785
  }
72786
+ this._clearSuspendedWait();
72695
72787
  if (this._telemetryReporter) {
72696
72788
  this._telemetryReporter.stopAutoFlush();
72697
72789
  await this._telemetryReporter.flush();
@@ -72805,7 +72897,12 @@ ${text}`;
72805
72897
  res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /decision, POST /action, GET /status, GET /targets, or /mcp" }));
72806
72898
  }
72807
72899
  });
72808
- this._httpServer.listen(port, "127.0.0.1", () => {
72900
+ const server = this._httpServer;
72901
+ server.on("error", (err) => {
72902
+ console.error(`[SecureChannel] local HTTP server on 127.0.0.1:${port} failed: ${err.message}`);
72903
+ if (this._httpServer === server) this._httpServer = null;
72904
+ });
72905
+ server.listen(port, "127.0.0.1", () => {
72809
72906
  this.emit("http-ready", port);
72810
72907
  });
72811
72908
  }
@@ -73345,8 +73442,13 @@ ${text}`;
73345
73442
  this.config.platform,
73346
73443
  this.config.expectedFramework
73347
73444
  );
73445
+ if (result.fingerprint && result.fingerprint !== fingerprint) {
73446
+ throw new Error(
73447
+ `Enrollment fingerprint mismatch: this agent's key is ${fingerprint} but the server reported ${result.fingerprint}. Not continuing \u2014 do not approve this device.`
73448
+ );
73449
+ }
73348
73450
  this._deviceId = result.device_id;
73349
- this._fingerprint = result.fingerprint;
73451
+ this._fingerprint = fingerprint;
73350
73452
  this._persisted = {
73351
73453
  deviceId: result.device_id,
73352
73454
  deviceJwt: "",
@@ -73363,7 +73465,7 @@ ${text}`;
73363
73465
  publicKey: bytesToHex2(ephemeral.publicKey),
73364
73466
  privateKey: bytesToHex2(ephemeral.privateKey)
73365
73467
  },
73366
- fingerprint: result.fingerprint,
73468
+ fingerprint,
73367
73469
  messageHistory: []
73368
73470
  };
73369
73471
  this._poll();
@@ -73578,7 +73680,7 @@ ${text}`;
73578
73680
  agentVersion: this.config.agentVersion ?? "0.0.0",
73579
73681
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
73580
73682
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
73581
- pluginVersion: true ? "0.23.45" : "0.0.0-dev"
73683
+ pluginVersion: true ? "0.23.47" : "0.0.0-dev"
73582
73684
  });
73583
73685
  this._telemetryReporter.startAutoFlush(3e4);
73584
73686
  }
@@ -73663,6 +73765,10 @@ ${text}`;
73663
73765
  await this._handleDeviceRevoked();
73664
73766
  return;
73665
73767
  }
73768
+ if (data.event === "device_suspended") {
73769
+ await this._handleDeviceSuspended();
73770
+ return;
73771
+ }
73666
73772
  if (data.event === "connection_rejected") {
73667
73773
  await this._handleConnectionRejected(data);
73668
73774
  return;
@@ -73902,7 +74008,7 @@ ${text}`;
73902
74008
  agentVersion: this.config.agentVersion ?? "0.0.0",
73903
74009
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
73904
74010
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
73905
- pluginVersion: true ? "0.23.45" : "0.0.0-dev"
74011
+ pluginVersion: true ? "0.23.47" : "0.0.0-dev"
73906
74012
  });
73907
74013
  this._telemetryReporter.startAutoFlush(3e4);
73908
74014
  }
@@ -74354,12 +74460,15 @@ ${text}`;
74354
74460
  let messageType = "text";
74355
74461
  let topicId = data.topic_id;
74356
74462
  let mlsAttachment = null;
74463
+ let decisionReply;
74357
74464
  try {
74358
74465
  const parsed = JSON.parse(plaintext);
74359
74466
  text = envelopeText(parsed, plaintext);
74360
74467
  messageType = parsed.type ?? "text";
74361
74468
  topicId = parsed.topicId ?? topicId;
74362
74469
  if (parsed.attachment) mlsAttachment = parsed.attachment;
74470
+ decisionReply = decisionReplyFromEnvelope(parsed);
74471
+ if (decisionReply) messageType = "decision_response";
74363
74472
  } catch {
74364
74473
  }
74365
74474
  if (messageType === "history_catchup_request") {
@@ -74441,7 +74550,8 @@ ${text}`;
74441
74550
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
74442
74551
  // that a roomId was absent. The bridge's full-access DM lane requires it.
74443
74552
  ownerDm1to1: true,
74444
- messageType
74553
+ messageType,
74554
+ ...decisionReply ? { decision: decisionReply } : {}
74445
74555
  };
74446
74556
  this.emit("message", text, metadata);
74447
74557
  if (this.config.onMessage) {
@@ -74551,6 +74661,7 @@ ${text}`;
74551
74661
  let messageText;
74552
74662
  let messageType;
74553
74663
  let attachmentInfo = null;
74664
+ let decisionReply;
74554
74665
  try {
74555
74666
  const parsed = JSON.parse(plaintext);
74556
74667
  messageType = parsed.type || "message";
@@ -74558,6 +74669,7 @@ ${text}`;
74558
74669
  if (parsed.attachment) {
74559
74670
  attachmentInfo = parsed.attachment;
74560
74671
  }
74672
+ decisionReply = decisionReplyFromEnvelope(parsed);
74561
74673
  } catch {
74562
74674
  messageType = "message";
74563
74675
  messageText = plaintext;
@@ -74610,7 +74722,7 @@ ${text}`;
74610
74722
  return;
74611
74723
  }
74612
74724
  }
74613
- if (messageType === "message") {
74725
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
74614
74726
  const topicId = msgData.topic_id;
74615
74727
  this._lastIncomingTopicId = topicId;
74616
74728
  let attachData;
@@ -74672,10 +74784,12 @@ ${messageText}`;
74672
74784
  attachment: attachData,
74673
74785
  spanId: msgData.span_id,
74674
74786
  parentSpanId: msgData.parent_span_id,
74675
- messageType: msgData.message_type ?? "text",
74787
+ // A decision answer only counts from the owner's 1:1 — never a room.
74788
+ messageType: decisionReply && !roomId ? "decision_response" : msgData.message_type ?? "text",
74676
74789
  priority: msgData.priority ?? "normal",
74677
74790
  envelopeVersion: msgData.envelope_version ?? "1.0.0",
74678
74791
  roomId,
74792
+ ...decisionReply && !roomId ? { decision: decisionReply } : {},
74679
74793
  // #1223 — the pre-fold text. This DR `message` path also sets `roomId`
74680
74794
  // and folds an attachment into `emitText`, so without this a room
74681
74795
  // message that reaches the gate here would fall back to the folded
@@ -76202,9 +76316,9 @@ ${baseText}`;
76202
76316
  if (!groupId || !detail.endsWith("commit rejected")) return;
76203
76317
  const inFlight = this._commitInFlight.get(groupId);
76204
76318
  if (!inFlight) return;
76205
- const num = (v22) => typeof v22 === "number" && Number.isFinite(v22) ? v22 : void 0;
76206
- const current = num(payload.current_epoch);
76207
- const claimed = num(payload.expected_epoch) ?? current;
76319
+ const num2 = (v22) => typeof v22 === "number" && Number.isFinite(v22) ? v22 : void 0;
76320
+ const current = num2(payload.current_epoch);
76321
+ const claimed = num2(payload.expected_epoch) ?? current;
76208
76322
  const headDigest = typeof payload.head_digest === "string" ? payload.head_digest : void 0;
76209
76323
  const sent = inFlight.sent;
76210
76324
  const tag = `[SecureChannel] refusal for ${groupId.slice(0, 8)} ("${detail}")`;
@@ -77325,10 +77439,12 @@ ${baseText}`;
77325
77439
  }
77326
77440
  let messageText;
77327
77441
  let messageType;
77442
+ let decisionReply;
77328
77443
  try {
77329
77444
  const parsed = JSON.parse(plaintext);
77330
77445
  messageType = parsed.type || "message";
77331
77446
  messageText = envelopeText(parsed, plaintext);
77447
+ decisionReply = decisionReplyFromEnvelope(parsed);
77332
77448
  } catch {
77333
77449
  messageType = "message";
77334
77450
  messageText = plaintext;
@@ -77340,7 +77456,7 @@ ${baseText}`;
77340
77456
  ackedIds.push(msg.queue_id);
77341
77457
  continue;
77342
77458
  }
77343
- if (messageType === "message") {
77459
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
77344
77460
  const topicId = msg.topic_id;
77345
77461
  await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.message_id);
77346
77462
  const metadata = {
@@ -77351,7 +77467,8 @@ ${baseText}`;
77351
77467
  // #621: positive attestation that this decrypted under the OWNER'S 1:1
77352
77468
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
77353
77469
  // that a roomId was absent. The bridge's full-access DM lane requires it.
77354
- ownerDm1to1: true
77470
+ ownerDm1to1: true,
77471
+ ...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
77355
77472
  };
77356
77473
  this.emit("message", messageText, metadata);
77357
77474
  Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
@@ -77935,15 +78052,17 @@ ${baseText}`;
77935
78052
  }
77936
78053
  let messageText;
77937
78054
  let messageType;
78055
+ let decisionReply;
77938
78056
  try {
77939
78057
  const parsed = JSON.parse(plaintext);
77940
78058
  messageType = parsed.type || "message";
77941
78059
  messageText = envelopeText(parsed, plaintext);
78060
+ decisionReply = decisionReplyFromEnvelope(parsed);
77942
78061
  } catch {
77943
78062
  messageType = "message";
77944
78063
  messageText = plaintext;
77945
78064
  }
77946
- if (messageType === "message") {
78065
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
77947
78066
  const topicId = msg.topic_id;
77948
78067
  await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.id);
77949
78068
  const metadata = {
@@ -77954,7 +78073,8 @@ ${baseText}`;
77954
78073
  // #621: positive attestation that this decrypted under the OWNER'S 1:1
77955
78074
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
77956
78075
  // that a roomId was absent. The bridge's full-access DM lane requires it.
77957
- ownerDm1to1: true
78076
+ ownerDm1to1: true,
78077
+ ...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
77958
78078
  };
77959
78079
  this.emit("message", messageText, metadata);
77960
78080
  Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
@@ -78130,6 +78250,7 @@ ${baseText}`;
78130
78250
  }
78131
78251
  _scheduleReconnect() {
78132
78252
  if (this._stopped) return;
78253
+ if (this._suspended) return;
78133
78254
  if (this._reconnectTimer) return;
78134
78255
  const sinceOpen = Date.now() - this._lastWsOpenTime;
78135
78256
  if (this._lastWsOpenTime > 0 && sinceOpen < 1e4) {
@@ -78150,7 +78271,16 @@ ${baseText}`;
78150
78271
  return;
78151
78272
  }
78152
78273
  const lastCode = this._lastCloseCode;
78153
- if (lastCode === 4e3 || lastCode === 4001) {
78274
+ if (lastCode === 4001) {
78275
+ console.log(
78276
+ "[SecureChannel] Server rejected our credentials on every reconnect (close code 4001). Stopping; the device needs re-enrolling or a fresh token."
78277
+ );
78278
+ this._authFailedThisSession = true;
78279
+ this._setState("error");
78280
+ this.emit("auth_failed", { reason: "ws_auth_rejected" });
78281
+ return;
78282
+ }
78283
+ if (lastCode === 4e3) {
78154
78284
  console.log(
78155
78285
  `[SecureChannel] Server reports our session was replaced by a newer one (close code ${lastCode}). Stopping reconnect.`
78156
78286
  );
@@ -78242,15 +78372,17 @@ ${baseText}`;
78242
78372
  }
78243
78373
  let messageText;
78244
78374
  let messageType;
78375
+ let decisionReply;
78245
78376
  try {
78246
78377
  const parsed = JSON.parse(plaintext);
78247
78378
  messageType = parsed.type || "message";
78248
78379
  messageText = envelopeText(parsed, plaintext);
78380
+ decisionReply = decisionReplyFromEnvelope(parsed);
78249
78381
  } catch {
78250
78382
  messageType = "message";
78251
78383
  messageText = plaintext;
78252
78384
  }
78253
- if (messageType === "message") {
78385
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
78254
78386
  const topicId = msg.topic_id;
78255
78387
  await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.id);
78256
78388
  const metadata = {
@@ -78261,7 +78393,8 @@ ${baseText}`;
78261
78393
  // #621: positive attestation that this decrypted under the OWNER'S 1:1
78262
78394
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
78263
78395
  // that a roomId was absent. The bridge's full-access DM lane requires it.
78264
- ownerDm1to1: true
78396
+ ownerDm1to1: true,
78397
+ ...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
78265
78398
  };
78266
78399
  this.emit("message", messageText, metadata);
78267
78400
  Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
@@ -78350,6 +78483,10 @@ ${baseText}`;
78350
78483
  * `retryable` rejection is transient — fall through to a normal reconnect.
78351
78484
  */
78352
78485
  async _handleConnectionRejected(data) {
78486
+ if (data?.reason === "device_suspended") {
78487
+ this._enterSuspendedWait("connection_rejected");
78488
+ return;
78489
+ }
78353
78490
  if (data?.retryable === true) {
78354
78491
  this._scheduleReconnect();
78355
78492
  return;
@@ -78361,6 +78498,79 @@ ${baseText}`;
78361
78498
  );
78362
78499
  this.emit("auth_failed", { reason: authReason });
78363
78500
  }
78501
+ // --- Owner pause (device SUSPENDED) — NON-final ---------------------------
78502
+ //
78503
+ // Suspension is reversible ("Agent active" off/on in the app). While
78504
+ // suspended the server will not serve this device (it rejects the handshake
78505
+ // with a retryable `device_suspended`), so reconnecting is pointless and,
78506
+ // through the rapid-disconnect classifier, used to end in a terminal error.
78507
+ // Instead: stay in "disconnected", poll the public status endpoint, and
78508
+ // reconnect as soon as the device is ACTIVE again. REVOKED ends the wait as
78509
+ // terminal; anything inconclusive (rate limit, network) keeps waiting.
78510
+ static SUSPENDED_POLL_MS = 3e4;
78511
+ _suspended = false;
78512
+ _suspendedPollTimer = null;
78513
+ /** Handle a WS `device_suspended` frame (owner paused this agent). */
78514
+ async _handleDeviceSuspended() {
78515
+ this._enterSuspendedWait("device_suspended");
78516
+ }
78517
+ _enterSuspendedWait(source) {
78518
+ if (this._stopped) return;
78519
+ if (this._reconnectTimer) {
78520
+ clearTimeout(this._reconnectTimer);
78521
+ this._reconnectTimer = null;
78522
+ }
78523
+ this._rapidDisconnects = 0;
78524
+ if (!this._suspended) {
78525
+ this._suspended = true;
78526
+ console.log(
78527
+ `[SecureChannel] Agent paused by its owner (${source}) \u2014 idling; will reconnect when resumed`
78528
+ );
78529
+ this._setState("disconnected");
78530
+ this.emit("suspended", { source });
78531
+ }
78532
+ this._scheduleSuspendedPoll();
78533
+ }
78534
+ _scheduleSuspendedPoll() {
78535
+ if (this._stopped || !this._suspended || this._suspendedPollTimer) return;
78536
+ this._suspendedPollTimer = setTimeout(() => {
78537
+ this._suspendedPollTimer = null;
78538
+ void this._pollWhileSuspended();
78539
+ }, _SecureChannel.SUSPENDED_POLL_MS);
78540
+ }
78541
+ _clearSuspendedWait() {
78542
+ this._suspended = false;
78543
+ if (this._suspendedPollTimer) {
78544
+ clearTimeout(this._suspendedPollTimer);
78545
+ this._suspendedPollTimer = null;
78546
+ }
78547
+ }
78548
+ async _pollWhileSuspended() {
78549
+ if (this._stopped || !this._suspended) return;
78550
+ const deviceId = this._deviceId ?? this._persisted?.deviceId;
78551
+ if (deviceId) {
78552
+ try {
78553
+ const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
78554
+ if (this._stopped || !this._suspended) return;
78555
+ if (!st.rateLimited && (st.status === "ACTIVE" || st.status === "APPROVED")) {
78556
+ this._clearSuspendedWait();
78557
+ this._reconnectAttempt = 0;
78558
+ console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
78559
+ this.emit("resumed");
78560
+ this._connect();
78561
+ return;
78562
+ }
78563
+ if (!st.rateLimited && st.status === "REVOKED") {
78564
+ this._clearSuspendedWait();
78565
+ this._handleError(new Error("Device was revoked"));
78566
+ return;
78567
+ }
78568
+ } catch (err) {
78569
+ console.warn("[SecureChannel] status check while paused failed; still waiting:", err);
78570
+ }
78571
+ }
78572
+ this._scheduleSuspendedPoll();
78573
+ }
78364
78574
  async _handleDeviceRevoked() {
78365
78575
  const now = Date.now();
78366
78576
  this._revokeRecoveries = this._revokeRecoveries.filter(
@@ -78381,6 +78591,10 @@ ${baseText}`;
78381
78591
  let reconnect;
78382
78592
  try {
78383
78593
  const status = await pollDeviceStatus(this.config.apiUrl, deviceId);
78594
+ if (status.status === "SUSPENDED") {
78595
+ this._enterSuspendedWait("device_revoked");
78596
+ return;
78597
+ }
78384
78598
  reconnect = status.rateLimited === true || status.status === "ACTIVE";
78385
78599
  if (!reconnect) {
78386
78600
  console.warn(
@@ -78462,7 +78676,7 @@ ${baseText}`;
78462
78676
  label: "AgentVault",
78463
78677
  selectionLabel: "AgentVault (E2E Encrypted)",
78464
78678
  docsPath: "https://agentvault.chat/docs",
78465
- blurb: "Zero-knowledge, end-to-end encrypted messaging between owners and their AI agents.",
78679
+ blurb: "End-to-end encrypted messaging between owners and their AI agents.",
78466
78680
  aliases: ["av", "agent-vault"]
78467
78681
  },
78468
78682
  capabilities: {
@@ -78661,9 +78875,540 @@ ${actionsText}`);
78661
78875
  "use strict";
78662
78876
  }
78663
78877
  });
78878
+ init_llm_pricing_openrouter = __esm2({
78879
+ "src/llm-pricing-openrouter.ts"() {
78880
+ "use strict";
78881
+ OPENROUTER_PRICING = {
78882
+ anthropic: {
78883
+ "claude-fable-5": { inputPerMtoken: 10, outputPerMtoken: 50 },
78884
+ "claude-fable-5-1": { inputPerMtoken: 10, outputPerMtoken: 50 },
78885
+ "claude-haiku-4-5": { inputPerMtoken: 1, outputPerMtoken: 5 },
78886
+ "claude-haiku-5-5": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
78887
+ "claude-opus-4-1": { inputPerMtoken: 15, outputPerMtoken: 75 },
78888
+ "claude-opus-4-5": { inputPerMtoken: 5, outputPerMtoken: 25 },
78889
+ "claude-opus-4-6": { inputPerMtoken: 5, outputPerMtoken: 25 },
78890
+ "claude-opus-4-7": { inputPerMtoken: 5, outputPerMtoken: 25 },
78891
+ "claude-opus-4-8": { inputPerMtoken: 5, outputPerMtoken: 25 },
78892
+ "claude-opus-5": { inputPerMtoken: 5, outputPerMtoken: 25 },
78893
+ "claude-opus-5-5": { inputPerMtoken: 4, outputPerMtoken: 20 },
78894
+ "claude-sonnet-4": { inputPerMtoken: 3, outputPerMtoken: 15 },
78895
+ "claude-sonnet-4-5": { inputPerMtoken: 3, outputPerMtoken: 15 },
78896
+ "claude-sonnet-4-6": { inputPerMtoken: 3, outputPerMtoken: 15 },
78897
+ "claude-sonnet-5": { inputPerMtoken: 2, outputPerMtoken: 10 },
78898
+ "claude-sonnet-5-5": { inputPerMtoken: 2, outputPerMtoken: 10 }
78899
+ },
78900
+ openai: {
78901
+ "gpt-3.5-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
78902
+ "gpt-3.5-turbo-0613": { inputPerMtoken: 1, outputPerMtoken: 2 },
78903
+ "gpt-3.5-turbo-16k": { inputPerMtoken: 3, outputPerMtoken: 4 },
78904
+ "gpt-3.5-turbo-instruct": { inputPerMtoken: 1.5, outputPerMtoken: 2 },
78905
+ "gpt-4": { inputPerMtoken: 30, outputPerMtoken: 60 },
78906
+ "gpt-4-turbo": { inputPerMtoken: 10, outputPerMtoken: 30 },
78907
+ "gpt-4.1": { inputPerMtoken: 2, outputPerMtoken: 8 },
78908
+ "gpt-4.1-mini": { inputPerMtoken: 0.4, outputPerMtoken: 1.6 },
78909
+ "gpt-4.1-nano": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
78910
+ "gpt-4o": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
78911
+ "gpt-4o-2024-05-13": { inputPerMtoken: 5, outputPerMtoken: 15 },
78912
+ "gpt-4o-2024-08-06": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
78913
+ "gpt-4o-2024-11-20": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
78914
+ "gpt-4o-mini": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
78915
+ "gpt-4o-mini-2024-07-18": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
78916
+ "gpt-5": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
78917
+ "gpt-5-image": { inputPerMtoken: 10, outputPerMtoken: 10 },
78918
+ "gpt-5-image-mini": { inputPerMtoken: 2.5, outputPerMtoken: 2 },
78919
+ "gpt-5-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
78920
+ "gpt-5-nano": { inputPerMtoken: 0.05, outputPerMtoken: 0.4 },
78921
+ "gpt-5-pro": { inputPerMtoken: 15, outputPerMtoken: 120 },
78922
+ "gpt-5.1": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
78923
+ "gpt-5.1-codex": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
78924
+ "gpt-5.1-codex-max": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
78925
+ "gpt-5.1-codex-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
78926
+ "gpt-5.2": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
78927
+ "gpt-5.2-chat": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
78928
+ "gpt-5.2-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
78929
+ "gpt-5.2-pro": { inputPerMtoken: 21, outputPerMtoken: 168 },
78930
+ "gpt-5.3-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
78931
+ "gpt-5.4": { inputPerMtoken: 2.5, outputPerMtoken: 15 },
78932
+ "gpt-5.4-image-2": { inputPerMtoken: 8, outputPerMtoken: 15 },
78933
+ "gpt-5.4-mini": { inputPerMtoken: 0.75, outputPerMtoken: 4.5 },
78934
+ "gpt-5.4-nano": { inputPerMtoken: 0.2, outputPerMtoken: 1.25 },
78935
+ "gpt-5.4-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
78936
+ "gpt-5.5": { inputPerMtoken: 5, outputPerMtoken: 30 },
78937
+ "gpt-5.5-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
78938
+ "gpt-5.6-luna": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
78939
+ "gpt-5.6-luna-pro": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
78940
+ "gpt-5.6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
78941
+ "gpt-5.6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
78942
+ "gpt-5.6-terra": { inputPerMtoken: 2, outputPerMtoken: 12 },
78943
+ "gpt-5.6-terra-pro": { inputPerMtoken: 2, outputPerMtoken: 12 },
78944
+ "gpt-6-astra": { inputPerMtoken: 10, outputPerMtoken: 50 },
78945
+ "gpt-6-astra-pro": { inputPerMtoken: 10, outputPerMtoken: 50 },
78946
+ "gpt-6-luna": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
78947
+ "gpt-6-luna-pro": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
78948
+ "gpt-6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
78949
+ "gpt-6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
78950
+ "gpt-6.1-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
78951
+ "gpt-6.1-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
78952
+ "gpt-audio": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
78953
+ "gpt-audio-mini": { inputPerMtoken: 0.6, outputPerMtoken: 2.4 },
78954
+ "gpt-chat-latest": { inputPerMtoken: 5, outputPerMtoken: 30 },
78955
+ "gpt-oss-120b": { inputPerMtoken: 0.037, outputPerMtoken: 0.17 },
78956
+ "gpt-oss-20b": { inputPerMtoken: 0.018, outputPerMtoken: 0.09 },
78957
+ "gpt-oss-safeguard-20b": { inputPerMtoken: 0.075, outputPerMtoken: 0.3 },
78958
+ "o1": { inputPerMtoken: 15, outputPerMtoken: 60 },
78959
+ "o1-pro": { inputPerMtoken: 150, outputPerMtoken: 600 },
78960
+ "o3": { inputPerMtoken: 2, outputPerMtoken: 8 },
78961
+ "o3-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
78962
+ "o3-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
78963
+ "o3-pro": { inputPerMtoken: 20, outputPerMtoken: 80 },
78964
+ "o4-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
78965
+ "o4-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 }
78966
+ },
78967
+ openrouter: {
78968
+ "aion-2.0": { inputPerMtoken: 0.8, outputPerMtoken: 1.6 },
78969
+ "aion-3.0": { inputPerMtoken: 3, outputPerMtoken: 6 },
78970
+ "aion-3.0-mini": { inputPerMtoken: 0.7, outputPerMtoken: 1.4 },
78971
+ "aion-3.5": { inputPerMtoken: 3, outputPerMtoken: 6 },
78972
+ "aion-3.5-mini": { inputPerMtoken: 0.7, outputPerMtoken: 1.4 },
78973
+ "aion-rp-llama-3.1-8b": { inputPerMtoken: 0.8, outputPerMtoken: 1.6 },
78974
+ "claude-fable-5": { inputPerMtoken: 10, outputPerMtoken: 50 },
78975
+ "claude-fable-5.1": { inputPerMtoken: 10, outputPerMtoken: 50 },
78976
+ "claude-fable-latest": { inputPerMtoken: 10, outputPerMtoken: 50 },
78977
+ "claude-haiku-4.5": { inputPerMtoken: 1, outputPerMtoken: 5 },
78978
+ "claude-haiku-5.5": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
78979
+ "claude-haiku-latest": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
78980
+ "claude-opus-4.1": { inputPerMtoken: 15, outputPerMtoken: 75 },
78981
+ "claude-opus-4.5": { inputPerMtoken: 5, outputPerMtoken: 25 },
78982
+ "claude-opus-4.6": { inputPerMtoken: 5, outputPerMtoken: 25 },
78983
+ "claude-opus-4.7": { inputPerMtoken: 5, outputPerMtoken: 25 },
78984
+ "claude-opus-4.8": { inputPerMtoken: 5, outputPerMtoken: 25 },
78985
+ "claude-opus-5": { inputPerMtoken: 5, outputPerMtoken: 25 },
78986
+ "claude-opus-5.5": { inputPerMtoken: 4, outputPerMtoken: 20 },
78987
+ "claude-opus-latest": { inputPerMtoken: 4, outputPerMtoken: 20 },
78988
+ "claude-sonnet-4": { inputPerMtoken: 3, outputPerMtoken: 15 },
78989
+ "claude-sonnet-4.5": { inputPerMtoken: 3, outputPerMtoken: 15 },
78990
+ "claude-sonnet-4.6": { inputPerMtoken: 3, outputPerMtoken: 15 },
78991
+ "claude-sonnet-5": { inputPerMtoken: 2, outputPerMtoken: 10 },
78992
+ "claude-sonnet-5.5": { inputPerMtoken: 2, outputPerMtoken: 10 },
78993
+ "claude-sonnet-latest": { inputPerMtoken: 2, outputPerMtoken: 10 },
78994
+ "codestral-2508": { inputPerMtoken: 0.3, outputPerMtoken: 0.9 },
78995
+ "command-a": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
78996
+ "command-a-plus": { inputPerMtoken: 0.3, outputPerMtoken: 1.5 },
78997
+ "command-r-08-2024": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
78998
+ "command-r-plus-08-2024": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
78999
+ "command-r7b-12-2024": { inputPerMtoken: 0.0375, outputPerMtoken: 0.15 },
79000
+ "cydonia-24b-v4.1": { inputPerMtoken: 0.3, outputPerMtoken: 0.5 },
79001
+ "deepseek-chat": { inputPerMtoken: 0.32, outputPerMtoken: 0.89 },
79002
+ "deepseek-chat-v3-0324": { inputPerMtoken: 0.29, outputPerMtoken: 1.14 },
79003
+ "deepseek-chat-v3.1": { inputPerMtoken: 0.25, outputPerMtoken: 0.95 },
79004
+ "deepseek-flash-latest": { inputPerMtoken: 0.02016, outputPerMtoken: 0.891 },
79005
+ "deepseek-pro-latest": { inputPerMtoken: 0.1461, outputPerMtoken: 8 },
79006
+ "deepseek-r1": { inputPerMtoken: 0.7, outputPerMtoken: 2.5 },
79007
+ "deepseek-r1-0528": { inputPerMtoken: 0.5, outputPerMtoken: 2.15 },
79008
+ "deepseek-v3.1-terminus": { inputPerMtoken: 0.27, outputPerMtoken: 1 },
79009
+ "deepseek-v3.2": { inputPerMtoken: 0.259, outputPerMtoken: 0.8 },
79010
+ "deepseek-v3.2-exp": { inputPerMtoken: 0.27, outputPerMtoken: 0.41 },
79011
+ "deepseek-v4-flash": { inputPerMtoken: 0.091, outputPerMtoken: 0.182 },
79012
+ "deepseek-v4-flash-0731": { inputPerMtoken: 0.016, outputPerMtoken: 0.64 },
79013
+ "deepseek-v4-flash-latest": { inputPerMtoken: 0.0144, outputPerMtoken: 0.576 },
79014
+ "deepseek-v4-flash-vision-exp": { inputPerMtoken: 0.2156, outputPerMtoken: 0.6468 },
79015
+ "deepseek-v4-pro": { inputPerMtoken: 0.430824, outputPerMtoken: 0.861648 },
79016
+ "deepseek-v4-pro-0813": { inputPerMtoken: 0.66, outputPerMtoken: 1.98 },
79017
+ "deepseek-v4.1-flash": { inputPerMtoken: 0.02016, outputPerMtoken: 0.891 },
79018
+ "devstral-2512": { inputPerMtoken: 0.4, outputPerMtoken: 2 },
79019
+ "dolphin-mistral-24b-venice-edition": { inputPerMtoken: 0.2, outputPerMtoken: 0.9 },
79020
+ "dots-3-note-preview:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79021
+ "ember-1": { inputPerMtoken: 3, outputPerMtoken: 15 },
79022
+ "extract": { inputPerMtoken: 0.04, outputPerMtoken: 0 },
79023
+ "free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79024
+ "fugu-max": { inputPerMtoken: 2, outputPerMtoken: 6 },
79025
+ "fugu-ultra": { inputPerMtoken: 5, outputPerMtoken: 30 },
79026
+ "fugu-ultra-v2": { inputPerMtoken: 5, outputPerMtoken: 30 },
79027
+ "gemini-2.5-flash": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79028
+ "gemini-2.5-flash-image": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79029
+ "gemini-2.5-flash-lite": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
79030
+ "gemini-2.5-pro": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79031
+ "gemini-2.5-pro-preview": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79032
+ "gemini-3-flash-preview": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79033
+ "gemini-3-pro-image": { inputPerMtoken: 2, outputPerMtoken: 12 },
79034
+ "gemini-3-pro-image-preview": { inputPerMtoken: 2, outputPerMtoken: 12 },
79035
+ "gemini-3.1-flash-image": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79036
+ "gemini-3.1-flash-image-preview": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79037
+ "gemini-3.1-flash-lite": { inputPerMtoken: 0.25, outputPerMtoken: 1.5 },
79038
+ "gemini-3.1-flash-lite-image": { inputPerMtoken: 0.25, outputPerMtoken: 1.5 },
79039
+ "gemini-3.1-flash-lite-preview": { inputPerMtoken: 0.25, outputPerMtoken: 1.5 },
79040
+ "gemini-3.1-pro-preview": { inputPerMtoken: 2, outputPerMtoken: 12 },
79041
+ "gemini-3.1-pro-preview-customtools": { inputPerMtoken: 2, outputPerMtoken: 12 },
79042
+ "gemini-3.5-flash": { inputPerMtoken: 1.5, outputPerMtoken: 9 },
79043
+ "gemini-3.5-flash-lite": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79044
+ "gemini-3.6-flash": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79045
+ "gemini-3.7-flash": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79046
+ "gemini-3.8-flash": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79047
+ "gemini-4-argon": { inputPerMtoken: 2, outputPerMtoken: 10 },
79048
+ "gemini-flash-latest": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79049
+ "gemini-nano-banana-2.1": { inputPerMtoken: 1.5, outputPerMtoken: 7.5 },
79050
+ "gemini-pro-latest": { inputPerMtoken: 2, outputPerMtoken: 12 },
79051
+ "gemma-2-27b-it": { inputPerMtoken: 0.65, outputPerMtoken: 0.65 },
79052
+ "gemma-3-12b-it": { inputPerMtoken: 0.05, outputPerMtoken: 0.15 },
79053
+ "gemma-3-27b-it": { inputPerMtoken: 0.08, outputPerMtoken: 0.45 },
79054
+ "gemma-3-4b-it": { inputPerMtoken: 0.05, outputPerMtoken: 0.1 },
79055
+ "gemma-4-26b-a4b-it": { inputPerMtoken: 0.09, outputPerMtoken: 0.3 },
79056
+ "gemma-4-26b-a4b-it:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79057
+ "gemma-4-31b-it": { inputPerMtoken: 0.09, outputPerMtoken: 0.34 },
79058
+ "gemma-4-31b-it:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79059
+ "glm-4.5": { inputPerMtoken: 0.6, outputPerMtoken: 2.2 },
79060
+ "glm-4.5-air": { inputPerMtoken: 0.13, outputPerMtoken: 0.85 },
79061
+ "glm-4.5v": { inputPerMtoken: 0.6, outputPerMtoken: 1.8 },
79062
+ "glm-4.6": { inputPerMtoken: 0.5, outputPerMtoken: 2 },
79063
+ "glm-4.6v": { inputPerMtoken: 0.3, outputPerMtoken: 0.9 },
79064
+ "glm-4.7": { inputPerMtoken: 0.6, outputPerMtoken: 2.2 },
79065
+ "glm-4.7-flash": { inputPerMtoken: 0.0605, outputPerMtoken: 0.4 },
79066
+ "glm-5": { inputPerMtoken: 0.6, outputPerMtoken: 1.92 },
79067
+ "glm-5-turbo": { inputPerMtoken: 1.2, outputPerMtoken: 4 },
79068
+ "glm-5.1": { inputPerMtoken: 1.33, outputPerMtoken: 4.18 },
79069
+ "glm-5.2": { inputPerMtoken: 0.05, outputPerMtoken: 7 },
79070
+ "glm-5.3": { inputPerMtoken: 0.079, outputPerMtoken: 4.8 },
79071
+ "glm-5.3-flash": { inputPerMtoken: 0.036, outputPerMtoken: 0.9 },
79072
+ "glm-5.3-flashx": { inputPerMtoken: 0.37, outputPerMtoken: 1.25 },
79073
+ "glm-5.3-prime": { inputPerMtoken: 2.8, outputPerMtoken: 8.8 },
79074
+ "glm-5v-turbo": { inputPerMtoken: 1.2, outputPerMtoken: 4 },
79075
+ "glm-flash-latest": { inputPerMtoken: 0.036, outputPerMtoken: 0.9 },
79076
+ "glm-latest": { inputPerMtoken: 0.0576, outputPerMtoken: 4.4 },
79077
+ "gpt-3.5-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
79078
+ "gpt-3.5-turbo-0613": { inputPerMtoken: 1, outputPerMtoken: 2 },
79079
+ "gpt-3.5-turbo-16k": { inputPerMtoken: 3, outputPerMtoken: 4 },
79080
+ "gpt-3.5-turbo-instruct": { inputPerMtoken: 1.5, outputPerMtoken: 2 },
79081
+ "gpt-4": { inputPerMtoken: 30, outputPerMtoken: 60 },
79082
+ "gpt-4-turbo": { inputPerMtoken: 10, outputPerMtoken: 30 },
79083
+ "gpt-4.1": { inputPerMtoken: 2, outputPerMtoken: 8 },
79084
+ "gpt-4.1-mini": { inputPerMtoken: 0.4, outputPerMtoken: 1.6 },
79085
+ "gpt-4.1-nano": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
79086
+ "gpt-4o": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79087
+ "gpt-4o-2024-05-13": { inputPerMtoken: 5, outputPerMtoken: 15 },
79088
+ "gpt-4o-2024-08-06": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79089
+ "gpt-4o-2024-11-20": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79090
+ "gpt-4o-mini": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79091
+ "gpt-4o-mini-2024-07-18": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79092
+ "gpt-5": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79093
+ "gpt-5-image": { inputPerMtoken: 10, outputPerMtoken: 10 },
79094
+ "gpt-5-image-mini": { inputPerMtoken: 2.5, outputPerMtoken: 2 },
79095
+ "gpt-5-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79096
+ "gpt-5-nano": { inputPerMtoken: 0.05, outputPerMtoken: 0.4 },
79097
+ "gpt-5-pro": { inputPerMtoken: 15, outputPerMtoken: 120 },
79098
+ "gpt-5.1": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79099
+ "gpt-5.1-codex": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79100
+ "gpt-5.1-codex-max": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79101
+ "gpt-5.1-codex-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79102
+ "gpt-5.2": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79103
+ "gpt-5.2-chat": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79104
+ "gpt-5.2-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79105
+ "gpt-5.2-pro": { inputPerMtoken: 21, outputPerMtoken: 168 },
79106
+ "gpt-5.3-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79107
+ "gpt-5.4": { inputPerMtoken: 2.5, outputPerMtoken: 15 },
79108
+ "gpt-5.4-image-2": { inputPerMtoken: 8, outputPerMtoken: 15 },
79109
+ "gpt-5.4-mini": { inputPerMtoken: 0.75, outputPerMtoken: 4.5 },
79110
+ "gpt-5.4-nano": { inputPerMtoken: 0.2, outputPerMtoken: 1.25 },
79111
+ "gpt-5.4-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
79112
+ "gpt-5.5": { inputPerMtoken: 5, outputPerMtoken: 30 },
79113
+ "gpt-5.5-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
79114
+ "gpt-5.6-luna": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
79115
+ "gpt-5.6-luna-pro": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
79116
+ "gpt-5.6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79117
+ "gpt-5.6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79118
+ "gpt-5.6-terra": { inputPerMtoken: 2, outputPerMtoken: 12 },
79119
+ "gpt-5.6-terra-pro": { inputPerMtoken: 2, outputPerMtoken: 12 },
79120
+ "gpt-6-astra": { inputPerMtoken: 10, outputPerMtoken: 50 },
79121
+ "gpt-6-astra-pro": { inputPerMtoken: 10, outputPerMtoken: 50 },
79122
+ "gpt-6-luna": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79123
+ "gpt-6-luna-pro": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79124
+ "gpt-6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79125
+ "gpt-6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79126
+ "gpt-6.1-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79127
+ "gpt-6.1-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79128
+ "gpt-astra-latest": { inputPerMtoken: 10, outputPerMtoken: 50 },
79129
+ "gpt-audio": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79130
+ "gpt-audio-mini": { inputPerMtoken: 0.6, outputPerMtoken: 2.4 },
79131
+ "gpt-chat-latest": { inputPerMtoken: 5, outputPerMtoken: 30 },
79132
+ "gpt-luna-latest": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79133
+ "gpt-mini-latest": { inputPerMtoken: 0.75, outputPerMtoken: 4.5 },
79134
+ "gpt-oss-120b": { inputPerMtoken: 0.037, outputPerMtoken: 0.17 },
79135
+ "gpt-oss-20b": { inputPerMtoken: 0.018, outputPerMtoken: 0.09 },
79136
+ "gpt-oss-safeguard-20b": { inputPerMtoken: 0.075, outputPerMtoken: 0.3 },
79137
+ "gpt-sol-latest": { inputPerMtoken: 2, outputPerMtoken: 10 },
79138
+ "gpt-terra-latest": { inputPerMtoken: 2, outputPerMtoken: 12 },
79139
+ "granite-4.0-h-micro": { inputPerMtoken: 0.017, outputPerMtoken: 0.112 },
79140
+ "granite-4.2-8b": { inputPerMtoken: 0.06, outputPerMtoken: 0.25 },
79141
+ "grok-4.20": { inputPerMtoken: 1.25, outputPerMtoken: 2.5 },
79142
+ "grok-4.20-multi-agent": { inputPerMtoken: 1.25, outputPerMtoken: 2.5 },
79143
+ "grok-4.3": { inputPerMtoken: 1.25, outputPerMtoken: 2.5 },
79144
+ "grok-4.5": { inputPerMtoken: 2, outputPerMtoken: 6 },
79145
+ "grok-4.6": { inputPerMtoken: 2, outputPerMtoken: 6 },
79146
+ "grok-4.7": { inputPerMtoken: 2, outputPerMtoken: 6 },
79147
+ "grok-build-0.1": { inputPerMtoken: 1, outputPerMtoken: 2 },
79148
+ "grok-latest": { inputPerMtoken: 2, outputPerMtoken: 6 },
79149
+ "hermes-3-llama-3.1-405b": { inputPerMtoken: 1, outputPerMtoken: 1 },
79150
+ "hermes-3-llama-3.1-70b": { inputPerMtoken: 0.7, outputPerMtoken: 0.7 },
79151
+ "hermes-4-405b": { inputPerMtoken: 1, outputPerMtoken: 3 },
79152
+ "hunyuan-a13b-instruct": { inputPerMtoken: 0.14, outputPerMtoken: 0.57 },
79153
+ "hy-mt2-1.8b": { inputPerMtoken: 0.044, outputPerMtoken: 0.177 },
79154
+ "hy-mt2-30b-a3b": { inputPerMtoken: 0.074, outputPerMtoken: 0.295 },
79155
+ "hy-mt2-7b": { inputPerMtoken: 0.074, outputPerMtoken: 0.295 },
79156
+ "hy3": { inputPerMtoken: 0.132, outputPerMtoken: 0.528 },
79157
+ "hy3-preview": { inputPerMtoken: 0.18, outputPerMtoken: 0.6 },
79158
+ "hy4-preview": { inputPerMtoken: 0.834, outputPerMtoken: 2.501 },
79159
+ "inkling": { inputPerMtoken: 1, outputPerMtoken: 4.05 },
79160
+ "inkling-small": { inputPerMtoken: 0.45, outputPerMtoken: 1.2 },
79161
+ "inkling-small:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79162
+ "inkling:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79163
+ "kimi-k2": { inputPerMtoken: 0.57, outputPerMtoken: 2.3 },
79164
+ "kimi-k2-0905": { inputPerMtoken: 0.6, outputPerMtoken: 2.5 },
79165
+ "kimi-k2-thinking": { inputPerMtoken: 0.6, outputPerMtoken: 2.5 },
79166
+ "kimi-k2.5": { inputPerMtoken: 0.5, outputPerMtoken: 2.5 },
79167
+ "kimi-k2.6": { inputPerMtoken: 0.65, outputPerMtoken: 3.41 },
79168
+ "kimi-k2.7-code": { inputPerMtoken: 0.6712, outputPerMtoken: 3.35 },
79169
+ "kimi-k3": { inputPerMtoken: 0.7, outputPerMtoken: 15 },
79170
+ "kimi-latest": { inputPerMtoken: 0.536, outputPerMtoken: 14 },
79171
+ "l3-lunaris-8b": { inputPerMtoken: 0.04, outputPerMtoken: 0.05 },
79172
+ "l3.1-euryale-70b": { inputPerMtoken: 0.85, outputPerMtoken: 0.85 },
79173
+ "l3.3-euryale-70b": { inputPerMtoken: 0.65, outputPerMtoken: 0.75 },
79174
+ "laguna-s-2.1": { inputPerMtoken: 0.09, outputPerMtoken: 0.18 },
79175
+ "laguna-s-2.1:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79176
+ "laguna-xs-2.1": { inputPerMtoken: 0.06, outputPerMtoken: 0.12 },
79177
+ "laguna-xs-2.1:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79178
+ "lfm-2.5-2.6b:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79179
+ "lfm-2.5-24b-a2b": { inputPerMtoken: 0.05, outputPerMtoken: 0.7 },
79180
+ "ling-3.0-flash": { inputPerMtoken: 0.021, outputPerMtoken: 0.063 },
79181
+ "ling-3.0-flash-vl": { inputPerMtoken: 0.06, outputPerMtoken: 0.18 },
79182
+ "ling-3.1-flash": { inputPerMtoken: 0.075, outputPerMtoken: 0.225 },
79183
+ "llama-3.1-70b-instruct": { inputPerMtoken: 0.4, outputPerMtoken: 0.4 },
79184
+ "llama-3.1-8b-instruct": { inputPerMtoken: 0.05, outputPerMtoken: 0.08 },
79185
+ "llama-3.2-1b-instruct": { inputPerMtoken: 0.027, outputPerMtoken: 0.201 },
79186
+ "llama-3.2-3b-instruct": { inputPerMtoken: 0.05, outputPerMtoken: 0.33 },
79187
+ "llama-3.3-70b-instruct": { inputPerMtoken: 0.59, outputPerMtoken: 0.79 },
79188
+ "llama-4-maverick": { inputPerMtoken: 0.1875, outputPerMtoken: 0.6525 },
79189
+ "llama-4-scout": { inputPerMtoken: 0.18, outputPerMtoken: 0.59 },
79190
+ "llama-guard-4-12b": { inputPerMtoken: 0.18, outputPerMtoken: 0.18 },
79191
+ "longcat-2.0": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79192
+ "lyria-3-clip-preview": { inputPerMtoken: 0, outputPerMtoken: 0 },
79193
+ "lyria-3-pro-preview": { inputPerMtoken: 0, outputPerMtoken: 0 },
79194
+ "magnum-v4-72b": { inputPerMtoken: 2.5, outputPerMtoken: 5 },
79195
+ "mercury-2": { inputPerMtoken: 0.25, outputPerMtoken: 0.75 },
79196
+ "mercury-2.5": { inputPerMtoken: 0.04, outputPerMtoken: 0.15 },
79197
+ "mimo-v2.5": { inputPerMtoken: 0.14, outputPerMtoken: 0.28 },
79198
+ "mimo-v2.5-pro": { inputPerMtoken: 0.435, outputPerMtoken: 0.87 },
79199
+ "mimo-v2.6-flash": { inputPerMtoken: 0.14, outputPerMtoken: 0.28 },
79200
+ "mimo-v2.6-pro": { inputPerMtoken: 0.435, outputPerMtoken: 0.87 },
79201
+ "mimo-v2.6-pro-ultraspeed": { inputPerMtoken: 4.35, outputPerMtoken: 8.7 },
79202
+ "minimax-01": { inputPerMtoken: 0.2, outputPerMtoken: 1.1 },
79203
+ "minimax-m1": { inputPerMtoken: 0.55, outputPerMtoken: 2.2 },
79204
+ "minimax-m2": { inputPerMtoken: 0.255, outputPerMtoken: 1.02 },
79205
+ "minimax-m2-her": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79206
+ "minimax-m2.1": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79207
+ "minimax-m2.5": { inputPerMtoken: 0.27, outputPerMtoken: 1.08 },
79208
+ "minimax-m2.7": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79209
+ "minimax-m3": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79210
+ "ministral-14b-2512": { inputPerMtoken: 0.2, outputPerMtoken: 0.2 },
79211
+ "ministral-3b-2512": { inputPerMtoken: 0.1, outputPerMtoken: 0.1 },
79212
+ "ministral-8b-2512": { inputPerMtoken: 0.15, outputPerMtoken: 0.15 },
79213
+ "mistral-large": { inputPerMtoken: 2, outputPerMtoken: 6 },
79214
+ "mistral-large-2407": { inputPerMtoken: 2, outputPerMtoken: 6 },
79215
+ "mistral-large-2512": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
79216
+ "mistral-large-4-0": { inputPerMtoken: 0.68, outputPerMtoken: 2.09 },
79217
+ "mistral-medium-3": { inputPerMtoken: 0.4, outputPerMtoken: 2 },
79218
+ "mistral-medium-3-5": { inputPerMtoken: 1.5, outputPerMtoken: 7.5 },
79219
+ "mistral-medium-3.1": { inputPerMtoken: 0.4, outputPerMtoken: 2 },
79220
+ "mistral-nemo": { inputPerMtoken: 0.029, outputPerMtoken: 0.03 },
79221
+ "mistral-saba": { inputPerMtoken: 0.2, outputPerMtoken: 0.6 },
79222
+ "mistral-small-24b-instruct-2501": { inputPerMtoken: 0.05, outputPerMtoken: 0.08 },
79223
+ "mistral-small-2603": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79224
+ "mistral-small-3.1-24b-instruct": { inputPerMtoken: 0.351, outputPerMtoken: 0.555 },
79225
+ "mistral-small-3.2-24b-instruct": { inputPerMtoken: 0.09375, outputPerMtoken: 0.25 },
79226
+ "mixtral-8x22b-instruct": { inputPerMtoken: 2, outputPerMtoken: 6 },
79227
+ "morph-v3-fast": { inputPerMtoken: 0.8, outputPerMtoken: 1.2 },
79228
+ "morph-v3-large": { inputPerMtoken: 0.9, outputPerMtoken: 1.9 },
79229
+ "muse-glimmer-30b": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79230
+ "muse-spark-1.1": { inputPerMtoken: 1.25, outputPerMtoken: 4.25 },
79231
+ "muse-spark-1.2": { inputPerMtoken: 1.25, outputPerMtoken: 4.25 },
79232
+ "muse-spark-1.2-contributor": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79233
+ "muse-spark-1.3": { inputPerMtoken: 1.25, outputPerMtoken: 4.25 },
79234
+ "muse-spark-1.3-contributor": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79235
+ "muse-wonder": { inputPerMtoken: 4, outputPerMtoken: 20 },
79236
+ "mythomax-l2-13b": { inputPerMtoken: 0.08, outputPerMtoken: 0.11 },
79237
+ "nemotron-3-nano-30b-a3b": { inputPerMtoken: 0.06, outputPerMtoken: 0.24 },
79238
+ "nemotron-3-nano-omni-30b-a3b-reasoning:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79239
+ "nemotron-3-super-120b-a12b": { inputPerMtoken: 0.08, outputPerMtoken: 0.45 },
79240
+ "nemotron-3-super-120b-a12b:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79241
+ "nemotron-3-ultra-550b-a55b": { inputPerMtoken: 0.6, outputPerMtoken: 2.4 },
79242
+ "nemotron-3-ultra-550b-a55b:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79243
+ "nemotron-3.5-content-safety": { inputPerMtoken: 0.2, outputPerMtoken: 0.2 },
79244
+ "nemotron-3.5-content-safety:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79245
+ "nemotron-3.5-lightning": { inputPerMtoken: 0.07, outputPerMtoken: 0.2 },
79246
+ "nemotron-3.5-lightning:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79247
+ "nex-n2.5-mini": { inputPerMtoken: 0.025, outputPerMtoken: 0.1 },
79248
+ "nex-n2.5-pro": { inputPerMtoken: 0.075, outputPerMtoken: 0.25 },
79249
+ "north-mini-code:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79250
+ "nova-2-lite-v1": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79251
+ "nova-lite-v1": { inputPerMtoken: 0.06, outputPerMtoken: 0.24 },
79252
+ "nova-micro-v1": { inputPerMtoken: 0.035, outputPerMtoken: 0.14 },
79253
+ "nova-premier-v1": { inputPerMtoken: 2.5, outputPerMtoken: 12.5 },
79254
+ "nova-pro-v1": { inputPerMtoken: 0.8, outputPerMtoken: 3.2 },
79255
+ "o1": { inputPerMtoken: 15, outputPerMtoken: 60 },
79256
+ "o1-pro": { inputPerMtoken: 150, outputPerMtoken: 600 },
79257
+ "o3": { inputPerMtoken: 2, outputPerMtoken: 8 },
79258
+ "o3-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79259
+ "o3-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79260
+ "o3-pro": { inputPerMtoken: 20, outputPerMtoken: 80 },
79261
+ "o4-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79262
+ "o4-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79263
+ "palmyra-x5": { inputPerMtoken: 0.6, outputPerMtoken: 6 },
79264
+ "pareto-26.10-preview": { inputPerMtoken: 0.8, outputPerMtoken: 3.2 },
79265
+ "pareto-26.9": { inputPerMtoken: 2.5, outputPerMtoken: 7.5 },
79266
+ "pareto-latest": { inputPerMtoken: 2.5, outputPerMtoken: 7.5 },
79267
+ "perceptron-mk1": { inputPerMtoken: 0.15, outputPerMtoken: 1.5 },
79268
+ "perceptron-mk1.5": { inputPerMtoken: 0.15, outputPerMtoken: 1.5 },
79269
+ "phi-4": { inputPerMtoken: 0.07, outputPerMtoken: 0.14 },
79270
+ "qwen-2.5-72b-instruct": { inputPerMtoken: 0.36, outputPerMtoken: 0.4 },
79271
+ "qwen-2.5-7b-instruct": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79272
+ "qwen-2.5-coder-32b-instruct": { inputPerMtoken: 0.66, outputPerMtoken: 1 },
79273
+ "qwen-plus": { inputPerMtoken: 0.26, outputPerMtoken: 0.78 },
79274
+ "qwen2.5-vl-72b-instruct": { inputPerMtoken: 0.8, outputPerMtoken: 1 },
79275
+ "qwen3-14b": { inputPerMtoken: 0.12, outputPerMtoken: 0.24 },
79276
+ "qwen3-235b-a22b-2507": { inputPerMtoken: 0.09, outputPerMtoken: 0.55 },
79277
+ "qwen3-235b-a22b-thinking-2507": { inputPerMtoken: 0.45, outputPerMtoken: 3.5 },
79278
+ "qwen3-30b-a3b": { inputPerMtoken: 0.12, outputPerMtoken: 0.5 },
79279
+ "qwen3-30b-a3b-instruct-2507": { inputPerMtoken: 0.1, outputPerMtoken: 0.3 },
79280
+ "qwen3-32b": { inputPerMtoken: 0.08, outputPerMtoken: 0.28 },
79281
+ "qwen3-coder": { inputPerMtoken: 0.3, outputPerMtoken: 1 },
79282
+ "qwen3-coder-30b-a3b-instruct": { inputPerMtoken: 0.07, outputPerMtoken: 0.28 },
79283
+ "qwen3-coder-flash": { inputPerMtoken: 0.195, outputPerMtoken: 0.975 },
79284
+ "qwen3-coder-next": { inputPerMtoken: 0.12, outputPerMtoken: 0.8 },
79285
+ "qwen3-next-80b-a3b-instruct": { inputPerMtoken: 0.1, outputPerMtoken: 1.1 },
79286
+ "qwen3-next-80b-a3b-thinking": { inputPerMtoken: 0.15, outputPerMtoken: 1.2 },
79287
+ "qwen3-vl-235b-a22b-instruct": { inputPerMtoken: 0.21, outputPerMtoken: 1.9 },
79288
+ "qwen3-vl-30b-a3b-instruct": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79289
+ "qwen3-vl-30b-a3b-thinking": { inputPerMtoken: 0.29, outputPerMtoken: 1 },
79290
+ "qwen3-vl-8b-instruct": { inputPerMtoken: 0.25, outputPerMtoken: 0.75 },
79291
+ "qwen3.5-122b-a10b": { inputPerMtoken: 0.26, outputPerMtoken: 2.08 },
79292
+ "qwen3.5-27b": { inputPerMtoken: 0.26, outputPerMtoken: 2.6 },
79293
+ "qwen3.5-35b-a3b": { inputPerMtoken: 0.15, outputPerMtoken: 1 },
79294
+ "qwen3.5-397b-a17b": { inputPerMtoken: 0.5, outputPerMtoken: 3.6 },
79295
+ "qwen3.5-9b": { inputPerMtoken: 0.1, outputPerMtoken: 0.15 },
79296
+ "qwen3.5-flash-02-23": { inputPerMtoken: 0.065, outputPerMtoken: 0.26 },
79297
+ "qwen3.5-plus-02-15": { inputPerMtoken: 0.26, outputPerMtoken: 1.56 },
79298
+ "qwen3.5-plus-20260420": { inputPerMtoken: 0.3, outputPerMtoken: 1.8 },
79299
+ "qwen3.6-27b": { inputPerMtoken: 0.32, outputPerMtoken: 3.2 },
79300
+ "qwen3.6-35b-a3b": { inputPerMtoken: 0.1, outputPerMtoken: 0.95 },
79301
+ "qwen3.6-flash": { inputPerMtoken: 0.1875, outputPerMtoken: 1.125 },
79302
+ "qwen3.6-plus": { inputPerMtoken: 0.325, outputPerMtoken: 1.95 },
79303
+ "qwen3.7-flash": { inputPerMtoken: 0.03, outputPerMtoken: 0.13 },
79304
+ "qwen3.7-max": { inputPerMtoken: 1.475, outputPerMtoken: 4.425 },
79305
+ "qwen3.7-plus": { inputPerMtoken: 0.32, outputPerMtoken: 1.28 },
79306
+ "qwen3.8-2.4t-a95b": { inputPerMtoken: 2, outputPerMtoken: 6 },
79307
+ "qwen3.8-27b": { inputPerMtoken: 0.04, outputPerMtoken: 2.3 },
79308
+ "qwen3.8-flash": { inputPerMtoken: 0.15, outputPerMtoken: 0.47 },
79309
+ "qwen3.8-max-0902": { inputPerMtoken: 2, outputPerMtoken: 6 },
79310
+ "qwen3.8-max-prime": { inputPerMtoken: 4, outputPerMtoken: 12 },
79311
+ "qwen3.8-omni-flash": { inputPerMtoken: 0.15, outputPerMtoken: 0.47 },
79312
+ "reka-edge": { inputPerMtoken: 0.1, outputPerMtoken: 0.1 },
79313
+ "reka-flash-3": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79314
+ "relace-apply-3": { inputPerMtoken: 0.85, outputPerMtoken: 1.25 },
79315
+ "relace-search": { inputPerMtoken: 1, outputPerMtoken: 3 },
79316
+ "remm-slerp-l2-13b": { inputPerMtoken: 0.35, outputPerMtoken: 0.65 },
79317
+ "sakana-namazu": { inputPerMtoken: 0.95, outputPerMtoken: 4 },
79318
+ "schematron-v2-small": { inputPerMtoken: 0.05, outputPerMtoken: 0.23 },
79319
+ "schematron-v2-turbo": { inputPerMtoken: 0.03, outputPerMtoken: 0.15 },
79320
+ "seed-1.6": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79321
+ "seed-1.6-flash": { inputPerMtoken: 0.075, outputPerMtoken: 0.3 },
79322
+ "seed-2-1-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 2.5 },
79323
+ "seed-2.0-code": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79324
+ "seed-2.0-lite": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79325
+ "seed-2.0-mini": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
79326
+ "skyfall-36b-v2": { inputPerMtoken: 0.55, outputPerMtoken: 0.8 },
79327
+ "solar-mini4": { inputPerMtoken: 0.05, outputPerMtoken: 0.2 },
79328
+ "solar-pro-3": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79329
+ "solar-pro4": { inputPerMtoken: 0.09, outputPerMtoken: 0.36 },
79330
+ "sonar": { inputPerMtoken: 1, outputPerMtoken: 1 },
79331
+ "sonar-deep-research": { inputPerMtoken: 2, outputPerMtoken: 8 },
79332
+ "sonar-pro": { inputPerMtoken: 3, outputPerMtoken: 15 },
79333
+ "sonar-pro-search": { inputPerMtoken: 3, outputPerMtoken: 15 },
79334
+ "sonar-reasoning-pro": { inputPerMtoken: 2, outputPerMtoken: 8 },
79335
+ "step-3.5-flash": { inputPerMtoken: 0.1, outputPerMtoken: 0.3 },
79336
+ "step-3.7-flash": { inputPerMtoken: 0.2, outputPerMtoken: 1.15 },
79337
+ "step-5-preview": { inputPerMtoken: 1, outputPerMtoken: 2.7 },
79338
+ "summarize": { inputPerMtoken: 0.04, outputPerMtoken: 0 },
79339
+ "ternary-bonsai-2-27b": { inputPerMtoken: 0.075, outputPerMtoken: 0.5 },
79340
+ "trinity-large-thinking": { inputPerMtoken: 0.25, outputPerMtoken: 0.8 },
79341
+ "ui-tars-1.5-7b": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79342
+ "unslopnemo-12b": { inputPerMtoken: 0.4, outputPerMtoken: 0.4 },
79343
+ "voxtral-small-24b-2507": { inputPerMtoken: 0.1, outputPerMtoken: 0.3 },
79344
+ "weaver": { inputPerMtoken: 0.4, outputPerMtoken: 0.75 },
79345
+ "wizardlm-2-8x22b": { inputPerMtoken: 0.62, outputPerMtoken: 0.62 }
79346
+ }
79347
+ };
79348
+ }
79349
+ });
78664
79350
  init_llm_cost = __esm2({
78665
79351
  "src/llm-cost.ts"() {
78666
79352
  "use strict";
79353
+ init_llm_pricing_openrouter();
79354
+ LEGACY_PRICING = {
79355
+ // Superseded by OPENROUTER_PRICING wherever OpenRouter lists the model.
79356
+ anthropic: {
79357
+ "claude-opus-4-7": { inputPerMtoken: 15, outputPerMtoken: 75 },
79358
+ "claude-opus-4": { inputPerMtoken: 15, outputPerMtoken: 75 },
79359
+ "claude-sonnet-4-6": { inputPerMtoken: 3, outputPerMtoken: 15 },
79360
+ "claude-sonnet-4": { inputPerMtoken: 3, outputPerMtoken: 15 },
79361
+ "claude-haiku-4-5": { inputPerMtoken: 0.8, outputPerMtoken: 4 },
79362
+ "claude-3-5-sonnet": { inputPerMtoken: 3, outputPerMtoken: 15 },
79363
+ "claude-3-5-haiku": { inputPerMtoken: 0.8, outputPerMtoken: 4 },
79364
+ "claude-3-opus": { inputPerMtoken: 15, outputPerMtoken: 75 },
79365
+ "claude-3-sonnet": { inputPerMtoken: 3, outputPerMtoken: 15 },
79366
+ "claude-3-haiku": { inputPerMtoken: 0.25, outputPerMtoken: 1.25 }
79367
+ },
79368
+ openai: {
79369
+ "gpt-4o": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79370
+ "gpt-4o-mini": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79371
+ "gpt-4-turbo": { inputPerMtoken: 10, outputPerMtoken: 30 },
79372
+ "gpt-4": { inputPerMtoken: 30, outputPerMtoken: 60 },
79373
+ "gpt-3.5-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
79374
+ "o1-preview": { inputPerMtoken: 15, outputPerMtoken: 60 },
79375
+ "o1-mini": { inputPerMtoken: 3, outputPerMtoken: 12 },
79376
+ "o3-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 }
79377
+ },
79378
+ openrouter: {
79379
+ // Qwen via OpenRouter — keys are post-prefix-strip canonical names.
79380
+ "qwen3.5-397b-a17b": { inputPerMtoken: 0.39, outputPerMtoken: 2.34 },
79381
+ "qwen3.6-plus": { inputPerMtoken: 0.26, outputPerMtoken: 1.56 },
79382
+ "qwen3-max-thinking": { inputPerMtoken: 1e-3, outputPerMtoken: 4e-3 },
79383
+ "qwen3-coder:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79384
+ // Grok via OpenRouter
79385
+ "grok-4.20-multi-agent": { inputPerMtoken: 2, outputPerMtoken: 2 },
79386
+ // DeepSeek routed through OpenRouter (cheaper than direct on output tokens).
79387
+ "deepseek-v3.2": { inputPerMtoken: 0.28, outputPerMtoken: 0.42 },
79388
+ "deepseek-v3.2-speciale": { inputPerMtoken: 0.4, outputPerMtoken: 1.2 },
79389
+ "deepseek-v4-pro": { inputPerMtoken: 0.28, outputPerMtoken: 0.42 },
79390
+ "deepseek-v4-flash": { inputPerMtoken: 0.14, outputPerMtoken: 0.28 }
79391
+ },
79392
+ // DeepSeek direct (deepseek.com) — different pricing than via-OR.
79393
+ // Output prices are noticeably higher on the direct API.
79394
+ deepseek: {
79395
+ "deepseek-v3.2": { inputPerMtoken: 0.27, outputPerMtoken: 1.1 },
79396
+ "deepseek-v3.2-speciale": { inputPerMtoken: 0.55, outputPerMtoken: 2.19 },
79397
+ "deepseek-v4-pro": { inputPerMtoken: 0.27, outputPerMtoken: 1.1 },
79398
+ "deepseek-v4-flash": { inputPerMtoken: 0.14, outputPerMtoken: 0.55 }
79399
+ },
79400
+ // Empty for now — add as we onboard customers using these providers.
79401
+ groq: {},
79402
+ together: {},
79403
+ mistral: {},
79404
+ azure: {}
79405
+ };
79406
+ PRICING = {
79407
+ ...LEGACY_PRICING,
79408
+ anthropic: { ...LEGACY_PRICING.anthropic, ...OPENROUTER_PRICING.anthropic },
79409
+ openai: { ...LEGACY_PRICING.openai, ...OPENROUTER_PRICING.openai },
79410
+ openrouter: { ...LEGACY_PRICING.openrouter, ...OPENROUTER_PRICING.openrouter }
79411
+ };
78667
79412
  }
78668
79413
  });
78669
79414
  init_fetch_interceptor = __esm2({
@@ -99912,7 +100657,7 @@ data:
99912
100657
  await init_skill_telemetry();
99913
100658
  await init_policy_enforcer();
99914
100659
  init_room_protocol();
99915
- VERSION = true ? "0.23.45" : "0.0.0-dev";
100660
+ VERSION = true ? "0.23.47" : "0.0.0-dev";
99916
100661
  }
99917
100662
  });
99918
100663
  await init_index();
@@ -100120,6 +100865,77 @@ var init_config = __esm({
100120
100865
  }
100121
100866
  });
100122
100867
 
100868
+ // src/enrollment-fingerprint.ts
100869
+ import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
100870
+ import { join as join9 } from "node:path";
100871
+ function fingerprintLines(fingerprint) {
100872
+ return [
100873
+ `Fingerprint: ${fingerprint}`,
100874
+ "Verify this fingerprint matches the one shown in your AgentVault dashboard before clicking Approve."
100875
+ ];
100876
+ }
100877
+ function pendingFingerprintPath(dataDir) {
100878
+ return join9(dataDir, PENDING_FINGERPRINT_FILE);
100879
+ }
100880
+ function writePendingFingerprint(dataDir, fingerprint) {
100881
+ try {
100882
+ mkdirSync3(dataDir, { recursive: true, mode: 448 });
100883
+ writeFileSync2(pendingFingerprintPath(dataDir), fingerprint, { mode: 384 });
100884
+ } catch {
100885
+ }
100886
+ }
100887
+ function readPendingFingerprint(dataDir) {
100888
+ const p2 = pendingFingerprintPath(dataDir);
100889
+ if (!existsSync3(p2)) return void 0;
100890
+ try {
100891
+ const raw = readFileSync4(p2, "utf-8").trim();
100892
+ return raw.length > 0 ? raw : void 0;
100893
+ } catch {
100894
+ return void 0;
100895
+ }
100896
+ }
100897
+ function clearPendingFingerprint(dataDir) {
100898
+ try {
100899
+ rmSync2(pendingFingerprintPath(dataDir), { force: true });
100900
+ } catch {
100901
+ }
100902
+ }
100903
+ function sleepSync(ms2) {
100904
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms2);
100905
+ }
100906
+ function waitForPendingFingerprint(dataDir, opts = {}) {
100907
+ const timeoutMs = opts.timeoutMs ?? 3e4;
100908
+ const intervalMs = opts.intervalMs ?? 250;
100909
+ const sleep = opts.sleep ?? sleepSync;
100910
+ const now = opts.now ?? Date.now;
100911
+ const deadline = now() + timeoutMs;
100912
+ for (; ; ) {
100913
+ const fp = readPendingFingerprint(dataDir);
100914
+ if (fp) return fp;
100915
+ if (now() >= deadline) return void 0;
100916
+ sleep(intervalMs);
100917
+ }
100918
+ }
100919
+ function watchEnrollmentFingerprint(channel, dataDir, log) {
100920
+ channel.on("state", (s10) => {
100921
+ if (s10 === "polling") {
100922
+ const fp = channel.fingerprint;
100923
+ if (!fp) return;
100924
+ for (const line of fingerprintLines(fp)) log(line);
100925
+ writePendingFingerprint(dataDir, fp);
100926
+ } else if (s10 === "ready") {
100927
+ clearPendingFingerprint(dataDir);
100928
+ }
100929
+ });
100930
+ }
100931
+ var PENDING_FINGERPRINT_FILE;
100932
+ var init_enrollment_fingerprint = __esm({
100933
+ "src/enrollment-fingerprint.ts"() {
100934
+ "use strict";
100935
+ PENDING_FINGERPRINT_FILE = "pending-fingerprint";
100936
+ }
100937
+ });
100938
+
100123
100939
  // src/service/launcher.ts
100124
100940
  import { dirname as dirname4 } from "node:path";
100125
100941
  function sq2(s10) {
@@ -100172,7 +100988,7 @@ var init_launcher = __esm({
100172
100988
  });
100173
100989
 
100174
100990
  // src/service/spec.ts
100175
- import { join as join10 } from "node:path";
100991
+ import { join as join11 } from "node:path";
100176
100992
  function buildServiceSpec(cfg, opts) {
100177
100993
  const env = {
100178
100994
  AV_AGENT_NAME: cfg.agentName,
@@ -100185,7 +101001,7 @@ function buildServiceSpec(cfg, opts) {
100185
101001
  if (cfg.armRoom) env.AV_ARM_ROOM = "1";
100186
101002
  if (cfg.model) env.AV_CLAUDE_MODEL = cfg.model;
100187
101003
  if (cfg.systemPrompt) env.AV_SYSTEM_PROMPT = cfg.systemPrompt;
100188
- const launcherPath = join10(cfg.dataDir, "launch-bridge.sh");
101004
+ const launcherPath = join11(cfg.dataDir, "launch-bridge.sh");
100189
101005
  return {
100190
101006
  label: `dev.agentvault.bridge-${slugify2(cfg.agentName)}`,
100191
101007
  programArgs: [launcherPath],
@@ -100193,8 +101009,8 @@ function buildServiceSpec(cfg, opts) {
100193
101009
  launcherScript: renderLauncher({ installPath: opts.path, entrypoint: opts.entrypoint }),
100194
101010
  env,
100195
101011
  workingDir: cfg.workspaceDir ? cfg.workspaceDir : opts.home,
100196
- logOut: join10(cfg.dataDir, "logs", "bridge.log"),
100197
- logErr: join10(cfg.dataDir, "logs", "bridge.error.log"),
101012
+ logOut: join11(cfg.dataDir, "logs", "bridge.log"),
101013
+ logErr: join11(cfg.dataDir, "logs", "bridge.error.log"),
100198
101014
  keepAliveUnlessCleanExit: true,
100199
101015
  runAtLoad: true
100200
101016
  };
@@ -100208,7 +101024,7 @@ var init_spec = __esm({
100208
101024
  });
100209
101025
 
100210
101026
  // src/service/launchd.ts
100211
- import { dirname as dirname5, join as join11 } from "node:path";
101027
+ import { dirname as dirname5, join as join12 } from "node:path";
100212
101028
  function esc3(s10) {
100213
101029
  return s10.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
100214
101030
  }
@@ -100286,7 +101102,7 @@ var init_launchd = __esm({
100286
101102
  }
100287
101103
  deps;
100288
101104
  plistPath(label) {
100289
- return join11(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
101105
+ return join12(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
100290
101106
  }
100291
101107
  domain() {
100292
101108
  return `gui/${this.deps.uid}`;
@@ -100336,11 +101152,11 @@ var init_launchd = __esm({
100336
101152
  * KeepAlive leaves it down. `launchctl list` would not show the very thing
100337
101153
  * doctor exists to find. */
100338
101154
  list(prefix) {
100339
- const dir = join11(this.deps.home, "Library", "LaunchAgents");
101155
+ const dir = join12(this.deps.home, "Library", "LaunchAgents");
100340
101156
  const out = [];
100341
101157
  for (const name of this.deps.readdir(dir)) {
100342
101158
  if (!name.startsWith(prefix) || !name.endsWith(".plist")) continue;
100343
- const path2 = join11(dir, name);
101159
+ const path2 = join12(dir, name);
100344
101160
  out.push({
100345
101161
  label: name.slice(0, -".plist".length),
100346
101162
  path: path2,
@@ -100354,7 +101170,7 @@ var init_launchd = __esm({
100354
101170
  });
100355
101171
 
100356
101172
  // src/service/systemd.ts
100357
- import { dirname as dirname6, join as join12 } from "node:path";
101173
+ import { dirname as dirname6, join as join13 } from "node:path";
100358
101174
  function q5(s10) {
100359
101175
  const esc4 = s10.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/%/g, "%%");
100360
101176
  return `"${esc4}"`;
@@ -100409,7 +101225,7 @@ var init_systemd = __esm({
100409
101225
  }
100410
101226
  deps;
100411
101227
  unitPath(label) {
100412
- return join12(this.deps.home, ".config", "systemd", "user", `${label}.service`);
101228
+ return join13(this.deps.home, ".config", "systemd", "user", `${label}.service`);
100413
101229
  }
100414
101230
  install(spec) {
100415
101231
  const path2 = this.unitPath(spec.label);
@@ -100446,11 +101262,11 @@ var init_systemd = __esm({
100446
101262
  * SuccessExitStatus=0 treats as success, so it is never restarted. A
100447
101263
  * running-units listing would not show the thing doctor exists to find. */
100448
101264
  list(prefix) {
100449
- const dir = join12(this.deps.home, ".config", "systemd", "user");
101265
+ const dir = join13(this.deps.home, ".config", "systemd", "user");
100450
101266
  const out = [];
100451
101267
  for (const name of this.deps.readdir(dir)) {
100452
101268
  if (!name.startsWith(prefix) || !name.endsWith(".service")) continue;
100453
- const path2 = join12(dir, name);
101269
+ const path2 = join13(dir, name);
100454
101270
  out.push({
100455
101271
  label: name.slice(0, -".service".length),
100456
101272
  path: path2,
@@ -100465,7 +101281,7 @@ var init_systemd = __esm({
100465
101281
 
100466
101282
  // src/service/backend.ts
100467
101283
  import { spawnSync } from "node:child_process";
100468
- import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync3, rmSync as rmSync4, existsSync as existsSync4, chmodSync as chmodSync4, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "node:fs";
101284
+ import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync4, rmSync as rmSync5, existsSync as existsSync5, chmodSync as chmodSync4, readdirSync as readdirSync3, readFileSync as readFileSync7 } from "node:fs";
100469
101285
  import { userInfo } from "node:os";
100470
101286
  function defaultDeps() {
100471
101287
  return {
@@ -100476,11 +101292,11 @@ function defaultDeps() {
100476
101292
  const r7 = spawnSync(cmd, args, { encoding: "utf8" });
100477
101293
  return { code: r7.status ?? 1, stdout: r7.stdout ?? "" };
100478
101294
  },
100479
- writeFile: (p2, d10) => writeFileSync3(p2, d10),
100480
- mkdir: (p2) => mkdirSync5(p2, { recursive: true }),
101295
+ writeFile: (p2, d10) => writeFileSync4(p2, d10),
101296
+ mkdir: (p2) => mkdirSync6(p2, { recursive: true }),
100481
101297
  chmod: (p2, m6) => chmodSync4(p2, m6),
100482
- rm: (p2) => rmSync4(p2, { force: true }),
100483
- exists: (p2) => existsSync4(p2),
101298
+ rm: (p2) => rmSync5(p2, { force: true }),
101299
+ exists: (p2) => existsSync5(p2),
100484
101300
  readdir: (p2) => {
100485
101301
  try {
100486
101302
  return readdirSync3(p2);
@@ -100490,7 +101306,7 @@ function defaultDeps() {
100490
101306
  },
100491
101307
  readFile: (p2) => {
100492
101308
  try {
100493
- return readFileSync6(p2, "utf8");
101309
+ return readFileSync7(p2, "utf8");
100494
101310
  } catch {
100495
101311
  return "";
100496
101312
  }
@@ -100568,6 +101384,7 @@ function maybeRunServiceSubcommand(argv, env, deps) {
100568
101384
  const firstBoot = !hasPersistedCreds(cfg.dataDir) && !!cfg.inviteToken;
100569
101385
  if (firstBoot) {
100570
101386
  writePendingInvite(cfg.dataDir, cfg.inviteToken);
101387
+ clearPendingFingerprint(cfg.dataDir);
100571
101388
  }
100572
101389
  const spec = buildServiceSpec(cfg, {
100573
101390
  entrypoint,
@@ -100580,6 +101397,15 @@ function maybeRunServiceSubcommand(argv, env, deps) {
100580
101397
  backend.install(spec);
100581
101398
  log(`installed service ${spec.label} \u2014 logs: ${spec.logErr}`);
100582
101399
  if (firstBoot) {
101400
+ const waitFp = deps?.waitForFingerprint ?? (deps?.backend ? () => void 0 : waitForPendingFingerprint);
101401
+ const fp = waitFp(cfg.dataDir);
101402
+ if (fp) {
101403
+ for (const line of fingerprintLines(fp)) log(line);
101404
+ } else {
101405
+ log(
101406
+ `the device fingerprint is not available yet \u2014 see it with: AV_AGENT_NAME=${cfg.agentName} agentvault-claude-bridge status`
101407
+ );
101408
+ }
100583
101409
  log("now APPROVE the device in AgentVault \u2014 the service is waiting to enrol");
100584
101410
  log("if it does not connect within a minute, the log above says why");
100585
101411
  }
@@ -100598,6 +101424,15 @@ function maybeRunServiceSubcommand(argv, env, deps) {
100598
101424
  const label = resolveLabel(backend, env);
100599
101425
  const st = backend.status(label);
100600
101426
  log(`${label}: ${st.loaded ? "loaded" : "not loaded"}`);
101427
+ let pendingFp;
101428
+ try {
101429
+ pendingFp = readPendingFingerprint(resolveDataDir(env).dataDir);
101430
+ } catch {
101431
+ pendingFp = void 0;
101432
+ }
101433
+ if (pendingFp) {
101434
+ for (const line of fingerprintLines(pendingFp)) log(line);
101435
+ }
100601
101436
  } else if (cmd === "logs") {
100602
101437
  const label = resolveLabel(backend, env);
100603
101438
  log(`logs for ${label} are at <dataDir>/logs/bridge.log (tail -f it)`);
@@ -100615,6 +101450,7 @@ var init_subcommand = __esm({
100615
101450
  init_config();
100616
101451
  init_spec();
100617
101452
  init_pending_invite();
101453
+ init_enrollment_fingerprint();
100618
101454
  init_backend();
100619
101455
  SERVICE_CMDS = /* @__PURE__ */ new Set(["install", "uninstall", "restart", "status", "logs"]);
100620
101456
  }
@@ -100849,7 +101685,7 @@ __export(doctor_cli_exports, {
100849
101685
  maybeRunDoctorSubcommand: () => maybeRunDoctorSubcommand,
100850
101686
  realDoctorDeps: () => realDoctorDeps
100851
101687
  });
100852
- import { join as join14 } from "node:path";
101688
+ import { join as join15 } from "node:path";
100853
101689
  import { readdirSync as readdirSync5 } from "node:fs";
100854
101690
  async function fetchDeviceStatus(apiUrl, deviceId, doFetch = fetch) {
100855
101691
  const res = await doFetch(`${apiUrl}/api/v1/devices/${deviceId}/status`, {
@@ -100885,7 +101721,7 @@ function listCredDirs(base) {
100885
101721
  return out;
100886
101722
  }
100887
101723
  for (const name of names) {
100888
- const dir = join14(base, name);
101724
+ const dir = join15(base, name);
100889
101725
  if (hasPersistedCreds(dir)) out.push(dir);
100890
101726
  }
100891
101727
  return out;
@@ -100902,7 +101738,7 @@ function otherFamilyLabels(backend) {
100902
101738
  }
100903
101739
  function realDoctorDeps(env) {
100904
101740
  const backend = selectBackend(process.platform);
100905
- const base = join14(env.HOME ?? "", ".agentvault", "claude-room-bridge");
101741
+ const base = join15(env.HOME ?? "", ".agentvault", "claude-room-bridge");
100906
101742
  return {
100907
101743
  backend,
100908
101744
  labelPrefixes: [LABEL_PREFIX, LEGACY_LABEL_PREFIX],
@@ -100959,8 +101795,9 @@ var init_doctor_cli = __esm({
100959
101795
  await init_dist();
100960
101796
  init_config();
100961
101797
  init_pending_invite();
100962
- import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync7 } from "node:fs";
100963
- import { join as join15 } from "node:path";
101798
+ init_enrollment_fingerprint();
101799
+ import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync8 } from "node:fs";
101800
+ import { join as join16 } from "node:path";
100964
101801
 
100965
101802
  // ../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
100966
101803
  import { createRequire as $S } from "node:module";
@@ -122261,8 +123098,8 @@ import { realpathSync as realpathSync2 } from "node:fs";
122261
123098
  import { resolve as resolve4, dirname as dirname3, basename, sep as sep2, isAbsolute } from "node:path";
122262
123099
 
122263
123100
  // src/host-trust.ts
122264
- import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync2, rmSync as rmSync3, readdirSync as readdirSync2, lstatSync as lstatSync2, readFileSync as readFileSync5, chmodSync as chmodSync3 } from "node:fs";
122265
- import { join as join9 } from "node:path";
123101
+ import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync3, rmSync as rmSync4, readdirSync as readdirSync2, lstatSync as lstatSync2, readFileSync as readFileSync6, chmodSync as chmodSync3 } from "node:fs";
123102
+ import { join as join10 } from "node:path";
122266
123103
  import { homedir as homedir2, hostname as hostname3 } from "node:os";
122267
123104
  var TRUST_SUBDIR = "host-trust";
122268
123105
  var DIR_MODE4 = 448;
@@ -122272,7 +123109,7 @@ var IDENTITY_FILES = ["agentvault.json", "secure-channel.json", "agentvault.json
122272
123109
  var HostTrustError = class extends Error {
122273
123110
  };
122274
123111
  function trustDir(root3) {
122275
- return join9(root3 ?? join9(homedir2(), ".agentvault"), TRUST_SUBDIR);
123112
+ return join10(root3 ?? join10(homedir2(), ".agentvault"), TRUST_SUBDIR);
122276
123113
  }
122277
123114
  function sanitize(deviceId) {
122278
123115
  if (typeof deviceId !== "string" || !ID_RE.test(deviceId)) {
@@ -122283,7 +123120,7 @@ function sanitize(deviceId) {
122283
123120
  function isTrusted(deviceId, root3) {
122284
123121
  try {
122285
123122
  if (typeof deviceId !== "string" || !ID_RE.test(deviceId)) return false;
122286
- const p2 = join9(trustDir(root3), deviceId);
123123
+ const p2 = join10(trustDir(root3), deviceId);
122287
123124
  return lstatSync2(p2).isFile();
122288
123125
  } catch {
122289
123126
  return false;
@@ -122292,9 +123129,9 @@ function isTrusted(deviceId, root3) {
122292
123129
  function grant(deviceId, root3) {
122293
123130
  const id = sanitize(deviceId);
122294
123131
  const dir = trustDir(root3);
122295
- const p2 = join9(dir, id);
122296
- mkdirSync4(dir, { recursive: true, mode: DIR_MODE4 });
122297
- writeFileSync2(
123132
+ const p2 = join10(dir, id);
123133
+ mkdirSync5(dir, { recursive: true, mode: DIR_MODE4 });
123134
+ writeFileSync3(
122298
123135
  p2,
122299
123136
  `granted_at=${(/* @__PURE__ */ new Date()).toISOString()} host=${hostname3()}
122300
123137
  `,
@@ -122305,13 +123142,13 @@ function grant(deviceId, root3) {
122305
123142
  }
122306
123143
  function revoke(deviceId, root3) {
122307
123144
  const id = sanitize(deviceId);
122308
- const p2 = join9(trustDir(root3), id);
123145
+ const p2 = join10(trustDir(root3), id);
122309
123146
  try {
122310
123147
  if (!lstatSync2(p2).isFile()) return false;
122311
123148
  } catch {
122312
123149
  return false;
122313
123150
  }
122314
- rmSync3(p2, { force: true });
123151
+ rmSync4(p2, { force: true });
122315
123152
  return true;
122316
123153
  }
122317
123154
  function listTrusted(root3) {
@@ -122326,7 +123163,7 @@ function listTrusted(root3) {
122326
123163
  function readDeviceId(dataDir) {
122327
123164
  for (const f7 of IDENTITY_FILES) {
122328
123165
  try {
122329
- const parsed = JSON.parse(readFileSync5(join9(dataDir, f7), "utf-8"));
123166
+ const parsed = JSON.parse(readFileSync6(join10(dataDir, f7), "utf-8"));
122330
123167
  if (parsed?.deviceId && ID_RE.test(parsed.deviceId)) return parsed.deviceId;
122331
123168
  } catch {
122332
123169
  }
@@ -136264,6 +137101,45 @@ config2(en_default3());
136264
137101
 
136265
137102
  // src/session.ts
136266
137103
  init_log();
137104
+
137105
+ // src/usage-report.ts
137106
+ var num = (o10, k2) => typeof o10[k2] === "number" && Number.isFinite(o10[k2]) ? o10[k2] : void 0;
137107
+ function usageFromResult(result, fallbackModel) {
137108
+ const out = [];
137109
+ const perModel = result.modelUsage;
137110
+ if (perModel && typeof perModel === "object" && !Array.isArray(perModel)) {
137111
+ for (const [model, raw] of Object.entries(perModel)) {
137112
+ if (!raw || typeof raw !== "object") continue;
137113
+ const u2 = raw;
137114
+ const entry = {
137115
+ model,
137116
+ inputTokens: num(u2, "inputTokens") ?? 0,
137117
+ outputTokens: num(u2, "outputTokens") ?? 0,
137118
+ costUsd: num(u2, "costUSD"),
137119
+ cacheReadTokens: num(u2, "cacheReadInputTokens"),
137120
+ cacheCreationTokens: num(u2, "cacheCreationInputTokens")
137121
+ };
137122
+ if (entry.inputTokens > 0 || entry.outputTokens > 0) out.push(entry);
137123
+ }
137124
+ if (out.length > 0) return out;
137125
+ }
137126
+ const usage = result.usage ?? {};
137127
+ const inputTokens = num(usage, "input_tokens") ?? 0;
137128
+ const outputTokens = num(usage, "output_tokens") ?? 0;
137129
+ if (inputTokens > 0 || outputTokens > 0) {
137130
+ out.push({
137131
+ model: fallbackModel || "claude",
137132
+ inputTokens,
137133
+ outputTokens,
137134
+ costUsd: num(result, "total_cost_usd"),
137135
+ cacheReadTokens: num(usage, "cache_read_input_tokens"),
137136
+ cacheCreationTokens: num(usage, "cache_creation_input_tokens")
137137
+ });
137138
+ }
137139
+ return out;
137140
+ }
137141
+
137142
+ // src/session.ts
136267
137143
  function makeRoomSayTool(onSay) {
136268
137144
  return bs(
136269
137145
  "say",
@@ -136570,20 +137446,25 @@ var PersistentClaudeSession = class {
136570
137446
  } else if (m6.type === "result") {
136571
137447
  this.sawResultThisTurn = true;
136572
137448
  const r7 = m6;
136573
- const num = (k2) => typeof r7[k2] === "number" ? r7[k2] : void 0;
137449
+ const num2 = (k2) => typeof r7[k2] === "number" ? r7[k2] : void 0;
136574
137450
  const str = (k2) => typeof r7[k2] === "string" ? r7[k2] : void 0;
136575
137451
  const usage = r7.usage ?? {};
136576
137452
  const unum = (k2) => typeof usage[k2] === "number" ? usage[k2] : void 0;
136577
137453
  this.resultTelemetry = {
136578
- durationMs: num("duration_ms"),
136579
- durationApiMs: num("duration_api_ms"),
136580
- numTurns: num("num_turns"),
137454
+ durationMs: num2("duration_ms"),
137455
+ durationApiMs: num2("duration_api_ms"),
137456
+ numTurns: num2("num_turns"),
136581
137457
  subtype: str("subtype"),
136582
137458
  stopReason: str("stop_reason"),
136583
- apiErrorStatus: num("api_error_status"),
137459
+ apiErrorStatus: num2("api_error_status"),
136584
137460
  cacheReadTokens: unum("cache_read_input_tokens"),
136585
137461
  cacheCreationTokens: unum("cache_creation_input_tokens")
136586
137462
  };
137463
+ try {
137464
+ const usageEntries = usageFromResult(r7, this.opts.model);
137465
+ if (usageEntries.length > 0) this.opts.onUsage?.(usageEntries, num2("duration_api_ms"));
137466
+ } catch {
137467
+ }
136587
137468
  const reply = this.activeReply;
136588
137469
  if (this.currentReplyExpected && !this.saidThisTurn && this.turnText.trim()) {
136589
137470
  if (reply) {
@@ -136901,8 +137782,25 @@ function selfUninstallOnTerminal(reason, env, deps = {}) {
136901
137782
  }
136902
137783
 
136903
137784
  // src/approve-cli.ts
136904
- import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync4, readFileSync as readFileSync7, readdirSync as readdirSync4, rmSync as rmSync5, existsSync as existsSync5 } from "node:fs";
136905
- import { join as join13 } from "node:path";
137785
+ import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync5, readFileSync as readFileSync8, readdirSync as readdirSync4, rmSync as rmSync6, existsSync as existsSync6 } from "node:fs";
137786
+ import { join as join14 } from "node:path";
137787
+
137788
+ // src/cli-hint.ts
137789
+ var BRIDGE_BINARY = "agentvault-claude-bridge";
137790
+ function shellQuote(value) {
137791
+ return /^[A-Za-z0-9._-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
137792
+ }
137793
+ var HINT_ID_RE = /^[A-Za-z0-9_-]{1,128}$/;
137794
+ function isHintSafeId(value) {
137795
+ return typeof value === "string" && HINT_ID_RE.test(value);
137796
+ }
137797
+ function bridgeCommand(subcommand, agentName) {
137798
+ const name = agentName?.trim();
137799
+ const value = !name ? "<name>" : shellQuote(name);
137800
+ return `AV_AGENT_NAME=${value} ${BRIDGE_BINARY} ${subcommand}`;
137801
+ }
137802
+
137803
+ // src/approve-cli.ts
136906
137804
  var APPROVALS_SUBDIR = "arm-approvals";
136907
137805
  var ID_RE2 = /^[A-Za-z0-9_-]{1,128}$/;
136908
137806
  var ApproveArmError = class extends Error {
@@ -136922,24 +137820,24 @@ function sanitizeRoomId(roomId) {
136922
137820
  function writeApproval(dataDir, requestId, roomId) {
136923
137821
  const id = sanitizeRequestId(requestId);
136924
137822
  const room = sanitizeRoomId(roomId);
136925
- const dir = join13(dataDir, APPROVALS_SUBDIR);
136926
- mkdirSync6(dir, { recursive: true });
136927
- writeFileSync4(join13(dir, id), room);
137823
+ const dir = join14(dataDir, APPROVALS_SUBDIR);
137824
+ mkdirSync7(dir, { recursive: true });
137825
+ writeFileSync5(join14(dir, id), room);
136928
137826
  }
136929
137827
  function drainApprovals(dataDir) {
136930
- const dir = join13(dataDir, APPROVALS_SUBDIR);
136931
- if (!existsSync5(dir)) return [];
137828
+ const dir = join14(dataDir, APPROVALS_SUBDIR);
137829
+ if (!existsSync6(dir)) return [];
136932
137830
  const out = [];
136933
137831
  for (const name of readdirSync4(dir)) {
136934
137832
  if (!ID_RE2.test(name)) continue;
136935
137833
  let roomId = "";
136936
137834
  try {
136937
- roomId = readFileSync7(join13(dir, name), "utf8").trim();
137835
+ roomId = readFileSync8(join14(dir, name), "utf8").trim();
136938
137836
  } catch {
136939
137837
  }
136940
137838
  out.push({ requestId: name, roomId: ID_RE2.test(roomId) ? roomId : "" });
136941
137839
  try {
136942
- rmSync5(join13(dir, name), { force: true, recursive: true });
137840
+ rmSync6(join14(dir, name), { force: true, recursive: true });
136943
137841
  } catch {
136944
137842
  }
136945
137843
  }
@@ -136992,7 +137890,7 @@ function maybeRunHostTrustSubcommand(argv, dataDir, root3) {
136992
137890
  console.log(
136993
137891
  `This machine will trust web-granted full access for device ${deviceId}.
136994
137892
  Writes: ${trustDir(root3)}/${deviceId}
136995
- Revoke: av-bridge untrust-host
137893
+ Revoke: ${bridgeCommand("untrust-host", process.env.AV_AGENT_NAME)}
136996
137894
  Re-run with --yes to confirm.`
136997
137895
  );
136998
137896
  return true;
@@ -137246,7 +138144,7 @@ function wireBridge(channel, session, target, opts = {}) {
137246
138144
  const trustChanged = hostTrusted !== prevHostTrusted || gatesRemoved !== prevGatesEffective;
137247
138145
  if (s10?.gatesRemoved === true && !decision.hostTrusted) {
137248
138146
  log(
137249
- `"Remove all gates" is ON for this device but this HOST has not approved it. Full access is NOT in effect. Grant on this machine: av-bridge trust-host`
138147
+ `"Remove all gates" is ON for this device but this HOST has not approved it. Full access is NOT in effect. Grant on this machine: ${bridgeCommand("trust-host", opts.agentName)}`
137250
138148
  );
137251
138149
  }
137252
138150
  if (!workerCapable) {
@@ -137271,7 +138169,7 @@ function wireBridge(channel, session, target, opts = {}) {
137271
138169
  const dropped = arming.reconcileDisarm(roomIds);
137272
138170
  if (dropped.length > 0) {
137273
138171
  log(
137274
- `arming_snapshot: OS-isolated worker \u2014 disarm-only without host trust (av-bridge trust-host); disarmed: [${dropped.map((r7) => r7.slice(0, 8)).join(", ")}]`
138172
+ `arming_snapshot: OS-isolated worker \u2014 disarm-only without host trust (${bridgeCommand("trust-host", opts.agentName)}); disarmed: [${dropped.map((r7) => r7.slice(0, 8)).join(", ")}]`
137275
138173
  );
137276
138174
  }
137277
138175
  } else {
@@ -137307,9 +138205,13 @@ function wireBridge(channel, session, target, opts = {}) {
137307
138205
  return;
137308
138206
  }
137309
138207
  try {
137310
- arming.registerArmRequest(r7?.roomId, r7?.requestId);
138208
+ if (!isHintSafeId(r7?.requestId) || !isHintSafeId(r7?.roomId)) {
138209
+ log("arm_requested ignored \u2014 request-id or room-id is not a plain id");
138210
+ return;
138211
+ }
138212
+ arming.registerArmRequest(r7.roomId, r7.requestId);
137311
138213
  log(
137312
- `[worker-gate] arm requested for room ${r7?.roomId} \u2014 approve locally on the host: av-bridge approve-arm ${r7?.requestId} ${r7?.roomId}`
138214
+ `[worker-gate] arm requested for room ${r7.roomId} \u2014 approve locally on the host: ` + bridgeCommand(`approve-arm ${r7.requestId} ${r7.roomId}`, opts.agentName)
137313
138215
  );
137314
138216
  } catch (err) {
137315
138217
  log(`arm_requested handling failed (ignored): ${err instanceof Error ? err.message : String(err)}`);
@@ -137360,7 +138262,7 @@ async function main() {
137360
138262
  "[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
137361
138263
  );
137362
138264
  }
137363
- logLine(`[bridge] version: ${true ? "0.8.17" : "dev"}`);
138265
+ logLine(`[bridge] version: ${true ? "0.8.19" : "dev"}`);
137364
138266
  logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
137365
138267
  logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
137366
138268
  if (cfg.armRoom) {
@@ -137392,7 +138294,7 @@ async function main() {
137392
138294
  // its default would render "@agentvault/agentvault@0.7.x" — the wrong
137393
138295
  // package name attached to the bridge's version number, which is worse
137394
138296
  // than either alone.
137395
- clientVersion: `@agentvault/claude-bridge@${true ? "0.8.17" : "dev"}`
138297
+ clientVersion: `@agentvault/claude-bridge@${true ? "0.8.19" : "dev"}`
137396
138298
  });
137397
138299
  const agentSystemPrompt = cfg.systemPrompt ?? `You are ${cfg.agentName}, an AI agent on AgentVault. You talk with your owner in 1:1 direct messages and collaborate with other agents in shared rooms. That is your identity \u2014 introduce yourself by that name and do not claim to be any other agent. To speak, call the say tool. In a 1:1 with your owner, reply to what they say. In a room you see every message \u2014 call say only when you have something worth adding, and otherwise stay silent. Keep messages concise.`;
137398
138300
  const deviceJwt = () => {
@@ -137403,8 +138305,23 @@ async function main() {
137403
138305
  const workAllowed = () => liveWorkAllowed();
137404
138306
  let liveGatesRemoved = () => false;
137405
138307
  const gatesRemoved = () => liveGatesRemoved();
138308
+ const reportUsage = (entries, durationApiMs) => {
138309
+ const telemetry = channel.telemetry;
138310
+ if (!telemetry) return;
138311
+ for (const e7 of entries) {
138312
+ telemetry.reportLlmCall({
138313
+ model: e7.model,
138314
+ provider: "anthropic",
138315
+ tokensInput: e7.inputTokens,
138316
+ tokensOutput: e7.outputTokens,
138317
+ latencyMs: Math.round((durationApiMs ?? 0) / entries.length),
138318
+ ...e7.costUsd !== void 0 ? { costUsd: e7.costUsd } : {}
138319
+ });
138320
+ }
138321
+ };
137406
138322
  const listener = new PersistentClaudeSession({
137407
138323
  model: cfg.model,
138324
+ onUsage: reportUsage,
137408
138325
  systemPrompt: agentSystemPrompt,
137409
138326
  // Claude speaks by calling the say tool → the session routes it to the reply
137410
138327
  // bound to the message being answered (wireBridge captures that per inbound via
@@ -137421,6 +138338,7 @@ async function main() {
137421
138338
  makeSession: (task) => new PersistentClaudeSession({
137422
138339
  model: cfg.model,
137423
138340
  systemPrompt: agentSystemPrompt,
138341
+ onUsage: reportUsage,
137424
138342
  onObserve: (text) => logLine(`[worker] observed (${text.length} chars, not sent)`),
137425
138343
  worker: true,
137426
138344
  // Task 4: the hard backstop — no tool runs on any worker turn (owner DM or
@@ -137456,9 +138374,9 @@ async function main() {
137456
138374
  `[worker-trap] ${rec.at} ${rec.outcome} after ${rec.ranMs}ms (waited ${rec.waitedMs}ms behind ${rec.queueDepthAtEnqueue}, ${rec.queueDepthAtStart} still queued) replyExpected=${rec.replyExpected}` + (rec.session ? ` composed=${rec.session.composedChars} result=${rec.session.sawResult} said=${rec.session.said}` : "")
137457
138375
  );
137458
138376
  try {
137459
- const dir = join15(cfg.dataDir, "logs");
137460
- mkdirSync7(dir, { recursive: true });
137461
- appendFileSync2(join15(dir, "worker-incidents.jsonl"), JSON.stringify(rec) + "\n");
138377
+ const dir = join16(cfg.dataDir, "logs");
138378
+ mkdirSync8(dir, { recursive: true });
138379
+ appendFileSync2(join16(dir, "worker-incidents.jsonl"), JSON.stringify(rec) + "\n");
137462
138380
  } catch (err) {
137463
138381
  logLine(`[worker-trap] could not persist incident: ${err.message}`);
137464
138382
  }
@@ -137499,6 +138417,7 @@ async function main() {
137499
138417
  }
137500
138418
  });
137501
138419
  channel.on("state", (s10) => logLine(`[bridge] channel state: ${JSON.stringify(s10)}`));
138420
+ watchEnrollmentFingerprint(channel, cfg.dataDir, (m6) => logLine(`[bridge] ${m6}`));
137502
138421
  channel.on(
137503
138422
  "room_joined",
137504
138423
  (e7) => logLine(`[bridge] joined room ${e7.name} (${e7.roomId})`)