@agentvault/muse-bridge 0.1.21 → 0.1.23

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);
@@ -4981,28 +4988,28 @@ function decodeVarLenType(dec) {
4981
4988
  }
4982
4989
  function base64RecordEncoder(valueEncoder) {
4983
4990
  const entryEncoder = contramapBufferEncoders([contramapBufferEncoder(varLenDataEncoder, base64ToBytes2), valueEncoder], ([key, value]) => [key, value]);
4984
- return contramapBufferEncoders([varLenTypeEncoder(entryEncoder)], (record2) => [Object.entries(record2)]);
4991
+ return contramapBufferEncoders([varLenTypeEncoder(entryEncoder)], (record22) => [Object.entries(record22)]);
4985
4992
  }
4986
4993
  function decodeBase64Record(decodeValue) {
4987
4994
  return mapDecoder(decodeVarLenType(mapDecoders([mapDecoder(decodeVarLenData, bytesToBase642), decodeValue], (key, value) => [key, value])), (entries) => {
4988
- const record2 = {};
4995
+ const record22 = {};
4989
4996
  for (const [key, value] of entries) {
4990
- record2[key] = value;
4997
+ record22[key] = value;
4991
4998
  }
4992
- return record2;
4999
+ return record22;
4993
5000
  });
4994
5001
  }
4995
5002
  function numberRecordEncoder(numberEncoder, valueEncoder) {
4996
5003
  const entryEncoder = contramapBufferEncoders([numberEncoder, valueEncoder], ([key, value]) => [key, value]);
4997
- return contramapBufferEncoder(varLenTypeEncoder(entryEncoder), (record2) => Object.entries(record2).map(([key, value]) => [Number(key), value]));
5004
+ return contramapBufferEncoder(varLenTypeEncoder(entryEncoder), (record22) => Object.entries(record22).map(([key, value]) => [Number(key), value]));
4998
5005
  }
4999
5006
  function decodeNumberRecord(decodeNumber, decodeValue) {
5000
5007
  return mapDecoder(decodeVarLenType(mapDecoders([decodeNumber, decodeValue], (key, value) => [key, value])), (entries) => {
5001
- const record2 = {};
5008
+ const record22 = {};
5002
5009
  for (const [key, value] of entries) {
5003
- record2[key] = value;
5010
+ record22[key] = value;
5004
5011
  }
5005
- return record2;
5012
+ return record22;
5006
5013
  });
5007
5014
  }
