@agentvault/openai-bridge 0.1.1 → 0.1.3

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
@@ -3473,7 +3473,10 @@ function buildLlmSpan(opts) {
3473
3473
  "gen_ai.request.model": opts.model,
3474
3474
  "gen_ai.usage.input_tokens": opts.tokensInput,
3475
3475
  "gen_ai.usage.output_tokens": opts.tokensOutput,
3476
- "gen_ai.operation.name": "chat"
3476
+ "gen_ai.operation.name": "chat",
3477
+ // AgentVault extensions the backend ledger reads (telemetry_service.py
3478
+ // _fan_in_genai_ledger) — the same names the Hermes plugin sends.
3479
+ "av.genai.latency_ms": opts.latencyMs
3477
3480
  };
3478
3481
  if (opts.provider !== void 0) {
3479
3482
  attributes["ai.agent.llm.provider"] = opts.provider;
@@ -3482,6 +3485,7 @@ function buildLlmSpan(opts) {
3482
3485
  if (opts.costUsd !== void 0) {
3483
3486
  attributes["ai.agent.llm.cost_usd"] = opts.costUsd;
3484
3487
  attributes["gen_ai.usage.cost_usd"] = opts.costUsd;
3488
+ attributes["av.genai.cost_usd"] = opts.costUsd;
3485
3489
  }
3486
3490
  applySkillName(attributes, opts.skillName);
3487
3491
  const isError = opts.status === "error";
@@ -4093,6 +4097,9 @@ function spanToOtlp(span) {
4093
4097
  }
4094
4098
  return otlp;
4095
4099
  }
4100
+ function isRetryableStatus(status) {
4101
+ return status >= 500 || status === 408 || status === 429;
4102
+ }
4096
4103
  async function generateBackupCode() {
4097
4104
  await libsodium_wrappers_default.ready;
4098
4105
  const bytes = libsodium_wrappers_default.randombytes_buf(13);
@@ -5175,9 +5182,9 @@ async function deriveSecret(secret, label, kdf) {
5175
5182
  async function deriveTreeSecret(secret, label, generation, length, kdf) {
5176
5183
  return expandWithLabel(secret, label, encode(uint32Encoder)(generation), length, kdf);
5177
5184
  }
5178
- async function updatePskSecret(secret, pskId, psk, index, count, impl) {
5185
+ async function updatePskSecret(secret, pskId, psk, index, count2, impl) {
5179
5186
  const zeroes = new Uint8Array(impl.kdf.size);
5180
- return impl.kdf.extract(await expandWithLabel(await impl.kdf.extract(zeroes, psk), "derived psk", encode(pskLabelEncoder)({ id: pskId, index, count }), impl.kdf.size, impl.kdf), secret);
5187
+ return impl.kdf.extract(await expandWithLabel(await impl.kdf.extract(zeroes, psk), "derived psk", encode(pskLabelEncoder)({ id: pskId, index, count: count2 }), impl.kdf.size, impl.kdf), secret);
5181
5188
  }
5182
5189
  function decodeProposalCustom(proposalType) {
5183
5190
  return mapDecoder(decodeVarLenData, (proposalData) => ({ proposalType, proposalData }));
@@ -9489,7 +9496,7 @@ function expand_message_xof(msg, DST, lenInBytes, k2, H2) {
9489
9496
  throw new Error("expand_message_xof: invalid lenInBytes");
9490
9497
  return H2.create({ dkLen: lenInBytes }).update(msg).update(i2osp(lenInBytes, 2)).update(DST).update(i2osp(DST.length, 1)).digest();
9491
9498
  }
9492
- function hash_to_field(msg, count, options) {
9499
+ function hash_to_field(msg, count2, options) {
9493
9500
  _validateObject(options, {
9494
9501
  p: "bigint",
9495
9502
  m: "number",
@@ -9500,10 +9507,10 @@ function hash_to_field(msg, count, options) {
9500
9507
  if (!isHash(options.hash))
9501
9508
  throw new Error("expected valid hash");
9502
9509
  abytes4(msg);
9503
- anum(count);
9510
+ anum(count2);
9504
9511
  const log2p = p2.toString(2).length;
9505
9512
  const L2 = Math.ceil((log2p + k2) / 8);
9506
- const len_in_bytes = count * m2 * L2;
9513
+ const len_in_bytes = count2 * m2 * L2;
9507
9514
  let prb;
9508
9515
  if (expand === "xmd") {
9509
9516
  prb = expand_message_xmd(msg, DST, len_in_bytes, hash2);
@@ -9514,8 +9521,8 @@ function hash_to_field(msg, count, options) {
9514
9521
  } else {
9515
9522
  throw new Error('expand must be "xmd" or "xof"');
9516
9523
  }
9517
- const u2 = new Array(count);
9518
- for (let i2 = 0; i2 < count; i2++) {
9524
+ const u2 = new Array(count2);
9525
+ for (let i2 = 0; i2 < count2; i2++) {
9519
9526
  const e = new Array(m2);
9520
9527
  for (let j2 = 0; j2 < m2; j2++) {
9521
9528
  const elm_offset = L2 * (j2 + i2 * m2);
@@ -11737,11 +11744,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11737
11744
  return null;
11738
11745
  }
11739
11746
  function ownIdentity() {
11740
- const v2 = true ? "0.23.45" : FALLBACK;
11747
+ const v2 = true ? "0.23.47" : FALLBACK;
11741
11748
  return `${PACKAGE}@${v2}`;
11742
11749
  }
11743
11750
  function buildSha() {
11744
- const raw = true ? "af0ab83" : "";
11751
+ const raw = true ? "f1debc4" : "";
11745
11752
  const cleaned = (raw ?? "").trim();
11746
11753
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11747
11754
  }
@@ -12273,6 +12280,25 @@ async function offerHistoryRecoveryConfiguration(input) {
12273
12280
  output("Agent history recovery: not configured");
12274
12281
  }
12275
12282
  }
12283
+ function decisionReplyFromEnvelope(parsed) {
12284
+ if (parsed === null || typeof parsed !== "object") return void 0;
12285
+ const decision = parsed.decision;
12286
+ if (decision === null || typeof decision !== "object") return void 0;
12287
+ const d2 = decision;
12288
+ if (typeof d2.decision_id !== "string" || d2.decision_id.length === 0) return void 0;
12289
+ if (Array.isArray(d2.options)) return void 0;
12290
+ const selected = typeof d2.selected_option_id === "string" ? d2.selected_option_id : void 0;
12291
+ const action = typeof d2.action === "string" && ACTIONS.has(d2.action) ? d2.action : void 0;
12292
+ if (selected === void 0 && action === void 0) return void 0;
12293
+ const reply = { decision_id: d2.decision_id };
12294
+ if (selected !== void 0) reply.selected_option_id = selected;
12295
+ if (action !== void 0) reply.action = action;
12296
+ if (typeof d2.resolved_at === "string") reply.resolved_at = d2.resolved_at;
12297
+ if (typeof d2.defer_until === "string") reply.defer_until = d2.defer_until;
12298
+ if (typeof d2.defer_reason === "string") reply.defer_reason = d2.defer_reason;
12299
+ if (typeof d2.reason === "string") reply.reason = d2.reason;
12300
+ return reply;
12301
+ }
12276
12302
  async function readBoundedRestoreJson(response, signal, checkpoint) {
12277
12303
  const contentLength = response.headers?.get("content-length");
12278
12304
  if (contentLength && /^\d+$/.test(contentLength)) {
@@ -17850,7 +17876,7 @@ function reportSkillInvocation(opts) {
17850
17876
  spanBuffer.push(span);
17851
17877
  return span;
17852
17878
  }
17853
- 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_exports2, 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;
17879
+ 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_exports2, 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;
17854
17880
  var init_dist = __esm({
17855
17881
  async "../plugin/dist/index.js"() {
17856
17882
  "use strict";
@@ -60673,7 +60699,11 @@ var init_dist = __esm({
60673
60699
  _agentName;
60674
60700
  _agentVersion;
60675
60701
  _pluginVersion;
60702
+ _maxRetries;
60703
+ _maxBufferedSpans;
60676
60704
  _buffer = [];
60705
+ /** Failed send attempts per buffered span. */
60706
+ _attempts = /* @__PURE__ */ new WeakMap();
60677
60707
  _timer = null;
60678
60708
  constructor(config2) {
60679
60709
  this._apiBase = config2.apiBase.replace(/\/+$/, "");
@@ -60683,6 +60713,8 @@ var init_dist = __esm({
60683
60713
  this._agentName = config2.agentName ?? "unknown";
60684
60714
  this._agentVersion = config2.agentVersion ?? "0.0.0";
60685
60715
  this._pluginVersion = config2.pluginVersion ?? "0.0.0";
60716
+ this._maxRetries = Math.max(1, config2.maxRetries ?? 5);
60717
+ this._maxBufferedSpans = Math.max(1, config2.maxBufferedSpans ?? 1e3);
60686
60718
  }
60687
60719
  /** Number of spans waiting to be flushed. */
60688
60720
  get pendingCount() {
@@ -60730,7 +60762,9 @@ var init_dist = __esm({
60730
60762
  * POST all buffered spans to the backend ingest endpoint.
60731
60763
  *
60732
60764
  * - On success (HTTP 2xx): clears the buffer.
60733
- * - On failure: keeps spans in the buffer for retry.
60765
+ * - On a retryable failure (network, 5xx, 408, 429): keeps spans for retry,
60766
+ * bounded by `maxRetries` per span and `maxBufferedSpans` overall.
60767
+ * - On any other 4xx: drops the batch (it can never be accepted).
60734
60768
  * - Never throws — telemetry is best-effort.
60735
60769
  */
60736
60770
  async flush() {
@@ -60759,13 +60793,23 @@ var init_dist = __esm({
60759
60793
  spans: spans.map(spanToOtlp)
60760
60794
  })
60761
60795
  });
60762
- if (!response.ok) {
60763
- this._buffer = spans.concat(this._buffer);
60796
+ if (!response.ok && isRetryableStatus(response.status)) {
60797
+ this._requeue(spans);
60764
60798
  }
60765
60799
  } catch {
60766
- this._buffer = spans.concat(this._buffer);
60800
+ this._requeue(spans);
60767
60801
  }
60768
60802
  }
60803
+ /** Put a failed batch back in front of newer spans, within both caps. */
60804
+ _requeue(spans) {
60805
+ const retained = spans.filter((span) => {
60806
+ const attempts = (this._attempts.get(span) ?? 0) + 1;
60807
+ this._attempts.set(span, attempts);
60808
+ return attempts < this._maxRetries;
60809
+ });
60810
+ const merged = retained.concat(this._buffer);
60811
+ this._buffer = merged.length > this._maxBufferedSpans ? merged.slice(merged.length - this._maxBufferedSpans) : merged;
60812
+ }
60769
60813
  // -- Auto-flush -------------------------------------------------------------
60770
60814
  /**
60771
60815
  * Start a periodic flush timer.
@@ -62353,7 +62397,7 @@ var init_dist = __esm({
62353
62397
  decodePskId = mapDecoders([decodePskInfo, decodeVarLenData], (info, pskNonce) => ({ ...info, pskNonce }));
62354
62398
  pskLabelEncoder = contramapBufferEncoders([pskIdEncoder, uint16Encoder, uint16Encoder], (label) => [label.id, label.index, label.count]);
62355
62399
  encodePskLabel = encode(pskLabelEncoder);
62356
- decodePskLabel = mapDecoders([decodePskId, decodeUint16, decodeUint16], (id, index, count) => ({ id, index, count }));
62400
+ decodePskLabel = mapDecoders([decodePskId, decodeUint16, decodeUint16], (id, index, count2) => ({ id, index, count: count2 }));
62357
62401
  }
62358
62402
  });
62359
62403
  init_proposal = __esm2({
@@ -70287,6 +70331,12 @@ var init_dist = __esm({
70287
70331
  };
70288
70332
  }
70289
70333
  });
70334
+ init_decision_reply = __esm2({
70335
+ "src/decision-reply.ts"() {
70336
+ "use strict";
70337
+ ACTIONS = /* @__PURE__ */ new Set(["approve", "deny", "defer", "cancel"]);
70338
+ }
70339
+ });
70290
70340
  history_backup_client_exports = {};
70291
70341
  __export2(history_backup_client_exports, {
70292
70342
  HISTORY_RESTORE_RESPONSE_MAX_BYTES: () => HISTORY_RESTORE_RESPONSE_MAX_BYTES,
@@ -70630,6 +70680,7 @@ var init_dist = __esm({
70630
70680
  init_mls_membership_probe();
70631
70681
  init_history_backup_scheduler();
70632
70682
  await init_history_recovery_code();
70683
+ init_decision_reply();
70633
70684
  ROOM_AGENT_TYPES = /* @__PURE__ */ new Set([
70634
70685
  "message",
70635
70686
  "text",
@@ -70915,9 +70966,12 @@ ${text}`;
70915
70966
  // Reset at the start of every `_connect`.
70916
70967
  _authFailedThisSession = false;
70917
70968
  // Last observed WebSocket close code, captured by the ws.on("close", ...)
70918
- // handler. Used by the rapid-disconnect classifier to surface
70919
- // server-driven "session_replaced" events (close codes 4000 / 4001).
70969
+ // handler. Used by the rapid-disconnect classifier: 4001 = server rejected
70970
+ // the credentials (auth_failed); 4000 = reserved "session_replaced".
70920
70971
  _lastCloseCode = null;
70972
+ // True while a once("ready") listener is waiting to honour config.httpPort,
70973
+ // so repeated start() calls do not stack listeners.
70974
+ _httpPortListenerArmed = false;
70921
70975
  // Liveness detection: server sends app-level {"event":"ping"} every 30s.
70922
70976
  // We check every 30s; if no data received in 90s (3 missed pings), connection is dead.
70923
70977
  static PING_INTERVAL_MS = 3e4;
@@ -71219,10 +71273,19 @@ ${text}`;
71219
71273
  async start() {
71220
71274
  await this._stateSaveQueue;
71221
71275
  this._stopped = false;
71276
+ this._clearSuspendedWait();
71222
71277
  this._lifecycleGeneration += 1;
71223
71278
  this._historyBackupScheduler.stop();
71224
71279
  this._historyBackupScheduler = this._createHistoryBackupScheduler();
71225
71280
  await libsodium_wrappers_default.ready;
71281
+ const httpPort = this.config.httpPort;
71282
+ if (typeof httpPort === "number" && !this._httpPortListenerArmed) {
71283
+ this._httpPortListenerArmed = true;
71284
+ this.once("ready", () => {
71285
+ this._httpPortListenerArmed = false;
71286
+ if (!this._stopped) this.startHttpServer(httpPort);
71287
+ });
71288
+ }
71226
71289
  if (this._forceReEnroll) {
71227
71290
  console.log("[SecureChannel] forceReEnroll set \u2014 clearing cached credentials, will enroll fresh");
71228
71291
  await clearState(this.config.dataDir);
@@ -71565,7 +71628,24 @@ ${text}`;
71565
71628
  salt = libsodium_wrappers_default.randombytes_buf(16);
71566
71629
  }
71567
71630
  checkpoint();
71568
- const archive = buildHistoryArchive(state.hubId, state.messageHistory ?? []);
71631
+ const history = state.messageHistory ?? [];
71632
+ if (!Array.isArray(history)) throw new Error("entries must be an array");
71633
+ const snapshotEntries = /* @__PURE__ */ new Map();
71634
+ for (let index = 0; index < history.length; index += 1) {
71635
+ if (!(index in history)) throw new Error("entries must not be sparse");
71636
+ const entry = history[index];
71637
+ const legacyId = legacyHistoryEntryId(entry);
71638
+ const id = entry.id ?? legacyId;
71639
+ const previous = snapshotEntries.get(id);
71640
+ if (previous) {
71641
+ if (previous.sender !== entry.sender || previous.text !== entry.text || previous.ts !== entry.ts || previous.topicId !== entry.topicId) {
71642
+ throw new Error("History archive contains duplicate entry IDs");
71643
+ }
71644
+ continue;
71645
+ }
71646
+ snapshotEntries.set(id, { ...entry, id });
71647
+ }
71648
+ const archive = buildHistoryArchive(state.hubId, [...snapshotEntries.values()]);
71569
71649
  const requestedSaltHex = Buffer.from(salt).toString("hex");
71570
71650
  const cacheIdentity = `${state.hubId}:${codeHashHex}:${requestedSaltHex}`;
71571
71651
  checkpoint();
@@ -72295,7 +72375,7 @@ ${text}`;
72295
72375
  */
72296
72376
  sendActivitySpan(spanData) {
72297
72377
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
72298
- const pluginVersion = true ? "0.23.45" : "0.0.0-dev";
72378
+ const pluginVersion = true ? "0.23.47" : "0.0.0-dev";
72299
72379
  const agentName = this.config.agentName ?? "Agent";
72300
72380
  const resource = {
72301
72381
  "service.name": "agentvault-agent",
@@ -72374,16 +72454,27 @@ ${text}`;
72374
72454
  }
72375
72455
  /**
72376
72456
  * Wait for a decision response matching the given decisionId.
72377
- * Listens on the "message" event for messages where
72378
- * metadata.messageType === "decision_response" and the parsed plaintext
72379
- * contains a matching decision.decision_id.
72457
+ * Listens on the "message" event. Resolves when either:
72458
+ * - metadata.decision carries an answer for this decisionId — what every
72459
+ * receive path now lifts out of the app's envelope (an option selected,
72460
+ * or action "defer" / "cancel"); or
72461
+ * - legacy: metadata.messageType === "decision_response" and the
72462
+ * plaintext is the JSON envelope with a matching decision.decision_id.
72380
72463
  * Optional timeout rejects with an Error.
72381
72464
  */
72382
72465
  waitForDecision(decisionId, timeoutMs) {
72383
72466
  return new Promise((resolve4, reject) => {
72384
72467
  let timer = null;
72385
72468
  const handler = (plaintext, metadata) => {
72386
- if (metadata.messageType !== "decision_response") return;
72469
+ if (metadata?.roomId) return;
72470
+ const reply = metadata?.decision;
72471
+ if (reply && reply.decision_id === decisionId) {
72472
+ if (timer) clearTimeout(timer);
72473
+ this.removeListener("message", handler);
72474
+ resolve4(reply);
72475
+ return;
72476
+ }
72477
+ if (metadata?.messageType !== "decision_response") return;
72387
72478
  try {
72388
72479
  const parsed = JSON.parse(plaintext);
72389
72480
  if (parsed.decision?.decision_id === decisionId) {
@@ -73382,6 +73473,7 @@ ${text}`;
73382
73473
  clearTimeout(this._reconnectTimer);
73383
73474
  this._reconnectTimer = null;
73384
73475
  }
73476
+ this._clearSuspendedWait();
73385
73477
  if (this._telemetryReporter) {
73386
73478
  this._telemetryReporter.stopAutoFlush();
73387
73479
  await this._telemetryReporter.flush();
@@ -73495,7 +73587,12 @@ ${text}`;
73495
73587
  res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /decision, POST /action, GET /status, GET /targets, or /mcp" }));
73496
73588
  }
73497
73589
  });
73498
- this._httpServer.listen(port, "127.0.0.1", () => {
73590
+ const server = this._httpServer;
73591
+ server.on("error", (err) => {
73592
+ console.error(`[SecureChannel] local HTTP server on 127.0.0.1:${port} failed: ${err.message}`);
73593
+ if (this._httpServer === server) this._httpServer = null;
73594
+ });
73595
+ server.listen(port, "127.0.0.1", () => {
73499
73596
  this.emit("http-ready", port);
73500
73597
  });
73501
73598
  }
@@ -74035,8 +74132,13 @@ ${text}`;
74035
74132
  this.config.platform,
74036
74133
  this.config.expectedFramework
74037
74134
  );
74135
+ if (result.fingerprint && result.fingerprint !== fingerprint) {
74136
+ throw new Error(
74137
+ `Enrollment fingerprint mismatch: this agent's key is ${fingerprint} but the server reported ${result.fingerprint}. Not continuing \u2014 do not approve this device.`
74138
+ );
74139
+ }
74038
74140
  this._deviceId = result.device_id;
74039
- this._fingerprint = result.fingerprint;
74141
+ this._fingerprint = fingerprint;
74040
74142
  this._persisted = {
74041
74143
  deviceId: result.device_id,
74042
74144
  deviceJwt: "",
@@ -74053,7 +74155,7 @@ ${text}`;
74053
74155
  publicKey: bytesToHex2(ephemeral.publicKey),
74054
74156
  privateKey: bytesToHex2(ephemeral.privateKey)
74055
74157
  },
74056
- fingerprint: result.fingerprint,
74158
+ fingerprint,
74057
74159
  messageHistory: []
74058
74160
  };
74059
74161
  this._poll();
@@ -74268,7 +74370,7 @@ ${text}`;
74268
74370
  agentVersion: this.config.agentVersion ?? "0.0.0",
74269
74371
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
74270
74372
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
74271
- pluginVersion: true ? "0.23.45" : "0.0.0-dev"
74373
+ pluginVersion: true ? "0.23.47" : "0.0.0-dev"
74272
74374
  });
74273
74375
  this._telemetryReporter.startAutoFlush(3e4);
74274
74376
  }
@@ -74353,6 +74455,10 @@ ${text}`;
74353
74455
  await this._handleDeviceRevoked();
74354
74456
  return;
74355
74457
  }
74458
+ if (data.event === "device_suspended") {
74459
+ await this._handleDeviceSuspended();
74460
+ return;
74461
+ }
74356
74462
  if (data.event === "connection_rejected") {
74357
74463
  await this._handleConnectionRejected(data);
74358
74464
  return;
@@ -74592,7 +74698,7 @@ ${text}`;
74592
74698
  agentVersion: this.config.agentVersion ?? "0.0.0",
74593
74699
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
74594
74700
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
74595
- pluginVersion: true ? "0.23.45" : "0.0.0-dev"
74701
+ pluginVersion: true ? "0.23.47" : "0.0.0-dev"
74596
74702
  });
74597
74703
  this._telemetryReporter.startAutoFlush(3e4);
74598
74704
  }
@@ -75044,12 +75150,15 @@ ${text}`;
75044
75150
  let messageType = "text";
75045
75151
  let topicId = data.topic_id;
75046
75152
  let mlsAttachment = null;
75153
+ let decisionReply;
75047
75154
  try {
75048
75155
  const parsed = JSON.parse(plaintext);
75049
75156
  text = envelopeText(parsed, plaintext);
75050
75157
  messageType = parsed.type ?? "text";
75051
75158
  topicId = parsed.topicId ?? topicId;
75052
75159
  if (parsed.attachment) mlsAttachment = parsed.attachment;
75160
+ decisionReply = decisionReplyFromEnvelope(parsed);
75161
+ if (decisionReply) messageType = "decision_response";
75053
75162
  } catch {
75054
75163
  }
75055
75164
  if (messageType === "history_catchup_request") {
@@ -75131,7 +75240,8 @@ ${text}`;
75131
75240
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
75132
75241
  // that a roomId was absent. The bridge's full-access DM lane requires it.
75133
75242
  ownerDm1to1: true,
75134
- messageType
75243
+ messageType,
75244
+ ...decisionReply ? { decision: decisionReply } : {}
75135
75245
  };
75136
75246
  this.emit("message", text, metadata);
75137
75247
  if (this.config.onMessage) {
@@ -75143,10 +75253,10 @@ ${text}`;
75143
75253
  return;
75144
75254
  }
75145
75255
  const failKey = mgrKey || `unknown:${groupId}`;
75146
- const count = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
75147
- this._mlsDecryptFailCounts.set(failKey, count);
75148
- console.error(`[SecureChannel] MLS 1:1 decrypt failed (${count}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${failKey}:`, decryptErr);
75149
- if (count >= _SecureChannel.MAX_MLS_DECRYPT_FAILS) {
75256
+ const count2 = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
75257
+ this._mlsDecryptFailCounts.set(failKey, count2);
75258
+ console.error(`[SecureChannel] MLS 1:1 decrypt failed (${count2}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${failKey}:`, decryptErr);
75259
+ if (count2 >= _SecureChannel.MAX_MLS_DECRYPT_FAILS) {
75150
75260
  const recoveryGroupId = (convGroupId ? this._persisted?.mlsGroups?.[convGroupId]?.mlsGroupId : null) ?? this._persisted?.mlsConversations?.[convId]?.mlsGroupId ?? groupId;
75151
75261
  if (recoveryGroupId && failKey) {
75152
75262
  if (!await this._resyncOnDivergence(failKey, recoveryGroupId)) {
@@ -75241,6 +75351,7 @@ ${text}`;
75241
75351
  let messageText;
75242
75352
  let messageType;
75243
75353
  let attachmentInfo = null;
75354
+ let decisionReply;
75244
75355
  try {
75245
75356
  const parsed = JSON.parse(plaintext);
75246
75357
  messageType = parsed.type || "message";
@@ -75248,6 +75359,7 @@ ${text}`;
75248
75359
  if (parsed.attachment) {
75249
75360
  attachmentInfo = parsed.attachment;
75250
75361
  }
75362
+ decisionReply = decisionReplyFromEnvelope(parsed);
75251
75363
  } catch {
75252
75364
  messageType = "message";
75253
75365
  messageText = plaintext;
@@ -75300,7 +75412,7 @@ ${text}`;
75300
75412
  return;
75301
75413
  }
75302
75414
  }
75303
- if (messageType === "message") {
75415
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
75304
75416
  const topicId = msgData.topic_id;
75305
75417
  this._lastIncomingTopicId = topicId;
75306
75418
  let attachData;
@@ -75362,10 +75474,12 @@ ${messageText}`;
75362
75474
  attachment: attachData,
75363
75475
  spanId: msgData.span_id,
75364
75476
  parentSpanId: msgData.parent_span_id,
75365
- messageType: msgData.message_type ?? "text",
75477
+ // A decision answer only counts from the owner's 1:1 — never a room.
75478
+ messageType: decisionReply && !roomId ? "decision_response" : msgData.message_type ?? "text",
75366
75479
  priority: msgData.priority ?? "normal",
75367
75480
  envelopeVersion: msgData.envelope_version ?? "1.0.0",
75368
75481
  roomId,
75482
+ ...decisionReply && !roomId ? { decision: decisionReply } : {},
75369
75483
  // #1223 — the pre-fold text. This DR `message` path also sets `roomId`
75370
75484
  // and folds an attachment into `emitText`, so without this a room
75371
75485
  // message that reaches the gate here would fall back to the folded
@@ -76116,10 +76230,10 @@ ${baseText}`;
76116
76230
  return;
76117
76231
  }
76118
76232
  const failKey = resolvedRoomId;
76119
- const count = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
76120
- this._mlsDecryptFailCounts.set(failKey, count);
76121
- console.error(`[SecureChannel] MLS room decrypt failed (${count}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${resolvedRoomId.slice(0, 8)}:`, err);
76122
- if (count >= _SecureChannel.MAX_MLS_DECRYPT_FAILS && groupId) {
76233
+ const count2 = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
76234
+ this._mlsDecryptFailCounts.set(failKey, count2);
76235
+ console.error(`[SecureChannel] MLS room decrypt failed (${count2}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${resolvedRoomId.slice(0, 8)}:`, err);
76236
+ if (count2 >= _SecureChannel.MAX_MLS_DECRYPT_FAILS && groupId) {
76123
76237
  if (!await this._resyncOnDivergence(resolvedRoomId, groupId)) {
76124
76238
  await this._triggerMlsEpochRecovery(resolvedRoomId, groupId);
76125
76239
  }
@@ -76323,14 +76437,14 @@ ${baseText}`;
76323
76437
  );
76324
76438
  return;
76325
76439
  }
76326
- const count = (this._mlsCommitFailCounts.get(groupKey) ?? 0) + 1;
76327
- this._mlsCommitFailCounts.set(groupKey, count);
76440
+ const count2 = (this._mlsCommitFailCounts.get(groupKey) ?? 0) + 1;
76441
+ this._mlsCommitFailCounts.set(groupKey, count2);
76328
76442
  console.error(
76329
- `[SecureChannel] MLS commit failed (${count}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${label}:`,
76443
+ `[SecureChannel] MLS commit failed (${count2}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${label}:`,
76330
76444
  err
76331
76445
  );
76332
- if (count < _SecureChannel.MAX_MLS_DECRYPT_FAILS) return;
76333
- console.warn(`[SecureChannel] MLS commit resync triggered for ${label} \u2014 ${count} consecutive failures`);
76446
+ if (count2 < _SecureChannel.MAX_MLS_DECRYPT_FAILS) return;
76447
+ console.warn(`[SecureChannel] MLS commit resync triggered for ${label} \u2014 ${count2} consecutive failures`);
76334
76448
  try {
76335
76449
  if (!await this._resyncOnDivergence(groupKey, mlsGroupId)) {
76336
76450
  await this._triggerMlsEpochRecovery(groupKey, mlsGroupId);
@@ -77638,9 +77752,9 @@ ${baseText}`;
77638
77752
  console.debug(`[SecureChannel] Delivery ${msg.message_type} at epoch ${String(msg.epoch)} predates our epoch ${String(localMgr?.epoch)} \u2014 not counting toward recovery`);
77639
77753
  continue;
77640
77754
  }
77641
- const count = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
77642
- this._mlsDecryptFailCounts.set(failKey, count);
77643
- if (count >= _SecureChannel.MAX_MLS_DECRYPT_FAILS) {
77755
+ const count2 = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
77756
+ this._mlsDecryptFailCounts.set(failKey, count2);
77757
+ if (count2 >= _SecureChannel.MAX_MLS_DECRYPT_FAILS) {
77644
77758
  await this._triggerMlsEpochRecovery(failKey, msg.group_id);
77645
77759
  }
77646
77760
  }
@@ -78015,10 +78129,12 @@ ${baseText}`;
78015
78129
  }
78016
78130
  let messageText;
78017
78131
  let messageType;
78132
+ let decisionReply;
78018
78133
  try {
78019
78134
  const parsed = JSON.parse(plaintext);
78020
78135
  messageType = parsed.type || "message";
78021
78136
  messageText = envelopeText(parsed, plaintext);
78137
+ decisionReply = decisionReplyFromEnvelope(parsed);
78022
78138
  } catch {
78023
78139
  messageType = "message";
78024
78140
  messageText = plaintext;
@@ -78030,7 +78146,7 @@ ${baseText}`;
78030
78146
  ackedIds.push(msg.queue_id);
78031
78147
  continue;
78032
78148
  }
78033
- if (messageType === "message") {
78149
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
78034
78150
  const topicId = msg.topic_id;
78035
78151
  await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.message_id);
78036
78152
  const metadata = {
@@ -78041,7 +78157,8 @@ ${baseText}`;
78041
78157
  // #621: positive attestation that this decrypted under the OWNER'S 1:1
78042
78158
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
78043
78159
  // that a roomId was absent. The bridge's full-access DM lane requires it.
78044
- ownerDm1to1: true
78160
+ ownerDm1to1: true,
78161
+ ...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
78045
78162
  };
78046
78163
  this.emit("message", messageText, metadata);
78047
78164
  Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
@@ -78191,10 +78308,10 @@ ${baseText}`;
78191
78308
  return;
78192
78309
  }
78193
78310
  const failKey = `a2a:${a2aChannelId}`;
78194
- const count = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
78195
- this._mlsDecryptFailCounts.set(failKey, count);
78196
- console.error(`[SecureChannel] MLS A2A decrypt failed (${count}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${a2aChannelId.slice(0, 8)}:`, err);
78197
- if (count >= _SecureChannel.MAX_MLS_DECRYPT_FAILS && groupId) {
78311
+ const count2 = (this._mlsDecryptFailCounts.get(failKey) ?? 0) + 1;
78312
+ this._mlsDecryptFailCounts.set(failKey, count2);
78313
+ console.error(`[SecureChannel] MLS A2A decrypt failed (${count2}/${_SecureChannel.MAX_MLS_DECRYPT_FAILS}) for ${a2aChannelId.slice(0, 8)}:`, err);
78314
+ if (count2 >= _SecureChannel.MAX_MLS_DECRYPT_FAILS && groupId) {
78198
78315
  if (!await this._resyncOnDivergence(failKey, groupId)) {
78199
78316
  await this._triggerMlsEpochRecovery(failKey, groupId);
78200
78317
  }
@@ -78625,15 +78742,17 @@ ${baseText}`;
78625
78742
  }
78626
78743
  let messageText;
78627
78744
  let messageType;
78745
+ let decisionReply;
78628
78746
  try {
78629
78747
  const parsed = JSON.parse(plaintext);
78630
78748
  messageType = parsed.type || "message";
78631
78749
  messageText = envelopeText(parsed, plaintext);
78750
+ decisionReply = decisionReplyFromEnvelope(parsed);
78632
78751
  } catch {
78633
78752
  messageType = "message";
78634
78753
  messageText = plaintext;
78635
78754
  }
78636
- if (messageType === "message") {
78755
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
78637
78756
  const topicId = msg.topic_id;
78638
78757
  await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.id);
78639
78758
  const metadata = {
@@ -78644,7 +78763,8 @@ ${baseText}`;
78644
78763
  // #621: positive attestation that this decrypted under the OWNER'S 1:1
78645
78764
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
78646
78765
  // that a roomId was absent. The bridge's full-access DM lane requires it.
78647
- ownerDm1to1: true
78766
+ ownerDm1to1: true,
78767
+ ...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
78648
78768
  };
78649
78769
  this.emit("message", messageText, metadata);
78650
78770
  Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
@@ -78820,6 +78940,7 @@ ${baseText}`;
78820
78940
  }
78821
78941
  _scheduleReconnect() {
78822
78942
  if (this._stopped) return;
78943
+ if (this._suspended) return;
78823
78944
  if (this._reconnectTimer) return;
78824
78945
  const sinceOpen = Date.now() - this._lastWsOpenTime;
78825
78946
  if (this._lastWsOpenTime > 0 && sinceOpen < 1e4) {
@@ -78840,7 +78961,16 @@ ${baseText}`;
78840
78961
  return;
78841
78962
  }
78842
78963
  const lastCode = this._lastCloseCode;
78843
- if (lastCode === 4e3 || lastCode === 4001) {
78964
+ if (lastCode === 4001) {
78965
+ console.log(
78966
+ "[SecureChannel] Server rejected our credentials on every reconnect (close code 4001). Stopping; the device needs re-enrolling or a fresh token."
78967
+ );
78968
+ this._authFailedThisSession = true;
78969
+ this._setState("error");
78970
+ this.emit("auth_failed", { reason: "ws_auth_rejected" });
78971
+ return;
78972
+ }
78973
+ if (lastCode === 4e3) {
78844
78974
  console.log(
78845
78975
  `[SecureChannel] Server reports our session was replaced by a newer one (close code ${lastCode}). Stopping reconnect.`
78846
78976
  );
@@ -78932,15 +79062,17 @@ ${baseText}`;
78932
79062
  }
78933
79063
  let messageText;
78934
79064
  let messageType;
79065
+ let decisionReply;
78935
79066
  try {
78936
79067
  const parsed = JSON.parse(plaintext);
78937
79068
  messageType = parsed.type || "message";
78938
79069
  messageText = envelopeText(parsed, plaintext);
79070
+ decisionReply = decisionReplyFromEnvelope(parsed);
78939
79071
  } catch {
78940
79072
  messageType = "message";
78941
79073
  messageText = plaintext;
78942
79074
  }
78943
- if (messageType === "message") {
79075
+ if (messageType === "message" || messageType === "decision_response" && decisionReply) {
78944
79076
  const topicId = msg.topic_id;
78945
79077
  await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.id);
78946
79078
  const metadata = {
@@ -78951,7 +79083,8 @@ ${baseText}`;
78951
79083
  // #621: positive attestation that this decrypted under the OWNER'S 1:1
78952
79084
  // material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
78953
79085
  // that a roomId was absent. The bridge's full-access DM lane requires it.
78954
- ownerDm1to1: true
79086
+ ownerDm1to1: true,
79087
+ ...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
78955
79088
  };
78956
79089
  this.emit("message", messageText, metadata);
78957
79090
  Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
@@ -79040,6 +79173,10 @@ ${baseText}`;
79040
79173
  * `retryable` rejection is transient — fall through to a normal reconnect.
79041
79174
  */
79042
79175
  async _handleConnectionRejected(data) {
79176
+ if (data?.reason === "device_suspended") {
79177
+ this._enterSuspendedWait("connection_rejected");
79178
+ return;
79179
+ }
79043
79180
  if (data?.retryable === true) {
79044
79181
  this._scheduleReconnect();
79045
79182
  return;
@@ -79051,6 +79188,79 @@ ${baseText}`;
79051
79188
  );
79052
79189
  this.emit("auth_failed", { reason: authReason });
79053
79190
  }
79191
+ // --- Owner pause (device SUSPENDED) — NON-final ---------------------------
79192
+ //
79193
+ // Suspension is reversible ("Agent active" off/on in the app). While
79194
+ // suspended the server will not serve this device (it rejects the handshake
79195
+ // with a retryable `device_suspended`), so reconnecting is pointless and,
79196
+ // through the rapid-disconnect classifier, used to end in a terminal error.
79197
+ // Instead: stay in "disconnected", poll the public status endpoint, and
79198
+ // reconnect as soon as the device is ACTIVE again. REVOKED ends the wait as
79199
+ // terminal; anything inconclusive (rate limit, network) keeps waiting.
79200
+ static SUSPENDED_POLL_MS = 3e4;
79201
+ _suspended = false;
79202
+ _suspendedPollTimer = null;
79203
+ /** Handle a WS `device_suspended` frame (owner paused this agent). */
79204
+ async _handleDeviceSuspended() {
79205
+ this._enterSuspendedWait("device_suspended");
79206
+ }
79207
+ _enterSuspendedWait(source) {
79208
+ if (this._stopped) return;
79209
+ if (this._reconnectTimer) {
79210
+ clearTimeout(this._reconnectTimer);
79211
+ this._reconnectTimer = null;
79212
+ }
79213
+ this._rapidDisconnects = 0;
79214
+ if (!this._suspended) {
79215
+ this._suspended = true;
79216
+ console.log(
79217
+ `[SecureChannel] Agent paused by its owner (${source}) \u2014 idling; will reconnect when resumed`
79218
+ );
79219
+ this._setState("disconnected");
79220
+ this.emit("suspended", { source });
79221
+ }
79222
+ this._scheduleSuspendedPoll();
79223
+ }
79224
+ _scheduleSuspendedPoll() {
79225
+ if (this._stopped || !this._suspended || this._suspendedPollTimer) return;
79226
+ this._suspendedPollTimer = setTimeout(() => {
79227
+ this._suspendedPollTimer = null;
79228
+ void this._pollWhileSuspended();
79229
+ }, _SecureChannel.SUSPENDED_POLL_MS);
79230
+ }
79231
+ _clearSuspendedWait() {
79232
+ this._suspended = false;
79233
+ if (this._suspendedPollTimer) {
79234
+ clearTimeout(this._suspendedPollTimer);
79235
+ this._suspendedPollTimer = null;
79236
+ }
79237
+ }
79238
+ async _pollWhileSuspended() {
79239
+ if (this._stopped || !this._suspended) return;
79240
+ const deviceId = this._deviceId ?? this._persisted?.deviceId;
79241
+ if (deviceId) {
79242
+ try {
79243
+ const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
79244
+ if (this._stopped || !this._suspended) return;
79245
+ if (!st.rateLimited && (st.status === "ACTIVE" || st.status === "APPROVED")) {
79246
+ this._clearSuspendedWait();
79247
+ this._reconnectAttempt = 0;
79248
+ console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
79249
+ this.emit("resumed");
79250
+ this._connect();
79251
+ return;
79252
+ }
79253
+ if (!st.rateLimited && st.status === "REVOKED") {
79254
+ this._clearSuspendedWait();
79255
+ this._handleError(new Error("Device was revoked"));
79256
+ return;
79257
+ }
79258
+ } catch (err) {
79259
+ console.warn("[SecureChannel] status check while paused failed; still waiting:", err);
79260
+ }
79261
+ }
79262
+ this._scheduleSuspendedPoll();
79263
+ }
79054
79264
  async _handleDeviceRevoked() {
79055
79265
  const now = Date.now();
79056
79266
  this._revokeRecoveries = this._revokeRecoveries.filter(
@@ -79071,6 +79281,10 @@ ${baseText}`;
79071
79281
  let reconnect;
79072
79282
  try {
79073
79283
  const status = await pollDeviceStatus(this.config.apiUrl, deviceId);
79284
+ if (status.status === "SUSPENDED") {
79285
+ this._enterSuspendedWait("device_revoked");
79286
+ return;
79287
+ }
79074
79288
  reconnect = status.rateLimited === true || status.status === "ACTIVE";
79075
79289
  if (!reconnect) {
79076
79290
  console.warn(
@@ -79152,7 +79366,7 @@ ${baseText}`;
79152
79366
  label: "AgentVault",
79153
79367
  selectionLabel: "AgentVault (E2E Encrypted)",
79154
79368
  docsPath: "https://agentvault.chat/docs",
79155
- blurb: "Zero-knowledge, end-to-end encrypted messaging between owners and their AI agents.",
79369
+ blurb: "End-to-end encrypted messaging between owners and their AI agents.",
79156
79370
  aliases: ["av", "agent-vault"]
79157
79371
  },
79158
79372
  capabilities: {
@@ -79351,9 +79565,540 @@ ${actionsText}`);
79351
79565
  "use strict";
79352
79566
  }
79353
79567
  });
79568
+ init_llm_pricing_openrouter = __esm2({
79569
+ "src/llm-pricing-openrouter.ts"() {
79570
+ "use strict";
79571
+ OPENROUTER_PRICING = {
79572
+ anthropic: {
79573
+ "claude-fable-5": { inputPerMtoken: 10, outputPerMtoken: 50 },
79574
+ "claude-fable-5-1": { inputPerMtoken: 10, outputPerMtoken: 50 },
79575
+ "claude-haiku-4-5": { inputPerMtoken: 1, outputPerMtoken: 5 },
79576
+ "claude-haiku-5-5": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79577
+ "claude-opus-4-1": { inputPerMtoken: 15, outputPerMtoken: 75 },
79578
+ "claude-opus-4-5": { inputPerMtoken: 5, outputPerMtoken: 25 },
79579
+ "claude-opus-4-6": { inputPerMtoken: 5, outputPerMtoken: 25 },
79580
+ "claude-opus-4-7": { inputPerMtoken: 5, outputPerMtoken: 25 },
79581
+ "claude-opus-4-8": { inputPerMtoken: 5, outputPerMtoken: 25 },
79582
+ "claude-opus-5": { inputPerMtoken: 5, outputPerMtoken: 25 },
79583
+ "claude-opus-5-5": { inputPerMtoken: 4, outputPerMtoken: 20 },
79584
+ "claude-sonnet-4": { inputPerMtoken: 3, outputPerMtoken: 15 },
79585
+ "claude-sonnet-4-5": { inputPerMtoken: 3, outputPerMtoken: 15 },
79586
+ "claude-sonnet-4-6": { inputPerMtoken: 3, outputPerMtoken: 15 },
79587
+ "claude-sonnet-5": { inputPerMtoken: 2, outputPerMtoken: 10 },
79588
+ "claude-sonnet-5-5": { inputPerMtoken: 2, outputPerMtoken: 10 }
79589
+ },
79590
+ openai: {
79591
+ "gpt-3.5-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
79592
+ "gpt-3.5-turbo-0613": { inputPerMtoken: 1, outputPerMtoken: 2 },
79593
+ "gpt-3.5-turbo-16k": { inputPerMtoken: 3, outputPerMtoken: 4 },
79594
+ "gpt-3.5-turbo-instruct": { inputPerMtoken: 1.5, outputPerMtoken: 2 },
79595
+ "gpt-4": { inputPerMtoken: 30, outputPerMtoken: 60 },
79596
+ "gpt-4-turbo": { inputPerMtoken: 10, outputPerMtoken: 30 },
79597
+ "gpt-4.1": { inputPerMtoken: 2, outputPerMtoken: 8 },
79598
+ "gpt-4.1-mini": { inputPerMtoken: 0.4, outputPerMtoken: 1.6 },
79599
+ "gpt-4.1-nano": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
79600
+ "gpt-4o": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79601
+ "gpt-4o-2024-05-13": { inputPerMtoken: 5, outputPerMtoken: 15 },
79602
+ "gpt-4o-2024-08-06": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79603
+ "gpt-4o-2024-11-20": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79604
+ "gpt-4o-mini": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79605
+ "gpt-4o-mini-2024-07-18": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79606
+ "gpt-5": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79607
+ "gpt-5-image": { inputPerMtoken: 10, outputPerMtoken: 10 },
79608
+ "gpt-5-image-mini": { inputPerMtoken: 2.5, outputPerMtoken: 2 },
79609
+ "gpt-5-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79610
+ "gpt-5-nano": { inputPerMtoken: 0.05, outputPerMtoken: 0.4 },
79611
+ "gpt-5-pro": { inputPerMtoken: 15, outputPerMtoken: 120 },
79612
+ "gpt-5.1": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79613
+ "gpt-5.1-codex": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79614
+ "gpt-5.1-codex-max": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79615
+ "gpt-5.1-codex-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79616
+ "gpt-5.2": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79617
+ "gpt-5.2-chat": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79618
+ "gpt-5.2-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79619
+ "gpt-5.2-pro": { inputPerMtoken: 21, outputPerMtoken: 168 },
79620
+ "gpt-5.3-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79621
+ "gpt-5.4": { inputPerMtoken: 2.5, outputPerMtoken: 15 },
79622
+ "gpt-5.4-image-2": { inputPerMtoken: 8, outputPerMtoken: 15 },
79623
+ "gpt-5.4-mini": { inputPerMtoken: 0.75, outputPerMtoken: 4.5 },
79624
+ "gpt-5.4-nano": { inputPerMtoken: 0.2, outputPerMtoken: 1.25 },
79625
+ "gpt-5.4-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
79626
+ "gpt-5.5": { inputPerMtoken: 5, outputPerMtoken: 30 },
79627
+ "gpt-5.5-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
79628
+ "gpt-5.6-luna": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
79629
+ "gpt-5.6-luna-pro": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
79630
+ "gpt-5.6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79631
+ "gpt-5.6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79632
+ "gpt-5.6-terra": { inputPerMtoken: 2, outputPerMtoken: 12 },
79633
+ "gpt-5.6-terra-pro": { inputPerMtoken: 2, outputPerMtoken: 12 },
79634
+ "gpt-6-astra": { inputPerMtoken: 10, outputPerMtoken: 50 },
79635
+ "gpt-6-astra-pro": { inputPerMtoken: 10, outputPerMtoken: 50 },
79636
+ "gpt-6-luna": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79637
+ "gpt-6-luna-pro": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79638
+ "gpt-6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79639
+ "gpt-6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79640
+ "gpt-6.1-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79641
+ "gpt-6.1-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79642
+ "gpt-audio": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79643
+ "gpt-audio-mini": { inputPerMtoken: 0.6, outputPerMtoken: 2.4 },
79644
+ "gpt-chat-latest": { inputPerMtoken: 5, outputPerMtoken: 30 },
79645
+ "gpt-oss-120b": { inputPerMtoken: 0.037, outputPerMtoken: 0.17 },
79646
+ "gpt-oss-20b": { inputPerMtoken: 0.018, outputPerMtoken: 0.09 },
79647
+ "gpt-oss-safeguard-20b": { inputPerMtoken: 0.075, outputPerMtoken: 0.3 },
79648
+ "o1": { inputPerMtoken: 15, outputPerMtoken: 60 },
79649
+ "o1-pro": { inputPerMtoken: 150, outputPerMtoken: 600 },
79650
+ "o3": { inputPerMtoken: 2, outputPerMtoken: 8 },
79651
+ "o3-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79652
+ "o3-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79653
+ "o3-pro": { inputPerMtoken: 20, outputPerMtoken: 80 },
79654
+ "o4-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79655
+ "o4-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 }
79656
+ },
79657
+ openrouter: {
79658
+ "aion-2.0": { inputPerMtoken: 0.8, outputPerMtoken: 1.6 },
79659
+ "aion-3.0": { inputPerMtoken: 3, outputPerMtoken: 6 },
79660
+ "aion-3.0-mini": { inputPerMtoken: 0.7, outputPerMtoken: 1.4 },
79661
+ "aion-3.5": { inputPerMtoken: 3, outputPerMtoken: 6 },
79662
+ "aion-3.5-mini": { inputPerMtoken: 0.7, outputPerMtoken: 1.4 },
79663
+ "aion-rp-llama-3.1-8b": { inputPerMtoken: 0.8, outputPerMtoken: 1.6 },
79664
+ "claude-fable-5": { inputPerMtoken: 10, outputPerMtoken: 50 },
79665
+ "claude-fable-5.1": { inputPerMtoken: 10, outputPerMtoken: 50 },
79666
+ "claude-fable-latest": { inputPerMtoken: 10, outputPerMtoken: 50 },
79667
+ "claude-haiku-4.5": { inputPerMtoken: 1, outputPerMtoken: 5 },
79668
+ "claude-haiku-5.5": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79669
+ "claude-haiku-latest": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79670
+ "claude-opus-4.1": { inputPerMtoken: 15, outputPerMtoken: 75 },
79671
+ "claude-opus-4.5": { inputPerMtoken: 5, outputPerMtoken: 25 },
79672
+ "claude-opus-4.6": { inputPerMtoken: 5, outputPerMtoken: 25 },
79673
+ "claude-opus-4.7": { inputPerMtoken: 5, outputPerMtoken: 25 },
79674
+ "claude-opus-4.8": { inputPerMtoken: 5, outputPerMtoken: 25 },
79675
+ "claude-opus-5": { inputPerMtoken: 5, outputPerMtoken: 25 },
79676
+ "claude-opus-5.5": { inputPerMtoken: 4, outputPerMtoken: 20 },
79677
+ "claude-opus-latest": { inputPerMtoken: 4, outputPerMtoken: 20 },
79678
+ "claude-sonnet-4": { inputPerMtoken: 3, outputPerMtoken: 15 },
79679
+ "claude-sonnet-4.5": { inputPerMtoken: 3, outputPerMtoken: 15 },
79680
+ "claude-sonnet-4.6": { inputPerMtoken: 3, outputPerMtoken: 15 },
79681
+ "claude-sonnet-5": { inputPerMtoken: 2, outputPerMtoken: 10 },
79682
+ "claude-sonnet-5.5": { inputPerMtoken: 2, outputPerMtoken: 10 },
79683
+ "claude-sonnet-latest": { inputPerMtoken: 2, outputPerMtoken: 10 },
79684
+ "codestral-2508": { inputPerMtoken: 0.3, outputPerMtoken: 0.9 },
79685
+ "command-a": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79686
+ "command-a-plus": { inputPerMtoken: 0.3, outputPerMtoken: 1.5 },
79687
+ "command-r-08-2024": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79688
+ "command-r-plus-08-2024": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79689
+ "command-r7b-12-2024": { inputPerMtoken: 0.0375, outputPerMtoken: 0.15 },
79690
+ "cydonia-24b-v4.1": { inputPerMtoken: 0.3, outputPerMtoken: 0.5 },
79691
+ "deepseek-chat": { inputPerMtoken: 0.32, outputPerMtoken: 0.89 },
79692
+ "deepseek-chat-v3-0324": { inputPerMtoken: 0.29, outputPerMtoken: 1.14 },
79693
+ "deepseek-chat-v3.1": { inputPerMtoken: 0.25, outputPerMtoken: 0.95 },
79694
+ "deepseek-flash-latest": { inputPerMtoken: 0.02016, outputPerMtoken: 0.891 },
79695
+ "deepseek-pro-latest": { inputPerMtoken: 0.1461, outputPerMtoken: 8 },
79696
+ "deepseek-r1": { inputPerMtoken: 0.7, outputPerMtoken: 2.5 },
79697
+ "deepseek-r1-0528": { inputPerMtoken: 0.5, outputPerMtoken: 2.15 },
79698
+ "deepseek-v3.1-terminus": { inputPerMtoken: 0.27, outputPerMtoken: 1 },
79699
+ "deepseek-v3.2": { inputPerMtoken: 0.259, outputPerMtoken: 0.8 },
79700
+ "deepseek-v3.2-exp": { inputPerMtoken: 0.27, outputPerMtoken: 0.41 },
79701
+ "deepseek-v4-flash": { inputPerMtoken: 0.091, outputPerMtoken: 0.182 },
79702
+ "deepseek-v4-flash-0731": { inputPerMtoken: 0.016, outputPerMtoken: 0.64 },
79703
+ "deepseek-v4-flash-latest": { inputPerMtoken: 0.0144, outputPerMtoken: 0.576 },
79704
+ "deepseek-v4-flash-vision-exp": { inputPerMtoken: 0.2156, outputPerMtoken: 0.6468 },
79705
+ "deepseek-v4-pro": { inputPerMtoken: 0.430824, outputPerMtoken: 0.861648 },
79706
+ "deepseek-v4-pro-0813": { inputPerMtoken: 0.66, outputPerMtoken: 1.98 },
79707
+ "deepseek-v4.1-flash": { inputPerMtoken: 0.02016, outputPerMtoken: 0.891 },
79708
+ "devstral-2512": { inputPerMtoken: 0.4, outputPerMtoken: 2 },
79709
+ "dolphin-mistral-24b-venice-edition": { inputPerMtoken: 0.2, outputPerMtoken: 0.9 },
79710
+ "dots-3-note-preview:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79711
+ "ember-1": { inputPerMtoken: 3, outputPerMtoken: 15 },
79712
+ "extract": { inputPerMtoken: 0.04, outputPerMtoken: 0 },
79713
+ "free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79714
+ "fugu-max": { inputPerMtoken: 2, outputPerMtoken: 6 },
79715
+ "fugu-ultra": { inputPerMtoken: 5, outputPerMtoken: 30 },
79716
+ "fugu-ultra-v2": { inputPerMtoken: 5, outputPerMtoken: 30 },
79717
+ "gemini-2.5-flash": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79718
+ "gemini-2.5-flash-image": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79719
+ "gemini-2.5-flash-lite": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
79720
+ "gemini-2.5-pro": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79721
+ "gemini-2.5-pro-preview": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79722
+ "gemini-3-flash-preview": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79723
+ "gemini-3-pro-image": { inputPerMtoken: 2, outputPerMtoken: 12 },
79724
+ "gemini-3-pro-image-preview": { inputPerMtoken: 2, outputPerMtoken: 12 },
79725
+ "gemini-3.1-flash-image": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79726
+ "gemini-3.1-flash-image-preview": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
79727
+ "gemini-3.1-flash-lite": { inputPerMtoken: 0.25, outputPerMtoken: 1.5 },
79728
+ "gemini-3.1-flash-lite-image": { inputPerMtoken: 0.25, outputPerMtoken: 1.5 },
79729
+ "gemini-3.1-flash-lite-preview": { inputPerMtoken: 0.25, outputPerMtoken: 1.5 },
79730
+ "gemini-3.1-pro-preview": { inputPerMtoken: 2, outputPerMtoken: 12 },
79731
+ "gemini-3.1-pro-preview-customtools": { inputPerMtoken: 2, outputPerMtoken: 12 },
79732
+ "gemini-3.5-flash": { inputPerMtoken: 1.5, outputPerMtoken: 9 },
79733
+ "gemini-3.5-flash-lite": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79734
+ "gemini-3.6-flash": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79735
+ "gemini-3.7-flash": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79736
+ "gemini-3.8-flash": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79737
+ "gemini-4-argon": { inputPerMtoken: 2, outputPerMtoken: 10 },
79738
+ "gemini-flash-latest": { inputPerMtoken: 0.75, outputPerMtoken: 3.75 },
79739
+ "gemini-nano-banana-2.1": { inputPerMtoken: 1.5, outputPerMtoken: 7.5 },
79740
+ "gemini-pro-latest": { inputPerMtoken: 2, outputPerMtoken: 12 },
79741
+ "gemma-2-27b-it": { inputPerMtoken: 0.65, outputPerMtoken: 0.65 },
79742
+ "gemma-3-12b-it": { inputPerMtoken: 0.05, outputPerMtoken: 0.15 },
79743
+ "gemma-3-27b-it": { inputPerMtoken: 0.08, outputPerMtoken: 0.45 },
79744
+ "gemma-3-4b-it": { inputPerMtoken: 0.05, outputPerMtoken: 0.1 },
79745
+ "gemma-4-26b-a4b-it": { inputPerMtoken: 0.09, outputPerMtoken: 0.3 },
79746
+ "gemma-4-26b-a4b-it:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79747
+ "gemma-4-31b-it": { inputPerMtoken: 0.09, outputPerMtoken: 0.34 },
79748
+ "gemma-4-31b-it:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79749
+ "glm-4.5": { inputPerMtoken: 0.6, outputPerMtoken: 2.2 },
79750
+ "glm-4.5-air": { inputPerMtoken: 0.13, outputPerMtoken: 0.85 },
79751
+ "glm-4.5v": { inputPerMtoken: 0.6, outputPerMtoken: 1.8 },
79752
+ "glm-4.6": { inputPerMtoken: 0.5, outputPerMtoken: 2 },
79753
+ "glm-4.6v": { inputPerMtoken: 0.3, outputPerMtoken: 0.9 },
79754
+ "glm-4.7": { inputPerMtoken: 0.6, outputPerMtoken: 2.2 },
79755
+ "glm-4.7-flash": { inputPerMtoken: 0.0605, outputPerMtoken: 0.4 },
79756
+ "glm-5": { inputPerMtoken: 0.6, outputPerMtoken: 1.92 },
79757
+ "glm-5-turbo": { inputPerMtoken: 1.2, outputPerMtoken: 4 },
79758
+ "glm-5.1": { inputPerMtoken: 1.33, outputPerMtoken: 4.18 },
79759
+ "glm-5.2": { inputPerMtoken: 0.05, outputPerMtoken: 7 },
79760
+ "glm-5.3": { inputPerMtoken: 0.079, outputPerMtoken: 4.8 },
79761
+ "glm-5.3-flash": { inputPerMtoken: 0.036, outputPerMtoken: 0.9 },
79762
+ "glm-5.3-flashx": { inputPerMtoken: 0.37, outputPerMtoken: 1.25 },
79763
+ "glm-5.3-prime": { inputPerMtoken: 2.8, outputPerMtoken: 8.8 },
79764
+ "glm-5v-turbo": { inputPerMtoken: 1.2, outputPerMtoken: 4 },
79765
+ "glm-flash-latest": { inputPerMtoken: 0.036, outputPerMtoken: 0.9 },
79766
+ "glm-latest": { inputPerMtoken: 0.0576, outputPerMtoken: 4.4 },
79767
+ "gpt-3.5-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
79768
+ "gpt-3.5-turbo-0613": { inputPerMtoken: 1, outputPerMtoken: 2 },
79769
+ "gpt-3.5-turbo-16k": { inputPerMtoken: 3, outputPerMtoken: 4 },
79770
+ "gpt-3.5-turbo-instruct": { inputPerMtoken: 1.5, outputPerMtoken: 2 },
79771
+ "gpt-4": { inputPerMtoken: 30, outputPerMtoken: 60 },
79772
+ "gpt-4-turbo": { inputPerMtoken: 10, outputPerMtoken: 30 },
79773
+ "gpt-4.1": { inputPerMtoken: 2, outputPerMtoken: 8 },
79774
+ "gpt-4.1-mini": { inputPerMtoken: 0.4, outputPerMtoken: 1.6 },
79775
+ "gpt-4.1-nano": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
79776
+ "gpt-4o": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79777
+ "gpt-4o-2024-05-13": { inputPerMtoken: 5, outputPerMtoken: 15 },
79778
+ "gpt-4o-2024-08-06": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79779
+ "gpt-4o-2024-11-20": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79780
+ "gpt-4o-mini": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79781
+ "gpt-4o-mini-2024-07-18": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79782
+ "gpt-5": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79783
+ "gpt-5-image": { inputPerMtoken: 10, outputPerMtoken: 10 },
79784
+ "gpt-5-image-mini": { inputPerMtoken: 2.5, outputPerMtoken: 2 },
79785
+ "gpt-5-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79786
+ "gpt-5-nano": { inputPerMtoken: 0.05, outputPerMtoken: 0.4 },
79787
+ "gpt-5-pro": { inputPerMtoken: 15, outputPerMtoken: 120 },
79788
+ "gpt-5.1": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79789
+ "gpt-5.1-codex": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79790
+ "gpt-5.1-codex-max": { inputPerMtoken: 1.25, outputPerMtoken: 10 },
79791
+ "gpt-5.1-codex-mini": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
79792
+ "gpt-5.2": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79793
+ "gpt-5.2-chat": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79794
+ "gpt-5.2-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79795
+ "gpt-5.2-pro": { inputPerMtoken: 21, outputPerMtoken: 168 },
79796
+ "gpt-5.3-codex": { inputPerMtoken: 1.75, outputPerMtoken: 14 },
79797
+ "gpt-5.4": { inputPerMtoken: 2.5, outputPerMtoken: 15 },
79798
+ "gpt-5.4-image-2": { inputPerMtoken: 8, outputPerMtoken: 15 },
79799
+ "gpt-5.4-mini": { inputPerMtoken: 0.75, outputPerMtoken: 4.5 },
79800
+ "gpt-5.4-nano": { inputPerMtoken: 0.2, outputPerMtoken: 1.25 },
79801
+ "gpt-5.4-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
79802
+ "gpt-5.5": { inputPerMtoken: 5, outputPerMtoken: 30 },
79803
+ "gpt-5.5-pro": { inputPerMtoken: 30, outputPerMtoken: 180 },
79804
+ "gpt-5.6-luna": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
79805
+ "gpt-5.6-luna-pro": { inputPerMtoken: 0.2, outputPerMtoken: 1.2 },
79806
+ "gpt-5.6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79807
+ "gpt-5.6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79808
+ "gpt-5.6-terra": { inputPerMtoken: 2, outputPerMtoken: 12 },
79809
+ "gpt-5.6-terra-pro": { inputPerMtoken: 2, outputPerMtoken: 12 },
79810
+ "gpt-6-astra": { inputPerMtoken: 10, outputPerMtoken: 50 },
79811
+ "gpt-6-astra-pro": { inputPerMtoken: 10, outputPerMtoken: 50 },
79812
+ "gpt-6-luna": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79813
+ "gpt-6-luna-pro": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79814
+ "gpt-6-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79815
+ "gpt-6-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79816
+ "gpt-6.1-sol": { inputPerMtoken: 2, outputPerMtoken: 10 },
79817
+ "gpt-6.1-sol-pro": { inputPerMtoken: 2, outputPerMtoken: 10 },
79818
+ "gpt-astra-latest": { inputPerMtoken: 10, outputPerMtoken: 50 },
79819
+ "gpt-audio": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
79820
+ "gpt-audio-mini": { inputPerMtoken: 0.6, outputPerMtoken: 2.4 },
79821
+ "gpt-chat-latest": { inputPerMtoken: 5, outputPerMtoken: 30 },
79822
+ "gpt-luna-latest": { inputPerMtoken: 0.1, outputPerMtoken: 0.5 },
79823
+ "gpt-mini-latest": { inputPerMtoken: 0.75, outputPerMtoken: 4.5 },
79824
+ "gpt-oss-120b": { inputPerMtoken: 0.037, outputPerMtoken: 0.17 },
79825
+ "gpt-oss-20b": { inputPerMtoken: 0.018, outputPerMtoken: 0.09 },
79826
+ "gpt-oss-safeguard-20b": { inputPerMtoken: 0.075, outputPerMtoken: 0.3 },
79827
+ "gpt-sol-latest": { inputPerMtoken: 2, outputPerMtoken: 10 },
79828
+ "gpt-terra-latest": { inputPerMtoken: 2, outputPerMtoken: 12 },
79829
+ "granite-4.0-h-micro": { inputPerMtoken: 0.017, outputPerMtoken: 0.112 },
79830
+ "granite-4.2-8b": { inputPerMtoken: 0.06, outputPerMtoken: 0.25 },
79831
+ "grok-4.20": { inputPerMtoken: 1.25, outputPerMtoken: 2.5 },
79832
+ "grok-4.20-multi-agent": { inputPerMtoken: 1.25, outputPerMtoken: 2.5 },
79833
+ "grok-4.3": { inputPerMtoken: 1.25, outputPerMtoken: 2.5 },
79834
+ "grok-4.5": { inputPerMtoken: 2, outputPerMtoken: 6 },
79835
+ "grok-4.6": { inputPerMtoken: 2, outputPerMtoken: 6 },
79836
+ "grok-4.7": { inputPerMtoken: 2, outputPerMtoken: 6 },
79837
+ "grok-build-0.1": { inputPerMtoken: 1, outputPerMtoken: 2 },
79838
+ "grok-latest": { inputPerMtoken: 2, outputPerMtoken: 6 },
79839
+ "hermes-3-llama-3.1-405b": { inputPerMtoken: 1, outputPerMtoken: 1 },
79840
+ "hermes-3-llama-3.1-70b": { inputPerMtoken: 0.7, outputPerMtoken: 0.7 },
79841
+ "hermes-4-405b": { inputPerMtoken: 1, outputPerMtoken: 3 },
79842
+ "hunyuan-a13b-instruct": { inputPerMtoken: 0.14, outputPerMtoken: 0.57 },
79843
+ "hy-mt2-1.8b": { inputPerMtoken: 0.044, outputPerMtoken: 0.177 },
79844
+ "hy-mt2-30b-a3b": { inputPerMtoken: 0.074, outputPerMtoken: 0.295 },
79845
+ "hy-mt2-7b": { inputPerMtoken: 0.074, outputPerMtoken: 0.295 },
79846
+ "hy3": { inputPerMtoken: 0.132, outputPerMtoken: 0.528 },
79847
+ "hy3-preview": { inputPerMtoken: 0.18, outputPerMtoken: 0.6 },
79848
+ "hy4-preview": { inputPerMtoken: 0.834, outputPerMtoken: 2.501 },
79849
+ "inkling": { inputPerMtoken: 1, outputPerMtoken: 4.05 },
79850
+ "inkling-small": { inputPerMtoken: 0.45, outputPerMtoken: 1.2 },
79851
+ "inkling-small:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79852
+ "inkling:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79853
+ "kimi-k2": { inputPerMtoken: 0.57, outputPerMtoken: 2.3 },
79854
+ "kimi-k2-0905": { inputPerMtoken: 0.6, outputPerMtoken: 2.5 },
79855
+ "kimi-k2-thinking": { inputPerMtoken: 0.6, outputPerMtoken: 2.5 },
79856
+ "kimi-k2.5": { inputPerMtoken: 0.5, outputPerMtoken: 2.5 },
79857
+ "kimi-k2.6": { inputPerMtoken: 0.65, outputPerMtoken: 3.41 },
79858
+ "kimi-k2.7-code": { inputPerMtoken: 0.6712, outputPerMtoken: 3.35 },
79859
+ "kimi-k3": { inputPerMtoken: 0.7, outputPerMtoken: 15 },
79860
+ "kimi-latest": { inputPerMtoken: 0.536, outputPerMtoken: 14 },
79861
+ "l3-lunaris-8b": { inputPerMtoken: 0.04, outputPerMtoken: 0.05 },
79862
+ "l3.1-euryale-70b": { inputPerMtoken: 0.85, outputPerMtoken: 0.85 },
79863
+ "l3.3-euryale-70b": { inputPerMtoken: 0.65, outputPerMtoken: 0.75 },
79864
+ "laguna-s-2.1": { inputPerMtoken: 0.09, outputPerMtoken: 0.18 },
79865
+ "laguna-s-2.1:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79866
+ "laguna-xs-2.1": { inputPerMtoken: 0.06, outputPerMtoken: 0.12 },
79867
+ "laguna-xs-2.1:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79868
+ "lfm-2.5-2.6b:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79869
+ "lfm-2.5-24b-a2b": { inputPerMtoken: 0.05, outputPerMtoken: 0.7 },
79870
+ "ling-3.0-flash": { inputPerMtoken: 0.021, outputPerMtoken: 0.063 },
79871
+ "ling-3.0-flash-vl": { inputPerMtoken: 0.06, outputPerMtoken: 0.18 },
79872
+ "ling-3.1-flash": { inputPerMtoken: 0.075, outputPerMtoken: 0.225 },
79873
+ "llama-3.1-70b-instruct": { inputPerMtoken: 0.4, outputPerMtoken: 0.4 },
79874
+ "llama-3.1-8b-instruct": { inputPerMtoken: 0.05, outputPerMtoken: 0.08 },
79875
+ "llama-3.2-1b-instruct": { inputPerMtoken: 0.027, outputPerMtoken: 0.201 },
79876
+ "llama-3.2-3b-instruct": { inputPerMtoken: 0.05, outputPerMtoken: 0.33 },
79877
+ "llama-3.3-70b-instruct": { inputPerMtoken: 0.59, outputPerMtoken: 0.79 },
79878
+ "llama-4-maverick": { inputPerMtoken: 0.1875, outputPerMtoken: 0.6525 },
79879
+ "llama-4-scout": { inputPerMtoken: 0.18, outputPerMtoken: 0.59 },
79880
+ "llama-guard-4-12b": { inputPerMtoken: 0.18, outputPerMtoken: 0.18 },
79881
+ "longcat-2.0": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79882
+ "lyria-3-clip-preview": { inputPerMtoken: 0, outputPerMtoken: 0 },
79883
+ "lyria-3-pro-preview": { inputPerMtoken: 0, outputPerMtoken: 0 },
79884
+ "magnum-v4-72b": { inputPerMtoken: 2.5, outputPerMtoken: 5 },
79885
+ "mercury-2": { inputPerMtoken: 0.25, outputPerMtoken: 0.75 },
79886
+ "mercury-2.5": { inputPerMtoken: 0.04, outputPerMtoken: 0.15 },
79887
+ "mimo-v2.5": { inputPerMtoken: 0.14, outputPerMtoken: 0.28 },
79888
+ "mimo-v2.5-pro": { inputPerMtoken: 0.435, outputPerMtoken: 0.87 },
79889
+ "mimo-v2.6-flash": { inputPerMtoken: 0.14, outputPerMtoken: 0.28 },
79890
+ "mimo-v2.6-pro": { inputPerMtoken: 0.435, outputPerMtoken: 0.87 },
79891
+ "mimo-v2.6-pro-ultraspeed": { inputPerMtoken: 4.35, outputPerMtoken: 8.7 },
79892
+ "minimax-01": { inputPerMtoken: 0.2, outputPerMtoken: 1.1 },
79893
+ "minimax-m1": { inputPerMtoken: 0.55, outputPerMtoken: 2.2 },
79894
+ "minimax-m2": { inputPerMtoken: 0.255, outputPerMtoken: 1.02 },
79895
+ "minimax-m2-her": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79896
+ "minimax-m2.1": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79897
+ "minimax-m2.5": { inputPerMtoken: 0.27, outputPerMtoken: 1.08 },
79898
+ "minimax-m2.7": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79899
+ "minimax-m3": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79900
+ "ministral-14b-2512": { inputPerMtoken: 0.2, outputPerMtoken: 0.2 },
79901
+ "ministral-3b-2512": { inputPerMtoken: 0.1, outputPerMtoken: 0.1 },
79902
+ "ministral-8b-2512": { inputPerMtoken: 0.15, outputPerMtoken: 0.15 },
79903
+ "mistral-large": { inputPerMtoken: 2, outputPerMtoken: 6 },
79904
+ "mistral-large-2407": { inputPerMtoken: 2, outputPerMtoken: 6 },
79905
+ "mistral-large-2512": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
79906
+ "mistral-large-4-0": { inputPerMtoken: 0.68, outputPerMtoken: 2.09 },
79907
+ "mistral-medium-3": { inputPerMtoken: 0.4, outputPerMtoken: 2 },
79908
+ "mistral-medium-3-5": { inputPerMtoken: 1.5, outputPerMtoken: 7.5 },
79909
+ "mistral-medium-3.1": { inputPerMtoken: 0.4, outputPerMtoken: 2 },
79910
+ "mistral-nemo": { inputPerMtoken: 0.029, outputPerMtoken: 0.03 },
79911
+ "mistral-saba": { inputPerMtoken: 0.2, outputPerMtoken: 0.6 },
79912
+ "mistral-small-24b-instruct-2501": { inputPerMtoken: 0.05, outputPerMtoken: 0.08 },
79913
+ "mistral-small-2603": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79914
+ "mistral-small-3.1-24b-instruct": { inputPerMtoken: 0.351, outputPerMtoken: 0.555 },
79915
+ "mistral-small-3.2-24b-instruct": { inputPerMtoken: 0.09375, outputPerMtoken: 0.25 },
79916
+ "mixtral-8x22b-instruct": { inputPerMtoken: 2, outputPerMtoken: 6 },
79917
+ "morph-v3-fast": { inputPerMtoken: 0.8, outputPerMtoken: 1.2 },
79918
+ "morph-v3-large": { inputPerMtoken: 0.9, outputPerMtoken: 1.9 },
79919
+ "muse-glimmer-30b": { inputPerMtoken: 0.3, outputPerMtoken: 1.2 },
79920
+ "muse-spark-1.1": { inputPerMtoken: 1.25, outputPerMtoken: 4.25 },
79921
+ "muse-spark-1.2": { inputPerMtoken: 1.25, outputPerMtoken: 4.25 },
79922
+ "muse-spark-1.2-contributor": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79923
+ "muse-spark-1.3": { inputPerMtoken: 1.25, outputPerMtoken: 4.25 },
79924
+ "muse-spark-1.3-contributor": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79925
+ "muse-wonder": { inputPerMtoken: 4, outputPerMtoken: 20 },
79926
+ "mythomax-l2-13b": { inputPerMtoken: 0.08, outputPerMtoken: 0.11 },
79927
+ "nemotron-3-nano-30b-a3b": { inputPerMtoken: 0.06, outputPerMtoken: 0.24 },
79928
+ "nemotron-3-nano-omni-30b-a3b-reasoning:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79929
+ "nemotron-3-super-120b-a12b": { inputPerMtoken: 0.08, outputPerMtoken: 0.45 },
79930
+ "nemotron-3-super-120b-a12b:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79931
+ "nemotron-3-ultra-550b-a55b": { inputPerMtoken: 0.6, outputPerMtoken: 2.4 },
79932
+ "nemotron-3-ultra-550b-a55b:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79933
+ "nemotron-3.5-content-safety": { inputPerMtoken: 0.2, outputPerMtoken: 0.2 },
79934
+ "nemotron-3.5-content-safety:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79935
+ "nemotron-3.5-lightning": { inputPerMtoken: 0.07, outputPerMtoken: 0.2 },
79936
+ "nemotron-3.5-lightning:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79937
+ "nex-n2.5-mini": { inputPerMtoken: 0.025, outputPerMtoken: 0.1 },
79938
+ "nex-n2.5-pro": { inputPerMtoken: 0.075, outputPerMtoken: 0.25 },
79939
+ "north-mini-code:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
79940
+ "nova-2-lite-v1": { inputPerMtoken: 0.3, outputPerMtoken: 2.5 },
79941
+ "nova-lite-v1": { inputPerMtoken: 0.06, outputPerMtoken: 0.24 },
79942
+ "nova-micro-v1": { inputPerMtoken: 0.035, outputPerMtoken: 0.14 },
79943
+ "nova-premier-v1": { inputPerMtoken: 2.5, outputPerMtoken: 12.5 },
79944
+ "nova-pro-v1": { inputPerMtoken: 0.8, outputPerMtoken: 3.2 },
79945
+ "o1": { inputPerMtoken: 15, outputPerMtoken: 60 },
79946
+ "o1-pro": { inputPerMtoken: 150, outputPerMtoken: 600 },
79947
+ "o3": { inputPerMtoken: 2, outputPerMtoken: 8 },
79948
+ "o3-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79949
+ "o3-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79950
+ "o3-pro": { inputPerMtoken: 20, outputPerMtoken: 80 },
79951
+ "o4-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79952
+ "o4-mini-high": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 },
79953
+ "palmyra-x5": { inputPerMtoken: 0.6, outputPerMtoken: 6 },
79954
+ "pareto-26.10-preview": { inputPerMtoken: 0.8, outputPerMtoken: 3.2 },
79955
+ "pareto-26.9": { inputPerMtoken: 2.5, outputPerMtoken: 7.5 },
79956
+ "pareto-latest": { inputPerMtoken: 2.5, outputPerMtoken: 7.5 },
79957
+ "perceptron-mk1": { inputPerMtoken: 0.15, outputPerMtoken: 1.5 },
79958
+ "perceptron-mk1.5": { inputPerMtoken: 0.15, outputPerMtoken: 1.5 },
79959
+ "phi-4": { inputPerMtoken: 0.07, outputPerMtoken: 0.14 },
79960
+ "qwen-2.5-72b-instruct": { inputPerMtoken: 0.36, outputPerMtoken: 0.4 },
79961
+ "qwen-2.5-7b-instruct": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
79962
+ "qwen-2.5-coder-32b-instruct": { inputPerMtoken: 0.66, outputPerMtoken: 1 },
79963
+ "qwen-plus": { inputPerMtoken: 0.26, outputPerMtoken: 0.78 },
79964
+ "qwen2.5-vl-72b-instruct": { inputPerMtoken: 0.8, outputPerMtoken: 1 },
79965
+ "qwen3-14b": { inputPerMtoken: 0.12, outputPerMtoken: 0.24 },
79966
+ "qwen3-235b-a22b-2507": { inputPerMtoken: 0.09, outputPerMtoken: 0.55 },
79967
+ "qwen3-235b-a22b-thinking-2507": { inputPerMtoken: 0.45, outputPerMtoken: 3.5 },
79968
+ "qwen3-30b-a3b": { inputPerMtoken: 0.12, outputPerMtoken: 0.5 },
79969
+ "qwen3-30b-a3b-instruct-2507": { inputPerMtoken: 0.1, outputPerMtoken: 0.3 },
79970
+ "qwen3-32b": { inputPerMtoken: 0.08, outputPerMtoken: 0.28 },
79971
+ "qwen3-coder": { inputPerMtoken: 0.3, outputPerMtoken: 1 },
79972
+ "qwen3-coder-30b-a3b-instruct": { inputPerMtoken: 0.07, outputPerMtoken: 0.28 },
79973
+ "qwen3-coder-flash": { inputPerMtoken: 0.195, outputPerMtoken: 0.975 },
79974
+ "qwen3-coder-next": { inputPerMtoken: 0.12, outputPerMtoken: 0.8 },
79975
+ "qwen3-next-80b-a3b-instruct": { inputPerMtoken: 0.1, outputPerMtoken: 1.1 },
79976
+ "qwen3-next-80b-a3b-thinking": { inputPerMtoken: 0.15, outputPerMtoken: 1.2 },
79977
+ "qwen3-vl-235b-a22b-instruct": { inputPerMtoken: 0.21, outputPerMtoken: 1.9 },
79978
+ "qwen3-vl-30b-a3b-instruct": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
79979
+ "qwen3-vl-30b-a3b-thinking": { inputPerMtoken: 0.29, outputPerMtoken: 1 },
79980
+ "qwen3-vl-8b-instruct": { inputPerMtoken: 0.25, outputPerMtoken: 0.75 },
79981
+ "qwen3.5-122b-a10b": { inputPerMtoken: 0.26, outputPerMtoken: 2.08 },
79982
+ "qwen3.5-27b": { inputPerMtoken: 0.26, outputPerMtoken: 2.6 },
79983
+ "qwen3.5-35b-a3b": { inputPerMtoken: 0.15, outputPerMtoken: 1 },
79984
+ "qwen3.5-397b-a17b": { inputPerMtoken: 0.5, outputPerMtoken: 3.6 },
79985
+ "qwen3.5-9b": { inputPerMtoken: 0.1, outputPerMtoken: 0.15 },
79986
+ "qwen3.5-flash-02-23": { inputPerMtoken: 0.065, outputPerMtoken: 0.26 },
79987
+ "qwen3.5-plus-02-15": { inputPerMtoken: 0.26, outputPerMtoken: 1.56 },
79988
+ "qwen3.5-plus-20260420": { inputPerMtoken: 0.3, outputPerMtoken: 1.8 },
79989
+ "qwen3.6-27b": { inputPerMtoken: 0.32, outputPerMtoken: 3.2 },
79990
+ "qwen3.6-35b-a3b": { inputPerMtoken: 0.1, outputPerMtoken: 0.95 },
79991
+ "qwen3.6-flash": { inputPerMtoken: 0.1875, outputPerMtoken: 1.125 },
79992
+ "qwen3.6-plus": { inputPerMtoken: 0.325, outputPerMtoken: 1.95 },
79993
+ "qwen3.7-flash": { inputPerMtoken: 0.03, outputPerMtoken: 0.13 },
79994
+ "qwen3.7-max": { inputPerMtoken: 1.475, outputPerMtoken: 4.425 },
79995
+ "qwen3.7-plus": { inputPerMtoken: 0.32, outputPerMtoken: 1.28 },
79996
+ "qwen3.8-2.4t-a95b": { inputPerMtoken: 2, outputPerMtoken: 6 },
79997
+ "qwen3.8-27b": { inputPerMtoken: 0.04, outputPerMtoken: 2.3 },
79998
+ "qwen3.8-flash": { inputPerMtoken: 0.15, outputPerMtoken: 0.47 },
79999
+ "qwen3.8-max-0902": { inputPerMtoken: 2, outputPerMtoken: 6 },
80000
+ "qwen3.8-max-prime": { inputPerMtoken: 4, outputPerMtoken: 12 },
80001
+ "qwen3.8-omni-flash": { inputPerMtoken: 0.15, outputPerMtoken: 0.47 },
80002
+ "reka-edge": { inputPerMtoken: 0.1, outputPerMtoken: 0.1 },
80003
+ "reka-flash-3": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
80004
+ "relace-apply-3": { inputPerMtoken: 0.85, outputPerMtoken: 1.25 },
80005
+ "relace-search": { inputPerMtoken: 1, outputPerMtoken: 3 },
80006
+ "remm-slerp-l2-13b": { inputPerMtoken: 0.35, outputPerMtoken: 0.65 },
80007
+ "sakana-namazu": { inputPerMtoken: 0.95, outputPerMtoken: 4 },
80008
+ "schematron-v2-small": { inputPerMtoken: 0.05, outputPerMtoken: 0.23 },
80009
+ "schematron-v2-turbo": { inputPerMtoken: 0.03, outputPerMtoken: 0.15 },
80010
+ "seed-1.6": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
80011
+ "seed-1.6-flash": { inputPerMtoken: 0.075, outputPerMtoken: 0.3 },
80012
+ "seed-2-1-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 2.5 },
80013
+ "seed-2.0-code": { inputPerMtoken: 0.5, outputPerMtoken: 3 },
80014
+ "seed-2.0-lite": { inputPerMtoken: 0.25, outputPerMtoken: 2 },
80015
+ "seed-2.0-mini": { inputPerMtoken: 0.1, outputPerMtoken: 0.4 },
80016
+ "skyfall-36b-v2": { inputPerMtoken: 0.55, outputPerMtoken: 0.8 },
80017
+ "solar-mini4": { inputPerMtoken: 0.05, outputPerMtoken: 0.2 },
80018
+ "solar-pro-3": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
80019
+ "solar-pro4": { inputPerMtoken: 0.09, outputPerMtoken: 0.36 },
80020
+ "sonar": { inputPerMtoken: 1, outputPerMtoken: 1 },
80021
+ "sonar-deep-research": { inputPerMtoken: 2, outputPerMtoken: 8 },
80022
+ "sonar-pro": { inputPerMtoken: 3, outputPerMtoken: 15 },
80023
+ "sonar-pro-search": { inputPerMtoken: 3, outputPerMtoken: 15 },
80024
+ "sonar-reasoning-pro": { inputPerMtoken: 2, outputPerMtoken: 8 },
80025
+ "step-3.5-flash": { inputPerMtoken: 0.1, outputPerMtoken: 0.3 },
80026
+ "step-3.7-flash": { inputPerMtoken: 0.2, outputPerMtoken: 1.15 },
80027
+ "step-5-preview": { inputPerMtoken: 1, outputPerMtoken: 2.7 },
80028
+ "summarize": { inputPerMtoken: 0.04, outputPerMtoken: 0 },
80029
+ "ternary-bonsai-2-27b": { inputPerMtoken: 0.075, outputPerMtoken: 0.5 },
80030
+ "trinity-large-thinking": { inputPerMtoken: 0.25, outputPerMtoken: 0.8 },
80031
+ "ui-tars-1.5-7b": { inputPerMtoken: 0.1, outputPerMtoken: 0.2 },
80032
+ "unslopnemo-12b": { inputPerMtoken: 0.4, outputPerMtoken: 0.4 },
80033
+ "voxtral-small-24b-2507": { inputPerMtoken: 0.1, outputPerMtoken: 0.3 },
80034
+ "weaver": { inputPerMtoken: 0.4, outputPerMtoken: 0.75 },
80035
+ "wizardlm-2-8x22b": { inputPerMtoken: 0.62, outputPerMtoken: 0.62 }
80036
+ }
80037
+ };
80038
+ }
80039
+ });
79354
80040
  init_llm_cost = __esm2({
79355
80041
  "src/llm-cost.ts"() {
79356
80042
  "use strict";
80043
+ init_llm_pricing_openrouter();
80044
+ LEGACY_PRICING = {
80045
+ // Superseded by OPENROUTER_PRICING wherever OpenRouter lists the model.
80046
+ anthropic: {
80047
+ "claude-opus-4-7": { inputPerMtoken: 15, outputPerMtoken: 75 },
80048
+ "claude-opus-4": { inputPerMtoken: 15, outputPerMtoken: 75 },
80049
+ "claude-sonnet-4-6": { inputPerMtoken: 3, outputPerMtoken: 15 },
80050
+ "claude-sonnet-4": { inputPerMtoken: 3, outputPerMtoken: 15 },
80051
+ "claude-haiku-4-5": { inputPerMtoken: 0.8, outputPerMtoken: 4 },
80052
+ "claude-3-5-sonnet": { inputPerMtoken: 3, outputPerMtoken: 15 },
80053
+ "claude-3-5-haiku": { inputPerMtoken: 0.8, outputPerMtoken: 4 },
80054
+ "claude-3-opus": { inputPerMtoken: 15, outputPerMtoken: 75 },
80055
+ "claude-3-sonnet": { inputPerMtoken: 3, outputPerMtoken: 15 },
80056
+ "claude-3-haiku": { inputPerMtoken: 0.25, outputPerMtoken: 1.25 }
80057
+ },
80058
+ openai: {
80059
+ "gpt-4o": { inputPerMtoken: 2.5, outputPerMtoken: 10 },
80060
+ "gpt-4o-mini": { inputPerMtoken: 0.15, outputPerMtoken: 0.6 },
80061
+ "gpt-4-turbo": { inputPerMtoken: 10, outputPerMtoken: 30 },
80062
+ "gpt-4": { inputPerMtoken: 30, outputPerMtoken: 60 },
80063
+ "gpt-3.5-turbo": { inputPerMtoken: 0.5, outputPerMtoken: 1.5 },
80064
+ "o1-preview": { inputPerMtoken: 15, outputPerMtoken: 60 },
80065
+ "o1-mini": { inputPerMtoken: 3, outputPerMtoken: 12 },
80066
+ "o3-mini": { inputPerMtoken: 1.1, outputPerMtoken: 4.4 }
80067
+ },
80068
+ openrouter: {
80069
+ // Qwen via OpenRouter — keys are post-prefix-strip canonical names.
80070
+ "qwen3.5-397b-a17b": { inputPerMtoken: 0.39, outputPerMtoken: 2.34 },
80071
+ "qwen3.6-plus": { inputPerMtoken: 0.26, outputPerMtoken: 1.56 },
80072
+ "qwen3-max-thinking": { inputPerMtoken: 1e-3, outputPerMtoken: 4e-3 },
80073
+ "qwen3-coder:free": { inputPerMtoken: 0, outputPerMtoken: 0 },
80074
+ // Grok via OpenRouter
80075
+ "grok-4.20-multi-agent": { inputPerMtoken: 2, outputPerMtoken: 2 },
80076
+ // DeepSeek routed through OpenRouter (cheaper than direct on output tokens).
80077
+ "deepseek-v3.2": { inputPerMtoken: 0.28, outputPerMtoken: 0.42 },
80078
+ "deepseek-v3.2-speciale": { inputPerMtoken: 0.4, outputPerMtoken: 1.2 },
80079
+ "deepseek-v4-pro": { inputPerMtoken: 0.28, outputPerMtoken: 0.42 },
80080
+ "deepseek-v4-flash": { inputPerMtoken: 0.14, outputPerMtoken: 0.28 }
80081
+ },
80082
+ // DeepSeek direct (deepseek.com) — different pricing than via-OR.
80083
+ // Output prices are noticeably higher on the direct API.
80084
+ deepseek: {
80085
+ "deepseek-v3.2": { inputPerMtoken: 0.27, outputPerMtoken: 1.1 },
80086
+ "deepseek-v3.2-speciale": { inputPerMtoken: 0.55, outputPerMtoken: 2.19 },
80087
+ "deepseek-v4-pro": { inputPerMtoken: 0.27, outputPerMtoken: 1.1 },
80088
+ "deepseek-v4-flash": { inputPerMtoken: 0.14, outputPerMtoken: 0.55 }
80089
+ },
80090
+ // Empty for now — add as we onboard customers using these providers.
80091
+ groq: {},
80092
+ together: {},
80093
+ mistral: {},
80094
+ azure: {}
80095
+ };
80096
+ PRICING = {
80097
+ ...LEGACY_PRICING,
80098
+ anthropic: { ...LEGACY_PRICING.anthropic, ...OPENROUTER_PRICING.anthropic },
80099
+ openai: { ...LEGACY_PRICING.openai, ...OPENROUTER_PRICING.openai },
80100
+ openrouter: { ...LEGACY_PRICING.openrouter, ...OPENROUTER_PRICING.openrouter }
80101
+ };
79357
80102
  }
79358
80103
  });
79359
80104
  init_fetch_interceptor = __esm2({
@@ -93109,20 +93854,20 @@ ${actionsText}`);
93109
93854
  return false;
93110
93855
  }
93111
93856
  function countKeys(schema) {
93112
- let count = 0;
93857
+ let count2 = 0;
93113
93858
  for (const key in schema) {
93114
93859
  if (key === "$ref")
93115
93860
  return Infinity;
93116
- count++;
93861
+ count2++;
93117
93862
  if (SIMPLE_INLINED.has(key))
93118
93863
  continue;
93119
93864
  if (typeof schema[key] == "object") {
93120
- (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch));
93865
+ (0, util_1.eachItem)(schema[key], (sch) => count2 += countKeys(sch));
93121
93866
  }
93122
- if (count === Infinity)
93867
+ if (count2 === Infinity)
93123
93868
  return Infinity;
93124
93869
  }
93125
- return count;
93870
+ return count2;
93126
93871
  }
93127
93872
  function getFullPath(resolver, id = "", normalize) {
93128
93873
  if (normalize !== false)
@@ -96145,8 +96890,8 @@ ${actionsText}`);
96145
96890
  cxt.result(valid, () => cxt.reset());
96146
96891
  function validateItemsWithCount() {
96147
96892
  const schValid = gen.name("_valid");
96148
- const count = gen.let("count", 0);
96149
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
96893
+ const count2 = gen.let("count", 0);
96894
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count2)));
96150
96895
  }
96151
96896
  function validateItems(_valid, block) {
96152
96897
  gen.forRange("i", 0, len, (i2) => {
@@ -96159,16 +96904,16 @@ ${actionsText}`);
96159
96904
  block();
96160
96905
  });
96161
96906
  }
96162
- function checkLimits(count) {
96163
- gen.code((0, codegen_1._)`${count}++`);
96907
+ function checkLimits(count2) {
96908
+ gen.code((0, codegen_1._)`${count2}++`);
96164
96909
  if (max === void 0) {
96165
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break());
96910
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true).break());
96166
96911
  } else {
96167
- gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break());
96912
+ gen.if((0, codegen_1._)`${count2} > ${max}`, () => gen.assign(valid, false).break());
96168
96913
  if (min === 1)
96169
96914
  gen.assign(valid, true);
96170
96915
  else
96171
- gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true));
96916
+ gen.if((0, codegen_1._)`${count2} >= ${min}`, () => gen.assign(valid, true));
96172
96917
  }
96173
96918
  }
96174
96919
  }
@@ -100602,7 +101347,7 @@ data:
100602
101347
  await init_skill_telemetry();
100603
101348
  await init_policy_enforcer();
100604
101349
  init_room_protocol();
100605
- VERSION = true ? "0.23.45" : "0.0.0-dev";
101350
+ VERSION = true ? "0.23.47" : "0.0.0-dev";
100606
101351
  }
100607
101352
  });
100608
101353
  await init_index();
@@ -100755,7 +101500,7 @@ function buildInvocation(layout, sessionId) {
100755
101500
  "-c",
100756
101501
  'approval_policy="never"',
100757
101502
  "-c",
100758
- 'model="gpt-5.6-terra"',
101503
+ `model="${CODEX_MODEL}"`,
100759
101504
  "-c",
100760
101505
  'cli_auth_credentials_store="file"',
100761
101506
  "-c",
@@ -100798,7 +101543,17 @@ async function checkVersion(binary, layout) {
100798
101543
  if (version2 !== `codex-cli ${SUPPORTED_CODEX_VERSION}`)
100799
101544
  throw new Error(`Unsupported Codex CLI; install ${SUPPORTED_CODEX_VERSION}`);
100800
101545
  }
100801
- var SUPPORTED_CODEX_VERSION, CODE_MODE_WARNING, UUID2, CodexDriver;
101546
+ function parseTurnUsage(raw) {
101547
+ if (!raw || typeof raw !== "object")
101548
+ return void 0;
101549
+ const u2 = raw;
101550
+ const inputTokens = count(u2.input_tokens), outputTokens = count(u2.output_tokens);
101551
+ if (inputTokens === void 0 || outputTokens === void 0 || inputTokens + outputTokens === 0)
101552
+ return void 0;
101553
+ const cached2 = count(u2.cached_input_tokens);
101554
+ return { model: CODEX_MODEL, inputTokens, outputTokens, ...cached2 !== void 0 ? { cachedInputTokens: cached2 } : {} };
101555
+ }
101556
+ var SUPPORTED_CODEX_VERSION, CODE_MODE_WARNING, UUID2, CODEX_MODEL, count, CodexDriver;
100802
101557
  var init_driver = __esm({
100803
101558
  "src/driver.ts"() {
100804
101559
  "use strict";
@@ -100806,6 +101561,8 @@ var init_driver = __esm({
100806
101561
  SUPPORTED_CODEX_VERSION = "0.154.0";
100807
101562
  CODE_MODE_WARNING = "Code Mode is unavailable because code-mode host is disabled. Code mode will fail closed; enable `features.code_mode_host` and install `codex-code-mode-host`.";
100808
101563
  UUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
101564
+ CODEX_MODEL = "gpt-5.6-terra";
101565
+ count = (v2) => typeof v2 === "number" && Number.isSafeInteger(v2) && v2 >= 0 ? v2 : void 0;
100809
101566
  CodexDriver = class {
100810
101567
  constructor(options) {
100811
101568
  this.options = options;
@@ -100851,6 +101608,7 @@ var init_driver = __esm({
100851
101608
  const child = spawn(binary, invocation.args, { cwd: invocation.cwd, env: invocation.env, stdio: ["pipe", "pipe", "pipe"], detached: true });
100852
101609
  let failed = false, closed = false, settled = false, started = false, terminal = false;
100853
101610
  let sessionId = "", text = "", buffered = "", bytes = 0;
101611
+ let usage;
100854
101612
  const decoder2 = new StringDecoder("utf8");
100855
101613
  let killTimer;
100856
101614
  let reapTimer;
@@ -100876,7 +101634,7 @@ var init_driver = __esm({
100876
101634
  settled = true;
100877
101635
  cleanup();
100878
101636
  if (ok)
100879
- resolve4({ text, sessionId });
101637
+ resolve4({ text, sessionId, ...usage ? { usage } : {} });
100880
101638
  else
100881
101639
  reject(new Error("Codex turn failed"));
100882
101640
  };
@@ -100928,6 +101686,7 @@ var init_driver = __esm({
100928
101686
  if (!started || !text.trim())
100929
101687
  throw new Error();
100930
101688
  terminal = true;
101689
+ usage = parseTurnUsage(e.usage);
100931
101690
  break;
100932
101691
  case "error":
100933
101692
  case "turn.failed":
@@ -101240,7 +101999,7 @@ var init_cli = __esm({
101240
101999
  "use strict";
101241
102000
  await init_dist();
101242
102001
  init_driver();
101243
- VERSION2 = "0.1.1";
102002
+ VERSION2 = "0.1.3";
101244
102003
  HELP = `AgentVault OpenAI Bridge ${VERSION2}
101245
102004
  Usage: AV_AGENT_NAME=<name> agentvault-openai-bridge <command>
101246
102005
 
@@ -101370,12 +102129,14 @@ var init_bridge = __esm({
101370
102129
  const controller = new AbortController();
101371
102130
  this.active = controller;
101372
102131
  try {
102132
+ const startedAt = Date.now();
101373
102133
  const reply = await this.driver.run(JSON.stringify([target.deviceId, kind, id]), `You are ${this.name}, an AgentVault conversational agent. Reply in plain text to this ${kind === "dm" ? "owner direct message" : "addressed room message"}. Filesystem, shell, web and integration tools are unavailable.
101374
102134
  ${history ? `Recent messages from this room (conversation context):
101375
102135
  ${history}
101376
102136
  ` : ""}
101377
102137
  Current message:
101378
102138
  ${text}`, controller.signal);
102139
+ this.reportUsage(reply, Date.now() - startedAt);
101379
102140
  if (!valid() || controller.signal.aborted)
101380
102141
  return;
101381
102142
  await this.deliver(target, reply.text, controller.signal);
@@ -101390,6 +102151,22 @@ ${text}`, controller.signal);
101390
102151
  this.pending--;
101391
102152
  });
101392
102153
  }
102154
+ /** Health (2026-10-14): tokens for the model call. No cost — the bridge runs
102155
+ * on a ChatGPT login, so there is no per-token price to report honestly. */
102156
+ reportUsage(reply, latencyMs) {
102157
+ if (!reply.usage)
102158
+ return;
102159
+ try {
102160
+ this.channel.telemetry?.reportLlmCall({
102161
+ model: reply.usage.model,
102162
+ provider: "openai",
102163
+ latencyMs,
102164
+ tokensInput: reply.usage.inputTokens,
102165
+ tokensOutput: reply.usage.outputTokens
102166
+ });
102167
+ } catch {
102168
+ }
102169
+ }
101393
102170
  async deliver(target, text, signal) {
101394
102171
  const delivery = target.kind === "room" ? this.channel.sendToRoom(target.id, text) : this.channel.send(text, { conversationId: target.id });
101395
102172
  await new Promise((resolve4, reject) => {
@@ -101589,6 +102366,13 @@ async function startBridge(config2, injected) {
101589
102366
  if (state === "error")
101590
102367
  void stop();
101591
102368
  });
102369
+ channel.on("state", (state) => {
102370
+ const fingerprint = channel?.fingerprint;
102371
+ if (state !== "polling" || !fingerprint)
102372
+ return;
102373
+ report(`Fingerprint: ${fingerprint}`);
102374
+ report("Verify this fingerprint matches the one shown in your AgentVault dashboard before clicking Approve.");
102375
+ });
101592
102376
  channel.on("error", () => {
101593
102377
  });
101594
102378
  await Promise.race([channel.start(), ended]);