@openclaw/matrix 2026.7.2-beta.7 → 2026.8.1-beta.2
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/{account-selection-kqquRzCf.js → account-selection-CWuhuFn1.js} +7 -8
- package/dist/{accounts-DfngqebB.js → accounts-BCzyubQt.js} +3 -3
- package/dist/api.js +7 -10
- package/dist/{approval-handler.runtime-DSeaIsGa.js → approval-handler.runtime-CJXCUdRg.js} +5 -5
- package/dist/{approval-ids-BdJGPAJT.js → approval-ids-7rf7etWE.js} +1 -1
- package/dist/{approval-reaction-auth-BjOpELxu.js → approval-reaction-auth-wBwbEDpZ.js} +2 -2
- package/dist/{approval-reactions-D-BxBK_L.js → approval-reactions-tXh9KYrW.js} +2 -8
- package/dist/auth-presence.js +2 -2
- package/dist/{channel-vj788dNZ.js → channel-VSrHgTON.js} +156 -136
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-CLoF2S9T.js → channel.runtime-pOOL0uT_.js} +70 -56
- package/dist/{config-schema-Djxw3C6b.js → channel.setup-PpxRP9Du.js} +50 -3
- package/dist/{cli-DMqfDE-q.js → cli-CkTfKC_c.js} +16 -16
- package/dist/{cli-metadata-C7D53SND.js → cli-metadata-B1d1aGM5.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/client-CeGw0G5S.js +784 -0
- package/dist/{client-bootstrap-XsIkHNt0.js → client-bootstrap-BFwT_2VT.js} +25 -61
- package/dist/{client-6eRENr7k.js → client-sJesKQmp.js} +4 -4
- package/dist/client-support-DLj4vDeu.js +93 -0
- package/dist/config-update-Bor_Pjsv.js +150 -0
- package/dist/contract-api.js +2 -2
- package/dist/{credentials-W2EmwRhu.js → credentials-BdAaWuiR.js} +2 -1
- package/dist/credentials-read-B37cQknZ.js +51 -0
- package/dist/credentials-state-B3cuUFwZ.js +27 -0
- package/dist/{credentials-write.runtime-Be9zNSUw.js → credentials-write.runtime-nAV2-5uR.js} +1 -1
- package/dist/{crypto-runtime-D9_6J5tZ.js → crypto-runtime-Bnz3zEcS.js} +55 -32
- package/dist/direct-room-RinHjtqX.js +71 -0
- package/dist/{directory-live-C8dVBiCc.js → directory-live-Bvg2wAnR.js} +1 -2
- package/dist/{doctor-CM8ijNpW.js → doctor-EWf9CDso.js} +2 -2
- package/dist/{doctor-contract-BMSJkkAE.js → doctor-contract-DEt4O4Zt.js} +2 -3
- package/dist/doctor-contract-api.js +202 -90
- package/dist/{draft-stream-CtvOXq0Z.js → draft-stream-BRi7PRRS.js} +20 -23
- package/dist/{encryption-guidance-CbEFe38F.js → encryption-guidance-DmLY8NiO.js} +1 -1
- package/dist/{env-auth-CQsYbz-p.js → env-auth-MVS-Vv41.js} +4 -3
- package/dist/{env-vars-B0NxQnPk.js → env-vars-dGqak9dN.js} +1 -1
- package/dist/{errors-C47hvAF8.js → errors-DKVS3_DO.js} +2 -5
- package/dist/{file-sync-store-DiiFsayX.js → file-sync-store-DjskBX2o.js} +24 -3
- package/dist/helper-api.js +2 -2
- package/dist/{idb-persistence-B6x7dMsF.js → idb-persistence-BM0P27Zg.js} +3 -2
- package/dist/{inbound-dedupe-CaBLblef.js → inbound-dedupe-RvSLqdsz.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{logger-D0GCSDQq.js → logger-B_71hN6W.js} +1 -1
- package/dist/{logging-DV-p52N0.js → logging-DRjvUOIh.js} +1 -1
- package/dist/{media-text-BTwzADS_.js → media-text-JudlYOSc.js} +1 -1
- package/dist/{messages-DxQJkhxs.js → messages-BW0s-6Y9.js} +7 -7
- package/dist/{monitor-VyWlSLwo.js → monitor-Ddfc-vjX.js} +394 -384
- package/dist/plugin-entry.handlers.runtime.js +3 -3
- package/dist/probe.runtime-Dr91B_X3.js +2 -0
- package/dist/profile-D-Wubo0A.js +108 -0
- package/dist/{profile-update-CffmyW_4.js → profile-update-BkgWYDIp.js} +3 -2
- package/dist/{reaction-events-B00WSi98.js → reaction-events-nfUbFLdV.js} +9 -6
- package/dist/{recovery-key-store-BNnHvXdk.js → recovery-key-store-CognuDys.js} +5 -4
- package/dist/{resolve-targets-nm2L48sh.js → resolve-targets-BJAPY4Vb.js} +1 -1
- package/dist/{resolver.runtime-DS6uPaEe.js → resolver.runtime-LWJELYq5.js} +1 -1
- package/dist/{room-info-CAFZ3Z9J.js → room-info-BXQA7y10.js} +12 -3
- package/dist/runtime-api.js +6 -3
- package/dist/{sdk-bUytQHx7.js → sdk-DjaQFCHc.js} +229 -120
- package/dist/{secret-contract-M3hRmGO-.js → secret-contract-CufozuyJ.js} +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-BldGYG8g.js → send-ZDLU4JTk.js} +1462 -1196
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-Deleiibz.js → setup-bootstrap-BaXkhgJg.js} +4 -4
- package/dist/{setup-core-BVfBv2ai.js → setup-core-DQn6b5vi.js} +17 -266
- package/dist/setup-plugin-api.js +1 -44
- package/dist/{setup-surface-BBq3WeqX.js → setup-surface-DlhJdrNI.js} +9 -11
- package/dist/{startup-verification-wm3_i88s.js → startup-verification-Cs08ca8u.js} +3 -3
- package/dist/{storage-BvAkgzvT.js → storage-BsGuHngK.js} +3 -3
- package/dist/{thread-bindings-DGbl3vDW.js → thread-bindings-CcHZP3w2.js} +7 -4
- package/dist/{tool-actions.runtime-uu9blSqO.js → tool-actions.runtime-DmdRL0bN.js} +35 -18
- package/dist/{verification-DYMQ1QpI.js → verification-C7ig-bQE.js} +2 -2
- package/openclaw.plugin.json +54 -1
- package/package.json +4 -4
- package/dist/active-client-DXvz2gCo.js +0 -20
- package/dist/client-Dbso3-0V.js +0 -30
- package/dist/create-client-BmSU-q-D.js +0 -61
- package/dist/credentials-read-DVmFCm7X.js +0 -77
- package/dist/exec-approval-resolver-BCgqRtZS.js +0 -16
- package/dist/preflight-audio.runtime-BZxxQsxY.js +0 -11
- package/dist/probe.runtime-BuieqmS3.js +0 -3
- package/dist/record-shared-CWWx6fvI.js +0 -2
- package/dist/shared-CUMWxcMz.js +0 -673
- package/dist/sync-state-CWbp0QSY.js +0 -12
- package/dist/{runtime-api-D1xI_cvh.js → runtime-api-BGO16Fu8.js} +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
|
|
2
1
|
import { t as ensureMatrixCryptoRuntime } from "./deps-CcVJfvRM.js";
|
|
3
|
-
import { n as LogService, r as noop } from "./logger-
|
|
4
|
-
import { i as restoreIdbFromDisk, n as persistIdbToDisk } from "./idb-persistence-
|
|
5
|
-
import { n as isRepairableSecretStorageAccessError } from "./recovery-key-store-
|
|
2
|
+
import { n as LogService, r as noop } from "./logger-B_71hN6W.js";
|
|
3
|
+
import { i as restoreIdbFromDisk, n as persistIdbToDisk } from "./idb-persistence-BM0P27Zg.js";
|
|
4
|
+
import { n as isRepairableSecretStorageAccessError } from "./recovery-key-store-CognuDys.js";
|
|
6
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
|
+
import { formatErrorMessage, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
7
7
|
import { resolveDateTimestampMs, resolveTimestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
8
8
|
import { MatrixEventEvent } from "matrix-js-sdk/lib/matrix.js";
|
|
9
9
|
import { IDBDatabase } from "fake-indexeddb";
|
|
@@ -199,7 +199,7 @@ var MatrixCryptoBootstrapper = class {
|
|
|
199
199
|
await this.trustFreshOwnIdentity(crypto);
|
|
200
200
|
} catch (repairErr) {
|
|
201
201
|
LogService.warn("MatrixClientLite", "Forced cross-signing reset failed:", repairErr);
|
|
202
|
-
if (options.strict) throw
|
|
202
|
+
if (options.strict) throw toStringifiedError(repairErr);
|
|
203
203
|
return {
|
|
204
204
|
ready: false,
|
|
205
205
|
published: false
|
|
@@ -210,7 +210,7 @@ var MatrixCryptoBootstrapper = class {
|
|
|
210
210
|
LogService.warn("MatrixClientLite", "Forced cross-signing reset failed:", err);
|
|
211
211
|
if (options.strict) {
|
|
212
212
|
if (isRepairableSecretStorageAccessError(err)) throw new Error("Forced cross-signing reset cannot access secret storage; restore the Matrix recovery key before retrying", { cause: err });
|
|
213
|
-
throw
|
|
213
|
+
throw toStringifiedError(err);
|
|
214
214
|
}
|
|
215
215
|
return {
|
|
216
216
|
ready: false,
|
|
@@ -245,7 +245,7 @@ var MatrixCryptoBootstrapper = class {
|
|
|
245
245
|
});
|
|
246
246
|
} catch (resetErr) {
|
|
247
247
|
LogService.warn("MatrixClientLite", "Failed to bootstrap cross-signing:", resetErr);
|
|
248
|
-
if (options.strict) throw
|
|
248
|
+
if (options.strict) throw toStringifiedError(resetErr);
|
|
249
249
|
return {
|
|
250
250
|
ready: false,
|
|
251
251
|
published: false
|
|
@@ -274,7 +274,7 @@ var MatrixCryptoBootstrapper = class {
|
|
|
274
274
|
await this.trustFreshOwnIdentity(crypto);
|
|
275
275
|
} catch (err) {
|
|
276
276
|
LogService.warn("MatrixClientLite", "Fallback cross-signing bootstrap failed:", err);
|
|
277
|
-
if (options.strict) throw
|
|
277
|
+
if (options.strict) throw toStringifiedError(err);
|
|
278
278
|
return {
|
|
279
279
|
ready: false,
|
|
280
280
|
published: false
|
|
@@ -298,7 +298,7 @@ var MatrixCryptoBootstrapper = class {
|
|
|
298
298
|
LogService.info("MatrixClientLite", "Secret storage bootstrap complete");
|
|
299
299
|
} catch (err) {
|
|
300
300
|
LogService.warn("MatrixClientLite", "Failed to bootstrap secret storage:", err);
|
|
301
|
-
if (options.strict) throw
|
|
301
|
+
if (options.strict) throw toStringifiedError(err);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
registerVerificationRequestHandler(crypto) {
|
|
@@ -354,15 +354,7 @@ function createMatrixCryptoFacade(deps) {
|
|
|
354
354
|
return {
|
|
355
355
|
prepare: async (_joinedRooms) => {},
|
|
356
356
|
updateSyncData: async (_toDeviceMessages, _otkCounts, _unusedFallbackKeyAlgs, _changedDeviceLists, _leftDeviceLists) => {},
|
|
357
|
-
isRoomEncrypted:
|
|
358
|
-
if (deps.client.getRoom(roomId)?.hasEncryptionStateEvent()) return true;
|
|
359
|
-
try {
|
|
360
|
-
const event = await deps.getRoomStateEvent(roomId, "m.room.encryption", "");
|
|
361
|
-
return typeof event.algorithm === "string" && event.algorithm.length > 0;
|
|
362
|
-
} catch {
|
|
363
|
-
return false;
|
|
364
|
-
}
|
|
365
|
-
},
|
|
357
|
+
isRoomEncrypted: deps.isRoomEncrypted,
|
|
366
358
|
requestOwnUserVerification: async () => {
|
|
367
359
|
const crypto = deps.client.getCrypto();
|
|
368
360
|
return await deps.verificationManager.requestOwnUserVerification(crypto);
|
|
@@ -457,6 +449,7 @@ function createMatrixCryptoFacade(deps) {
|
|
|
457
449
|
const MATRIX_DECRYPT_RETRY_BASE_DELAY_MS = 1500;
|
|
458
450
|
const MATRIX_DECRYPT_RETRY_MAX_DELAY_MS = 3e4;
|
|
459
451
|
const MATRIX_DECRYPT_RETRY_MAX_ATTEMPTS = 8;
|
|
452
|
+
const MATRIX_DECRYPT_DRAIN_TIMEOUT_MS = 5e3;
|
|
460
453
|
const MATRIX_DECRYPT_EXHAUSTED_RETRY_TTL_MS = 60 * 6e4;
|
|
461
454
|
const MATRIX_DECRYPT_EXHAUSTED_RETRY_MAX_ENTRIES = 512;
|
|
462
455
|
function resolveDecryptRetryKey(roomId, eventId) {
|
|
@@ -472,6 +465,7 @@ var MatrixDecryptBridge = class {
|
|
|
472
465
|
constructor(deps) {
|
|
473
466
|
this.deps = deps;
|
|
474
467
|
this.trackedEncryptedEvents = /* @__PURE__ */ new WeakSet();
|
|
468
|
+
this.pendingSdkDecryptions = /* @__PURE__ */ new Set();
|
|
475
469
|
this.decryptedMessageDedupe = /* @__PURE__ */ new Map();
|
|
476
470
|
this.decryptRetries = /* @__PURE__ */ new Map();
|
|
477
471
|
this.failedDecryptionsNotified = /* @__PURE__ */ new Set();
|
|
@@ -479,6 +473,7 @@ var MatrixDecryptBridge = class {
|
|
|
479
473
|
this.activeRetryRuns = 0;
|
|
480
474
|
this.retryIdleResolvers = /* @__PURE__ */ new Set();
|
|
481
475
|
this.cryptoRetrySignalsBound = false;
|
|
476
|
+
this.quiescing = false;
|
|
482
477
|
this.stopped = false;
|
|
483
478
|
}
|
|
484
479
|
shouldEmitUnencryptedMessage(roomId, eventId) {
|
|
@@ -489,9 +484,17 @@ var MatrixDecryptBridge = class {
|
|
|
489
484
|
return false;
|
|
490
485
|
}
|
|
491
486
|
attachEncryptedEvent(event, roomId) {
|
|
492
|
-
if (this.stopped) return;
|
|
487
|
+
if (this.quiescing || this.stopped) return;
|
|
493
488
|
if (this.trackedEncryptedEvents.has(event)) return;
|
|
494
489
|
this.trackedEncryptedEvents.add(event);
|
|
490
|
+
const sdkDecryption = event.getDecryptionPromise();
|
|
491
|
+
if (sdkDecryption) {
|
|
492
|
+
this.pendingSdkDecryptions.add(sdkDecryption);
|
|
493
|
+
const forgetSdkDecryption = () => {
|
|
494
|
+
this.pendingSdkDecryptions.delete(sdkDecryption);
|
|
495
|
+
};
|
|
496
|
+
sdkDecryption.then(forgetSdkDecryption, forgetSdkDecryption);
|
|
497
|
+
}
|
|
495
498
|
event.on(MatrixEventEvent.Decrypted, (decryptedEvent, err) => {
|
|
496
499
|
this.handleEncryptedEventDecrypted({
|
|
497
500
|
roomId,
|
|
@@ -510,7 +513,7 @@ var MatrixDecryptBridge = class {
|
|
|
510
513
|
}
|
|
511
514
|
}
|
|
512
515
|
retryPendingNow(reason, options) {
|
|
513
|
-
if (this.stopped) return;
|
|
516
|
+
if (this.quiescing || this.stopped) return;
|
|
514
517
|
if (options?.includeExhausted) {
|
|
515
518
|
this.pruneExhaustedDecryptRetries(Date.now());
|
|
516
519
|
for (const [retryKey, state] of this.exhaustedDecryptRetries) {
|
|
@@ -556,16 +559,33 @@ var MatrixDecryptBridge = class {
|
|
|
556
559
|
});
|
|
557
560
|
}
|
|
558
561
|
stop() {
|
|
562
|
+
this.quiescing = true;
|
|
559
563
|
this.stopped = true;
|
|
560
564
|
for (const retryKey of this.decryptRetries.keys()) this.clearDecryptRetry(retryKey);
|
|
565
|
+
this.pendingSdkDecryptions.clear();
|
|
561
566
|
this.exhaustedDecryptRetries.clear();
|
|
562
567
|
}
|
|
563
|
-
async drainPendingDecryptions(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
if (
|
|
568
|
+
async drainPendingDecryptions(_reason) {
|
|
569
|
+
this.quiescing = true;
|
|
570
|
+
const pendingSdkDecryptions = Array.from(this.pendingSdkDecryptions);
|
|
571
|
+
const pending = Array.from(this.decryptRetries.entries());
|
|
572
|
+
for (const [retryKey, state] of pending) {
|
|
573
|
+
if (state.timer) {
|
|
574
|
+
clearTimeout(state.timer);
|
|
575
|
+
state.timer = null;
|
|
576
|
+
}
|
|
577
|
+
if (!state.inFlight) this.runDecryptRetry(retryKey).catch(noop);
|
|
578
|
+
}
|
|
579
|
+
let timeout;
|
|
580
|
+
try {
|
|
581
|
+
await Promise.race([Promise.all([Promise.allSettled(pendingSdkDecryptions), this.waitForActiveRetryRunsToFinish()]), new Promise((_, reject) => {
|
|
582
|
+
timeout = setTimeout(() => {
|
|
583
|
+
reject(/* @__PURE__ */ new Error(`Matrix decryption drain did not finish within ${MATRIX_DECRYPT_DRAIN_TIMEOUT_MS}ms`));
|
|
584
|
+
}, MATRIX_DECRYPT_DRAIN_TIMEOUT_MS);
|
|
585
|
+
timeout.unref?.();
|
|
586
|
+
})]);
|
|
587
|
+
} finally {
|
|
588
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
569
589
|
}
|
|
570
590
|
}
|
|
571
591
|
handleEncryptedEventDecrypted(params) {
|
|
@@ -607,7 +627,7 @@ var MatrixDecryptBridge = class {
|
|
|
607
627
|
this.deps.emitFailedDecryption(roomId, event, error);
|
|
608
628
|
}
|
|
609
629
|
scheduleDecryptRetry(params) {
|
|
610
|
-
if (this.stopped) return;
|
|
630
|
+
if (this.quiescing || this.stopped) return;
|
|
611
631
|
const retryKey = resolveDecryptRetryKey(params.roomId, params.eventId);
|
|
612
632
|
if (!retryKey) return;
|
|
613
633
|
const existing = this.decryptRetries.get(retryKey);
|
|
@@ -670,7 +690,10 @@ var MatrixDecryptBridge = class {
|
|
|
670
690
|
this.resolveRetryIdleIfNeeded();
|
|
671
691
|
}
|
|
672
692
|
if (this.decryptRetries.get(retryKey) !== state) return;
|
|
673
|
-
if (this.stopped)
|
|
693
|
+
if (this.stopped || this.quiescing && state.event.isDecryptionFailure()) {
|
|
694
|
+
this.clearDecryptRetry(retryKey);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
674
697
|
if (state.event.isDecryptionFailure()) {
|
|
675
698
|
if (!shouldRetryDecryptionFailure(state.event)) {
|
|
676
699
|
this.clearDecryptRetry(retryKey);
|
|
@@ -898,7 +921,7 @@ var MatrixVerificationManager = class {
|
|
|
898
921
|
this.touchVerificationSession(session);
|
|
899
922
|
}).catch((err) => {
|
|
900
923
|
session.acceptRequested = false;
|
|
901
|
-
session.error =
|
|
924
|
+
session.error = formatErrorMessage(err);
|
|
902
925
|
this.touchVerificationSession(session);
|
|
903
926
|
});
|
|
904
927
|
}
|
|
@@ -947,7 +970,7 @@ var MatrixVerificationManager = class {
|
|
|
947
970
|
});
|
|
948
971
|
verifier.on(VerifierEvent.Cancel, (err) => {
|
|
949
972
|
this.clearSasAutoConfirmTimer(session);
|
|
950
|
-
session.error =
|
|
973
|
+
session.error = formatErrorMessage(err);
|
|
951
974
|
this.touchVerificationSession(session);
|
|
952
975
|
});
|
|
953
976
|
this.ensureVerificationStarted(session);
|
|
@@ -965,7 +988,7 @@ var MatrixVerificationManager = class {
|
|
|
965
988
|
this.confirmSasForSession(session, callbacks, { trustOwnDevice: true }).then(() => {
|
|
966
989
|
this.touchVerificationSession(session);
|
|
967
990
|
}).catch((err) => {
|
|
968
|
-
session.error =
|
|
991
|
+
session.error = formatErrorMessage(err);
|
|
969
992
|
this.touchVerificationSession(session);
|
|
970
993
|
});
|
|
971
994
|
}, SAS_AUTO_CONFIRM_DELAY_MS);
|
|
@@ -980,7 +1003,7 @@ var MatrixVerificationManager = class {
|
|
|
980
1003
|
session.verifyPromise = session.activeVerifier.verify().then(() => {
|
|
981
1004
|
this.touchVerificationSession(session);
|
|
982
1005
|
}).catch((err) => {
|
|
983
|
-
session.error =
|
|
1006
|
+
session.error = formatErrorMessage(err);
|
|
984
1007
|
this.touchVerificationSession(session);
|
|
985
1008
|
});
|
|
986
1009
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
//#region extensions/matrix/src/matrix/direct-room.ts
|
|
4
|
+
var direct_room_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
hasDirectMatrixMemberFlag: () => hasDirectMatrixMemberFlag,
|
|
6
|
+
inspectMatrixDirectRoomEvidence: () => inspectMatrixDirectRoomEvidence,
|
|
7
|
+
isStrictDirectMembership: () => isStrictDirectMembership,
|
|
8
|
+
isStrictDirectRoom: () => isStrictDirectRoom,
|
|
9
|
+
readJoinedMatrixMembers: () => readJoinedMatrixMembers
|
|
10
|
+
});
|
|
11
|
+
function normalizeJoinedMatrixMembers(joinedMembers) {
|
|
12
|
+
if (!Array.isArray(joinedMembers)) return [];
|
|
13
|
+
return joinedMembers.map((entry) => normalizeNullableString(entry)).filter((entry) => Boolean(entry));
|
|
14
|
+
}
|
|
15
|
+
function isStrictDirectMembership(params) {
|
|
16
|
+
const selfUserId = normalizeNullableString(params.selfUserId);
|
|
17
|
+
const remoteUserId = normalizeNullableString(params.remoteUserId);
|
|
18
|
+
const joinedMembers = params.joinedMembers ?? [];
|
|
19
|
+
return Boolean(selfUserId && remoteUserId && joinedMembers.length === 2 && joinedMembers.includes(selfUserId) && joinedMembers.includes(remoteUserId));
|
|
20
|
+
}
|
|
21
|
+
async function readJoinedMatrixMembers(client, roomId) {
|
|
22
|
+
try {
|
|
23
|
+
return normalizeJoinedMatrixMembers(await client.getJoinedRoomMembers(roomId));
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function hasDirectMatrixMemberFlag(client, roomId, userId) {
|
|
29
|
+
const normalizedUserId = normalizeNullableString(userId);
|
|
30
|
+
if (!normalizedUserId) return null;
|
|
31
|
+
try {
|
|
32
|
+
const state = await client.getRoomStateEvent(roomId, "m.room.member", normalizedUserId);
|
|
33
|
+
if (state?.is_direct === true) return true;
|
|
34
|
+
if (state?.is_direct === false) return false;
|
|
35
|
+
return null;
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function inspectMatrixDirectRoomEvidence(params) {
|
|
41
|
+
const selfUserId = params.selfUserId !== void 0 ? normalizeNullableString(params.selfUserId) : normalizeNullableString(await params.client.getUserId().catch(() => null));
|
|
42
|
+
const joinedMembers = await readJoinedMatrixMembers(params.client, params.roomId);
|
|
43
|
+
const strict = isStrictDirectMembership({
|
|
44
|
+
selfUserId,
|
|
45
|
+
remoteUserId: params.remoteUserId,
|
|
46
|
+
joinedMembers
|
|
47
|
+
});
|
|
48
|
+
if (!strict) return {
|
|
49
|
+
joinedMembers,
|
|
50
|
+
strict: false,
|
|
51
|
+
viaMemberState: false,
|
|
52
|
+
memberStateFlag: null
|
|
53
|
+
};
|
|
54
|
+
const memberStateFlag = await hasDirectMatrixMemberFlag(params.client, params.roomId, selfUserId);
|
|
55
|
+
return {
|
|
56
|
+
joinedMembers,
|
|
57
|
+
strict,
|
|
58
|
+
viaMemberState: memberStateFlag === true,
|
|
59
|
+
memberStateFlag
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async function isStrictDirectRoom(params) {
|
|
63
|
+
return (await inspectMatrixDirectRoomEvidence({
|
|
64
|
+
client: params.client,
|
|
65
|
+
roomId: params.roomId,
|
|
66
|
+
remoteUserId: params.remoteUserId,
|
|
67
|
+
selfUserId: params.selfUserId
|
|
68
|
+
})).strict;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { isStrictDirectRoom as a, isStrictDirectMembership as i, hasDirectMatrixMemberFlag as n, readJoinedMatrixMembers as o, inspectMatrixDirectRoomEvidence as r, direct_room_exports as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { n as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-B-5aQxwn.js";
|
|
3
|
-
import {
|
|
4
|
-
import "./client-Dbso3-0V.js";
|
|
3
|
+
import { c as resolveMatrixAuth } from "./client-CeGw0G5S.js";
|
|
5
4
|
import { t as MatrixAuthedHttpClient } from "./http-client-CycYxU9-.js";
|
|
6
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
6
|
//#region extensions/matrix/src/directory-live.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
2
|
-
import { detectPluginInstallPathIssue, formatPluginInstallPathIssue, removePluginFromConfig } from "openclaw/plugin-sdk/runtime
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DEt4O4Zt.js";
|
|
2
|
+
import { detectPluginInstallPathIssue, formatPluginInstallPathIssue, removePluginFromConfig } from "openclaw/plugin-sdk/doctor-repair-runtime";
|
|
3
3
|
//#region extensions/matrix/src/doctor.ts
|
|
4
4
|
async function collectMatrixInstallPathWarnings(cfg) {
|
|
5
5
|
const issue = await detectPluginInstallPathIssue({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineChannelAliasMigration, defineKeyMoveMigration, hasLegacyAccountStreamingAliases, normalizeChannelConfigEntries, stripRetiredChannelKeys } from "openclaw/plugin-sdk/runtime-doctor";
|
|
3
|
-
import { hasLegacyFlatAllowPrivateNetworkAlias, migrateLegacyFlatAllowPrivateNetworkAlias } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
1
|
+
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { defineChannelAliasMigration, defineKeyMoveMigration, hasLegacyAccountStreamingAliases, hasLegacyFlatAllowPrivateNetworkAlias, migrateLegacyFlatAllowPrivateNetworkAlias, normalizeChannelConfigEntries, stripRetiredChannelKeys } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
4
3
|
//#region extensions/matrix/src/doctor-contract.ts
|
|
5
4
|
function parseMatrixStreamingMode(value) {
|
|
6
5
|
if (typeof value !== "string") return null;
|