@agentvault/muse-bridge 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bridge.d.ts CHANGED
@@ -76,6 +76,23 @@ export declare function attachLifecycle(channel: LifecycleChannel, opts?: {
76
76
  }) => void;
77
77
  }): void;
78
78
  export declare function roomTurnPrefix(roomId: string, senderName: string, roomName?: string): string;
79
+ /**
80
+ * Does this agent owe a reply to this room message? (#1107)
81
+ *
82
+ * This bridge used to answer with `e.senderIsAgent === false` — "reply to any
83
+ * human". That was a THIRD implementation of the room reply rule, alongside the
84
+ * OpenClaw plugin and hermes, and #1107 shipped to the other two only. Under the
85
+ * old rule this agent would still have answered every un-mentioned message while
86
+ * wren, cortina, smartcode and smartcoder2 stayed quiet: the cascade, half-fixed,
87
+ * in the half most likely to be read as "the protocol doesn't work".
88
+ *
89
+ * Now it defers to the ONE shared implementation exported by
90
+ * `@agentvault/agentvault`. The message is still pushed into the session either
91
+ * way — the agent reads the whole room and only the reply obligation changes.
92
+ */
93
+ export declare function _makeOwesReply(agentName: string | undefined, channel: {
94
+ ownDisplayName?: string;
95
+ }, log: (msg: string) => void): (e: RoomMessage) => boolean;
79
96
  export declare function wireBridge(channel: RoomChannel, session: RoomSession, target: ActiveTarget, opts?: {
80
97
  /**
81
98
  * #1107: this agent's own name, used to recognise its own @mention. Threaded
package/dist/index.js CHANGED
@@ -334,6 +334,58 @@ function classifyCommitFailure(messageEpoch, groupEpoch) {
334
334
  if (msg === null || grp === null) return "count";
335
335
  return msg < grp ? "already-applied" : "count";
336
336
  }
337
+ function parseMentions(text) {
338
+ const mentions = [];
339
+ const re2 = new RegExp(MENTION_RE.source, MENTION_RE.flags);
340
+ let match;
341
+ while ((match = re2.exec(text)) !== null) {
342
+ mentions.push(match[1].toLowerCase());
343
+ }
344
+ return mentions;
345
+ }
346
+ function resolveOwn(mention, names) {
347
+ if (names.has(mention)) return mention;
348
+ const parts = mention.split("-");
349
+ for (let i2 = parts.length - 1; i2 > 0; i2--) {
350
+ const candidate = parts.slice(0, i2).join("-");
351
+ if (names.has(candidate)) return candidate;
352
+ }
353
+ return null;
354
+ }
355
+ function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true) {
356
+ const mentions = parseMentions(plaintext);
357
+ if (mentions.length === 0) return false;
358
+ const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
359
+ if (mentions.some((m2) => resolveOwn(m2, ownNames) !== null)) return true;
360
+ if (mentions.some((m2) => resolveOwn(m2, BROADCAST_NAMES) !== null)) {
361
+ return senderIsAgent !== true;
362
+ }
363
+ if (!selfResolved) return true;
364
+ return false;
365
+ }
366
+ function ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName) {
367
+ const names = /* @__PURE__ */ new Set();
368
+ const add4 = (n2) => {
369
+ if (!n2) return;
370
+ const lower = n2.toLowerCase();
371
+ names.add(lower);
372
+ names.add(lower.split(/[\s(]/)[0]);
373
+ };
374
+ add4(agentName);
375
+ add4(accountId);
376
+ add4(roomDisplayName);
377
+ add4(ownDisplayName);
378
+ return names;
379
+ }
380
+ function stripMentions(text, agentName, accountId, roomDisplayName, ownDisplayName) {
381
+ const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
382
+ return text.replace(new RegExp(MENTION_RE.source, MENTION_RE.flags), (full, name) => {
383
+ const lower = name.toLowerCase();
384
+ const matched = resolveOwn(lower, ownNames) ?? resolveOwn(lower, BROADCAST_NAMES);
385
+ if (matched === null) return full;
386
+ return name.slice(matched.length);
387
+ }).replace(/^\s+/, "").trim();
388
+ }
337
389
  function _(e) {
338
390
  if ("function" == typeof TextEncoder) return new TextEncoder().encode(e);
339
391
  e = unescape(encodeURIComponent(e));
@@ -11465,11 +11517,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11465
11517
  return null;
11466
11518
  }
11467
11519
  function ownIdentity() {
11468
- const v2 = true ? "0.23.38" : FALLBACK;
11520
+ const v2 = true ? "0.23.40" : FALLBACK;
11469
11521
  return `${PACKAGE}@${v2}`;
11470
11522
  }
11471
11523
  function buildSha() {
11472
- const raw = true ? "c0acb44-dirty" : "";
11524
+ const raw = true ? "dbac15d-dirty" : "";
11473
11525
  const cleaned = (raw ?? "").trim();
11474
11526
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11475
11527
  }
@@ -12474,58 +12526,6 @@ async function checkGateway(options) {
12474
12526
  return { ok: false, error: friendlyError(err) };
12475
12527
  }
12476
12528
  }
12477
- function parseMentions(text) {
12478
- const mentions = [];
12479
- const re2 = new RegExp(MENTION_RE.source, MENTION_RE.flags);
12480
- let match;
12481
- while ((match = re2.exec(text)) !== null) {
12482
- mentions.push(match[1].toLowerCase());
12483
- }
12484
- return mentions;
12485
- }
12486
- function resolveOwn(mention, names) {
12487
- if (names.has(mention)) return mention;
12488
- const parts = mention.split("-");
12489
- for (let i2 = parts.length - 1; i2 > 0; i2--) {
12490
- const candidate = parts.slice(0, i2).join("-");
12491
- if (names.has(candidate)) return candidate;
12492
- }
12493
- return null;
12494
- }
12495
- function owesRoomReply(plaintext, agentName, accountId, senderIsAgent, roomDisplayName, ownDisplayName, selfResolved = true) {
12496
- const mentions = parseMentions(plaintext);
12497
- if (mentions.length === 0) return false;
12498
- const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
12499
- if (mentions.some((m2) => resolveOwn(m2, ownNames) !== null)) return true;
12500
- if (mentions.some((m2) => resolveOwn(m2, BROADCAST_NAMES) !== null)) {
12501
- return senderIsAgent !== true;
12502
- }
12503
- if (!selfResolved) return true;
12504
- return false;
12505
- }
12506
- function ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName) {
12507
- const names = /* @__PURE__ */ new Set();
12508
- const add4 = (n2) => {
12509
- if (!n2) return;
12510
- const lower = n2.toLowerCase();
12511
- names.add(lower);
12512
- names.add(lower.split(/[\s(]/)[0]);
12513
- };
12514
- add4(agentName);
12515
- add4(accountId);
12516
- add4(roomDisplayName);
12517
- add4(ownDisplayName);
12518
- return names;
12519
- }
12520
- function stripMentions(text, agentName, accountId, roomDisplayName, ownDisplayName) {
12521
- const ownNames = ownRoomNames(agentName, accountId, roomDisplayName, ownDisplayName);
12522
- return text.replace(new RegExp(MENTION_RE.source, MENTION_RE.flags), (full, name) => {
12523
- const lower = name.toLowerCase();
12524
- const matched = resolveOwn(lower, ownNames) ?? resolveOwn(lower, BROADCAST_NAMES);
12525
- if (matched === null) return full;
12526
- return name.slice(matched.length);
12527
- }).replace(/^\s+/, "").trim();
12528
- }
12529
12529
  function getErrorMap() {
12530
12530
  return overrideErrorMap;
12531
12531
  }
@@ -17056,7 +17056,7 @@ function reportSkillInvocation(opts) {
17056
17056
  spanBuffer.push(span);
17057
17057
  return span;
17058
17058
  }
17059
- var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_mls_commit_classify, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, 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, isLE, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md, U32_MASK64, _32n, init_u64, 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, isLE2, wrapCipher, init_utils, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto2, init_cryptoNode, isLE3, swap32IfBE2, hasHexBuiltin, hexes, asciis, Hash, init_utils2, HashMD2, SHA256_IV2, SHA384_IV2, SHA512_IV2, init_md2, U32_MASK642, _32n2, shrSH2, shrSL2, rotrSH2, rotrSL2, rotrBH2, rotrBL2, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L2, add3H2, add4L2, add4H2, add5L2, add5H2, init_u642, 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_utils3, _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, oidNist2, init_utils4, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, 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_BYTES2, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, MENTION_RE, BROADCAST_NAMES, init_room_protocol, init_llm_response_parser, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, isUsingManagedRoutes, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
17059
+ var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, 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, isLE, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md, U32_MASK64, _32n, init_u64, 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, isLE2, wrapCipher, init_utils, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto2, init_cryptoNode, isLE3, swap32IfBE2, hasHexBuiltin, hexes, asciis, Hash, init_utils2, HashMD2, SHA256_IV2, SHA384_IV2, SHA512_IV2, init_md2, U32_MASK642, _32n2, shrSH2, shrSL2, rotrSH2, rotrSL2, rotrBH2, rotrBL2, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L2, add3H2, add4L2, add4H2, add5L2, add5H2, init_u642, 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_utils3, _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, oidNist2, init_utils4, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, 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_BYTES2, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, isUsingManagedRoutes, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
17060
17060
  var init_dist = __esm({
17061
17061
  async "../plugin/dist/index.js"() {
17062
17062
  "use strict";
@@ -17105,6 +17105,13 @@ var init_dist = __esm({
17105
17105
  "use strict";
17106
17106
  }
17107
17107
  });
17108
+ init_room_protocol = __esm2({
17109
+ "src/room-protocol.ts"() {
17110
+ "use strict";
17111
+ MENTION_RE = /@([\w-]+)/gi;
17112
+ BROADCAST_NAMES = /* @__PURE__ */ new Set(["all", "everyone"]);
17113
+ }
17114
+ });
17108
17115
  init_libsodium_sumo = __esm2({
17109
17116
  async "../../node_modules/libsodium-sumo/dist/modules-sumo-esm/libsodium-sumo.mjs"() {
17110
17117
  try {
@@ -68296,10 +68303,10 @@ var init_dist = __esm({
68296
68303
  const commits = [];
68297
68304
  if (leavesToRemove.length > 0) {
68298
68305
  const { commit } = await this.removeMembers(leavesToRemove);
68299
- commits.push({ commit, epoch: this.epoch });
68306
+ commits.push({ commit, epoch: this.epoch, state: this.exportState() });
68300
68307
  }
68301
68308
  const added = await this.addMembers(toAdd);
68302
- commits.push({ commit: added.commit, epoch: this.epoch });
68309
+ commits.push({ commit: added.commit, epoch: this.epoch, state: this.exportState() });
68303
68310
  return { commits, welcome: added.welcome };
68304
68311
  }
68305
68312
  async removeMembers(memberIndices) {
@@ -68891,6 +68898,7 @@ var init_dist = __esm({
68891
68898
  "use strict";
68892
68899
  init_abstention();
68893
68900
  init_mls_commit_classify();
68901
+ init_room_protocol();
68894
68902
  await init_libsodium_wrappers();
68895
68903
  await init_dist2();
68896
68904
  await init_dist2();
@@ -69072,6 +69080,56 @@ var init_dist = __esm({
69072
69080
  * this process (GH #366). Cleared on (re)join so the next first message
69073
69081
  * re-fetches the authoritative roster. Prevents per-message refetch storms. */
69074
69082
  _roomRosterRefreshed = /* @__PURE__ */ new Set();
69083
+ /**
69084
+ * #1181: the last attachment saved per room, so the NEXT room turn can name
69085
+ * it. wren saved an un-mentioned file (no reply, #1107), was asked "@wren can
69086
+ * you read this file?" 14 s later, and answered "I don't see a file
69087
+ * attached" — the note lived only in the prior history line. Hermes defers
69088
+ * un-mentioned attachments and fetches on the next addressed turn (#1162);
69089
+ * this is the plugin's equivalent surface. In-memory: a restart forgets it,
69090
+ * which is the right default for "this file".
69091
+ */
69092
+ _recentRoomAttachments = /* @__PURE__ */ new Map();
69093
+ static RECENT_ROOM_ATTACHMENT_MS = 10 * 60 * 1e3;
69094
+ /** #1181: prefix a room turn that carries no attachment with the one saved in this room recently. */
69095
+ _withRecentRoomAttachmentNote(roomId, text) {
69096
+ const recent = this._recentRoomAttachments.get(roomId);
69097
+ if (!recent) return text;
69098
+ const ageMs = Date.now() - recent.at;
69099
+ if (ageMs > _SecureChannel.RECENT_ROOM_ATTACHMENT_MS) return text;
69100
+ return `[Most recent file in this room: ${recent.filePath} (${recent.name}, received ${Math.round(ageMs / 1e3)}s ago). If this message refers to "the file" or "this file", it means that one \u2014 use your Read tool on it.]
69101
+
69102
+ ${text}`;
69103
+ }
69104
+ /**
69105
+ * #1161: room attachments whose caption addressed nobody, NOT yet fetched.
69106
+ * The reply gate lives in every consumer of `room_message` (openclaw-entry
69107
+ * and the three native bridges), but its first clause is shared and needs no
69108
+ * identity: a caption with no mention token owes nobody a reply (#1107), so
69109
+ * nobody needs the file yet. Kept per room, newest last, and fetched on the
69110
+ * room's next ADDRESSED turn — the owner attaches, then asks (#1159/#1181).
69111
+ * Hermes does the same (`_defer_room_attachment`).
69112
+ */
69113
+ _deferredRoomAttachments = /* @__PURE__ */ new Map();
69114
+ static DEFERRED_ROOM_ATTACHMENT_MAX = 5;
69115
+ static DEFERRED_ROOM_ATTACHMENT_MS = 60 * 60 * 1e3;
69116
+ _deferRoomAttachment(roomId, info) {
69117
+ const list = this._deferredRoomAttachments.get(roomId) ?? [];
69118
+ list.push({ info, at: Date.now() });
69119
+ while (list.length > _SecureChannel.DEFERRED_ROOM_ATTACHMENT_MAX) list.shift();
69120
+ this._deferredRoomAttachments.set(roomId, list);
69121
+ console.log(
69122
+ `[SecureChannel] room ${roomId.slice(0, 8)}: attachment ${String(info?.filename ?? "file")} deferred \u2014 caption addresses nobody, fetch on the next @-addressed turn (#1161)`
69123
+ );
69124
+ }
69125
+ /** Drain the room's deferred attachments that are still fresh (oldest first). */
69126
+ _takeDeferredRoomAttachments(roomId) {
69127
+ const list = this._deferredRoomAttachments.get(roomId);
69128
+ if (!list?.length) return [];
69129
+ this._deferredRoomAttachments.delete(roomId);
69130
+ const cutoff = Date.now() - _SecureChannel.DEFERRED_ROOM_ATTACHMENT_MS;
69131
+ return list.filter((d2) => d2.at >= cutoff).map((d2) => d2.info);
69132
+ }
69075
69133
  /** In-flight roster-refresh promises (per room) — dedup concurrent refreshes. */
69076
69134
  _roomRosterRefreshInFlight = /* @__PURE__ */ new Map();
69077
69135
  /** Dedup buffer for A2A message IDs (prevents double-delivery via direct + Redis) */
@@ -70167,7 +70225,7 @@ var init_dist = __esm({
70167
70225
  */
70168
70226
  sendActivitySpan(spanData) {
70169
70227
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
70170
- const pluginVersion = true ? "0.23.38" : "0.0.0-dev";
70228
+ const pluginVersion = true ? "0.23.40" : "0.0.0-dev";
70171
70229
  const agentName = this.config.agentName ?? "Agent";
70172
70230
  const resource = {
70173
70231
  "service.name": "agentvault-agent",
@@ -72105,7 +72163,7 @@ var init_dist = __esm({
72105
72163
  agentVersion: this.config.agentVersion ?? "0.0.0",
72106
72164
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72107
72165
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72108
- pluginVersion: true ? "0.23.38" : "0.0.0-dev"
72166
+ pluginVersion: true ? "0.23.40" : "0.0.0-dev"
72109
72167
  });
72110
72168
  this._telemetryReporter.startAutoFlush(3e4);
72111
72169
  }
@@ -72429,7 +72487,7 @@ var init_dist = __esm({
72429
72487
  agentVersion: this.config.agentVersion ?? "0.0.0",
72430
72488
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72431
72489
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72432
- pluginVersion: true ? "0.23.38" : "0.0.0-dev"
72490
+ pluginVersion: true ? "0.23.40" : "0.0.0-dev"
72433
72491
  });
72434
72492
  this._telemetryReporter.startAutoFlush(3e4);
72435
72493
  }
@@ -72743,6 +72801,7 @@ var init_dist = __esm({
72743
72801
  `[deliver] delivery_result=REJECTED group=${rejectedGroup || "unknown"} detail=${detail}`
72744
72802
  );
72745
72803
  console.error(`[SecureChannel] Server error: ${detail}`);
72804
+ this._noteCommitRefusal(data.data || data);
72746
72805
  await this._handleServerError(data.data || data);
72747
72806
  this.emit("error", new Error(`Server: ${detail}`));
72748
72807
  }
@@ -73044,7 +73103,7 @@ var init_dist = __esm({
73044
73103
  try {
73045
73104
  const parsed = JSON.parse(plaintext);
73046
73105
  messageType = parsed.type || "message";
73047
- messageText = parsed.text || plaintext;
73106
+ messageText = parsed.text ?? plaintext;
73048
73107
  if (parsed.attachment) {
73049
73108
  attachmentInfo = parsed.attachment;
73050
73109
  }
@@ -73202,12 +73261,13 @@ ${messageText}`;
73202
73261
  * Returns the text unchanged when there is no attachment or the fetch fails —
73203
73262
  * but a failure is LOGGED and announced in the text, never silent.
73204
73263
  */
73205
- async _augmentWithAttachment(attachmentInfo, baseText) {
73264
+ async _augmentWithAttachment(attachmentInfo, baseText, roomId) {
73206
73265
  if (!attachmentInfo) return baseText;
73207
73266
  try {
73208
73267
  const { filePath, decrypted } = await this._downloadAndDecryptAttachment(attachmentInfo);
73209
73268
  const mime = String(attachmentInfo.mime ?? "application/octet-stream");
73210
73269
  const name = String(attachmentInfo.filename ?? "attachment");
73270
+ if (roomId) this._recentRoomAttachments.set(roomId, { filePath, name, at: Date.now() });
73211
73271
  const textMimes = ["text/", "application/json", "application/xml", "application/csv"];
73212
73272
  if (textMimes.some((m2) => mime.startsWith(m2))) {
73213
73273
  const content = new TextDecoder().decode(decrypted);
@@ -73795,7 +73855,7 @@ ${baseText}`;
73795
73855
  try {
73796
73856
  const parsed = JSON.parse(rawPlaintext);
73797
73857
  messageType = parsed.type || "message";
73798
- messageText = parsed.text || rawPlaintext;
73858
+ messageText = parsed.text ?? rawPlaintext;
73799
73859
  if (parsed.attachment) roomAttachment = parsed.attachment;
73800
73860
  } catch {
73801
73861
  messageType = "message";
@@ -73836,8 +73896,19 @@ ${baseText}`;
73836
73896
  await this._refreshRoomRoster(resolvedRoomId);
73837
73897
  }
73838
73898
  }
73839
- if (roomAttachment) {
73840
- messageText = await this._augmentWithAttachment(roomAttachment, messageText);
73899
+ const addressed = parseMentions(messageText).length > 0;
73900
+ if (roomAttachment && !addressed) {
73901
+ this._deferRoomAttachment(resolvedRoomId, roomAttachment);
73902
+ } else {
73903
+ const deferred = addressed ? this._takeDeferredRoomAttachments(resolvedRoomId) : [];
73904
+ for (const info of deferred) {
73905
+ messageText = await this._augmentWithAttachment(info, messageText, resolvedRoomId);
73906
+ }
73907
+ if (roomAttachment) {
73908
+ messageText = await this._augmentWithAttachment(roomAttachment, messageText, resolvedRoomId);
73909
+ } else if (deferred.length === 0) {
73910
+ messageText = this._withRecentRoomAttachmentNote(resolvedRoomId, messageText);
73911
+ }
73841
73912
  }
73842
73913
  const roomMembers = this._persisted?.rooms?.[resolvedRoomId]?.members ?? [];
73843
73914
  const senderMember = roomMembers.find((m2) => m2.deviceId === senderDeviceId);
@@ -73961,6 +74032,12 @@ ${baseText}`;
73961
74032
  const groupId = data.group_id;
73962
74033
  const epoch = typeof data.epoch === "number" ? data.epoch : 0;
73963
74034
  this._noteGroupEpoch(groupId, data.epoch);
74035
+ const held = this._commitInFlight.get(groupId);
74036
+ if (held) {
74037
+ held.frames.push(data);
74038
+ console.log(`[SecureChannel] MLS commit for ${groupId.slice(0, 8)} held (epoch=${epoch}) \u2014 our own commit is awaiting confirmation (#1184)`);
74039
+ return true;
74040
+ }
73964
74041
  const target = this._resolveGroupFamily(groupId);
73965
74042
  if (target) {
73966
74043
  const { managerKey: groupKey, label } = target;
@@ -74203,73 +74280,146 @@ ${baseText}`;
74203
74280
  return 0;
74204
74281
  }
74205
74282
  const snapshot = mlsGroup.exportState();
74206
- let parent2 = await this._readGroupHeadDigest(mlsGroupId);
74207
- const { commits, welcome } = await mlsGroup.reAdmitMembers(targets.map((t2) => t2.keyPackage));
74208
- let sentCommits = 0;
74209
- for (const c2 of commits) {
74210
- const ok = await this._sendFrameConfirmed(
74211
- {
74212
- event: "mls_commit",
74213
- data: {
74214
- group_id: mlsGroupId,
74215
- // The epoch this commit PRODUCED. After two commits the manager
74216
- // only knows the last one, which is why the result carries them.
74217
- epoch: Number(c2.epoch),
74218
- payload: Buffer.from(c2.commit).toString("hex"),
74219
- ...parent2 ? { parent_digest: parent2 } : {}
74220
- }
74221
- },
74222
- `${label} commit ${sentCommits + 1}/${commits.length}`
74223
- );
74224
- if (!ok) break;
74225
- parent2 = this._commitDigest(c2.commit);
74226
- sentCommits++;
74227
- }
74228
- if (sentCommits === 0) {
74229
- mlsGroup.importState(snapshot);
74230
- console.warn(
74231
- `[SecureChannel] ${label}: commit was NOT written \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}, nothing fulfilled, requests stay pending`
74232
- );
74233
- return 0;
74234
- }
74235
- await saveMlsState(this.config.dataDir, mlsGroupId, JSON.stringify(mlsGroup.exportState()));
74236
- if (sentCommits < commits.length) {
74237
- console.warn(
74238
- `[SecureChannel] ${label}: only ${sentCommits}/${commits.length} commits reached the wire \u2014 requests stay PENDING for the next pull`
74239
- );
74240
- return 0;
74241
- }
74242
- if (!welcome) {
74283
+ const preHead = await this._readGroupHead(mlsGroupId);
74284
+ if (preHead.ok && preHead.epoch !== Number(mlsGroup.epoch)) {
74243
74285
  console.warn(
74244
- `[SecureChannel] ${label}: addMembers produced NO Welcome \u2014 ${targets.length} request(s) left pending rather than marked fulfilled`
74286
+ `[SecureChannel] ${label}: server head is at epoch ${preHead.epoch}, we are at ${Number(mlsGroup.epoch)} \u2014 NOT committing (it would be refused, #1184); ${targets.length} request(s) stay pending`
74245
74287
  );
74246
74288
  return 0;
74247
74289
  }
74248
- let fulfilled = 0;
74249
- for (const t2 of targets) {
74250
- const sent = await this._sendFrameConfirmed(
74251
- {
74252
- event: "mls_welcome",
74253
- data: {
74254
- target_device_id: t2.deviceId,
74255
- group_id: mlsGroupId,
74256
- ...welcomeFields,
74257
- payload: Buffer.from(welcome).toString("hex")
74258
- }
74259
- },
74260
- `${label} welcome\u2192${t2.deviceId.slice(0, 8)}`
74261
- );
74262
- if (!sent) {
74290
+ let parent2 = preHead.ok ? preHead.digest : void 0;
74291
+ const inFlight = { frames: [], sent: [] };
74292
+ this._commitInFlight.set(mlsGroupId, inFlight);
74293
+ try {
74294
+ const { commits, welcome } = await mlsGroup.reAdmitMembers(targets.map((t2) => t2.keyPackage));
74295
+ let sentCommits = 0;
74296
+ let refusedAt = -1;
74297
+ let verdict = "confirmed";
74298
+ for (const c2 of commits) {
74299
+ const ours = this._commitDigest(c2.commit);
74300
+ inFlight.sent.push({
74301
+ epoch: Number(c2.epoch),
74302
+ digest: ours,
74303
+ verified: false,
74304
+ stateBefore: sentCommits === 0 ? snapshot : commits[sentCommits - 1].state
74305
+ });
74306
+ const ok = await this._sendFrameConfirmed(
74307
+ {
74308
+ event: "mls_commit",
74309
+ data: {
74310
+ group_id: mlsGroupId,
74311
+ // The epoch this commit PRODUCED. After two commits the manager
74312
+ // only knows the last one, which is why the result carries them.
74313
+ epoch: Number(c2.epoch),
74314
+ payload: Buffer.from(c2.commit).toString("hex"),
74315
+ ...parent2 ? { parent_digest: parent2 } : {}
74316
+ }
74317
+ },
74318
+ `${label} commit ${sentCommits + 1}/${commits.length}`
74319
+ );
74320
+ if (!ok) {
74321
+ verdict = "unsent";
74322
+ inFlight.sent.pop();
74323
+ break;
74324
+ }
74325
+ verdict = await this._confirmCommitAtHead(mlsGroupId, Number(c2.epoch), ours, inFlight, label);
74326
+ if (verdict === "confirmed") {
74327
+ inFlight.sent[sentCommits].verified = true;
74328
+ } else if (verdict === "unverifiable") {
74329
+ console.warn(
74330
+ `[SecureChannel] ${label}: commit ${sentCommits + 1}/${commits.length} at epoch ${Number(c2.epoch)} could not be verified and was not refused \u2014 proceeding UNCHECKED (#1184)`
74331
+ );
74332
+ } else {
74333
+ refusedAt = sentCommits;
74334
+ break;
74335
+ }
74336
+ parent2 = ours;
74337
+ sentCommits++;
74338
+ }
74339
+ const cutFromRefusal = () => {
74340
+ const r2 = inFlight.refusal;
74341
+ if (r2 === void 0) return refusedAt;
74342
+ return refusedAt === -1 ? r2.from : Math.min(refusedAt, r2.from);
74343
+ };
74344
+ const rollBackTo = async (cut2, stage, persisted) => {
74345
+ const why = inFlight.refusal?.detail ?? verdict.toUpperCase();
74346
+ mlsGroup.importState(inFlight.sent[cut2].stateBefore);
74347
+ sentCommits = cut2;
74263
74348
  console.warn(
74264
- `[SecureChannel] ${label}: Welcome for ${t2.deviceId.slice(0, 8)} was NOT written \u2014 leaving the request PENDING so the next pull retries it`
74349
+ `[SecureChannel] ${label}: commit ${cut2 + 1}/${commits.length} ${stage} \u2014 "${why}" \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}` + (cut2 === 0 ? ", nothing" : ` (after commit ${cut2}), only that`) + ` persisted, ${targets.length} request(s) stay pending`
74265
74350
  );
74266
- continue;
74351
+ if (persisted) await saveMlsState(this.config.dataDir, mlsGroupId, JSON.stringify(mlsGroup.exportState()));
74352
+ };
74353
+ let cut = cutFromRefusal();
74354
+ if (cut !== -1) {
74355
+ await rollBackTo(cut, "was refused by the server", false);
74356
+ if (sentCommits === 0) return 0;
74357
+ }
74358
+ if (sentCommits === 0) {
74359
+ mlsGroup.importState(snapshot);
74360
+ console.warn(
74361
+ `[SecureChannel] ${label}: commit was NOT written \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}, nothing fulfilled, requests stay pending`
74362
+ );
74363
+ return 0;
74364
+ }
74365
+ await saveMlsState(this.config.dataDir, mlsGroupId, JSON.stringify(mlsGroup.exportState()));
74366
+ cut = cutFromRefusal();
74367
+ if (cut !== -1 && cut < sentCommits) {
74368
+ await rollBackTo(cut, "was refused by the server after the window (during persist)", true);
74369
+ return 0;
74370
+ }
74371
+ if (sentCommits < commits.length) {
74372
+ console.warn(
74373
+ `[SecureChannel] ${label}: only ${sentCommits}/${commits.length} commits were confirmed \u2014 requests stay PENDING for the next pull`
74374
+ );
74375
+ return 0;
74376
+ }
74377
+ if (!welcome) {
74378
+ console.warn(
74379
+ `[SecureChannel] ${label}: addMembers produced NO Welcome \u2014 ${targets.length} request(s) left pending rather than marked fulfilled`
74380
+ );
74381
+ return 0;
74382
+ }
74383
+ let fulfilled = 0;
74384
+ for (const t2 of targets) {
74385
+ const sent = await this._sendFrameConfirmed(
74386
+ {
74387
+ event: "mls_welcome",
74388
+ data: {
74389
+ target_device_id: t2.deviceId,
74390
+ group_id: mlsGroupId,
74391
+ ...welcomeFields,
74392
+ payload: Buffer.from(welcome).toString("hex")
74393
+ }
74394
+ },
74395
+ `${label} welcome\u2192${t2.deviceId.slice(0, 8)}`
74396
+ );
74397
+ if (!sent) {
74398
+ console.warn(
74399
+ `[SecureChannel] ${label}: Welcome for ${t2.deviceId.slice(0, 8)} was NOT written \u2014 leaving the request PENDING so the next pull retries it`
74400
+ );
74401
+ continue;
74402
+ }
74403
+ cut = cutFromRefusal();
74404
+ if (cut !== -1 && cut < sentCommits) {
74405
+ await rollBackTo(cut, "was refused by the server after the window (during the Welcome)", true);
74406
+ return fulfilled;
74407
+ }
74408
+ if (await this._postFulfilWelcome(mlsGroupId, t2.requestId, `${label} ${t2.deviceId.slice(0, 8)}`)) {
74409
+ fulfilled++;
74410
+ }
74267
74411
  }
74268
- if (await this._postFulfilWelcome(mlsGroupId, t2.requestId, `${label} ${t2.deviceId.slice(0, 8)}`)) {
74269
- fulfilled++;
74412
+ return fulfilled;
74413
+ } finally {
74414
+ this._commitInFlight.delete(mlsGroupId);
74415
+ for (const frame of inFlight.frames) {
74416
+ try {
74417
+ await this._handleMlsCommit(frame);
74418
+ } catch (err) {
74419
+ console.error(`[SecureChannel] ${label}: replaying a held MLS commit failed:`, err);
74420
+ }
74270
74421
  }
74271
74422
  }
74272
- return fulfilled;
74273
74423
  }
74274
74424
  /**
74275
74425
  * Resolve an MLS group id to the family that owns it.
@@ -74316,24 +74466,237 @@ ${baseText}`;
74316
74466
  /**
74317
74467
  * #1177: the digest of the commit at the server's head, or undefined.
74318
74468
  *
74319
- * Undefined covers "no head yet", "older backend", AND "could not read" —
74320
- * deliberately the same value. The commit is sent either way: the server
74321
- * skips the parent check for an ABSENT field and refuses a MALFORMED one,
74322
- * so a read failure must degrade to "unchecked", never to "blocked" (a
74323
- * rescue that cannot run is the 2026-09-04 lockout) and never to `null`.
74469
+ * Undefined covers "no head yet" (a pruned group: epoch known, digest NULL —
74470
+ * 29 in production) AND "could not read" — deliberately the same value. The
74471
+ * commit is sent either way: the server skips the parent check for an
74472
+ * ABSENT field and refuses a MALFORMED one, so a read failure must degrade
74473
+ * to "unchecked", never to "blocked" (a rescue that cannot run is the
74474
+ * 2026-09-04 lockout) and never to `null`.
74324
74475
  */
74325
74476
  async _readGroupHeadDigest(groupId) {
74477
+ const head = await this._readGroupHead(groupId);
74478
+ return head.ok ? head.digest : void 0;
74479
+ }
74480
+ /**
74481
+ * #1184: the server's head — its `current_epoch` and the digest of the commit
74482
+ * that produced it.
74483
+ *
74484
+ * - `{ ok: true, epoch, digest? }` the server described its head. `digest`
74485
+ * is absent on a pruned group (NULL
74486
+ * `last_commit_digest`).
74487
+ * - `{ ok: false, why }` the read failed: a non-2xx (the 403
74488
+ * `assert_group_member` returns on an
74489
+ * EMPTY roster — 79 of 80 production
74490
+ * rooms — or a 5xx), a timeout, or a body
74491
+ * with no `current_epoch`. Callers may
74492
+ * retry; a failure is never a verdict.
74493
+ *
74494
+ * `current_epoch` is a required field of `MLSGroupResponse`, so "200 with
74495
+ * no head" is not a shape any deployed backend produces; it is folded into
74496
+ * `ok: false` rather than given a branch of its own (the first cut of #1184
74497
+ * had one, and it was the only branch the suite exercised).
74498
+ */
74499
+ async _readGroupHead(groupId) {
74326
74500
  try {
74327
74501
  const res = await fetch(`${this.config.apiUrl}/api/v1/mls/groups/${groupId}`, {
74328
- headers: { Authorization: `Bearer ${this._deviceJwt}` }
74502
+ headers: { Authorization: `Bearer ${this._deviceJwt}` },
74503
+ // The confirm loop holds `_deliveryPulling`; a black-holed read must
74504
+ // not hold it for undici's 300 s default. A timeout is a failed read.
74505
+ signal: AbortSignal.timeout(_SecureChannel.HEAD_READ_TIMEOUT_MS)
74329
74506
  });
74330
- if (!res.ok) return void 0;
74507
+ if (!res.ok) return { ok: false, why: `HTTP ${res.status}` };
74331
74508
  const head = await res.json();
74332
- const d2 = head?.last_commit_digest;
74333
- return typeof d2 === "string" && /^[0-9a-f]{64}$/.test(d2) ? d2 : void 0;
74334
- } catch {
74335
- return void 0;
74509
+ if (typeof head?.current_epoch !== "number") return { ok: false, why: "no current_epoch in body" };
74510
+ const d2 = head.last_commit_digest;
74511
+ return { ok: true, epoch: head.current_epoch, digest: typeof d2 === "string" && /^[0-9a-f]{64}$/.test(d2) ? d2 : void 0 };
74512
+ } catch (err) {
74513
+ return { ok: false, why: err instanceof Error ? err.name : String(err) };
74514
+ }
74515
+ }
74516
+ /**
74517
+ * #1184: after each read of the head, how long to wait before the next.
74518
+ * The web's schedule (`lib/mls-commit-confirm.ts`) plus one immediate read:
74519
+ * five reads, ~3.75 s, no resend — an MLS commit cannot be regenerated. The
74520
+ * immediate read catches the common case where the server stored the frame
74521
+ * before the GET lands. Instance-level so tests can run the decision logic
74522
+ * without the clock; an empty schedule still reads once (`_confirmCommitAtHead`).
74523
+ */
74524
+ _commitConfirmDelaysMs = [0, 250, 500, 1e3, 2e3];
74525
+ static HEAD_READ_TIMEOUT_MS = 5e3;
74526
+ /**
74527
+ * #1184: groups with a commit of OURS between "built" and "confirmed or rolled
74528
+ * back". Each record holds the `mls_commit` frames the socket delivered for
74529
+ * that group meanwhile — before the confirm loop that window was
74530
+ * microseconds; now it is up to ~3.75 s, and a commit applied to our
74531
+ * unconfirmed local state would be lost by the rollback (in memory) after
74532
+ * being persisted (on disk). Held frames are replayed, in order, once the
74533
+ * group is back on a real state. The record also carries the server's
74534
+ * REFUSAL, when one arrives on the socket (`_noteCommitRefusal`), and a
74535
+ * `wake` the confirm loop installs so a refusal ends its wait at once.
74536
+ */
74537
+ _commitInFlight = /* @__PURE__ */ new Map();
74538
+ /** #1184: a pull was requested while one was running — run once more after. */
74539
+ _deliveryPullRequested = false;
74540
+ /**
74541
+ * #1184: an `error` frame naming a group we have a commit in flight for, with
74542
+ * a `… commit rejected` detail, is the server's refusal of one of those
74543
+ * commits — every rejection the `mls_commit` WS handler sends (malformed
74544
+ * parent, PARENT_MISMATCH, EPOCH_CONFLICT, not-a-member, no-participants)
74545
+ * ends with those words and carries `group_id` (pinned by
74546
+ * `tests/test_1184_commit_reject_frame_contract.py`). It is sent on OUR
74547
+ * socket after the server processed OUR frame, so it is deterministic in a
74548
+ * way the head poll is not, and it is the only refusal signal on a group
74549
+ * whose head we cannot read (403).
74550
+ *
74551
+ * WHICH commit, and what else the frame proves (re-review of #1227):
74552
+ * - EPOCH_CONFLICT carries `expected_epoch` (the epoch we claimed to build
74553
+ * on) and `current_epoch` (the server's); PARENT_MISMATCH carries
74554
+ * `current_epoch` (the head, which equalled our claim or the epoch check
74555
+ * would have fired first) and `head_digest`. The refused commit is the
74556
+ * one built on that epoch. A frame naming an epoch none of our in-flight
74557
+ * commits claimed is a refusal of some EARLIER attempt — ignored.
74558
+ * - the server's `current_epoch` bounds our earlier commits too: any of
74559
+ * ours ABOVE it did not land.
74560
+ * - `head_digest` at `current_epoch` is our commit at that epoch → that one
74561
+ * positively LANDED; someone else's → ours at that epoch did not.
74562
+ * - the un-numbered shapes refuse all of ours alike: the cut is the first
74563
+ * commit the head poll has not positively confirmed.
74564
+ * Recorded as the index of the first commit shown not to hold; the fulfil
74565
+ * path honours it whenever it arrives. A frame for a group with nothing in
74566
+ * flight is somebody else's business.
74567
+ */
74568
+ _noteCommitRefusal(payload) {
74569
+ const groupId = typeof payload?.group_id === "string" ? payload.group_id : void 0;
74570
+ const detail = typeof payload?.detail === "string" ? payload.detail : "";
74571
+ if (!groupId || !detail.endsWith("commit rejected")) return;
74572
+ const inFlight = this._commitInFlight.get(groupId);
74573
+ if (!inFlight) return;
74574
+ const num = (v2) => typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
74575
+ const current = num(payload.current_epoch);
74576
+ const claimed = num(payload.expected_epoch) ?? current;
74577
+ const headDigest = typeof payload.head_digest === "string" ? payload.head_digest : void 0;
74578
+ const sent = inFlight.sent;
74579
+ const tag = `[SecureChannel] refusal for ${groupId.slice(0, 8)} ("${detail}")`;
74580
+ let from = -1;
74581
+ if (claimed !== void 0) {
74582
+ from = sent.findIndex((c2) => c2.epoch === claimed + 1);
74583
+ if (from === -1) {
74584
+ console.warn(`${tag} names epoch ${claimed + 1}, which no commit in flight claimed \u2014 an earlier attempt's; ignored`);
74585
+ return;
74586
+ }
74587
+ }
74588
+ if (current !== void 0) {
74589
+ const above = sent.findIndex((c2) => c2.epoch > current && !c2.verified);
74590
+ if (above !== -1 && (from === -1 || above < from)) from = above;
74591
+ }
74592
+ if (headDigest !== void 0 && current !== void 0) {
74593
+ const at = sent.findIndex((c2) => c2.epoch === current);
74594
+ if (at !== -1) {
74595
+ if (sent[at].digest === headDigest) {
74596
+ sent[at].verified = true;
74597
+ } else if (from === -1 || at < from) {
74598
+ from = at;
74599
+ }
74600
+ }
74601
+ }
74602
+ if (from === -1) from = sent.findIndex((c2) => !c2.verified);
74603
+ if (from === -1 || sent[from].verified) {
74604
+ console.warn(`${tag} contradicts a head read that showed our commit \u2014 stale; ignored`);
74605
+ return;
74606
+ }
74607
+ if (inFlight.refusal !== void 0 && inFlight.refusal.from <= from) return;
74608
+ inFlight.refusal = { detail, from };
74609
+ inFlight.wake?.();
74610
+ }
74611
+ /**
74612
+ * #1184: a commit is CONFIRMED when the server's head shows OUR digest at OUR
74613
+ * epoch — never when the socket took the bytes (#1015 covers only that). The
74614
+ * server sends no ack for a stored commit, so, like the web, we read the
74615
+ * head back; but it DOES send a refusal on the socket (`_noteCommitRefusal`),
74616
+ * and that is checked first, before every read and during every wait.
74617
+ *
74618
+ * confirmed head.epoch === ours && head.digest === ours
74619
+ * conflict the server refused ours on the socket, OR the head is at
74620
+ * our epoch with ANOTHER digest, OR already past us
74621
+ * unconfirmed the head was READ (at least once) but never reached our
74622
+ * epoch within the window — the server described its state
74623
+ * and ours is not in it
74624
+ * unverifiable the head could not be read on ANY try (403 on an empty
74625
+ * roster, an outage) and no refusal arrived — or it is at
74626
+ * our epoch but keeps no digest (a pruned group). Nothing
74627
+ * can be decided on; the caller proceeds UNCHECKED (#1177's
74628
+ * rule: a rescue that cannot run is the 2026-09-04 lockout)
74629
+ *
74630
+ * The first cut returned `unverifiable` only for a body with no
74631
+ * `current_epoch`, which no deployed backend produces, and rolled back on
74632
+ * every real read failure — the opposite of the rule it stated.
74633
+ */
74634
+ async _confirmCommitAtHead(groupId, epoch, ours, inFlight, label) {
74635
+ const refused = () => {
74636
+ if (inFlight.refusal === void 0) return void 0;
74637
+ console.warn(`[SecureChannel] ${label}: server refused our commit at epoch ${epoch} \u2014 "${inFlight.refusal.detail}"`);
74638
+ return "conflict";
74639
+ };
74640
+ let lastSeen;
74641
+ let described = false;
74642
+ let lastFailure = "";
74643
+ const delays = this._commitConfirmDelaysMs.length > 0 ? this._commitConfirmDelaysMs : [0];
74644
+ for (const delay of delays) {
74645
+ if (delay > 0) {
74646
+ await new Promise((resolve3) => {
74647
+ const timer = setTimeout(() => {
74648
+ inFlight.wake = void 0;
74649
+ resolve3();
74650
+ }, delay);
74651
+ inFlight.wake = () => {
74652
+ clearTimeout(timer);
74653
+ inFlight.wake = void 0;
74654
+ resolve3();
74655
+ };
74656
+ });
74657
+ }
74658
+ const early = refused();
74659
+ if (early) return early;
74660
+ const head = await this._readGroupHead(groupId);
74661
+ const duringRead = refused();
74662
+ if (duringRead) return duringRead;
74663
+ if (!head.ok) {
74664
+ lastFailure = head.why;
74665
+ continue;
74666
+ }
74667
+ described = true;
74668
+ lastSeen = head.epoch;
74669
+ if (head.epoch === epoch) {
74670
+ if (head.digest === ours) return "confirmed";
74671
+ if (head.digest === void 0) return "unverifiable";
74672
+ console.warn(
74673
+ `[SecureChannel] ${label}: head at epoch ${epoch} is NOT our commit (${head.digest.slice(0, 12)}\u2026 vs ours ${ours.slice(0, 12)}\u2026) \u2014 ours was refused`
74674
+ );
74675
+ return "conflict";
74676
+ }
74677
+ if (head.epoch > epoch) {
74678
+ console.warn(`[SecureChannel] ${label}: head already at epoch ${head.epoch}, past our ${epoch} \u2014 ours was refused`);
74679
+ return "conflict";
74680
+ }
74681
+ }
74682
+ const late2 = refused();
74683
+ if (late2) return late2;
74684
+ if (!described && !this._wsIsOpen()) {
74685
+ console.warn(
74686
+ `[SecureChannel] ${label}: the socket closed during the confirm window and the head could not be read \u2014 a refusal of commit at epoch ${epoch} may have been lost; treating as refused`
74687
+ );
74688
+ return "unconfirmed";
74689
+ }
74690
+ if (!described) {
74691
+ console.warn(
74692
+ `[SecureChannel] ${label}: could not read the head on any of ${delays.length} tries (last: ${lastFailure}) and the server sent no refusal \u2014 cannot verify commit at epoch ${epoch}`
74693
+ );
74694
+ return "unverifiable";
74336
74695
  }
74696
+ console.warn(
74697
+ `[SecureChannel] ${label}: commit at epoch ${epoch} never appeared at the head (last seen ${lastSeen}) \u2014 treating as refused`
74698
+ );
74699
+ return "unconfirmed";
74337
74700
  }
74338
74701
  /**
74339
74702
  * #1015: write one frame and report whether the socket took it.
@@ -74855,7 +75218,11 @@ ${baseText}`;
74855
75218
  * Called on WS connect, on mls_delivery ping, and every 30s heartbeat.
74856
75219
  */
74857
75220
  async _pullDeliveryQueue() {
74858
- if (!this._deviceId || !this._deviceJwt || this._deliveryPulling) return;
75221
+ if (!this._deviceId || !this._deviceJwt) return;
75222
+ if (this._deliveryPulling) {
75223
+ this._deliveryPullRequested = true;
75224
+ return;
75225
+ }
74859
75226
  this._deliveryPulling = true;
74860
75227
  try {
74861
75228
  const res = await fetch(
@@ -75417,6 +75784,10 @@ ${baseText}`;
75417
75784
  console.warn("[SecureChannel] Delivery pull error:", err);
75418
75785
  } finally {
75419
75786
  this._deliveryPulling = false;
75787
+ if (this._deliveryPullRequested) {
75788
+ this._deliveryPullRequested = false;
75789
+ void this._pullDeliveryQueue().catch((err) => console.warn("[SecureChannel] Coalesced delivery pull error:", err));
75790
+ }
75420
75791
  }
75421
75792
  }
75422
75793
  /**
@@ -75500,7 +75871,7 @@ ${baseText}`;
75500
75871
  try {
75501
75872
  const parsed = JSON.parse(plaintext);
75502
75873
  messageType = parsed.type || "message";
75503
- messageText = parsed.text || plaintext;
75874
+ messageText = parsed.text ?? plaintext;
75504
75875
  } catch {
75505
75876
  messageType = "message";
75506
75877
  messageText = plaintext;
@@ -75849,7 +76220,7 @@ ${baseText}`;
75849
76220
  try {
75850
76221
  const parsed = JSON.parse(plaintext);
75851
76222
  messageType = parsed.type || "message";
75852
- messageText = parsed.text || plaintext;
76223
+ messageText = parsed.text ?? plaintext;
75853
76224
  } catch {
75854
76225
  messageType = "message";
75855
76226
  messageText = plaintext;
@@ -76134,7 +76505,7 @@ ${baseText}`;
76134
76505
  try {
76135
76506
  const parsed = JSON.parse(plaintext);
76136
76507
  messageType = parsed.type || "message";
76137
- messageText = parsed.text || plaintext;
76508
+ messageText = parsed.text ?? plaintext;
76138
76509
  } catch {
76139
76510
  messageType = "message";
76140
76511
  messageText = plaintext;
@@ -76570,13 +76941,6 @@ ${actionsText}`);
76570
76941
  init_openclaw_compat();
76571
76942
  }
76572
76943
  });
76573
- init_room_protocol = __esm2({
76574
- "src/room-protocol.ts"() {
76575
- "use strict";
76576
- MENTION_RE = /@([\w-]+)/gi;
76577
- BROADCAST_NAMES = /* @__PURE__ */ new Set(["all", "everyone"]);
76578
- }
76579
- });
76580
76944
  init_llm_response_parser = __esm2({
76581
76945
  "src/llm-response-parser.ts"() {
76582
76946
  "use strict";
@@ -97832,7 +98196,7 @@ data:
97832
98196
  await init_skill_telemetry();
97833
98197
  await init_policy_enforcer();
97834
98198
  init_room_protocol();
97835
- VERSION = true ? "0.23.38" : "0.0.0-dev";
98199
+ VERSION = true ? "0.23.40" : "0.0.0-dev";
97836
98200
  }
97837
98201
  });
97838
98202
  await init_index();
@@ -99215,7 +99579,7 @@ function mkdir700(path2) {
99215
99579
  chmodSync5(path2, 448);
99216
99580
  }
99217
99581
  function packageVersion() {
99218
- return true ? "0.1.14" : void 0;
99582
+ return true ? "0.1.16" : void 0;
99219
99583
  }
99220
99584
  function helpText(version2) {
99221
99585
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
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",