@agentvault/muse-bridge 0.1.40 → 0.1.42

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/README.md CHANGED
@@ -109,6 +109,17 @@ messages, and answers your message. No notice is sent. The log says
109
109
 
110
110
  Tip: to find these in the log, search for `turn_failed` or `turn_recovered`.
111
111
 
112
+ **After a restart.** If the bridge is stopped or restarted (for example during an
113
+ update) while it owes a message an answer, nothing replays that message, so the
114
+ chat gets the plain "Wowzer couldn't answer this message." sentence. It never
115
+ names a cause, and nothing is recorded under Health, because the model did not
116
+ fail. The same goes for a message waiting its turn and one that lands while the
117
+ bridge stops. The log line is
118
+ `turn_cancelled reason=shutdown notice=<sent, failed, timeout or none>`, with
119
+ `queued=true` or `late=true` where they apply. `notice=none delivered=true` means
120
+ the answer was already on its way, so nothing more is posted. The bridge waits at
121
+ most 10 seconds for these sentences and 15 seconds for the whole stop.
122
+
112
123
  ## Copied-from ledger — REVIEW PERIODICALLY
113
124
 
114
125
  These files were copied once from the Claude bridge and are now owned here. A fix
package/dist/bridge.d.ts CHANGED
@@ -146,7 +146,9 @@ export declare class ActiveTarget {
146
146
  setRoom(roomId: string): void;
147
147
  setDm(conversationId?: string, groupId?: string): void;
148
148
  get current(): BridgeTarget | null;
149
- snapshotReply(channel: ReplyChannel, log?: (msg: string) => void): (text: string) => Promise<void>;
149
+ snapshotReply(channel: ReplyChannel, log?: (msg: string) => void): (text: string, opts?: {
150
+ notice?: boolean;
151
+ }) => Promise<void | boolean>;
150
152
  }