5008
5015
  function bigintMapEncoder(valueEncoder) {
@@ -6042,16 +6049,16 @@ function removeOldGenerations(unusedGenerations, max) {
6042
6049
  const generations = Object.keys(unusedGenerations).map(Number).sort((a2, b2) => a2 - b2);
6043
6050
  const cutoff = generations.length - max;
6044
6051
  const consumed = new Array();
6045
- const record2 = {};
6052
+ const record22 = {};
6046
6053
  for (const [n2, gen] of generations.entries()) {
6047
6054
  const value = unusedGenerations[gen];
6048
6055
  if (n2 < cutoff) {
6049
6056
  consumed.push(value);
6050
6057
  } else {
6051
- record2[gen] = value;
6058
+ record22[gen] = value;
6052
6059
  }
6053
6060
  }
6054
- return [record2, consumed];
6061
+ return [record22, consumed];
6055
6062
  }
6056
6063
  async function derivePrivateMessageNonce(secret, generation, reuseGuard, cs) {
6057
6064
  const nonce = await deriveNonce(secret, generation, cs);
@@ -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
  }
@@ -12058,12 +12065,12 @@ async function loadHistoryRecoveryCode(tenantId, env = process.env) {
12058
12065
  const raw = await handle.readFile({ encoding: "utf8" });
12059
12066
  const parsed = JSON.parse(raw);
12060
12067
  if (!parsed || typeof parsed !== "object") return null;
12061
- const record2 = parsed;
12062
- if (record2.version !== 1 || record2.tenantId !== canonicalTenant || typeof record2.code !== "string") {
12068
+ const record22 = parsed;
12069
+ if (record22.version !== 1 || record22.tenantId !== canonicalTenant || typeof record22.code !== "string") {
12063
12070
  return null;
12064
12071
  }
12065
- const normalized = normalizeHistoryCode(record2.code);
12066
- return normalized === record2.code ? normalized : null;
12072
+ const normalized = normalizeHistoryCode(record22.code);
12073
+ return normalized === record22.code ? normalized : null;
12067
12074
  } catch {
12068
12075
  return null;
12069
12076
  } finally {
@@ -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)) {
@@ -12412,11 +12438,11 @@ function parseRestoreResponse(value) {
12412
12438
  if (value === null || typeof value !== "object" || Array.isArray(value)) {
12413
12439
  throw new Error("History restore returned an invalid response");
12414
12440
  }
12415
- const record2 = value;
12416
- if (Object.keys(record2).length !== 2 || !Object.hasOwn(record2, "hub_id") || !Object.hasOwn(record2, "generations") || typeof record2.hub_id !== "string" || !UUID_RE2.test(record2.hub_id) || !Array.isArray(record2.generations) || record2.generations.length > 3) {
12441
+ const record22 = value;
12442
+ if (Object.keys(record22).length !== 2 || !Object.hasOwn(record22, "hub_id") || !Object.hasOwn(record22, "generations") || typeof record22.hub_id !== "string" || !UUID_RE2.test(record22.hub_id) || !Array.isArray(record22.generations) || record22.generations.length > 3) {
12417
12443
  throw new Error("History restore returned an invalid response");
12418
12444
  }
12419
- const generations = record2.generations.map((item) => {
12445
+ const generations = record22.generations.map((item) => {
12420
12446
  if (item === null || typeof item !== "object" || Array.isArray(item)) {
12421
12447
  throw new Error("History restore returned an invalid response");
12422
12448
  }
@@ -12426,7 +12452,7 @@ function parseRestoreResponse(value) {
12426
12452
  }
12427
12453
  return generation;
12428
12454
  });
12429
- return { hub_id: record2.hub_id, generations };
12455
+ return { hub_id: record22.hub_id, generations };
12430
12456
  }
12431
12457
  function decodeStrictBase64(value) {
12432
12458
  if (value.length === 0 || value.length > Math.ceil(HISTORY_MAX_BLOB_BYTES / 3) * 4 || value.length % 4 !== 0 || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value)) {
@@ -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.
@@ -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((resolve42, 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
+ resolve42(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) {
@@ -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
@@ -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) => {
@@ -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({
@@ -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();
@@ -101376,8 +102121,9 @@ var MuseSession = class {
101376
102121
  ${item.text}` : item.text;
101377
102122
  const result = await this.driver.runTurn(prompt);
101378
102123
  await this.maybeFallback(item, result);
101379
- } catch (e) {
101380
- this.log(`turn failed: ${e instanceof Error ? e.message : String(e)}`);
102124
+ } catch {
102125
+ this.log("turn failed reason=driver");
102126
+ await this.failureNotice(item);
101381
102127
  } finally {
101382
102128
  this.current = null;
101383
102129
  }
@@ -101386,6 +102132,31 @@ ${item.text}` : item.text;
101386
102132
  this.running = false;
101387
102133
  }
101388
102134
  }
102135
+ async failureNotice(item) {
102136
+ if (!item.autoReplyOnText || this.saidThisTurn) return;
102137
+ const sink = item.reply ?? this.opts.onSay;
102138
+ if (!sink) return;
102139
+ this.saidThisTurn = true;
102140
+ let timer;
102141
+ const delivery = Promise.resolve().then(() => sink("I couldn't complete this reply. Please try again.")).then(
102142
+ () => {
102143
+ this.log("failure_notice outcome=delivered");
102144
+ },
102145
+ () => {
102146
+ this.log("failure_notice outcome=failed");
102147
+ }
102148
+ );
102149
+ try {
102150
+ await Promise.race([delivery, new Promise((resolve5) => {
102151
+ timer = setTimeout(() => {
102152
+ this.log("failure_notice outcome=timeout");
102153
+ resolve5();
102154
+ }, 1e4);
102155
+ })]);
102156
+ } finally {
102157
+ clearTimeout(timer);
102158
+ }
102159
+ }
101389
102160
  /**
101390
102161
  * Room/DM fallback only when this turn authorised a reply AND the model
101391
102162
  * never called `say`. Echo provider payload.text is prefixed `echo:` — that
@@ -101471,6 +102242,254 @@ function museSpawnArgs(opts) {
101471
102242
  return { command: opts.command, args, cwd: opts.workspaceDir, env };
101472
102243
  }
101473
102244
 
102245
+ // src/muse-provider.ts
102246
+ import { randomBytes as randomBytes3 } from "node:crypto";
102247
+ import { createServer as createServer2 } from "node:http";
102248
+ import { once } from "node:events";
102249
+ var META_RESPONSES_URL = "https://api.meta.ai/v1/responses";
102250
+ var BODY_LIMIT = 16 * 1024 * 1024;
102251
+ var ERROR_LIMIT = 64 * 1024;
102252
+ var HOP_HEADERS = ["connection", "keep-alive", "proxy-authenticate", "proxy-authorization", "te", "trailer", "transfer-encoding", "upgrade"];
102253
+ function record2(value) {
102254
+ return value !== null && typeof value === "object" && !Array.isArray(value);
102255
+ }
102256
+ function recoverable(body) {
102257
+ return Array.isArray(body.input) && body.previous_response_id == null;
102258
+ }
102259
+ function reasoning(item) {
102260
+ return record2(item) && item.type === "reasoning";
102261
+ }
102262
+ function settledInput(input) {
102263
+ let latestUser = -1;
102264
+ input.forEach((item, i2) => {
102265
+ if (record2(item) && item.role === "user" && (item.type === "message" || item.type == null)) latestUser = i2;
102266
+ });
102267
+ return input.filter((item, i2) => i2 >= latestUser || !reasoning(item));
102268
+ }
102269
+ function safeHeaders(headers) {
102270
+ const result = new Headers(headers);
102271
+ const nominated = result.get("connection")?.split(",").map((h2) => h2.trim()) ?? [];
102272
+ for (const name of [...HOP_HEADERS, ...nominated, "host", "content-length", "content-encoding"]) result.delete(name);
102273
+ return result;
102274
+ }
102275
+ function requestHeaders2(req) {
102276
+ const headers = new Headers();
102277
+ for (const [name, value] of Object.entries(req.headers)) {
102278
+ if (value != null) headers.set(name, Array.isArray(value) ? value.join(", ") : value);
102279
+ }
102280
+ return safeHeaders(headers);
102281
+ }
102282
+ function readBody(req) {
102283
+ return new Promise((resolve5, reject) => {
102284
+ const chunks = [];
102285
+ let size = 0;
102286
+ const clean5 = () => {
102287
+ req.off("data", data);
102288
+ req.off("end", end);
102289
+ req.off("error", fail);
102290
+ req.off("aborted", aborted2);
102291
+ };
102292
+ const fail = (error2) => {
102293
+ clean5();
102294
+ reject(error2);
102295
+ };
102296
+ const aborted2 = () => fail(new Error("aborted"));
102297
+ const data = (chunk) => {
102298
+ size += chunk.length;
102299
+ if (size > BODY_LIMIT) {
102300
+ fail(new Error("body_limit"));
102301
+ req.resume();
102302
+ } else chunks.push(chunk);
102303
+ };
102304
+ const end = () => {
102305
+ clean5();
102306
+ resolve5(Buffer.concat(chunks));
102307
+ };
102308
+ req.on("data", data);
102309
+ req.on("end", end);
102310
+ req.on("error", fail);
102311
+ req.on("aborted", aborted2);
102312
+ });
102313
+ }
102314
+ async function inspectedError(response) {
102315
+ const reader = response.body?.getReader();
102316
+ const chunks = [];
102317
+ let size = 0;
102318
+ if (reader) {
102319
+ while (size <= ERROR_LIMIT) {
102320
+ const chunk = await reader.read();
102321
+ if (chunk.done) break;
102322
+ chunks.push(chunk.value);
102323
+ size += chunk.value.byteLength;
102324
+ }
102325
+ }
102326
+ let expired = false;
102327
+ if (size <= ERROR_LIMIT) {
102328
+ try {
102329
+ const parsed = JSON.parse(Buffer.concat(chunks).toString("utf8"));
102330
+ expired = record2(parsed) && record2(parsed.error) && typeof parsed.error.message === "string" && /\breasoning ([`'"]?)encrypted_content\1 has expired\b/i.test(parsed.error.message);
102331
+ } catch {
102332
+ }
102333
+ }
102334
+ return { expired, chunks, reader };
102335
+ }
102336
+ async function forward(response, res, signal, inspected) {
102337
+ res.statusCode = response.status;
102338
+ safeHeaders(response.headers).forEach((value, name) => res.setHeader(name, value));
102339
+ res.flushHeaders();
102340
+ const reader = inspected?.reader ?? response.body?.getReader();
102341
+ const write = async (chunk) => {
102342
+ signal.throwIfAborted();
102343
+ if (!res.write(chunk)) await once(res, "drain", { signal });
102344
+ };
102345
+ try {
102346
+ for (const chunk of inspected?.chunks ?? []) await write(chunk);
102347
+ if (reader) {
102348
+ for (; ; ) {
102349
+ signal.throwIfAborted();
102350
+ const chunk = await reader.read();
102351
+ if (chunk.done) break;
102352
+ await write(chunk.value);
102353
+ }
102354
+ }
102355
+ res.end();
102356
+ } finally {
102357
+ await reader?.cancel().catch(() => {
102358
+ });
102359
+ }
102360
+ }
102361
+ async function createMuseProviderAdapter(opts) {
102362
+ const route = `/${randomBytes3(24).toString("hex")}/v1/responses`;
102363
+ const turn = new AbortController();
102364
+ const sockets = /* @__PURE__ */ new Set();
102365
+ const log = (message) => {
102366
+ try {
102367
+ opts.log?.(`[muse-provider] ${message}`);
102368
+ } catch {
102369
+ }
102370
+ };
102371
+ const server = createServer2((req, res) => {
102372
+ const abort = new AbortController();
102373
+ const stop = () => abort.abort();
102374
+ turn.signal.addEventListener("abort", stop, { once: true });
102375
+ res.on("close", stop);
102376
+ req.on("aborted", stop);
102377
+ req.on("error", stop);
102378
+ if (turn.signal.aborted) stop();
102379
+ const error2 = (status) => {
102380
+ if (res.headersSent || res.destroyed) {
102381
+ res.destroy();
102382
+ return;
102383
+ }
102384
+ res.writeHead(status, { "content-type": "application/json" });
102385
+ res.end('{"error":"provider request failed"}');
102386
+ };
102387
+ void (async () => {
102388
+ if (req.url !== route || req.method !== "POST") {
102389
+ req.resume();
102390
+ error2(404);
102391
+ return;
102392
+ }
102393
+ if (req.headers["content-encoding"] != null) {
102394
+ req.resume();
102395
+ error2(415);
102396
+ return;
102397
+ }
102398
+ let raw;
102399
+ try {
102400
+ raw = await readBody(req);
102401
+ } catch (e) {
102402
+ error2(e instanceof Error && e.message === "body_limit" ? 413 : 400);
102403
+ return;
102404
+ }
102405
+ let parsed;
102406
+ try {
102407
+ parsed = JSON.parse(raw.toString("utf8"));
102408
+ } catch {
102409
+ error2(400);
102410
+ return;
102411
+ }
102412
+ if (!record2(parsed)) {
102413
+ error2(400);
102414
+ return;
102415
+ }
102416
+ let body = parsed;
102417
+ const eligible = recoverable(body);
102418
+ let removed = 0;
102419
+ if (recoverable(body)) {
102420
+ const input = settledInput(body.input);
102421
+ removed = body.input.length - input.length;
102422
+ if (removed) body = { ...body, input };
102423
+ }
102424
+ log(`settled_reasoning removed=${removed}`);
102425
+ const headers = requestHeaders2(req);
102426
+ const request = (payload) => (opts.fetchForTests ?? fetch)(META_RESPONSES_URL, {
102427
+ method: "POST",
102428
+ headers,
102429
+ body: payload,
102430
+ redirect: "error",
102431
+ signal: abort.signal
102432
+ });
102433
+ let response = await request(removed ? JSON.stringify(body) : raw.toString("utf8"));
102434
+ let inspected;
102435
+ if (response.status === 400) {
102436
+ inspected = await inspectedError(response);
102437
+ if (inspected.expired && eligible && recoverable(body)) {
102438
+ const input = body.input.filter((item) => !reasoning(item));
102439
+ const remaining = body.input.length - input.length;
102440
+ if (remaining > 0) {
102441
+ await inspected.reader?.cancel();
102442
+ log(`expiry_recovery outcome=retry removed=${remaining}`);
102443
+ response = await request(JSON.stringify({ ...body, input }));
102444
+ inspected = void 0;
102445
+ log(`expiry_recovery outcome=${response.ok ? "response_accepted" : "failed"}`);
102446
+ }
102447
+ }
102448
+ }
102449
+ await forward(response, res, abort.signal, inspected);
102450
+ })().catch(() => {
102451
+ log("request_failed reason=transport");
102452
+ error2(502);
102453
+ }).finally(() => {
102454
+ turn.signal.removeEventListener("abort", stop);
102455
+ res.off("close", stop);
102456
+ });
102457
+ });
102458
+ server.on("connection", (socket) => {
102459
+ sockets.add(socket);
102460
+ socket.on("close", () => sockets.delete(socket));
102461
+ });
102462
+ server.headersTimeout = Math.min(opts.timeoutMs, 6e4);
102463
+ server.requestTimeout = opts.timeoutMs;
102464
+ await new Promise((resolve5, reject) => {
102465
+ server.once("error", reject);
102466
+ server.listen(0, "127.0.0.1", () => {
102467
+ server.off("error", reject);
102468
+ resolve5();
102469
+ });
102470
+ });
102471
+ let closed;
102472
+ const close = () => {
102473
+ if (closed) return closed;
102474
+ clearTimeout(timer);
102475
+ turn.abort();
102476
+ closed = new Promise((resolve5) => {
102477
+ server.close(() => resolve5());
102478
+ for (const socket of sockets) socket.destroy();
102479
+ });
102480
+ return closed;
102481
+ };
102482
+ const timer = setTimeout(() => {
102483
+ void close();
102484
+ }, opts.timeoutMs);
102485
+ const address = server.address();
102486
+ if (!address || typeof address === "string") {
102487
+ await close();
102488
+ throw new Error("provider adapter unavailable");
102489
+ }
102490
+ return { baseUrl: `http://127.0.0.1:${address.port}${route.slice(0, -"/responses".length)}`, close };
102491
+ }
102492
+
101474
102493
  // src/muse-driver.ts
101475
102494
  var SESSION_FILE = "muse-session-id";
101476
102495
  var DEFAULT_TURN_TIMEOUT_MS = 3e5;
@@ -101488,6 +102507,7 @@ var MuseDriver = class {
101488
102507
  current = null;
101489
102508
  child = null;
101490
102509
  probed = false;
102510
+ adapter = null;
101491
102511
  /** Load or create `<dataDir>/muse-session-id`. Does not spawn muse. */
101492
102512
  async start() {
101493
102513
  mkdirSync3(this.opts.dataDir, { recursive: true });
@@ -101513,7 +102533,7 @@ var MuseDriver = class {
101513
102533
  if (this.current || this.child) {
101514
102534
  throw new Error("MuseDriver.runTurn called while a turn is in flight");
101515
102535
  }
101516
- this.current = { spoke: false };
102536
+ this.current = { spoke: false, cancelled: false };
101517
102537
  return this.executeTurn(prompt).finally(() => {
101518
102538
  this.current = null;
101519
102539
  });
@@ -101522,9 +102542,14 @@ var MuseDriver = class {
101522
102542
  if (this.current) this.current.spoke = true;
101523
102543
  }
101524
102544
  async stop() {
102545
+ if (this.current) this.current.cancelled = true;
102546
+ const closing = this.adapter?.close();
101525
102547
  const child = this.child;
101526
- if (!child) return;
101527
- await this.escalateKill(child);
102548
+ if (!child) {
102549
+ await closing;
102550
+ return;
102551
+ }
102552
+ await Promise.all([closing, this.escalateKill(child)]);
101528
102553
  }
101529
102554
  /** SIGTERM, then SIGKILL if still alive after 2s. Does not fulfill runTurn. */
101530
102555
  async escalateKill(child) {
@@ -101550,7 +102575,21 @@ var MuseDriver = class {
101550
102575
  gatesRemoved: readFlag(this.opts.gatesRemoved)
101551
102576
  });
101552
102577
  await this.probeUsable(spawn2);
101553
- return this.execJsonl(spawn2);
102578
+ if (this.current?.cancelled) throw new Error("muse turn stopped");
102579
+ if ((this.opts.provider ?? "meta") === "echo") return this.execJsonl(spawn2);
102580
+ const adapter = await (this.opts.providerAdapterFactory ?? createMuseProviderAdapter)({
102581
+ timeoutMs: this.turnTimeoutMs,
102582
+ log: this.opts.log
102583
+ });
102584
+ this.adapter = adapter;
102585
+ try {
102586
+ if (this.current?.cancelled) throw new Error("muse turn stopped");
102587
+ spawn2.args.splice(2, 0, "--base-url", adapter.baseUrl);
102588
+ return await this.execJsonl(spawn2);
102589
+ } finally {
102590
+ await adapter.close();
102591
+ if (this.adapter === adapter) this.adapter = null;
102592
+ }
101554
102593
  }
101555
102594
  async probeUsable(spawn2) {
101556
102595
  if (this.probed) return;
@@ -101613,6 +102652,7 @@ var MuseDriver = class {
101613
102652
  };
101614
102653
  const timer = setTimeout(() => {
101615
102654
  timedOut = true;
102655
+ void this.adapter?.close();
101616
102656
  void this.escalateKill(child);
101617
102657
  }, this.turnTimeoutMs);
101618
102658
  const onLine = (raw) => {
@@ -101740,8 +102780,8 @@ function redactSecrets(text) {
101740
102780
  }
101741
102781
 
101742
102782
  // src/muse-room-http.ts
101743
- import { createServer as createServer2 } from "node:http";
101744
- import { randomBytes as randomBytes3, randomUUID as randomUUID6, timingSafeEqual } from "node:crypto";
102783
+ import { createServer as createServer3 } from "node:http";
102784
+ import { randomBytes as randomBytes4, randomUUID as randomUUID6, timingSafeEqual } from "node:crypto";
101745
102785
 
101746
102786
  // src/muse-room-mcp.ts
101747
102787
  var PROTOCOL = "2024-11-05";
@@ -101818,7 +102858,7 @@ function acceptOf(req) {
101818
102858
  async function startRoomMcpServer(opts) {
101819
102859
  const seen = [];
101820
102860
  const traces = [];
101821
- const token = randomBytes3(24).toString("base64url");
102861
+ const token = randomBytes4(24).toString("base64url");
101822
102862
  const path2 = `/mcp/${token}`;
101823
102863
  const log = opts.log ?? (() => {
101824
102864
  });
@@ -101839,7 +102879,7 @@ async function startRoomMcpServer(opts) {
101839
102879
  if (got !== sessionId) return "wrong";
101840
102880
  return "ok";
101841
102881
  }
101842
- const server = createServer2((req, res) => {
102882
+ const server = createServer3((req, res) => {
101843
102883
  req.on("error", () => {
101844
102884
  });
101845
102885
  res.on("error", () => {
@@ -102211,6 +103251,22 @@ function buildClientVersion2(version2) {
102211
103251
  return `@agentvault/muse-bridge@${version2 ?? "dev"}`;
102212
103252
  }
102213
103253
 
103254
+ // src/enrollment-fingerprint.ts
103255
+ function fingerprintLines(fingerprint) {
103256
+ return [
103257
+ `Fingerprint: ${fingerprint}`,
103258
+ "Verify this fingerprint matches the one shown in your AgentVault dashboard before clicking Approve."
103259
+ ];
103260
+ }
103261
+ function watchEnrollmentFingerprint(channel, log) {
103262
+ channel.on("state", (s2) => {
103263
+ if (s2 !== "polling") return;
103264
+ const fp = channel.fingerprint;
103265
+ if (!fp) return;
103266
+ for (const line of fingerprintLines(fp)) log(line);
103267
+ });
103268
+ }
103269
+
102214
103270
  // src/index.ts
102215
103271
  async function maybeRunRecoverySubcommand(argv = process.argv, env = process.env, runRecovery = runHistoryRecoveryCommand) {
102216
103272
  if (argv[2] !== "recovery") return false;
@@ -102236,7 +103292,7 @@ function mkdir700(path2) {
102236
103292
  chmodSync5(path2, 448);
102237
103293
  }
102238
103294
  function packageVersion() {
102239
- return true ? "0.1.21" : void 0;
103295
+ return true ? "0.1.23" : void 0;
102240
103296
  }
102241
103297
  function helpText(version2) {
102242
103298
  return [
@@ -102349,6 +103405,7 @@ async function main(opts = {}) {
102349
103405
  writeFenceMcpSettings(cfg.fenceHome, { url: mcp.url });
102350
103406
  const childPath = opts.path ?? env.PATH ?? "";
102351
103407
  driver = new MuseDriver({
103408
+ log: (message) => logLine(message),
102352
103409
  command: cfg.musePath,
102353
103410
  path: childPath,
102354
103411
  workspaceDir: cfg.workspaceDir,
@@ -102401,6 +103458,7 @@ async function main(opts = {}) {
102401
103458
  log: (m2) => logLine("[muse-bridge] " + m2),
102402
103459
  onTerminal: (_reason, o2) => void shutdown(o2.restart ? 1 : 0)
102403
103460
  });
103461
+ watchEnrollmentFingerprint(channel, (m2) => logLine("[muse-bridge] " + m2));
102404
103462
  await channel.start();
102405
103463
  return {
102406
103464
  driver,