@agentvault/muse-bridge 0.1.16 → 0.1.18

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
@@ -9,6 +9,9 @@ export interface RoomMessage {
9
9
  roomId: string;
10
10
  senderName: string;
11
11
  plaintext: string;
12
+ /** #1223 — the text the sender typed, before any attachment was folded into
13
+ * `plaintext`. The @ gate reads this; absent on emitters < 0.23.42. */
14
+ caption?: string;
12
15
  senderIsAgent?: boolean;
13
16
  }
14
17
  export interface MessageMeta {
package/dist/index.js CHANGED
@@ -279,6 +279,7 @@ __export(dist_exports, {
279
279
  sendToRoom: () => sendToRoom,
280
280
  sendToTarget: () => sendToTarget,
281
281
  setOcRuntime: () => setOcRuntime,
282
+ stripCaptionMentions: () => stripCaptionMentions,
282
283
  stripMentions: () => stripMentions,
283
284
  wrapSkillExecution: () => wrapSkillExecution
284
285
  });
@@ -386,6 +387,19 @@ function stripMentions(text, agentName, accountId, roomDisplayName, ownDisplayNa
386
387
  return name.slice(matched.length);
387
388
  }).replace(/^\s+/, "").trim();
388
389
  }
390
+ function stripCaptionMentions(text, caption, agentName, accountId, roomDisplayName, ownDisplayName, roomId) {
391
+ if (typeof caption !== "string") {
392
+ return stripMentions(text, agentName, accountId, roomDisplayName, ownDisplayName);
393
+ }
394
+ const at = text.lastIndexOf(caption);
395
+ if (at < 0) {
396
+ console.warn(
397
+ `[AgentVault] caption not found in the folded text \u2014 left un-stripped rather than edit the fold (#1239) room=${(roomId ?? "").slice(0, 8)} caption_len=${caption.length} text_len=${text.length}`
398
+ );
399
+ return text;
400
+ }
401
+ return text.slice(0, at) + stripMentions(caption, agentName, accountId, roomDisplayName, ownDisplayName) + text.slice(at + caption.length);
402
+ }
389
403
  function _(e) {
390
404
  if ("function" == typeof TextEncoder) return new TextEncoder().encode(e);
391
405
  e = unescape(encodeURIComponent(e));
@@ -11517,11 +11531,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11517
11531
  return null;
11518
11532
  }
11519
11533
  function ownIdentity() {
11520
- const v2 = true ? "0.23.40" : FALLBACK;
11534
+ const v2 = true ? "0.23.42" : FALLBACK;
11521
11535
  return `${PACKAGE}@${v2}`;
11522
11536
  }
11523
11537
  function buildSha() {
11524
- const raw = true ? "dbac15d-dirty" : "";
11538
+ const raw = true ? "d9d53a0-dirty" : "";
11525
11539
  const cleaned = (raw ?? "").trim();
11526
11540
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11527
11541
  }
@@ -17056,7 +17070,7 @@ function reportSkillInvocation(opts) {
17056
17070
  spanBuffer.push(span);
17057
17071
  return span;
17058
17072
  }
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;
17073
+ 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, UUID_RE, 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
17074
  var init_dist = __esm({
17061
17075
  async "../plugin/dist/index.js"() {
17062
17076
  "use strict";
@@ -68930,6 +68944,7 @@ var init_dist = __esm({
68930
68944
  ]);
68931
68945
  POLL_INTERVAL_MS = 6e3;
68932
68946
  RECONNECT_BASE_MS = 1e3;
68947
+ UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
68933
68948
  RECONNECT_MAX_MS = 3e4;
68934
68949
  PENDING_POLL_INTERVAL_MS = 15e3;
68935
68950
  OUTBOUND_DEDUPE_WINDOW_MS = 3e3;
@@ -70225,7 +70240,7 @@ ${text}`;
70225
70240
  */
70226
70241
  sendActivitySpan(spanData) {
70227
70242
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
70228
- const pluginVersion = true ? "0.23.40" : "0.0.0-dev";
70243
+ const pluginVersion = true ? "0.23.42" : "0.0.0-dev";
70229
70244
  const agentName = this.config.agentName ?? "Agent";
70230
70245
  const resource = {
70231
70246
  "service.name": "agentvault-agent",
@@ -72163,7 +72178,7 @@ ${text}`;
72163
72178
  agentVersion: this.config.agentVersion ?? "0.0.0",
72164
72179
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72165
72180
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72166
- pluginVersion: true ? "0.23.40" : "0.0.0-dev"
72181
+ pluginVersion: true ? "0.23.42" : "0.0.0-dev"
72167
72182
  });
72168
72183
  this._telemetryReporter.startAutoFlush(3e4);
72169
72184
  }
@@ -72487,7 +72502,7 @@ ${text}`;
72487
72502
  agentVersion: this.config.agentVersion ?? "0.0.0",
72488
72503
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
72489
72504
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
72490
- pluginVersion: true ? "0.23.40" : "0.0.0-dev"
72505
+ pluginVersion: true ? "0.23.42" : "0.0.0-dev"
72491
72506
  });
72492
72507
  this._telemetryReporter.startAutoFlush(3e4);
72493
72508
  }
@@ -72702,45 +72717,78 @@ ${text}`;
72702
72717
  const mlsGroup = this._mlsGroups.get(`a2a:${channelId}`);