151
153
  export interface LifecycleChannel {
152
154
  on(ev: "auth_failed", cb: (e: {
package/dist/index.js CHANGED
@@ -11845,11 +11845,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11845
11845
  return null;
11846
11846
  }
11847
11847
  function ownIdentity() {
11848
- const v2 = true ? "0.23.66" : FALLBACK;
11848
+ const v2 = true ? "0.23.68" : FALLBACK;
11849
11849
  return `${PACKAGE}@${v2}`;
11850
11850
  }
11851
11851
  function buildSha() {
11852
- const raw = true ? "f354058" : "";
11852
+ const raw = true ? "c758a00" : "";
11853
11853
  const cleaned = (raw ?? "").trim();
11854
11854
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11855
11855
  }
@@ -12436,6 +12436,19 @@ function decisionReplyFromEnvelope(parsed) {
12436
12436
  if (typeof d2.reason === "string") reply.reason = d2.reason;
12437
12437
  return reply;
12438
12438
  }
12439
+ function parseDeliverySync(raw) {
12440
+ if (typeof raw !== "object" || raw === null) return null;
12441
+ const { quiet_pull_seconds: quiet, welcome_group_ids: groups } = raw;
12442
+ if (!Array.isArray(groups) || !groups.every((g2) => typeof g2 === "string")) return null;
12443
+ if (quiet !== null && (typeof quiet !== "number" || !Number.isFinite(quiet))) return null;
12444
+ return {
12445
+ quietPullMs: quiet === null ? null : Math.min(Math.max(quiet * 1e3, DELIVERY_PULL_MS), MAX_QUIET_PULL_MS),
12446
+ welcomeGroupIds: new Set(groups.map((g2) => g2.toLowerCase()))
12447
+ };
12448
+ }
12449
+ function wantsWelcomeRead(targets, groupId) {
12450
+ return targets === null || targets.has(groupId.toLowerCase());
12451
+ }
12439
12452
  async function readBoundedRestoreJson(response, signal, checkpoint) {
12440
12453
  const contentLength = response.headers?.get("content-length");
12441
12454
  if (contentLength && /^\d+$/.test(contentLength)) {
@@ -18590,7 +18603,7 @@ function reportSkillInvocation(opts) {
18590
18603
  spanBuffer.push(span);
18591
18604
  return span;
18592
18605
  }
18593
- var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, AMBIGUOUS_OWNER_ERROR, init_owner_routing, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, PRIVATE_ROOM_TURN_NOTE, GENERIC_AGENT_NAMES, init_room_protocol, __filename, __dirname, url, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto2, 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, atitle, aobject, aopts, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, U32_MASK64, _32n, fromNumH, fromNumL, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, 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, crypto3, 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, DECRYPTED_IDS_FILE, 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, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, NOT_A_MEMBER_DETAIL, 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, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, _heartbeatFn, init_openclaw_compat, TOOL_INVOKE_SPAN_NAME, UNCLASSIFIED_ERROR, KNOWN_TOOL_ERROR_CODES, KNOWN_CODES, CLASS_NAME_RE, TOOL_NAME_RE, ERROR_TEXT_CODES, _conversation, init_tool_telemetry, 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_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, ROOM_ROSTER_REFRESH_TIMEOUT_MS, 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, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, 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, TURN_FAILURE_CODES, CODES, TurnFailure, NOTICE_RE, init_turn_failure, AUTH_RE, BILLING_RE, RATE_RE, MODEL_GONE_RE, UNREACHABLE_RE, init_openclaw_turn_failure, 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, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, 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, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, 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, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, 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, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, 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;
18606
+ var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, AMBIGUOUS_OWNER_ERROR, init_owner_routing, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, PRIVATE_ROOM_TURN_NOTE, GENERIC_AGENT_NAMES, init_room_protocol, __filename, __dirname, url, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto2, 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, atitle, aobject, aopts, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, U32_MASK64, _32n, fromNumH, fromNumL, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, 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, crypto3, 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, DECRYPTED_IDS_FILE, 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, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, NOT_A_MEMBER_DETAIL, 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, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, DELIVERY_PULL_MS, DELIVERY_TICK_MS, FULL_WELCOME_SWEEP_MS, MAX_QUIET_PULL_MS, A2A_QUIET_RECONCILE_MS, A2A_QUIET_JITTER_MS, DeliveryCadence, A2aReconcileCadence, init_delivery_cadence, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, _heartbeatFn, init_openclaw_compat, TOOL_INVOKE_SPAN_NAME, UNCLASSIFIED_ERROR, KNOWN_TOOL_ERROR_CODES, KNOWN_CODES, CLASS_NAME_RE, TOOL_NAME_RE, ERROR_TEXT_CODES, _conversation, init_tool_telemetry, 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_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, PENDING_POLL_SILENCE_MS, HISTORY_RESTORE_TIMEOUT_MS2, ROOM_ROSTER_REFRESH_TIMEOUT_MS, 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, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, 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, TURN_FAILURE_CODES, CODES, TurnFailure, NOTICE_RE, init_turn_failure, AUTH_RE, BILLING_RE, RATE_RE, MODEL_GONE_RE, UNREACHABLE_RE, init_openclaw_turn_failure, SHUTDOWN_NOTICE_MS, KEEP_UNANSWERED_MS, OpenClawShutdownNotices, init_openclaw_shutdown_notice, _shutdownNotices, 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, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, 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, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, 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, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, 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, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, 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;
18594
18607
  var init_dist = __esm({
18595
18608
  async "../plugin/dist/index.js"() {
18596
18609
  "use strict";
@@ -70920,16 +70933,7 @@ var init_dist = __esm({
70920
70933
  _seenNonces = /* @__PURE__ */ new Map();
70921
70934
  static MAX_NONCES_PER_ROOM = 1e3;
70922
70935
  constructor() {
70923
- const purge = () => this.purgeAll();
70924
- process.on("exit", purge);
70925
- process.on("SIGINT", () => {
70926
- purge();
70927
- process.exit(0);
70928
- });
70929
- process.on("SIGTERM", () => {
70930
- purge();
70931
- process.exit(0);
70932
- });
70936
+ process.on("exit", () => this.purgeAll());
70933
70937
  }
70934
70938
  /**
70935
70939
  * Check if a nonce has been seen (replay prevention).
@@ -71297,6 +71301,64 @@ var init_dist = __esm({
71297
71301
  };
71298
71302
  }
71299
71303
  });
71304
+ init_delivery_cadence = __esm2({
71305
+ "src/delivery-cadence.ts"() {
71306
+ "use strict";
71307
+ DELIVERY_PULL_MS = 3e4;
71308
+ DELIVERY_TICK_MS = 5e3;
71309
+ FULL_WELCOME_SWEEP_MS = 6e5;
71310
+ MAX_QUIET_PULL_MS = 3e5;
71311
+ A2A_QUIET_RECONCILE_MS = 6e5;
71312
+ A2A_QUIET_JITTER_MS = 6e4;
71313
+ DeliveryCadence = class {
71314
+ _nextPullAt = 0;
71315
+ _nextFullSweepAt = 0;
71316
+ _fullSweepRequested = false;
71317
+ /** A new connection may have missed anything: pull now, read every group. */
71318
+ reset() {
71319
+ this._nextPullAt = 0;
71320
+ this._nextFullSweepAt = 0;
71321
+ }
71322
+ pullDue(now) {
71323
+ return now >= this._nextPullAt || this._nextPullAt - now > MAX_QUIET_PULL_MS;
71324
+ }
71325
+ pullStarted(now) {
71326
+ this._nextPullAt = now + DELIVERY_PULL_MS;
71327
+ }
71328
+ /** Call after a pull that returned no rows. */
71329
+ pullWasQuiet(now, sync) {
71330
+ if (sync?.quietPullMs != null) this._nextPullAt = now + sync.quietPullMs;
71331
+ }
71332
+ /** A wake named a request, so read every group on the next pull, as before. */
71333
+ requestFullSweep() {
71334
+ this._fullSweepRequested = true;
71335
+ }
71336
+ /** The groups this pull should read. null means all of them. */
71337
+ welcomeTargets(now, sync) {
71338
+ if (sync === null) return null;
71339
+ if (this._fullSweepRequested || now >= this._nextFullSweepAt) {
71340
+ this._fullSweepRequested = false;
71341
+ this._nextFullSweepAt = now + FULL_WELCOME_SWEEP_MS;
71342
+ return null;
71343
+ }
71344
+ return sync.welcomeGroupIds;
71345
+ }
71346
+ };
71347
+ A2aReconcileCadence = class {
71348
+ _nextAt = 0;
71349
+ due(now) {
71350
+ return now >= this._nextAt;
71351
+ }
71352
+ listed(now, channelCount, random = Math.random) {
71353
+ this._nextAt = channelCount > 0 ? 0 : now + A2A_QUIET_RECONCILE_MS + Math.floor(random() * A2A_QUIET_JITTER_MS);
71354
+ }
71355
+ /** A channel event arrived: reconcile at the next tick. */
71356
+ wake() {
71357
+ this._nextAt = 0;
71358
+ }
71359
+ };
71360
+ }
71361
+ });
71300
71362
  history_backup_client_exports = {};
71301
71363
  __export2(history_backup_client_exports, {
71302
71364
  HISTORY_RESTORE_RESPONSE_MAX_BYTES: () => HISTORY_RESTORE_RESPONSE_MAX_BYTES,
@@ -71689,6 +71751,7 @@ var init_dist = __esm({
71689
71751
  await init_history_recovery_code();
71690
71752
  init_decision_reply();
71691
71753
  init_welcome_kp_backoff();
71754
+ init_delivery_cadence();
71692
71755
  ROOM_AGENT_TYPES = /* @__PURE__ */ new Set([
71693
71756
  "message",
71694
71757
  "text",
@@ -71710,6 +71773,7 @@ var init_dist = __esm({
71710
71773
  UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
71711
71774
  RECONNECT_MAX_MS = 3e4;
71712
71775
  PENDING_POLL_INTERVAL_MS = 15e3;
71776
+ PENDING_POLL_SILENCE_MS = 18e4;
71713
71777
  HISTORY_RESTORE_TIMEOUT_MS2 = 1e4;
71714
71778
  ROOM_ROSTER_REFRESH_TIMEOUT_MS = 1e4;
71715
71779
  HISTORY_UPLOAD_TIMEOUT_MS = 1e4;
@@ -71782,6 +71846,8 @@ var init_dist = __esm({
71782
71846
  _pendingPollTimer = null;
71783
71847
  _syncMessageIds = null;
71784
71848
  _deliveryHeartbeat = null;
71849
+ _deliveryCadence = new DeliveryCadence();
71850
+ _a2aCadence = new A2aReconcileCadence();
71785
71851
  /**
71786
71852
  * How often to re-check the KeyPackage pool against the server (#826).
71787
71853
  *
@@ -74090,7 +74156,7 @@ ${text}`,
74090
74156
  */
74091
74157
  sendActivitySpan(spanData) {
74092
74158
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
74093
- const pluginVersion = true ? "0.23.66" : "0.0.0-dev";
74159
+ const pluginVersion = true ? "0.23.68" : "0.0.0-dev";
74094
74160
  const agentName = this.config.agentName ?? "Agent";
74095
74161
  const resource = {
74096
74162
  "service.name": "agentvault-agent",
@@ -75888,7 +75954,7 @@ ${text}`,
75888
75954
  throw new Error(`A2A channel ${channelId.slice(0, 8)} has no initialized MLS group`);
75889
75955
  }
75890
75956
  /**
75891
- * Start the periodic A2A reconcile timer (30s), mirroring `_deliveryHeartbeat`.
75957
+ * Start the periodic A2A reconcile timer, mirroring `_deliveryHeartbeat`.
75892
75958
  *
75893
75959
  * A2A join-triggers (`a2a_channel_approved` etc.) are delivered best-effort by
75894
75960
  * the backend's local-only `send_to_device`; if this agent is briefly
@@ -75896,10 +75962,14 @@ ${text}`,
75896
75962
  * channel hangs until the next connect. Re-running `listA2AChannels()` on a
75897
75963
  * timer re-fires the idempotent member sync-fallback (publish KeyPackage +
75898
75964
  * request Welcome) so the channel self-heals while staying connected.
75965
+ *
75966
+ * It ticks every 30 s, and an agent the server lists in no channel asks far
75967
+ * less often: see `A2aReconcileCadence`.
75899
75968
  */
75900
75969
  _startA2aReconcileTimer() {
75901
75970
  if (this._a2aReconcileTimer) clearInterval(this._a2aReconcileTimer);
75902
75971
  this._a2aReconcileTimer = setInterval(() => {
75972
+ if (!this._a2aCadence.due(Date.now())) return;
75903
75973
  this.listA2AChannels().catch(() => {
75904
75974
  });
75905
75975
  }, 3e4);
@@ -75925,6 +75995,7 @@ ${text}`,
75925
75995
  throw new Error(`List A2A channels failed (${res.status}): ${detail}`);
75926
75996
  }
75927
75997
  const resp = await res.json();
75998
+ this._a2aCadence.listed(Date.now(), resp.length);
75928
75999
  const channels = resp.map((ch) => ({
75929
76000
  channelId: ch.channel_id || ch.id,
75930
76001
  creator_hub_id: ch.creator_hub_id || "",
@@ -76373,7 +76444,7 @@ ${text}`,
76373
76444
  agentVersion: this.config.agentVersion ?? "0.0.0",
76374
76445
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
76375
76446
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
76376
- pluginVersion: true ? "0.23.66" : "0.0.0-dev"
76447
+ pluginVersion: true ? "0.23.68" : "0.0.0-dev"
76377
76448
  });
76378
76449
  this._telemetryReporter.startAutoFlush(3e4);
76379
76450
  }
@@ -76385,14 +76456,7 @@ ${text}`,
76385
76456
  await this._ensureKpPoolPublished();
76386
76457
  this._startKpReplenishTimer();
76387
76458
  this._startKeyProofTimer();
76388
- this._pullDeliveryQueue().catch((err) => {
76389
- console.warn("[SecureChannel] Initial delivery pull failed:", err);
76390
- });
76391
- if (this._deliveryHeartbeat) clearInterval(this._deliveryHeartbeat);
76392
- this._deliveryHeartbeat = setInterval(() => {
76393
- this._pullDeliveryQueue().catch(() => {
76394
- });
76395
- }, 3e4);
76459
+ this._beginDeliveryPulls();
76396
76460
  this._startA2aReconcileTimer();
76397
76461
  for (const [convId, entry] of Object.entries(this._persisted?.mlsConversations ?? {})) {
76398
76462
  if (entry.mlsGroupId) {
@@ -76587,6 +76651,7 @@ ${text}`,
76587
76651
  }
76588
76652
  if (data.event === "mls_welcome_requested") {
76589
76653
  console.log(`[SecureChannel] mls_welcome_requested for group ${(data.data?.group_id || "").slice(0, 8)} \u2014 pulling deliveries`);
76654
+ this._deliveryCadence.requestFullSweep();
76590
76655
  this._pullDeliveryQueue().catch((err) => {
76591
76656
  console.warn("[SecureChannel] Delivery pull on welcome request failed:", err);
76592
76657
  });
@@ -76711,7 +76776,7 @@ ${text}`,
76711
76776
  agentVersion: this.config.agentVersion ?? "0.0.0",
76712
76777
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
76713
76778
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
76714
- pluginVersion: true ? "0.23.66" : "0.0.0-dev"
76779
+ pluginVersion: true ? "0.23.68" : "0.0.0-dev"
76715
76780
  });
76716
76781
  this._telemetryReporter.startAutoFlush(3e4);
76717
76782
  }
@@ -76782,6 +76847,7 @@ ${text}`,
76782
76847
  this.emit("hub_identity_removed", data.data);
76783
76848
  }
76784
76849
  if (data.event === "a2a_channel_approved") {
76850
+ this._a2aCadence.wake();
76785
76851
  const channelData = data.data || data;
76786
76852
  const channelId = channelData.channel_id;
76787
76853
  const convId = channelData.conversation_id;
@@ -76858,6 +76924,7 @@ ${text}`,
76858
76924
  this.emit("a2a_channel_revoked", channelData);
76859
76925
  }
76860
76926
  if (data.event === "a2a_channel_invited") {
76927
+ this._a2aCadence.wake();
76861
76928
  const channelData = data.data || data;
76862
76929
  const channelId = channelData.channel_id;
76863
76930
  const convId = channelData.conversation_id;
@@ -79933,9 +80000,31 @@ ${baseText}`;
79933
80000
  await this._persistState();
79934
80001
  await this._applyBufferedMlsCommits(groupId, mgr);
79935
80002
  }
80003
+ /** A new connection may have missed any signal, so it starts from fresh. */
80004
+ _beginDeliveryPulls() {
80005
+ this._deliveryCadence.reset();
80006
+ this._pullDeliveryQueue().catch((err) => {
80007
+ console.warn("[SecureChannel] Initial delivery pull failed:", err);
80008
+ });
80009
+ this._startDeliveryHeartbeat();
80010
+ }
80011
+ /**
80012
+ * Keep pulling while the socket is up. The tick costs nothing: it only asks
80013
+ * `_deliveryCadence` whether a pull is due, which is every 30 s until the
80014
+ * server says this device may rest. A signal that never arrives is recovered
80015
+ * here, within one rest.
80016
+ */
80017
+ _startDeliveryHeartbeat() {
80018
+ if (this._deliveryHeartbeat) clearInterval(this._deliveryHeartbeat);
80019
+ this._deliveryHeartbeat = setInterval(() => {
80020
+ if (!this._deliveryCadence.pullDue(Date.now())) return;
80021
+ this._pullDeliveryQueue().catch(() => {
80022
+ });
80023
+ }, DELIVERY_TICK_MS);
80024
+ }
79936
80025
  /**
79937
80026
  * Pull pending MLS messages from the delivery queue and process them.
79938
- * Called on WS connect, on mls_delivery ping, and every 30s heartbeat.
80027
+ * Called on WS connect, on mls_delivery ping, and by the delivery heartbeat.
79939
80028
  */
79940
80029
  async _pullDeliveryQueue() {
79941
80030
  if (!this._deviceId || !this._deviceJwt) return;
@@ -79944,6 +80033,7 @@ ${baseText}`;
79944
80033
  return;
79945
80034
  }
79946
80035
  this._deliveryPulling = true;
80036
+ this._deliveryCadence.pullStarted(Date.now());
79947
80037
  try {
79948
80038
  const res = await fetch(
79949
80039
  `${this.config.apiUrl}/api/v1/mls/delivery?device_id=${this._deviceId}`,
@@ -79953,7 +80043,9 @@ ${baseText}`;
79953
80043
  console.warn(`[SecureChannel] Delivery pull failed: ${res.status}`);
79954
80044
  return;
79955
80045
  }
79956
- let { messages } = await res.json();
80046
+ const pulled = await res.json();
80047
+ let { messages } = pulled;
80048
+ const sync = parseDeliverySync(pulled.sync);
79957
80049
  const hasMessages = messages && messages.length > 0;
79958
80050
  if (hasMessages) {
79959
80051
  messages = orderDeliveryBatch(messages);
@@ -80074,11 +80166,13 @@ ${baseText}`;
80074
80166
  }
80075
80167
  }
80076
80168
  }
80169
+ const welcomeTargets = this._deliveryCadence.welcomeTargets(Date.now(), sync);
80077
80170
  for (const [roomId, mlsGroup] of this._mlsGroups) {
80078
80171
  if (!mlsGroup?.isInitialized) continue;
80079
80172
  if (roomId.includes(":")) continue;
80080
80173
  const roomState = this._persisted?.rooms?.[roomId];
80081
80174
  if (!roomState?.mlsGroupId) continue;
80175
+ if (!wantsWelcomeRead(welcomeTargets, roomState.mlsGroupId)) continue;
80082
80176
  try {
80083
80177
  const roomLabel2 = `room ${roomId.slice(0, 8)}`;
80084
80178
  const pendingRes = await fetch(
@@ -80179,6 +80273,7 @@ ${baseText}`;
80179
80273
  if (!entry.mlsGroupId) continue;
80180
80274
  const mlsGroup = this._mlsGroups.get(`1to1-group:${gid}`);
80181
80275
  if (!mlsGroup?.isInitialized) continue;
80276
+ if (!wantsWelcomeRead(welcomeTargets, entry.mlsGroupId)) continue;
80182
80277
  try {
80183
80278
  const sharedLabel = `shared group ${gid.slice(0, 8)}`;
80184
80279
  const pendingRes = await fetch(
@@ -80275,6 +80370,7 @@ ${baseText}`;
80275
80370
  if (!convEntry.mlsGroupId) continue;
80276
80371
  const mlsGroup = this._mlsGroups.get(`conv:${convId}`);
80277
80372
  if (!mlsGroup?.isInitialized) continue;
80373
+ if (!wantsWelcomeRead(welcomeTargets, convEntry.mlsGroupId)) continue;
80278
80374
  try {
80279
80375
  const convLabel = `conv ${convId.slice(0, 8)}`;
80280
80376
  const pendingRes = await fetch(
@@ -80417,6 +80513,7 @@ ${baseText}`;
80417
80513
  } catch {
80418
80514
  }
80419
80515
  }
80516
+ if (!hasMessages) this._deliveryCadence.pullWasQuiet(Date.now(), sync);
80420
80517
  } catch (err) {
80421
80518
  console.warn("[SecureChannel] Delivery pull error:", err);
80422
80519
  } finally {
@@ -81306,6 +81403,7 @@ ${baseText}`;
81306
81403
  }
81307
81404
  async _checkPendingMessages() {
81308
81405
  if (this._state === "connecting" || !this._deviceId || !this._deviceJwt) return;
81406
+ if (this._state === "ready" && Date.now() - this._lastServerMessage <= PENDING_POLL_SILENCE_MS) return;
81309
81407
  try {
81310
81408
  const url2 = `${this.config.apiUrl}/api/v1/devices/${this._deviceId}/pending`;
81311
81409
  const resp = await fetch(url2, {
@@ -81325,7 +81423,7 @@ ${baseText}`;
81325
81423
  }
81326
81424
  } else if (data.pending > 0 && this._state === "ready") {
81327
81425
  const silence = Date.now() - this._lastServerMessage;
81328
- if (silence > 18e4) {
81426
+ if (silence > PENDING_POLL_SILENCE_MS) {
81329
81427
  console.log(
81330
81428
  `[SecureChannel] Poll: ${data.pending} pending + ${Math.round(silence / 1e3)}s silence \u2014 forcing reconnect`
81331
81429
  );
@@ -82664,6 +82762,107 @@ ${actionsText}`);
82664
82762
  );
82665
82763
  }
82666
82764
  });
82765
+ init_openclaw_shutdown_notice = __esm2({
82766
+ "src/openclaw-shutdown-notice.ts"() {
82767
+ "use strict";
82768
+ init_turn_failure();
82769
+ SHUTDOWN_NOTICE_MS = 4500;
82770
+ KEEP_UNANSWERED_MS = 1e4;
82771
+ OpenClawShutdownNotices = class {
82772
+ constructor(log = (m2) => console.warn(m2), capMs = SHUTDOWN_NOTICE_MS) {
82773
+ this.log = log;
82774
+ this.capMs = capMs;
82775
+ }
82776
+ log;
82777
+ capMs;
82778
+ turns = /* @__PURE__ */ new Set();
82779
+ cap;
82780
+ expired = false;
82781
+ stopped;
82782
+ /** True once the gateway is closing: no new run can finish. */
82783
+ get stopping() {
82784
+ return this.cap !== void 0;
82785
+ }
82786
+ opened(entry) {
82787
+ this.prune();
82788
+ this.turns.add(entry);
82789
+ }
82790
+ /** The turn is over, every retry included. Resolves inside the cap. */
82791
+ async closed(entry) {
82792
+ if (this.stopping) {
82793
+ if (this.turns.delete(entry)) await this.tell(entry, "late=true ");
82794
+ return;
82795
+ }
82796
+ if (entry.turn.delivered || !entry.sink()) this.turns.delete(entry);
82797
+ else entry.endedAt = Date.now();
82798
+ }
82799
+ /** A channel is starting, so this process is not ending: the next stop starts fresh. */
82800
+ resume() {
82801
+ this.cap = void 0;
82802
+ this.expired = false;
82803
+ this.stopped = void 0;
82804
+ }
82805
+ /** `gateway_stop`: tell every owed turn still unanswered. Idempotent, never rejects. */
82806
+ stop() {
82807
+ this.stopped ??= this.run();
82808
+ return this.stopped;
82809
+ }
82810
+ async run() {
82811
+ this.prune();
82812
+ let timer;
82813
+ this.cap = new Promise((resolve42) => {
82814
+ timer = setTimeout(() => {
82815
+ this.expired = true;
82816
+ resolve42("timeout");
82817
+ }, this.capMs);
82818
+ });
82819
+ const turns = [...this.turns];
82820
+ this.turns.clear();
82821
+ await Promise.all(turns.map((entry) => this.tell(entry, "")));
82822
+ if (timer) clearTimeout(timer);
82823
+ }
82824
+ prune() {
82825
+ const cutoff = Date.now() - KEEP_UNANSWERED_MS;
82826
+ for (const entry of this.turns)
82827
+ if (entry.endedAt !== void 0 && entry.endedAt < cutoff) this.turns.delete(entry);
82828
+ }
82829
+ async tell(entry, tag) {
82830
+ const { turn } = entry;
82831
+ const cap = this.cap;
82832
+ if (turn.reported) return;
82833
+ if (turn.delivered) {
82834
+ this.safeLog(`[AgentVault] turn_cancelled reason=shutdown ${tag}notice=none delivered=true`);
82835
+ return;
82836
+ }
82837
+ let outcome = "none";
82838
+ try {
82839
+ const sink = entry.sink();
82840
+ if (sink) {
82841
+ turn.reported = true;
82842
+ outcome = "timeout";
82843
+ if (!this.expired) {
82844
+ const notice = ownerNoticeFor("model_error", { agentName: entry.agentName(), provider: entry.provider() });
82845
+ const sent = Promise.resolve().then(() => sink(notice)).then(
82846
+ (receipt) => receipt?.ok === false ? "failed" : "sent",
82847
+ () => "failed"
82848
+ );
82849
+ outcome = await (cap ? Promise.race([sent, cap]) : sent);
82850
+ }
82851
+ }
82852
+ } catch {
82853
+ outcome = "failed";
82854
+ }
82855
+ this.safeLog(`[AgentVault] turn_cancelled reason=shutdown ${tag}notice=${outcome}`);
82856
+ }
82857
+ safeLog(m2) {
82858
+ try {
82859
+ this.log(m2);
82860
+ } catch {
82861
+ }
82862
+ }
82863
+ };
82864
+ }
82865
+ });
82667
82866
  init_openclaw_entry = __esm2({
82668
82867
  "src/openclaw-entry.ts"() {
82669
82868
  "use strict";
@@ -82677,7 +82876,10 @@ ${actionsText}`);
82677
82876
  init_tool_telemetry();
82678
82877
  init_harness_compat();
82679
82878
  init_openclaw_turn_failure();
82879
+ init_turn_failure();
82880
+ init_openclaw_shutdown_notice();
82680
82881
  init_types();
82882
+ _shutdownNotices = new OpenClawShutdownNotices();
82681
82883
  managedRoutesRequested = false;
82682
82884
  }
82683
82885
  });
@@ -103403,7 +103605,7 @@ data:
103403
103605
  init_room_protocol();
103404
103606
  init_tool_telemetry();
103405
103607
  init_turn_failure();
103406
- VERSION = true ? "0.23.66" : "0.0.0-dev";
103608
+ VERSION = true ? "0.23.68" : "0.0.0-dev";
103407
103609
  }
103408
103610
  });
103409
103611
  await init_index();
@@ -104140,6 +104342,7 @@ function isStaleSession(err) {
104140
104342
  }
104141
104343
 
104142
104344
  // src/muse-session.ts
104345
+ var NOTICE_TIMEOUT_MS = 1e4;
104143
104346
  var ERROR_TYPE = /\(([a-z][a-z_]{2,40})\)\s*$/;
104144
104347
  function describeTurnFailure(err) {
104145
104348
  const message = err instanceof Error ? err.message : "";
@@ -104168,19 +104371,111 @@ var MuseSession = class {
104168
104371
  /** One failure notice per turn (re-review N1 split this from saidThisTurn). */
104169
104372
  noticedThisTurn = false;
104170
104373
  drain = Promise.resolve();
104374
+ /** #1583: set by stop() or invalidate(). No turn starts and no say leaves. */
104375
+ invalidated = false;
104376
+ /** #1583: open only while a `shutdown` stop() waits on its notices. The
104377
+ * channel is still up, and ACKing, so a message that lands here is told. */
104378
+ stopWindow = null;
104379
+ /** #1583: the turn's last word is going out, so stop() has nothing to add. */
104380
+ closing = null;
104171
104381
  push(text, reply, opts) {
104172
104382
  const conv = opts?.conversation;
104173
- this.queue.push({
104383
+ const item = {
104174
104384
  text,
104175
104385
  reply,
104176
104386
  autoReplyOnText: opts?.replyExpected ?? opts?.autoReplyOnText,
104177
104387
  sayAllowed: opts?.replyExpected ?? true,
104178
104388
  ownerTurn: opts?.ownerTurn === true,
104179
104389
  conversation: conv && (conv.kind === "room" || conv.kind === "direct") && conv.id ? { kind: conv.kind, id: conv.id } : { kind: "unknown" },
104180
- ...typeof opts?.seed === "string" && opts.seed.trim() ? { seed: opts.seed.slice(-SEED_LIMIT) } : {}
104181
- });
104390
+ ...typeof opts?.seed === "string" && opts.seed.trim() ? { seed: opts.seed.slice(-SEED_LIMIT) } : {},
104391
+ hushed: opts?.hushed
104392
+ };
104393
+ if (this.invalidated) {
104394
+ if (this.stopWindow) {
104395
+ this.stopWindow.late.push(this.cancelNotice(item, this.stopWindow.cap).then((outcome) => {
104396
+ this.log(`turn_cancelled reason=shutdown late=true notice=${outcome}`);
104397
+ }));
104398
+ } else {
104399
+ this.log("push on a stopped session; DROPPED");
104400
+ }
104401
+ return;
104402
+ }
104403
+ this.queue.push(item);
104182
104404
  if (!this.running) this.drain = this.run();
104183
104405
  }
104406
+ /** Revoke output and future work, before any asynchronous cleanup. */
104407
+ invalidate() {
104408
+ this.invalidated = true;
104409
+ this.current = null;
104410
+ this.queue = [];
104411
+ }
104412
+ /**
104413
+ * #1583: stop for good, BEFORE the process tears down. Revokes synchronously,
104414
+ * so no later say leaves and no queued turn spawns a child. Then, for
104415
+ * `shutdown`, tells every owed turn that will now never be answered: the one
104416
+ * in flight and each one queued behind it. Nothing replays them after a restart.
104417
+ *
104418
+ * Always the BARE sentence, even in a 1:1: a shutdown has no cause to tell,
104419
+ * and it is not a model failure, so nothing is reported. "Owed" is the #1560
104420
+ * rule (`autoReplyOnText`). A turn whose last word is already going out, an
104421
+ * answer or its own failure notice, gets nothing more; its send is waited for.
104422
+ *
104423
+ * The notices share ONE cap, so this resolves within `noticeTimeoutMs` however
104424
+ * stuck a send is. Call it before channel.stop(). Idempotent. Never throws.
104425
+ */
104426
+ async stop(opts) {
104427
+ if (this.invalidated) return;
104428
+ const reason = opts.reason;
104429
+ const closing = this.closing;
104430
+ const inFlight = closing ? null : this.current;
104431
+ const queued = this.queue.slice();
104432
+ this.invalidate();
104433
+ if (closing?.answered) this.log(`turn_cancelled reason=${reason} notice=none delivered=true`);
104434
+ const turns = [
104435
+ ...inFlight ? [{ item: inFlight, tag: "" }] : [],
104436
+ ...queued.map((item) => ({ item, tag: "queued=true " }))
104437
+ ];
104438
+ if (reason !== "shutdown") {
104439
+ turns.forEach(({ tag }) => this.log(`turn_cancelled reason=${reason} ${tag}notice=none`));
104440
+ return;
104441
+ }
104442
+ let timer;
104443
+ const cap = new Promise((resolve5) => {
104444
+ timer = setTimeout(() => resolve5("timeout"), this.opts.noticeTimeoutMs ?? NOTICE_TIMEOUT_MS);
104445
+ });
104446
+ const window2 = { cap, late: [] };
104447
+ this.stopWindow = window2;
104448
+ try {
104449
+ const outcomes = await Promise.all([
104450
+ ...turns.map(({ item }) => this.cancelNotice(item, cap)),
104451
+ ...closing ? [Promise.race([closing.sending, cap])] : []
104452
+ ]);
104453
+ turns.forEach(({ tag }, i2) => this.log(`turn_cancelled reason=${reason} ${tag}notice=${outcomes[i2]}`));
104454
+ while (window2.late.length) await Promise.all(window2.late.splice(0));
104455
+ } finally {
104456
+ this.stopWindow = null;
104457
+ clearTimeout(timer);
104458
+ }
104459
+ }
104460
+ /** The bare sentence for one owed, cancelled turn, raced against the shared
104461
+ * cap. Settles, never rejects. */
104462
+ async cancelNotice(item, cap) {
104463
+ const sink = item.reply;
104464
+ try {
104465
+ if (!item.autoReplyOnText || !sink || item.hushed?.()) return "none";
104466
+ } catch {
104467
+ return "failed";
104468
+ }
104469
+ let name;
104470
+ try {
104471
+ name = this.opts.agentName?.();
104472
+ } catch {
104473
+ name = void 0;
104474
+ }
104475
+ const notice = ownerNoticeFor("model_error", { agentName: name ?? "", provider: "Meta" });
104476
+ const sent = Promise.resolve().then(() => sink(notice, { notice: true })).then((r2) => r2 === false ? "failed" : "sent", () => "failed");
104477
+ return Promise.race([sent, cap]);
104478
+ }
104184
104479
  sayHandler() {
104185
104480
  return (text) => {
104186
104481
  try {
@@ -104228,10 +104523,11 @@ var MuseSession = class {
104228
104523
  const startedAt = Date.now();
104229
104524
  try {
104230
104525
  const result = await this.runWithRecovery(item);
104231
- await this.maybeFallback(item, result);
104526
+ if (!this.invalidated) await this.finishTurn(this.maybeFallback(item, result), true);
104232
104527
  } catch (err) {
104233
- await this.turnFailed(item, err, Date.now() - startedAt);
104528
+ if (!this.invalidated) await this.finishTurn(this.turnFailed(item, err, Date.now() - startedAt), false);
104234
104529
  } finally {
104530
+ this.closing = null;
104235
104531
  this.current = null;
104236
104532
  }
104237
104533
  }
@@ -104239,6 +104535,11 @@ var MuseSession = class {
104239
104535
  this.running = false;
104240
104536
  }
104241
104537
  }
104538
+ /** The turn's last word, visible to stop() while it goes out. */
104539
+ async finishTurn(sending, answered) {
104540
+ this.closing = { sending, answered };
104541
+ await sending;
104542
+ }
104242
104543
  prompt(item, seed) {
104243
104544
  const body = seed ? `${SEED_HEADER}
104244
104545
  ${seed}
@@ -104259,7 +104560,7 @@ ${body}` : body;
104259
104560
  try {
104260
104561
  return await this.driver.runTurn(this.prompt(item), { ownerTurn: item.ownerTurn });
104261
104562
  } catch (err) {
104262
- if (!isStaleSession(err) || this.saidThisTurn) throw err;
104563
+ if (!isStaleSession(err) || this.saidThisTurn || this.invalidated) throw err;
104263
104564
  const lane = item.ownerTurn ? "owner" : "shared";
104264
104565
  this.log(`session_resume_failed lane=${lane} action=fresh_session seeded=${item.seed ? "yes" : "no"}`);
104265
104566
  const result = await this.driver.runTurn(this.prompt(item, item.seed), {
@@ -105559,8 +105860,19 @@ var ActiveTarget = class {
105559
105860
  }) {
105560
105861
  const t2 = this.target;
105561
105862
  const where = !t2 ? "nowhere" : t2.kind === "room" ? `room ${t2.roomId.slice(0, 8)}` : "1:1 owner";
105562
- return async (text) => {
105563
- if (!t2) return;
105863
+ return async (text, opts) => {
105864
+ if (!t2) return opts?.notice ? false : void 0;
105865
+ if (opts?.notice) {
105866
+ try {
105867
+ if (t2.kind === "room") await channel.sendToRoom(t2.roomId, text);
105868
+ else await sendDm(channel, t2, text);
105869
+ log(`notice sent to ${where}`);
105870
+ return true;
105871
+ } catch (err) {
105872
+ log(`notice_failed code=${classifyToolError(err)}`);
105873
+ return false;
105874
+ }
105875
+ }
105564
105876
  const startedAt = Date.now();
105565
105877
  try {
105566
105878
  if (t2.kind === "room") await channel.sendToRoom(t2.roomId, text);
@@ -105721,7 +106033,8 @@ ${body}` : body,
105721
106033
  replyExpected: owes,
105722
106034
  ownerTurn: ownerPowered,
105723
106035
  conversation: { kind: "room", id: e.roomId },
105724
- ...seed ? { seed } : {}
106036
+ ...seed ? { seed } : {},
106037
+ hushed: () => hush.isHushed(e.roomId)
105725
106038
  }
105726
106039
  );
105727
106040
  if (ownerPowered) {
@@ -105810,12 +106123,13 @@ async function maybeRunRecoverySubcommand(argv = process.argv, env = process.env
105810
106123
  });
105811
106124
  return true;
105812
106125
  }
106126
+ var SHUTDOWN_BOUND_MS = 15e3;
105813
106127
  function mkdir700(path2) {
105814
106128
  mkdirSync6(path2, { recursive: true, mode: 448 });
105815
106129
  chmodSync5(path2, 448);
105816
106130
  }
105817
106131
  function packageVersion() {
105818
- return true ? "0.1.40" : void 0;
106132
+ return true ? "0.1.42" : void 0;
105819
106133
  }
105820
106134
  function helpText(version2) {
105821
106135
  return [
@@ -105895,17 +106209,31 @@ async function main(opts = {}) {
105895
106209
  let mcp;
105896
106210
  let channel;
105897
106211
  let session;
105898
- const shutdown = async (code = 0) => {
106212
+ const teardown = async (reason) => {
106213
+ const told = session?.stop({ reason });
106214
+ await Promise.all([told, driver?.stop()]);
106215
+ await mcp?.close();
106216
+ await channel?.stop();
106217
+ };
106218
+ const shutdown = async (code = 0, reason = "shutdown") => {
105899
106219
  if (exiting) return;
105900
106220
  exiting = true;
105901
106221
  shuttingDown = true;
105902
- process.off("SIGTERM", onSig);
105903
- process.off("SIGINT", onSig);
106222
+ let bound;
105904
106223
  try {
105905
- await driver?.stop();
105906
- await mcp?.close();
105907
- await channel?.stop();
106224
+ const timedOut = await Promise.race([
106225
+ teardown(reason).then(() => false),
106226
+ new Promise((resolve5) => {
106227
+ bound = setTimeout(() => resolve5(true), SHUTDOWN_BOUND_MS);
106228
+ })
106229
+ ]);
106230
+ if (timedOut) logLine(`[muse-bridge] teardown timed out after ${SHUTDOWN_BOUND_MS}ms; exiting anyway`);
106231
+ } catch (error2) {
106232
+ logLine("[muse-bridge] teardown failed:", error2);
105908
106233
  } finally {
106234
+ clearTimeout(bound);
106235
+ process.off("SIGTERM", onSig);
106236
+ process.off("SIGINT", onSig);
105909
106237
  exit(code);
105910
106238
  }
105911
106239
  };
@@ -105988,7 +106316,9 @@ async function main(opts = {}) {
105988
106316
  });
105989
106317
  attachLifecycle2(channel, {
105990
106318
  log: (m2) => logLine("[muse-bridge] " + m2),
105991
- onTerminal: (_reason, o2) => void shutdown(o2.restart ? 1 : 0)
106319
+ // #1583: silent. A revoked or replaced device has no chat to tell, and a
106320
+ // reconnect loop has no socket to tell it over.
106321
+ onTerminal: (_reason, o2) => void shutdown(o2.restart ? 1 : 0, "terminal")
105992
106322
  });
105993
106323
  watchEnrollmentFingerprint(channel, (m2) => logLine("[muse-bridge] " + m2));
105994
106324
  await channel.start();
@@ -1,4 +1,14 @@
1
1
  import { type ToolConversation, type TurnFailureCode } from "@agentvault/agentvault";
2
+ /** A reply sink. `{ notice: true }` marks a #1583 shutdown notice: delivered to
3
+ * the same chat, but not the agent's own `say`. A notice sink that logs its own
4
+ * send failure resolves `false`; anything else counts as sent. */
5
+ export type ReplySink = (text: string, opts?: {
6
+ notice?: boolean;
7
+ }) => Promise<void | boolean>;
8
+ /** #1583: why the session was stopped. `shutdown` is our own stop or restart
9
+ * (SIGTERM, a fleet roll): owed turns are told. `terminal` is a revoked device
10
+ * or a session taken over: nothing is posted. */
11
+ export type StopReason = "shutdown" | "terminal";
2
12
  export interface PushOpts {
3
13
  autoReplyOnText?: boolean;
4
14
  replyExpected?: boolean;
@@ -9,9 +19,11 @@ export interface PushOpts {
9
19
  * gone and this turn has to start a fresh one. The bridge decides what may
10
20
  * seed which lane; the session never builds a seed itself. */
11
21
  seed?: string;
22
+ /** #1583: true once this room is hushed. A shutdown notice stays out of it. */
23
+ hushed?: () => boolean;
12
24
  }
13
25
  export interface RoomSession {
14
- push(text: string, reply?: (text: string) => Promise<void>, opts?: PushOpts): void;
26
+ push(text: string, reply?: ReplySink, opts?: PushOpts): void;
15
27
  }
16
28
  export interface DriverLike {
17
29
  runTurn(prompt: string, opts?: {
@@ -59,6 +71,13 @@ export declare class MuseSession implements RoomSession {
59
71
  /** One failure notice per turn (re-review N1 split this from saidThisTurn). */
60
72
  private noticedThisTurn;
61
73
  private drain;
74
+ /** #1583: set by stop() or invalidate(). No turn starts and no say leaves. */
75
+ private invalidated;
76
+ /** #1583: open only while a `shutdown` stop() waits on its notices. The
77
+ * channel is still up, and ACKing, so a message that lands here is told. */
78
+ private stopWindow;
79
+ /** #1583: the turn's last word is going out, so stop() has nothing to add. */
80
+ private closing;
62
81
  constructor(driver: DriverLike, opts?: {
63
82
  onSay?: (text: string) => Promise<void>;
64
83
  log?: (m: string) => void;
@@ -67,12 +86,38 @@ export declare class MuseSession implements RoomSession {
67
86
  agentName?: () => string | undefined;
68
87
  /** #1467/#1560: a turn failed (not stopped). Fire-and-forget; a throw is swallowed. */
69
88
  onTurnFailed?: (report: TurnFailedReport) => void;
89
+ /** Test seam: the shared cap on the shutdown notices. */
90
+ noticeTimeoutMs?: number;
70
91
  });
71
- push(text: string, reply?: (text: string) => Promise<void>, opts?: PushOpts): void;
92
+ push(text: string, reply?: ReplySink, opts?: PushOpts): void;
93
+ /** Revoke output and future work, before any asynchronous cleanup. */
94
+ invalidate(): void;
95
+ /**
96
+ * #1583: stop for good, BEFORE the process tears down. Revokes synchronously,
97
+ * so no later say leaves and no queued turn spawns a child. Then, for
98
+ * `shutdown`, tells every owed turn that will now never be answered: the one
99
+ * in flight and each one queued behind it. Nothing replays them after a restart.
100
+ *
101
+ * Always the BARE sentence, even in a 1:1: a shutdown has no cause to tell,
102
+ * and it is not a model failure, so nothing is reported. "Owed" is the #1560
103
+ * rule (`autoReplyOnText`). A turn whose last word is already going out, an
104
+ * answer or its own failure notice, gets nothing more; its send is waited for.
105
+ *
106
+ * The notices share ONE cap, so this resolves within `noticeTimeoutMs` however
107
+ * stuck a send is. Call it before channel.stop(). Idempotent. Never throws.
108
+ */
109
+ stop(opts: {
110
+ reason: StopReason;
111
+ }): Promise<void>;
112
+ /** The bare sentence for one owed, cancelled turn, raced against the shared
113
+ * cap. Settles, never rejects. */
114
+ private cancelNotice;
72
115
  sayHandler(): (text: string) => void;
73
116
  idle(): Promise<void>;
74
117
  private log;
75
118
  private run;
119
+ /** The turn's last word, visible to stop() while it goes out. */
120
+ private finishTurn;
76
121
  private prompt;
77
122
  /**
78
123
  * #1560: one turn on the stored session. If Meta says that session can no
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "type": "module",
5
5
  "description": "AgentVault Muse Bridge — daemon bridging a Muse agent into E2E-encrypted AgentVault direct messages and rooms.",
6
6
  "main": "dist/index.js",