72703
72718
  if (mlsGroup?.isInitialized) {
72704
72719
  try {
72705
- const kpRes = await fetch(
72706
- `${this.config.apiUrl}/api/v1/mls/key-packages?hub_id=${encodeURIComponent(participant.hub_id)}`,
72707
- { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
72708
- );
72709
- if (kpRes.ok) {
72710
- const kpData = await kpRes.json();
72711
- if (kpData.key_package) {
72712
- const kpBytes = new Uint8Array(Buffer.from(kpData.key_package, "hex"));
72713
- const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
72714
- const { commit, welcome } = await mlsGroup.addMembers([memberKp]);
72715
- if (welcome && this._ws) {
72716
- this._ws.send(JSON.stringify({
72717
- event: "mls_commit",
72718
- data: {
72719
- group_id: entry.mlsGroupId,
72720
- epoch: Number(mlsGroup.epoch),
72721
- payload: Buffer.from(commit).toString("hex")
72722
- }
72723
- }));
72724
- const newDeviceId = participant.device_id || null;
72725
- if (!newDeviceId) {
72726
- console.warn(
72727
- `[SecureChannel] Skipping MLS Welcome to new participant ${participant.hub_address} for A2A ${channelId.slice(0, 8)}: no device_id on participant_joined payload.`
72728
- );
72729
- } else {
72730
- this._ws.send(JSON.stringify({
72731
- event: "mls_welcome",
72732
- data: {
72733
- group_id: entry.mlsGroupId,
72734
- payload: Buffer.from(welcome).toString("hex"),
72735
- target_device_id: newDeviceId,
72736
- a2a_channel_id: channelId,
72737
- target_hub_id: participant.hub_id
72738
- // observability only
72720
+ const newDeviceId = participant.device_id || null;
72721
+ const a2aLabel = `A2A ${channelId.slice(0, 8)} participant_joined`;
72722
+ if (!newDeviceId) {
72723
+ console.warn(
72724
+ `[SecureChannel] ${a2aLabel}: no device_id on the payload for ${participant.hub_address} \u2014 NOT adding (a Welcome could not be addressed)`
72725
+ );
72726
+ } else if (!this._wsIsOpen()) {
72727
+ console.warn(`[SecureChannel] ${a2aLabel}: socket is not OPEN \u2014 NOT advancing the group`);
72728
+ } else {
72729
+ const preHead = await this._readGroupHead(entry.mlsGroupId);
72730
+ const inFlight = preHead.ok && preHead.epoch !== Number(mlsGroup.epoch) ? null : this._reserveCommit(entry.mlsGroupId, a2aLabel);
72731
+ if (preHead.ok && preHead.epoch !== Number(mlsGroup.epoch)) {
72732
+ console.warn(
72733
+ `[SecureChannel] ${a2aLabel}: server head is at epoch ${preHead.epoch}, we are at ${Number(mlsGroup.epoch)} \u2014 NOT committing (it would be refused); resync catches up first`
72734
+ );
72735
+ await this._catchUpAfterPreflightSkip(entry.mlsGroupId, preHead.epoch, Number(mlsGroup.epoch), a2aLabel);
72736
+ } else if (inFlight) {
72737
+ try {
72738
+ const kpRes = await fetch(
72739
+ `${this.config.apiUrl}/api/v1/mls/key-packages?hub_id=${encodeURIComponent(participant.hub_id)}`,
72740
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
72741
+ );
72742
+ if (kpRes.ok) {
72743
+ const kpData = await kpRes.json();
72744
+ if (kpData.key_package) {
72745
+ const kpBytes = new Uint8Array(Buffer.from(kpData.key_package, "hex"));
72746
+ const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
72747
+ const stateBefore = mlsGroup.exportState();
72748
+ const { commit, welcome } = await mlsGroup.addMembers([memberKp]);
72749
+ const committedEpoch = Number(mlsGroup.epoch);
72750
+ if (!welcome) {
72751
+ mlsGroup.importState(stateBefore);
72752
+ console.warn(`[SecureChannel] ${a2aLabel}: addMembers produced no Welcome \u2014 rolled back`);
72753
+ } else {
72754
+ const verdict = await this._sendCommitConfirmed({
72755
+ mlsGroup,
72756
+ mlsGroupId: entry.mlsGroupId,
72757
+ label: a2aLabel,
72758
+ commit,
72759
+ epoch: committedEpoch,
72760
+ parent: preHead.ok ? preHead.digest : void 0,
72761
+ memberDeviceIds: this._commitRoster(
72762
+ (entry.participants ?? []).map((p2) => p2.deviceId),
72763
+ [newDeviceId]
72764
+ ),
72765
+ stateBefore,
72766
+ inFlight
72767
+ });
72768
+ if (verdict === "confirmed") {
72769
+ const sent = await this._sendFrameConfirmed({
72770
+ event: "mls_welcome",
72771
+ data: {
72772
+ group_id: entry.mlsGroupId,
72773
+ payload: Buffer.from(welcome).toString("hex"),
72774
+ target_device_id: newDeviceId,
72775
+ a2a_channel_id: channelId,
72776
+ target_hub_id: participant.hub_id
72777
+ // observability only
72778
+ }
72779
+ }, `${a2aLabel} welcome`);
72780
+ await saveMlsState(this.config.dataDir, entry.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
72781
+ if (sent) {
72782
+ console.log(`[SecureChannel] Sent MLS Welcome to new participant ${participant.hub_address} (device ${String(newDeviceId).slice(0, 8)})`);
72783
+ } else {
72784
+ console.warn(`[SecureChannel] ${a2aLabel}: Welcome to ${String(newDeviceId).slice(0, 8)} was NOT written \u2014 the participant will request one`);
72785
+ }
72786
+ }
72739
72787
  }
72740
- }));
72741
- await saveMlsState(this.config.dataDir, entry.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
72742
- console.log(`[SecureChannel] Sent MLS Welcome to new participant ${participant.hub_address} (device ${String(newDeviceId).slice(0, 8)})`);
72788
+ }
72743
72789
  }
72790
+ } finally {
72791
+ await this._releaseCommit(entry.mlsGroupId, inFlight, a2aLabel);
72744
72792
  }
72745
72793
  }
72746
72794
  }
@@ -73217,7 +73265,13 @@ ${messageText}`;
73217
73265
  messageType: msgData.message_type ?? "text",
73218
73266
  priority: msgData.priority ?? "normal",
73219
73267
  envelopeVersion: msgData.envelope_version ?? "1.0.0",
73220
- roomId
73268
+ roomId,
73269
+ // #1223 — the pre-fold text. This DR `message` path also sets `roomId`
73270
+ // and folds an attachment into `emitText`, so without this a room
73271
+ // message that reaches the gate here would fall back to the folded
73272
+ // text (the same bug the MLS room path fixes). `messageText` is the
73273
+ // envelope text before the fold; `emitText` is the folded copy.
73274
+ caption: messageText
73221
73275
  };
73222
73276
  this.emit("message", emitText, metadata);
73223
73277
  Promise.resolve(this.config.onMessage?.(emitText, metadata)).catch((err) => {
@@ -73896,6 +73950,7 @@ ${baseText}`;
73896
73950
  await this._refreshRoomRoster(resolvedRoomId);
73897
73951
  }
73898
73952
  }
73953
+ const caption = messageText;
73899
73954
  const addressed = parseMentions(messageText).length > 0;
73900
73955
  if (roomAttachment && !addressed) {
73901
73956
  this._deferRoomAttachment(resolvedRoomId, roomAttachment);
@@ -73922,7 +73977,8 @@ ${baseText}`;
73922
73977
  senderDeviceId,
73923
73978
  senderIsAgent,
73924
73979
  senderName: senderMember?.displayName || "unknown",
73925
- roomName: this._persisted?.rooms?.[resolvedRoomId]?.name
73980
+ roomName: this._persisted?.rooms?.[resolvedRoomId]?.name,
73981
+ caption
73926
73982
  };
73927
73983
  const senderLabel = senderMember?.displayName || "someone";
73928
73984
  this._appendHistory("owner", messageText, `room:${resolvedRoomId}`);
@@ -73931,6 +73987,9 @@ ${baseText}`;
73931
73987
  senderDeviceId,
73932
73988
  senderName: senderLabel,
73933
73989
  plaintext: messageText,
73990
+ // #1223 — what the sender typed, before the attachment fold. The
73991
+ // bridges gate on this (falling back to `plaintext` when absent).
73992
+ caption,
73934
73993
  messageType,
73935
73994
  timestamp: data.created_at ?? (/* @__PURE__ */ new Date()).toISOString(),
73936
73995
  // Native bridge (claude-room-bridge) consumes this to decide reply
@@ -74270,9 +74329,34 @@ ${baseText}`;
74270
74329
  *
74271
74330
  * Returns the number of requests actually fulfilled.
74272
74331
  */
74332
+ /**
74333
+ * #1226: the roster to submit on a commit frame — the caller's known members,
74334
+ * the devices being admitted, and ALWAYS ourselves — deduplicated, UUIDs
74335
+ * only. Self is non-negotiable: once a roster is non-empty the server
74336
+ * requires the committer in it (#469), and our own head read
74337
+ * (`assert_group_member`) requires it too. So with no device id of our own
74338
+ * this returns `[]` and the frame carries NO roster (the pre-#1226 shape)
74339
+ * rather than a roster that locks us out. Non-UUID entries are dropped:
74340
+ * `known` can come off an inbound Welcome frame, and a malformed id in the
74341
+ * outbound frame is refused by the server (`MEMBER_DEVICE_IDS_MALFORMED`).
74342
+ * @internal exposed for tests
74343
+ */
74344
+ _commitRoster(known, targets) {
74345
+ if (!this._deviceId) return [];
74346
+ const out = [];
74347
+ const seen = /* @__PURE__ */ new Set();
74348
+ for (const id of [...known ?? [], ...targets, this._deviceId]) {
74349
+ if (typeof id !== "string" || !UUID_RE.test(id) || seen.has(id)) continue;
74350
+ seen.add(id);
74351
+ out.push(id);
74352
+ }
74353
+ return out;
74354
+ }
74273
74355
  async _fulfilWelcomeRequests(opts) {
74274
74356
  const { mlsGroup, mlsGroupId, label, welcomeFields, targets } = opts;
74275
74357
  if (targets.length === 0) return 0;
74358
+ const rosterBefore = this._commitRoster(opts.memberDeviceIds, []);
74359
+ const rosterAfter = this._commitRoster(opts.memberDeviceIds, targets.map((t2) => t2.deviceId));
74276
74360
  if (!this._wsIsOpen()) {
74277
74361
  console.warn(
74278
74362
  `[SecureChannel] ${label}: socket is not OPEN \u2014 NOT advancing the group; ${targets.length} request(s) stay pending for the next pull`
@@ -74285,9 +74369,16 @@ ${baseText}`;
74285
74369
  console.warn(
74286
74370
  `[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`
74287
74371
  );
74372
+ await this._catchUpAfterPreflightSkip(mlsGroupId, preHead.epoch, Number(mlsGroup.epoch), label);
74288
74373
  return 0;
74289
74374
  }
74290
74375
  let parent2 = preHead.ok ? preHead.digest : void 0;
74376
+ if (this._commitInFlight.has(mlsGroupId)) {
74377
+ console.warn(
74378
+ `[SecureChannel] ${label}: another commit for this group is in flight \u2014 NOT advancing; ${targets.length} request(s) stay pending for the next pull`
74379
+ );
74380
+ return 0;
74381
+ }
74291
74382
  const inFlight = { frames: [], sent: [] };
74292
74383
  this._commitInFlight.set(mlsGroupId, inFlight);
74293
74384
  try {
@@ -74312,7 +74403,8 @@ ${baseText}`;
74312
74403
  // only knows the last one, which is why the result carries them.
74313
74404
  epoch: Number(c2.epoch),
74314
74405
  payload: Buffer.from(c2.commit).toString("hex"),
74315
- ...parent2 ? { parent_digest: parent2 } : {}
74406
+ ...parent2 ? { parent_digest: parent2 } : {},
74407
+ ...(sentCommits === commits.length - 1 ? rosterAfter : rosterBefore).length > 0 ? { member_device_ids: sentCommits === commits.length - 1 ? rosterAfter : rosterBefore } : {}
74316
74408
  }
74317
74409
  },
74318
74410
  `${label} commit ${sentCommits + 1}/${commits.length}`
@@ -74460,6 +74552,126 @@ ${baseText}`;
74460
74552
  return this._ws?.readyState === 1;
74461
74553
  }
74462
74554
  /** SHA-256 hex of a commit's bytes — its identity on the server (#1175/#1177). */
74555
+ /**
74556
+ * #1225: send ONE commit over the socket and wait for the server's verdict,
74557
+ * with the #1184 machinery — an in-flight record (so a `… commit rejected`
74558
+ * frame is correlated to it and a concurrent commit for the group is held
74559
+ * and replayed), the head poll, and rollback. The three A2A commit sites
74560
+ * (`a2a_participant_joined`, the `/distribute` WS fallback, `_foundA2AGroup`)
74561
+ * used a raw `ws.send` and treated "the socket took it" as "the server
74562
+ * stored it" — two of them then PERSISTED a state the server never saw.
74563
+ *
74564
+ * Returns the verdict. On `refused` / `unsent` the manager has been restored
74565
+ * to `stateBefore` and nothing must be persisted or minted from it.
74566
+ * `unverifiable` (head unreadable on every try AND no refusal) proceeds
74567
+ * UNCHECKED, the same deliberate choice as the fulfil site.
74568
+ */
74569
+ /**
74570
+ * #1225 (review F1): reserve the single in-flight slot for a group. The
74571
+ * record is what `_noteCommitRefusal` correlates a refusal to and what
74572
+ * `_handleMlsCommit` holds concurrent socket commits behind; a second run on
74573
+ * the same group would clobber both (measured: two overlapping joins → two
74574
+ * commits claiming one epoch, one Welcome instead of two, the manager AHEAD
74575
+ * of the server). Taken BEFORE the commit is generated; released by
74576
+ * `_releaseCommit` after the last step that depends on it.
74577
+ */
74578
+ /**
74579
+ * A pre-flight skip must not be a dead end. The skip happens because the
74580
+ * server's head is somewhere else; before this the group "caught up through
74581
+ * the normal divergence path", which only runs when a message for the group
74582
+ * arrives — so a group nobody writes to stayed diverged and its pending
74583
+ * Welcome requests were never fulfilled (named in PR #1227). When the server
74584
+ * is AHEAD, replay the missing commits now so the next pull can commit; when
74585
+ * WE are ahead there is nothing to replay (the fork-ahead direction, #972).
74586
+ */
74587
+ async _catchUpAfterPreflightSkip(mlsGroupId, serverEpoch, localEpoch, label) {
74588
+ if (serverEpoch < localEpoch) {
74589
+ console.warn(`[SecureChannel] ${label}: we are AHEAD of the server (${localEpoch} > ${serverEpoch}) \u2014 nothing to replay`);
74590
+ return;
74591
+ }
74592
+ const fam = this._resolveGroupFamily(mlsGroupId);
74593
+ if (!fam) return;
74594
+ try {
74595
+ const caughtUp = await this._resyncOnDivergence(fam.managerKey, mlsGroupId);
74596
+ console.log(`[SecureChannel] ${label}: catch-up after pre-flight skip ${caughtUp ? "replayed the missing commits" : "could not replay"}`);
74597
+ } catch (err) {
74598
+ console.warn(`[SecureChannel] ${label}: catch-up after pre-flight skip failed:`, err);
74599
+ }
74600
+ }
74601
+ _reserveCommit(groupId, label) {
74602
+ if (this._commitInFlight.has(groupId)) {
74603
+ console.warn(
74604
+ `[SecureChannel] ${label}: another commit for group ${groupId.slice(0, 8)} is in flight \u2014 NOT advancing the group (a Welcome can be requested again)`
74605
+ );
74606
+ return null;
74607
+ }
74608
+ const rec = { frames: [], sent: [] };
74609
+ this._commitInFlight.set(groupId, rec);
74610
+ return rec;
74611
+ }
74612
+ /** Release the slot taken by `_reserveCommit` and replay the socket commits held meanwhile. */
74613
+ async _releaseCommit(groupId, rec, label) {
74614
+ if (this._commitInFlight.get(groupId) === rec) this._commitInFlight.delete(groupId);
74615
+ for (const frame of rec.frames) {
74616
+ try {
74617
+ await this._handleMlsCommit(frame);
74618
+ } catch (err) {
74619
+ console.error(`[SecureChannel] ${label}: replaying a held MLS commit failed:`, err);
74620
+ }
74621
+ }
74622
+ }
74623
+ /**
74624
+ * #1225: send ONE commit over the socket and wait for the server's verdict
74625
+ * with the #1184 machinery (refusal frame correlated through the reserved
74626
+ * in-flight record, head poll). The three A2A commit sites
74627
+ * (`a2a_participant_joined`, the `/distribute` WS fallback, `_foundA2AGroup`)
74628
+ * used a raw `ws.send` and treated "the socket took it" as "the server
74629
+ * stored it" — two of them then PERSISTED a state the server never saw.
74630
+ *
74631
+ * Only `confirmed` proceeds. `unverifiable` (head unreadable on every try,
74632
+ * no refusal) is a ROLLBACK here, unlike the fulfil site: that site proceeds
74633
+ * UNCHECKED because 79 of 80 production rooms 403 the head read on an empty
74634
+ * roster; an A2A head read admits any active participant (observer
74635
+ * fallback), so five failed reads there mean an outage, not a routine 403.
74636
+ * On anything but `confirmed` the manager is back at `stateBefore`.
74637
+ */
74638
+ async _sendCommitConfirmed(opts) {
74639
+ const { mlsGroup, mlsGroupId, label, commit, epoch, parent: parent2, memberDeviceIds, stateBefore, inFlight } = opts;
74640
+ const ours = this._commitDigest(commit);
74641
+ inFlight.sent.push({ epoch, digest: ours, verified: false, stateBefore });
74642
+ const ok = await this._sendFrameConfirmed(
74643
+ {
74644
+ event: "mls_commit",
74645
+ data: {
74646
+ group_id: mlsGroupId,
74647
+ epoch,
74648
+ payload: Buffer.from(commit).toString("hex"),
74649
+ ...parent2 ? { parent_digest: parent2 } : {},
74650
+ ...memberDeviceIds && memberDeviceIds.length > 0 ? { member_device_ids: memberDeviceIds } : {}
74651
+ }
74652
+ },
74653
+ `${label} commit`
74654
+ );
74655
+ if (!ok) {
74656
+ inFlight.sent.pop();
74657
+ mlsGroup.importState(stateBefore);
74658
+ console.warn(
74659
+ `[SecureChannel] ${label}: commit at epoch ${epoch} was NOT written \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}`
74660
+ );
74661
+ return "unsent";
74662
+ }
74663
+ const verdict = await this._confirmCommitAtHead(mlsGroupId, epoch, ours, inFlight, label);
74664
+ if (inFlight.refusal === void 0 && verdict === "confirmed") {
74665
+ inFlight.sent[inFlight.sent.length - 1].verified = true;
74666
+ return "confirmed";
74667
+ }
74668
+ const why = inFlight.refusal?.detail ?? verdict.toUpperCase();
74669
+ mlsGroup.importState(stateBefore);
74670
+ console.warn(
74671
+ `[SecureChannel] ${label}: commit at epoch ${epoch} was ${verdict === "unverifiable" ? "not verified (head unreadable)" : "refused by the server"} \u2014 "${why}" \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}, nothing persisted`
74672
+ );
74673
+ return "refused";
74674
+ }
74463
74675
  _commitDigest(bytes) {
74464
74676
  return createHash("sha256").update(bytes).digest("hex");
74465
74677
  }
@@ -75413,7 +75625,9 @@ ${baseText}`;
75413
75625
  mlsGroupId: roomState.mlsGroupId,
75414
75626
  label: `room ${roomId.slice(0, 8)}`,
75415
75627
  welcomeFields: { room_id: roomId },
75416
- targets: roomTargets
75628
+ targets: roomTargets,
75629
+ memberDeviceIds: (roomState.members ?? []).map((m2) => m2.deviceId)
75630
+ // #1226
75417
75631
  });
75418
75632
  if (done > 0) {
75419
75633
  console.log(
@@ -75468,7 +75682,9 @@ ${baseText}`;
75468
75682
  mlsGroupId: entry.mlsGroupId,
75469
75683
  label: `shared group ${gid.slice(0, 8)}`,
75470
75684
  welcomeFields: { conversation_group_id: gid },
75471
- targets: sharedTargets
75685
+ targets: sharedTargets,
75686
+ memberDeviceIds: entry.memberDeviceIds ?? []
75687
+ // #1226
75472
75688
  });
75473
75689
  if (done > 0) {
75474
75690
  console.log(`[SecureChannel] Batched Welcome for ${done}/${validReqs.length} devices in shared group ${gid.slice(0, 8)} (epoch=${mlsGroup.epoch})`);
@@ -75482,7 +75698,9 @@ ${baseText}`;
75482
75698
  mlsGroupId: entry.mlsGroupId,
75483
75699
  label: `shared group ${gid.slice(0, 8)}`,
75484
75700
  welcomeFields: { conversation_group_id: gid },
75485
- targets: [target]
75701
+ targets: [target],
75702
+ memberDeviceIds: entry.memberDeviceIds ?? []
75703
+ // #1226
75486
75704
  });
75487
75705
  if (done > 0) {
75488
75706
  console.log(`[SecureChannel] Individual Welcome for ${target.deviceId.slice(0, 8)} in shared group ${gid.slice(0, 8)}`);
@@ -75529,7 +75747,11 @@ ${baseText}`;
75529
75747
  requestId: req.id,
75530
75748
  deviceId: req.requesting_device_id,
75531
75749
  keyPackage: memberKp
75532
- }]
75750
+ }],
75751
+ // #1226: a 1:1 roster is [self, owner] — the web's shape too.
75752
+ memberDeviceIds: [this._persisted?.sessions?.[convId]?.ownerDeviceId].filter(
75753
+ (d2) => typeof d2 === "string"
75754
+ )
75533
75755
  });
75534
75756
  if (done > 0) {
75535
75757
  console.log(`[SecureChannel] Fulfilled Welcome for ${req.requesting_device_id.slice(0, 8)} in conv ${convId.slice(0, 8)}`);
@@ -75587,192 +75809,8 @@ ${baseText}`;
75587
75809
  console.log(`[SecureChannel] ${pending.length} pending A2A Welcome requests for channel ${chId.slice(0, 8)}`);
75588
75810
  for (const req of pending) {
75589
75811
  try {
75590
- const kpRes = await fetch(
75591
- `${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
75592
- { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
75593
- );
75594
- if (!kpRes.ok) continue;
75595
- const kpData = await kpRes.json();
75596
- const kpHex = kpData[req.requesting_device_id];
75597
- if (!kpHex) continue;
75598
- const kpBytes = new Uint8Array(Buffer.from(kpHex, "hex"));
75599
- const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
75600
- console.log(`[SecureChannel] A2A addMembers for ${req.requesting_device_id.slice(0, 8)} group=${chState.mlsGroupId.slice(0, 8)} epoch=${mlsGroup.epoch}`);
75601
- let parentDigest = await this._readGroupHeadDigest(chState.mlsGroupId);
75602
- let commit;
75603
- let welcome;
75604
- try {
75605
- const result = await mlsGroup.addMembers([memberKp]);
75606
- commit = result.commit;
75607
- welcome = result.welcome;
75608
- } catch (addErr) {
75609
- const errMsg = addErr instanceof Error ? addErr.message : String(addErr);
75610
- if (errMsg.includes("already in the group")) {
75611
- console.log(`[SecureChannel] A2A member already in group \u2014 removing and re-adding ${req.requesting_device_id.slice(0, 8)}`);
75612
- const preRemoveState = JSON.stringify(mlsGroup.exportState());
75613
- let removeCommitPublished = false;
75614
- try {
75615
- const identityBytes = new TextEncoder().encode(req.requesting_device_id);
75616
- const leafIndex = mlsGroup.memberLeafIndex(identityBytes);
75617
- if (leafIndex === null) {
75618
- console.log(`[SecureChannel] A2A re-add: no leaf index for ${req.requesting_device_id.slice(0, 8)} \u2014 cannot remove`);
75619
- continue;
75620
- }
75621
- const removeResult = await mlsGroup.removeMember(leafIndex);
75622
- try {
75623
- const removeResp = await fetch(
75624
- `${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/distribute`,
75625
- {
75626
- method: "POST",
75627
- headers: { Authorization: `Bearer ${this._deviceJwt}`, "Content-Type": "application/json" },
75628
- body: JSON.stringify({
75629
- group_id: chState.mlsGroupId,
75630
- device_id: this._deviceId,
75631
- commit: Buffer.from(removeResult.commit).toString("hex"),
75632
- commit_epoch: Number(mlsGroup.epoch),
75633
- ...parentDigest ? { parent_digest: parentDigest } : {}
75634
- })
75635
- }
75636
- );
75637
- if (removeResp.ok) {
75638
- removeCommitPublished = true;
75639
- parentDigest = this._commitDigest(removeResult.commit);
75640
- } else {
75641
- const detail = await removeResp.text().catch(() => "");
75642
- console.warn(`[SecureChannel] A2A remove-commit distribute failed (${removeResp.status}): ${detail}`);
75643
- }
75644
- } catch (distErr) {
75645
- console.warn(`[SecureChannel] A2A remove-commit distribute network error:`, distErr);
75646
- }
75647
- if (!removeCommitPublished) {
75648
- mlsGroup.importState(JSON.parse(preRemoveState));
75649
- continue;
75650
- }
75651
- const kpRes2 = await fetch(
75652
- `${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
75653
- { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
75654
- );
75655
- if (kpRes2.ok) {
75656
- const kpData2 = await kpRes2.json();
75657
- const kpHex2 = kpData2[req.requesting_device_id];
75658
- if (kpHex2) {
75659
- const kpBytes2 = new Uint8Array(Buffer.from(kpHex2, "hex"));
75660
- const memberKp2 = MLSGroupManager.deserializeKeyPackage(kpBytes2);
75661
- const result2 = await mlsGroup.addMembers([memberKp2]);
75662
- commit = result2.commit;
75663
- welcome = result2.welcome;
75664
- } else {
75665
- console.log(`[SecureChannel] A2A re-add: no fresh KeyPackage for ${req.requesting_device_id.slice(0, 8)}`);
75666
- continue;
75667
- }
75668
- } else {
75669
- console.log(`[SecureChannel] A2A re-add: KeyPackage fetch failed (${kpRes2.status})`);
75670
- continue;
75671
- }
75672
- } catch (readdErr) {
75673
- console.log(`[SecureChannel] A2A remove+re-add FAILED: ${readdErr instanceof Error ? readdErr.message : String(readdErr)}`);
75674
- if (!removeCommitPublished) {
75675
- try {
75676
- mlsGroup.importState(JSON.parse(preRemoveState));
75677
- } catch {
75678
- }
75679
- }
75680
- continue;
75681
- }
75682
- } else {
75683
- console.log(`[SecureChannel] A2A addMembers FAILED: ${errMsg}`);
75684
- continue;
75685
- }
75686
- }
75687
- if (!welcome) {
75688
- console.warn(`[SecureChannel] A2A addMembers produced no Welcome for ${req.requesting_device_id.slice(0, 8)}`);
75689
- continue;
75690
- }
75691
- const commitHex = Buffer.from(commit).toString("hex");
75692
- const welcomeHex = Buffer.from(welcome).toString("hex");
75693
- let distributed = false;
75694
- const updatedMembers = [this._deviceId, req.requesting_device_id];
75695
- try {
75696
- const distResp = await fetch(
75697
- `${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/distribute`,
75698
- {
75699
- method: "POST",
75700
- headers: { Authorization: `Bearer ${this._deviceJwt}`, "Content-Type": "application/json" },
75701
- body: JSON.stringify({
75702
- group_id: chState.mlsGroupId,
75703
- device_id: this._deviceId,
75704
- commit: commitHex,
75705
- commit_epoch: Number(mlsGroup.epoch),
75706
- welcomes: [{ target_device_id: req.requesting_device_id, payload: welcomeHex }],
75707
- member_device_ids: updatedMembers,
75708
- ...parentDigest ? { parent_digest: parentDigest } : {}
75709
- })
75710
- }
75711
- );
75712
- if (distResp.ok) {
75713
- distributed = true;
75714
- } else {
75715
- const detail = await distResp.text().catch(() => "");
75716
- console.warn(`[SecureChannel] A2A distribute failed (${distResp.status}): ${detail}`);
75717
- }
75718
- } catch (distErr) {
75719
- console.warn(`[SecureChannel] A2A distribute network error:`, distErr);
75720
- }
75721
- if (!distributed && this._wsIsOpen()) {
75722
- const a2aLabel = `A2A ${chId.slice(0, 8)}`;
75723
- const commitSent = await this._sendFrameConfirmed({
75724
- event: "mls_commit",
75725
- data: {
75726
- group_id: chState.mlsGroupId,
75727
- epoch: Number(mlsGroup.epoch),
75728
- payload: commitHex,
75729
- ...parentDigest ? { parent_digest: parentDigest } : {}
75730
- }
75731
- }, `${a2aLabel} commit`);
75732
- const welcomeSent = commitSent && await this._sendFrameConfirmed({
75733
- event: "mls_welcome",
75734
- data: {
75735
- target_device_id: req.requesting_device_id,
75736
- group_id: chState.mlsGroupId,
75737
- a2a_channel_id: chId,
75738
- payload: welcomeHex
75739
- }
75740
- }, `${a2aLabel} welcome`);
75741
- if (!welcomeSent) {
75742
- console.warn(`[SecureChannel] ${a2aLabel}: Welcome frames were NOT written \u2014 leaving the request pending`);
75743
- continue;
75744
- }
75745
- try {
75746
- await fetch(
75747
- `${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/distribute`,
75748
- {
75749
- method: "POST",
75750
- headers: { Authorization: `Bearer ${this._deviceJwt}`, "Content-Type": "application/json" },
75751
- body: JSON.stringify({
75752
- group_id: chState.mlsGroupId,
75753
- device_id: this._deviceId,
75754
- commit_epoch: Number(mlsGroup.epoch),
75755
- member_device_ids: updatedMembers
75756
- })
75757
- }
75758
- );
75759
- } catch {
75760
- }
75761
- distributed = true;
75762
- }
75763
- if (!distributed) {
75764
- console.warn(`[SecureChannel] Cannot deliver Welcome \u2014 HTTP distribute and WS both unavailable`);
75765
- continue;
75766
- }
75767
- const a2aFulfilled = await this._postFulfilWelcome(
75768
- chState.mlsGroupId,
75769
- req.id,
75770
- `A2A ${chId.slice(0, 8)}`
75771
- );
75772
- await saveMlsState(this.config.dataDir, chState.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
75773
- if (a2aFulfilled) {
75774
- console.log(`[SecureChannel] Fulfilled A2A Welcome for ${req.requesting_device_id.slice(0, 8)} in channel ${chId.slice(0, 8)}`);
75775
- }
75812
+ const next = await this._fulfilA2AWelcome(chId, chState, mlsGroup, req);
75813
+ if (next === "stop") break;
75776
75814
  } catch (fulfillErr) {
75777
75815
  console.log(`[SecureChannel] A2A Welcome fulfill failed: ${fulfillErr instanceof Error ? fulfillErr.message : String(fulfillErr)}`);
75778
75816
  }
@@ -76043,6 +76081,227 @@ ${baseText}`;
76043
76081
  }
76044
76082
  }
76045
76083
  }
76084
+ /**
76085
+ * #1225: fulfil ONE pending A2A Welcome request — the `/distribute` path.
76086
+ * Extracted from the delivery pull so the in-flight slot (review F1) is held
76087
+ * for exactly this request and released on every exit. Returns "stop" when
76088
+ * nothing else on this channel can succeed this pull (review F2).
76089
+ */
76090
+ async _fulfilA2AWelcome(chId, chState, mlsGroup, req) {
76091
+ const a2aLabel = `A2A ${chId.slice(0, 8)}`;
76092
+ const preHead = await this._readGroupHead(chState.mlsGroupId);
76093
+ if (preHead.ok && preHead.epoch !== Number(mlsGroup.epoch)) {
76094
+ console.warn(
76095
+ `[SecureChannel] ${a2aLabel}: server head is at epoch ${preHead.epoch}, we are at ${Number(mlsGroup.epoch)} \u2014 NOT committing (it would be refused); resync catches up first`
76096
+ );
76097
+ await this._catchUpAfterPreflightSkip(chState.mlsGroupId, preHead.epoch, Number(mlsGroup.epoch), a2aLabel);
76098
+ return "stop";
76099
+ }
76100
+ const inFlight = this._reserveCommit(chState.mlsGroupId, a2aLabel);
76101
+ if (!inFlight) return "stop";
76102
+ try {
76103
+ const kpRes = await fetch(
76104
+ `${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
76105
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
76106
+ );
76107
+ if (!kpRes.ok) return "next";
76108
+ const kpData = await kpRes.json();
76109
+ const kpHex = kpData[req.requesting_device_id];
76110
+ if (!kpHex) return "next";
76111
+ const kpBytes = new Uint8Array(Buffer.from(kpHex, "hex"));
76112
+ const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
76113
+ console.log(`[SecureChannel] A2A addMembers for ${req.requesting_device_id.slice(0, 8)} group=${chState.mlsGroupId.slice(0, 8)} epoch=${mlsGroup.epoch}`);
76114
+ let parentDigest = preHead.ok ? preHead.digest : void 0;
76115
+ let commit;
76116
+ let welcome;
76117
+ let preAddState = mlsGroup.exportState();
76118
+ try {
76119
+ const result = await mlsGroup.addMembers([memberKp]);
76120
+ commit = result.commit;
76121
+ welcome = result.welcome;
76122
+ } catch (addErr) {
76123
+ const errMsg = addErr instanceof Error ? addErr.message : String(addErr);
76124
+ if (errMsg.includes("already in the group")) {
76125
+ console.log(`[SecureChannel] A2A member already in group \u2014 removing and re-adding ${req.requesting_device_id.slice(0, 8)}`);
76126
+ const preRemoveState = JSON.stringify(mlsGroup.exportState());
76127
+ let removeCommitPublished = false;
76128
+ try {
76129
+ const identityBytes = new TextEncoder().encode(req.requesting_device_id);
76130
+ const leafIndex = mlsGroup.memberLeafIndex(identityBytes);
76131
+ if (leafIndex === null) {
76132
+ console.log(`[SecureChannel] A2A re-add: no leaf index for ${req.requesting_device_id.slice(0, 8)} \u2014 cannot remove`);
76133
+ return "next";
76134
+ }
76135
+ const removeResult = await mlsGroup.removeMember(leafIndex);
76136
+ try {
76137
+ const removeResp = await fetch(
76138
+ `${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/distribute`,
76139
+ {
76140
+ method: "POST",
76141
+ headers: { Authorization: `Bearer ${this._deviceJwt}`, "Content-Type": "application/json" },
76142
+ body: JSON.stringify({
76143
+ group_id: chState.mlsGroupId,
76144
+ device_id: this._deviceId,
76145
+ commit: Buffer.from(removeResult.commit).toString("hex"),
76146
+ commit_epoch: Number(mlsGroup.epoch),
76147
+ expected_epoch: Number(mlsGroup.epoch) - 1,
76148
+ // #1225: exact-step, like the WS path
76149
+ ...parentDigest ? { parent_digest: parentDigest } : {}
76150
+ })
76151
+ }
76152
+ );
76153
+ if (removeResp.ok) {
76154
+ removeCommitPublished = true;
76155
+ await saveMlsState(this.config.dataDir, chState.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
76156
+ parentDigest = this._commitDigest(removeResult.commit);
76157
+ } else {
76158
+ const detail = await removeResp.text().catch(() => "");
76159
+ console.warn(`[SecureChannel] A2A remove-commit distribute failed (${removeResp.status}): ${detail}`);
76160
+ }
76161
+ } catch (distErr) {
76162
+ console.warn(`[SecureChannel] A2A remove-commit distribute network error:`, distErr);
76163
+ }
76164
+ if (!removeCommitPublished) {
76165
+ mlsGroup.importState(JSON.parse(preRemoveState));
76166
+ return "next";
76167
+ }
76168
+ const kpRes2 = await fetch(
76169
+ `${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
76170
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
76171
+ );
76172
+ if (kpRes2.ok) {
76173
+ const kpData2 = await kpRes2.json();
76174
+ const kpHex2 = kpData2[req.requesting_device_id];
76175
+ if (kpHex2) {
76176
+ const kpBytes2 = new Uint8Array(Buffer.from(kpHex2, "hex"));
76177
+ const memberKp2 = MLSGroupManager.deserializeKeyPackage(kpBytes2);
76178
+ preAddState = mlsGroup.exportState();
76179
+ const result2 = await mlsGroup.addMembers([memberKp2]);
76180
+ commit = result2.commit;
76181
+ welcome = result2.welcome;
76182
+ } else {
76183
+ console.log(`[SecureChannel] A2A re-add: no fresh KeyPackage for ${req.requesting_device_id.slice(0, 8)}`);
76184
+ return "next";
76185
+ }
76186
+ } else {
76187
+ console.log(`[SecureChannel] A2A re-add: KeyPackage fetch failed (${kpRes2.status})`);
76188
+ return "next";
76189
+ }
76190
+ } catch (readdErr) {
76191
+ console.log(`[SecureChannel] A2A remove+re-add FAILED: ${readdErr instanceof Error ? readdErr.message : String(readdErr)}`);
76192
+ if (!removeCommitPublished) {
76193
+ try {
76194
+ mlsGroup.importState(JSON.parse(preRemoveState));
76195
+ } catch {
76196
+ }
76197
+ }
76198
+ return "next";
76199
+ }
76200
+ } else {
76201
+ console.log(`[SecureChannel] A2A addMembers FAILED: ${errMsg}`);
76202
+ return "next";
76203
+ }
76204
+ }
76205
+ if (!welcome) {
76206
+ console.warn(`[SecureChannel] A2A addMembers produced no Welcome for ${req.requesting_device_id.slice(0, 8)}`);
76207
+ return "next";
76208
+ }
76209
+ const commitHex = Buffer.from(commit).toString("hex");
76210
+ const welcomeHex = Buffer.from(welcome).toString("hex");
76211
+ let distributed = false;
76212
+ let transportFailed = false;
76213
+ const updatedMembers = this._commitRoster([this._deviceId], [req.requesting_device_id]);
76214
+ try {
76215
+ const distResp = await fetch(
76216
+ `${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/distribute`,
76217
+ {
76218
+ method: "POST",
76219
+ headers: { Authorization: `Bearer ${this._deviceJwt}`, "Content-Type": "application/json" },
76220
+ body: JSON.stringify({
76221
+ group_id: chState.mlsGroupId,
76222
+ device_id: this._deviceId,
76223
+ commit: commitHex,
76224
+ commit_epoch: Number(mlsGroup.epoch),
76225
+ welcomes: [{ target_device_id: req.requesting_device_id, payload: welcomeHex }],
76226
+ member_device_ids: updatedMembers,
76227
+ expected_epoch: Number(mlsGroup.epoch) - 1,
76228
+ // #1225: exact-step, like the WS path
76229
+ ...parentDigest ? { parent_digest: parentDigest } : {}
76230
+ })
76231
+ }
76232
+ );
76233
+ if (distResp.ok) {
76234
+ distributed = true;
76235
+ } else {
76236
+ const detail = await distResp.text().catch(() => "");
76237
+ console.warn(`[SecureChannel] A2A distribute failed (${distResp.status}): ${detail}`);
76238
+ if (distResp.status >= 500) {
76239
+ transportFailed = true;
76240
+ } else if (distResp.status === 409) {
76241
+ mlsGroup.importState(preAddState);
76242
+ console.warn(
76243
+ `[SecureChannel] ${a2aLabel}: add commit lost the race (409) \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}, request stays pending`
76244
+ );
76245
+ return "next";
76246
+ } else {
76247
+ mlsGroup.importState(preAddState);
76248
+ console.error(
76249
+ `[SecureChannel] ${a2aLabel}: add commit refused with ${distResp.status} \u2014 rolled back to epoch ${Number(mlsGroup.epoch)}; not retrying this channel this pull`
76250
+ );
76251
+ return "stop";
76252
+ }
76253
+ }
76254
+ } catch (distErr) {
76255
+ console.warn(`[SecureChannel] A2A distribute network error:`, distErr);
76256
+ transportFailed = true;
76257
+ }
76258
+ if (!distributed && transportFailed && this._wsIsOpen()) {
76259
+ const verdict = await this._sendCommitConfirmed({
76260
+ mlsGroup,
76261
+ mlsGroupId: chState.mlsGroupId,
76262
+ label: a2aLabel,
76263
+ commit,
76264
+ epoch: Number(mlsGroup.epoch),
76265
+ parent: parentDigest,
76266
+ memberDeviceIds: updatedMembers,
76267
+ stateBefore: preAddState,
76268
+ inFlight
76269
+ });
76270
+ if (verdict !== "confirmed") return "next";
76271
+ const welcomeSent = await this._sendFrameConfirmed({
76272
+ event: "mls_welcome",
76273
+ data: {
76274
+ target_device_id: req.requesting_device_id,
76275
+ group_id: chState.mlsGroupId,
76276
+ a2a_channel_id: chId,
76277
+ payload: welcomeHex
76278
+ }
76279
+ }, `${a2aLabel} welcome`);
76280
+ if (!welcomeSent) {
76281
+ await saveMlsState(this.config.dataDir, chState.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
76282
+ console.warn(`[SecureChannel] ${a2aLabel}: Welcome frame was NOT written \u2014 leaving the request pending`);
76283
+ return "next";
76284
+ }
76285
+ distributed = true;
76286
+ }
76287
+ if (!distributed) {
76288
+ console.warn(`[SecureChannel] Cannot deliver Welcome \u2014 HTTP distribute and WS both unavailable`);
76289
+ return "next";
76290
+ }
76291
+ const a2aFulfilled = await this._postFulfilWelcome(
76292
+ chState.mlsGroupId,
76293
+ req.id,
76294
+ `A2A ${chId.slice(0, 8)}`
76295
+ );
76296
+ await saveMlsState(this.config.dataDir, chState.mlsGroupId, JSON.stringify(mlsGroup.exportState()));
76297
+ if (a2aFulfilled) {
76298
+ console.log(`[SecureChannel] Fulfilled A2A Welcome for ${req.requesting_device_id.slice(0, 8)} in channel ${chId.slice(0, 8)}`);
76299
+ }
76300
+ return "next";
76301
+ } finally {
76302
+ await this._releaseCommit(chState.mlsGroupId, inFlight, a2aLabel);
76303
+ }
76304
+ }
76046
76305
  /**
76047
76306
  * Found the MLS group for an A2A channel as the creator agent.
76048
76307
  * Calls /mls/a2a/{channelId}/init, creates the local MLS group, and sends
@@ -76085,48 +76344,77 @@ ${baseText}`;
76085
76344
  await saveMlsState(this.config.dataDir, mlsData.group_id, JSON.stringify(mgr.exportState()));
76086
76345
  for (const p2 of participants) {
76087
76346
  if (p2.status !== "active" && p2.status !== "invited") continue;
76347
+ const a2aLabel = `A2A ${channelId.slice(0, 8)} found\u2192${p2.hubAddress}`;
76088
76348
  try {
76089
- const kpRes = await fetch(
76090
- `${this.config.apiUrl}/api/v1/mls/key-packages?hub_id=${encodeURIComponent(p2.hubId)}`,
76091
- { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
76092
- );
76093
- if (kpRes.ok) {
76094
- const kpData = await kpRes.json();
76095
- if (kpData.key_package) {
76096
- const kpBytes = new Uint8Array(Buffer.from(kpData.key_package, "hex"));
76097
- const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
76098
- const { commit, welcome } = await mgr.addMembers([memberKp]);
76099
- if (welcome && this._ws) {
76100
- this._ws.send(JSON.stringify({
76101
- event: "mls_commit",
76349
+ if (!p2.deviceId) {
76350
+ console.warn(
76351
+ `[SecureChannel] ${a2aLabel}: no deviceId \u2014 NOT adding (a Welcome could not be addressed). Backend a2a_channel_approved payload may be missing device_id for this participant.`
76352
+ );
76353
+ continue;
76354
+ }
76355
+ if (!this._wsIsOpen()) {
76356
+ console.warn(`[SecureChannel] ${a2aLabel}: socket is not OPEN \u2014 NOT advancing the group`);
76357
+ continue;
76358
+ }
76359
+ const head = await this._readGroupHead(mlsData.group_id);
76360
+ if (head.ok && head.epoch !== Number(mgr.epoch)) {
76361
+ console.warn(`[SecureChannel] ${a2aLabel}: server head is at epoch ${head.epoch}, we are at ${Number(mgr.epoch)} \u2014 NOT committing`);
76362
+ await this._catchUpAfterPreflightSkip(mlsData.group_id, head.epoch, Number(mgr.epoch), a2aLabel);
76363
+ continue;
76364
+ }
76365
+ const inFlight = this._reserveCommit(mlsData.group_id, a2aLabel);
76366
+ if (!inFlight) continue;
76367
+ try {
76368
+ const kpRes = await fetch(
76369
+ `${this.config.apiUrl}/api/v1/mls/key-packages?hub_id=${encodeURIComponent(p2.hubId)}`,
76370
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
76371
+ );
76372
+ if (kpRes.ok) {
76373
+ const kpData = await kpRes.json();
76374
+ if (kpData.key_package) {
76375
+ const kpBytes = new Uint8Array(Buffer.from(kpData.key_package, "hex"));
76376
+ const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
76377
+ const stateBefore = mgr.exportState();
76378
+ const { commit, welcome } = await mgr.addMembers([memberKp]);
76379
+ const committedEpoch = Number(mgr.epoch);
76380
+ if (!welcome) {
76381
+ mgr.importState(stateBefore);
76382
+ console.warn(`[SecureChannel] ${a2aLabel}: addMembers produced no Welcome \u2014 rolled back`);
76383
+ continue;
76384
+ }
76385
+ const verdict = await this._sendCommitConfirmed({
76386
+ mlsGroup: mgr,
76387
+ mlsGroupId: mlsData.group_id,
76388
+ label: a2aLabel,
76389
+ commit,
76390
+ epoch: committedEpoch,
76391
+ parent: head.ok ? head.digest : void 0,
76392
+ memberDeviceIds: this._commitRoster(participants.map((q22) => q22.deviceId), [p2.deviceId]),
76393
+ stateBefore,
76394
+ inFlight
76395
+ });
76396
+ if (verdict !== "confirmed") continue;
76397
+ const sent = await this._sendFrameConfirmed({
76398
+ event: "mls_welcome",
76102
76399
  data: {
76103
76400
  group_id: mlsData.group_id,
76104
- epoch: Number(mgr.epoch),
76105
- payload: Buffer.from(commit).toString("hex")
76401
+ payload: Buffer.from(welcome).toString("hex"),
76402
+ target_device_id: p2.deviceId,
76403
+ a2a_channel_id: channelId,
76404
+ target_hub_id: p2.hubId
76405
+ // observability only — the backend ignores it
76106
76406
  }
76107
- }));
76108
- if (!p2.deviceId) {
76109
- console.warn(
76110
- `[SecureChannel] Skipping MLS Welcome to ${p2.hubAddress} for A2A ${channelId.slice(0, 8)}: no deviceId. Backend a2a_channel_approved payload may be missing device_id for this participant.`
76111
- );
76112
- } else {
76113
- this._ws.send(JSON.stringify({
76114
- event: "mls_welcome",
76115
- data: {
76116
- group_id: mlsData.group_id,
76117
- payload: Buffer.from(welcome).toString("hex"),
76118
- target_device_id: p2.deviceId,
76119
- a2a_channel_id: channelId,
76120
- // Kept for observability — backend ignores but it's
76121
- // useful in logs/wire captures to correlate to a hub.
76122
- target_hub_id: p2.hubId
76123
- }
76124
- }));
76407
+ }, `${a2aLabel} welcome`);
76408
+ await saveMlsState(this.config.dataDir, mlsData.group_id, JSON.stringify(mgr.exportState()));
76409
+ if (sent) {
76125
76410
  console.log(`[SecureChannel] Sent MLS Welcome to ${p2.hubAddress} (device ${p2.deviceId.slice(0, 8)}) for A2A ${channelId.slice(0, 8)}`);
76411
+ } else {
76412
+ console.warn(`[SecureChannel] ${a2aLabel}: Welcome was NOT written \u2014 the participant will request one`);
76126
76413
  }
76127
76414
  }
76128
- await saveMlsState(this.config.dataDir, mlsData.group_id, JSON.stringify(mgr.exportState()));
76129
76415
  }
76416
+ } finally {
76417
+ await this._releaseCommit(mlsData.group_id, inFlight, a2aLabel);
76130
76418
  }
76131
76419
  } catch (kpErr) {
76132
76420
  console.warn(`[SecureChannel] Failed to Welcome participant ${p2.hubAddress}:`, kpErr);
@@ -98196,7 +98484,7 @@ data:
98196
98484
  await init_skill_telemetry();
98197
98485
  await init_policy_enforcer();
98198
98486
  init_room_protocol();
98199
- VERSION = true ? "0.23.40" : "0.0.0-dev";
98487
+ VERSION = true ? "0.23.42" : "0.0.0-dev";
98200
98488
  }
98201
98489
  });
98202
98490
  await init_index();
@@ -99491,7 +99779,7 @@ function _makeOwesReply(agentName, channel, log) {
99491
99779
  );
99492
99780
  }
99493
99781
  return owesRoomReply(
99494
- e.plaintext,
99782
+ e.caption ?? e.plaintext,
99495
99783
  own,
99496
99784
  own,
99497
99785
  e.senderIsAgent,
@@ -99579,7 +99867,7 @@ function mkdir700(path2) {
99579
99867
  chmodSync5(path2, 448);
99580
99868
  }
99581
99869
  function packageVersion() {
99582
- return true ? "0.1.16" : void 0;
99870
+ return true ? "0.1.18" : void 0;
99583
99871
  }
99584
99872
  function helpText(version2) {
99585
99873
  return [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/muse-bridge",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
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",