@openclaw/matrix 2026.10.10-beta.4 → 2026.10.10
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/.setup/{account-config-CRsKoMqJ.mjs → account-config-CVM2a28p.mjs} +1 -2
- package/dist/.setup/{account-selection-Bs_jCAaG.mjs → account-selection-Co94mKNj.mjs} +5 -8
- package/dist/.setup/{approval-handler.runtime-CsqMdj7h.mjs → approval-handler.runtime-DtNvJpfB.mjs} +8 -9
- package/dist/.setup/{approval-reactions-D2pEUrFS.mjs → approval-reactions-DMDBJos0.mjs} +2 -3
- package/dist/.setup/{backup-health-Dm_YMVFT.mjs → backup-health-BxH69np2.mjs} +1 -2
- package/dist/.setup/{channel-Dw4_imdd.mjs → channel-CNjJyBS_.mjs} +29 -43
- package/dist/.setup/{channel.runtime-2EEtIlyu.mjs → channel.runtime-DaGbm27q.mjs} +8 -10
- package/dist/.setup/{channel.setup-Be8TYKMA.mjs → channel.setup-IjRB0ymg.mjs} +7 -11
- package/dist/.setup/{cli-CEmWh7wh.mjs → cli-CuEJNM3c.mjs} +28 -39
- package/dist/.setup/{cli-metadata-CBLGwJT6.mjs → cli-metadata-rWmD_rzx.mjs} +3 -5
- package/dist/.setup/{client-C4Gibhzl.mjs → client-7eyTX0cu.mjs} +19 -25
- package/dist/.setup/{client-BKiiI29H.mjs → client-CV0MkCZG.mjs} +4 -5
- package/dist/.setup/{client-bootstrap-kOIDV4z_.mjs → client-bootstrap-BjcmTmyR.mjs} +2 -3
- package/dist/.setup/{client-support-D-xHScuo.mjs → client-support-CFofPPPm.mjs} +3 -5
- package/dist/.setup/{config-paths-CnREYb1Y.mjs → config-paths-DBpHxDyc.mjs} +1 -2
- package/dist/.setup/{create-client-BS8UYx6N.mjs → create-client-C4Lnqs2C.mjs} +8 -9
- package/dist/.setup/{credentials-CPnJZaZB.mjs → credentials-B0vpXvcB.mjs} +5 -6
- package/dist/.setup/{credentials-read-D2ULV55A.mjs → credentials-read-WCQSEvI8.mjs} +5 -6
- package/dist/.setup/{credentials-state-B3cuUFwZ.mjs → credentials-state-jxq29yQw.mjs} +1 -2
- package/dist/.setup/{crypto-node.runtime-6Aj_ltHQ.mjs → crypto-node.runtime-E_hqXGxm.mjs} +1 -2
- package/dist/.setup/{crypto-runtime-D8yY7kjD.mjs → crypto-runtime-Crp1is7m.mjs} +12 -19
- package/dist/.setup/{crypto-state-store-D4wrCvFs.mjs → crypto-state-store-CM57gchf.mjs} +3 -4
- package/dist/.setup/{crypto-store-ownership-Z_Y5WRKr.mjs → crypto-store-ownership-Bratn-Np.mjs} +3 -4
- package/dist/.setup/{crypto-unsafe-state-doctor-C8szCYmf.mjs → crypto-unsafe-state-doctor-Brv4bIyx.mjs} +7 -8
- package/dist/.setup/{deps-L_1bUAGL.mjs → deps-O7rEnklr.mjs} +1 -2
- package/dist/.setup/{device-health-Be60VF1w.mjs → device-health-DnKAXW1v.mjs} +2 -3
- package/dist/.setup/{direct-management-B3wYhx_M.mjs → direct-management-DDaWVbQI.mjs} +7 -11
- package/dist/.setup/{directory-live-BpSz-FQB.mjs → directory-live-B-csizuK.mjs} +5 -6
- package/dist/.setup/{doctor-contract-CsTNmbMa.mjs → doctor-contract-DybEjJcd.mjs} +6 -12
- package/dist/.setup/{draft-stream-DYf0th1n.mjs → draft-stream-dmhBHufd.mjs} +4 -4
- package/dist/.setup/{encryption-guidance-D5_IsDIy.mjs → encryption-guidance-Cn6-Tlx0.mjs} +3 -4
- package/dist/.setup/{env-vars-aEBngJPa.mjs → env-vars-Bh1iOXJ1.mjs} +1 -2
- package/dist/.setup/{errors-Bw4EHwKX.mjs → errors-CL3YJV8U.mjs} +1 -2
- package/dist/.setup/{event-helpers-CxNgMQqH.mjs → event-helpers-DDUjVVf7.mjs} +1 -2
- package/dist/.setup/{exec-approvals-DaM-5OA5.mjs → exec-approvals-D7vv3AZS.mjs} +6 -9
- package/dist/.setup/{file-sync-store-CUH8EAJq.mjs → file-sync-store-q5KCV2Lp.mjs} +5 -6
- package/dist/.setup/{http-client-ByR4STVQ.mjs → http-client-CxTmU1kT.mjs} +4 -7
- package/dist/.setup/{idb-persistence-BHTYPRe_.mjs → idb-persistence-BF0MZglD.mjs} +6 -7
- package/dist/.setup/{idb-persistence-lock-Bh3ZLIsE.mjs → idb-persistence-lock-CH2K6d_3.mjs} +1 -2
- package/dist/.setup/{inbound-dedupe-C-EBGY0B.mjs → inbound-dedupe-CZnOq0ja.mjs} +2 -3
- package/dist/.setup/{joined-room-encryption-BAD70N5n.mjs → joined-room-encryption-Dl7Sb9FF.mjs} +2 -3
- package/dist/.setup/{logger-CXQnpXCt.mjs → logger-BX5kXvh1.mjs} +2 -3
- package/dist/.setup/{logging-BKV8TYQq.mjs → logging-BLcaOSRD.mjs} +3 -4
- package/dist/.setup/{messages-_XHVg3do.mjs → messages-BiHM0DM3.mjs} +9 -14
- package/dist/.setup/{monitor-DRUSJ_Ev.mjs → monitor-CPwDgRFY.mjs} +88 -96
- package/dist/.setup/{onboarding-CK9Ksgio.mjs → onboarding-DiVtpjNu.mjs} +10 -11
- package/dist/.setup/{outbound-D5Z_4FBg.mjs → outbound-DwP97VpQ.mjs} +3 -4
- package/dist/.setup/{profile-update--Pf3jCXD.mjs → profile-update-DnNA9mEa.mjs} +6 -8
- package/dist/.setup/{reaction-events-BG9spedG.mjs → reaction-events-ClY9h_FC.mjs} +8 -9
- package/dist/.setup/{resolve-targets-BJ5sIKeM.mjs → resolve-targets-B8PAwHVS.mjs} +4 -5
- package/dist/.setup/{retired-state-DOCruzWd.mjs → retired-state-vIr2IB90.mjs} +4 -7
- package/dist/.setup/{room-info-BE7bbX_c.mjs → room-info-T_PR_liR.mjs} +6 -8
- package/dist/.setup/{runtime-1kn1P6io.mjs → runtime-Ck8TjD7L.mjs} +1 -2
- package/dist/.setup/{runtime-setter-api-i2MOXoT3.mjs → runtime-setter-api-CpwhcBQK.mjs} +1 -1
- package/dist/.setup/{sdk-ByU8So5S.mjs → sdk-Cj3ggJHG.mjs} +32 -47
- package/dist/.setup/{secret-contract-DxyzKSzf.mjs → secret-contract-AKnr45nw.mjs} +2 -3
- package/dist/.setup/{secret-contract-api-Dukgvike.mjs → secret-contract-api-DMSwMIxd.mjs} +1 -1
- package/dist/.setup/{send-BprM-Wmx.mjs → send-C1qeMQAy.mjs} +25 -42
- package/dist/.setup/{send-currentness-C2rMVVIQ.mjs → send-currentness-CAUVR-f3.mjs} +2 -4
- package/dist/.setup/{setup-bootstrap-DmznRqYe.mjs → setup-bootstrap-DDhwWvDs.mjs} +4 -5
- package/dist/.setup/{setup-core-DcCk1_Tv.mjs → setup-core-D2r4BivQ.mjs} +13 -20
- package/dist/.setup/setup-plugin-api-SO1hdrsT.mjs +2 -0
- package/dist/.setup/{startup-verification-UU8DUvi4.mjs → startup-verification-B3LEbW33.mjs} +4 -5
- package/dist/.setup/{state-layout-walk-BQMgMykU.mjs → state-layout-walk-BqCZTHpp.mjs} +2 -3
- package/dist/.setup/{storage-l8V0XsGM.mjs → storage-CxN4jqKI.mjs} +7 -9
- package/dist/.setup/{storage-paths-B51JM-pC.mjs → storage-paths-e_Vq6cvw.mjs} +1 -2
- package/dist/.setup/{subagent-hooks-CSY4iwa_.mjs → subagent-hooks-CT-rdJmh.mjs} +2 -3
- package/dist/.setup/{sync-cache-state-Cnm4TCEI.mjs → sync-cache-state-qYrd2EEh.mjs} +3 -4
- package/dist/.setup/{target-ids-HhcaKX1n.mjs → target-ids-DltG_ZHJ.mjs} +1 -2
- package/dist/.setup/{thread-binding-api-BvuaKpd0.mjs → thread-binding-api-OtSciHmZ.mjs} +2 -3
- package/dist/.setup/{thread-bindings-rrwQAS6R.mjs → thread-bindings-D2ZR6mEZ.mjs} +7 -9
- package/dist/.setup/{thread-bindings-shared-CPjUA0Ib.mjs → thread-bindings-shared-FMu_szTm.mjs} +1 -2
- package/dist/.setup/{tool-actions-DBrk6Yei.mjs → tool-actions-CdKa0DC4.mjs} +18 -23
- package/dist/.setup/{url-validation-CF6pG6eE.mjs → url-validation-C77p4qT9.mjs} +1 -2
- package/dist/.setup/{verification--qUbmRd-.mjs → verification-jP3tm-xD.mjs} +4 -5
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +2 -3
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +13 -16
- package/dist/helper-api.js +3 -3
- package/dist/index.js +3 -4
- package/dist/plugin-entry.handlers.runtime.js +3 -4
- package/dist/runtime-api.js +7 -8
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +4 -5
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/utils.js +3 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +7 -1
- package/node_modules/matrix-js-sdk/src/http-api/utils.ts +5 -1
- package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +7 -1
- package/package.json +4 -4
- package/dist/.setup/setup-plugin-api-BU6UGksW.mjs +0 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
2
|
-
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-
|
|
3
|
-
import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-
|
|
4
|
-
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-
|
|
5
|
-
import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-
|
|
6
|
-
import { n as isMatrixQualifiedUserId, r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-
|
|
7
|
-
import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-
|
|
8
|
-
import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers, v as RelationType } from "./direct-management-
|
|
9
|
-
import { _ as isPollEventType, c as formatMatrixMessageText, d as resolveMatrixReplacementContent, h as formatPollAsText, l as isLikelyBareFilename, r as sendMessageMatrix, u as resolveMatrixMessageAttachment, v as isPollStartType, w as setBoundedMap, y as parsePollStart } from "./send-
|
|
10
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-
|
|
11
|
-
import { a as isMatrixStartupAbortError, c as getMatrixMonitorTaskSignal, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as createMatrixMonitorTaskRunner, u as resolveMatrixAuth } from "./client-
|
|
12
|
-
import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-
|
|
13
|
-
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-
|
|
14
|
-
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-
|
|
15
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
16
|
-
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-
|
|
17
|
-
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-
|
|
18
|
-
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-
|
|
19
|
-
import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-Ck8TjD7L.mjs";
|
|
2
|
+
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CVM2a28p.mjs";
|
|
3
|
+
import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-D2r4BivQ.mjs";
|
|
4
|
+
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-CNjJyBS_.mjs";
|
|
5
|
+
import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-IjRB0ymg.mjs";
|
|
6
|
+
import { n as isMatrixQualifiedUserId, r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-DltG_ZHJ.mjs";
|
|
7
|
+
import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-CAUVR-f3.mjs";
|
|
8
|
+
import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers, v as RelationType } from "./direct-management-DDaWVbQI.mjs";
|
|
9
|
+
import { _ as isPollEventType, c as formatMatrixMessageText, d as resolveMatrixReplacementContent, h as formatPollAsText, l as isLikelyBareFilename, r as sendMessageMatrix, u as resolveMatrixMessageAttachment, v as isPollStartType, w as setBoundedMap, y as parsePollStart } from "./send-C1qeMQAy.mjs";
|
|
10
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-D2ZR6mEZ.mjs";
|
|
11
|
+
import { a as isMatrixStartupAbortError, c as getMatrixMonitorTaskSignal, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as createMatrixMonitorTaskRunner, u as resolveMatrixAuth } from "./client-7eyTX0cu.mjs";
|
|
12
|
+
import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-BiHM0DM3.mjs";
|
|
13
|
+
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-CxTmU1kT.mjs";
|
|
14
|
+
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-DwP97VpQ.mjs";
|
|
15
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-B8PAwHVS.mjs";
|
|
16
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-Cn6-Tlx0.mjs";
|
|
17
|
+
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-CZnOq0ja.mjs";
|
|
18
|
+
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-CFofPPPm.mjs";
|
|
19
|
+
import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-T_PR_liR.mjs";
|
|
20
20
|
import { channelBlockedPatch, channelReadyPatch, channelStoppedPatch, createTransportActivityStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
21
21
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
22
22
|
import { createChannelDeliveryAccumulator, createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, createReplyPrefixOptions, createTypingCallbacks, logTypingFailure, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -50,7 +50,7 @@ import { createChannelPreflightAudio, formatAudioTranscriptForAgent } from "open
|
|
|
50
50
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
51
51
|
import { buildInboundHistoryFromEntries } from "openclaw/plugin-sdk/reply-history";
|
|
52
52
|
import { decodeHtmlEntities } from "openclaw/plugin-sdk/html-entity-runtime";
|
|
53
|
-
|
|
53
|
+
// extensions/matrix/src/matrix/monitor/auto-join.ts
|
|
54
54
|
function registerMatrixAutoJoin(params) {
|
|
55
55
|
const { client, accountConfig, runtime } = params;
|
|
56
56
|
const core = getMatrixRuntime();
|
|
@@ -109,8 +109,7 @@ function registerMatrixAutoJoin(params) {
|
|
|
109
109
|
client.off("room.invite", onInvite);
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
//#region extensions/matrix/src/matrix/monitor/config.ts
|
|
112
|
+
// extensions/matrix/src/matrix/monitor/config.ts
|
|
114
113
|
function normalizeMatrixUserLookupEntry(raw) {
|
|
115
114
|
return raw.replace(/^matrix:/i, "").replace(/^user:/i, "").trim();
|
|
116
115
|
}
|
|
@@ -400,8 +399,7 @@ async function resolveMatrixMonitorConfig(params) {
|
|
|
400
399
|
roomsConfig
|
|
401
400
|
};
|
|
402
401
|
}
|
|
403
|
-
|
|
404
|
-
//#region extensions/matrix/src/matrix/monitor/direct.ts
|
|
402
|
+
// extensions/matrix/src/matrix/monitor/direct.ts
|
|
405
403
|
const DM_CACHE_TTL_MS = 3e4;
|
|
406
404
|
const RECENT_INVITE_TTL_MS = 3e4;
|
|
407
405
|
const MAX_DM_ROOMS = 1024;
|
|
@@ -597,8 +595,7 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
597
595
|
}
|
|
598
596
|
};
|
|
599
597
|
}
|
|
600
|
-
|
|
601
|
-
//#region extensions/matrix/src/matrix/monitor/types.ts
|
|
598
|
+
// extensions/matrix/src/matrix/monitor/types.ts
|
|
602
599
|
const EventType = {
|
|
603
600
|
RoomMessage: "m.room.message",
|
|
604
601
|
RoomMessageEncrypted: "m.room.encrypted",
|
|
@@ -606,8 +603,7 @@ const EventType = {
|
|
|
606
603
|
Location: "m.location",
|
|
607
604
|
Reaction: MATRIX_REACTION_EVENT_TYPE
|
|
608
605
|
};
|
|
609
|
-
|
|
610
|
-
//#region extensions/matrix/src/matrix/monitor/access-state.ts
|
|
606
|
+
// extensions/matrix/src/matrix/monitor/access-state.ts
|
|
611
607
|
function normalizeMatrixEntry(raw) {
|
|
612
608
|
return normalizeMatrixAllowList([raw ?? ""])[0] ?? null;
|
|
613
609
|
}
|
|
@@ -713,8 +709,7 @@ async function resolveMatrixMonitorCommandAccess(state, params) {
|
|
|
713
709
|
}
|
|
714
710
|
})).commandAccess;
|
|
715
711
|
}
|
|
716
|
-
|
|
717
|
-
//#region extensions/matrix/src/matrix/monitor/verification-utils.ts
|
|
712
|
+
// extensions/matrix/src/matrix/monitor/verification-utils.ts
|
|
718
713
|
const VERIFICATION_EVENT_PREFIX = "m.key.verification.";
|
|
719
714
|
const VERIFICATION_REQUEST_MSGTYPE = "m.key.verification.request";
|
|
720
715
|
const VERIFICATION_NOTICE_PREFIXES = [
|
|
@@ -742,12 +737,11 @@ const matrixVerificationConstants = {
|
|
|
742
737
|
eventPrefix: VERIFICATION_EVENT_PREFIX,
|
|
743
738
|
requestMsgtype: VERIFICATION_REQUEST_MSGTYPE
|
|
744
739
|
};
|
|
745
|
-
|
|
746
|
-
//#region extensions/matrix/src/matrix/monitor/verification-events.ts
|
|
740
|
+
// extensions/matrix/src/matrix/monitor/verification-events.ts
|
|
747
741
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
748
742
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
749
743
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
750
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-
|
|
744
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-DDaWVbQI.mjs").then((n) => n.t), import("./direct-management-DDaWVbQI.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
|
|
751
745
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
752
746
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
753
747
|
})));
|
|
@@ -1045,8 +1039,7 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
1045
1039
|
routeVerificationSummary
|
|
1046
1040
|
};
|
|
1047
1041
|
}
|
|
1048
|
-
|
|
1049
|
-
//#region extensions/matrix/src/matrix/monitor/events.ts
|
|
1042
|
+
// extensions/matrix/src/matrix/monitor/events.ts
|
|
1050
1043
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS = 12e4;
|
|
1051
1044
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_THRESHOLD = 3;
|
|
1052
1045
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT = 3;
|
|
@@ -1346,8 +1339,7 @@ function registerMatrixMonitorEvents(params) {
|
|
|
1346
1339
|
client.off("room.event", onRoomEvent);
|
|
1347
1340
|
};
|
|
1348
1341
|
}
|
|
1349
|
-
|
|
1350
|
-
//#region extensions/matrix/src/matrix/monitor/context-summary.ts
|
|
1342
|
+
// extensions/matrix/src/matrix/monitor/context-summary.ts
|
|
1351
1343
|
const MAX_CONTEXT_BODY_LENGTH = 500;
|
|
1352
1344
|
function truncateMatrixContextBody(value) {
|
|
1353
1345
|
if (value.length <= MAX_CONTEXT_BODY_LENGTH) return value;
|
|
@@ -1365,8 +1357,7 @@ function summarizeMatrixMessageContextEvent(event) {
|
|
|
1365
1357
|
msgtype: normalizeOptionalString(content.msgtype)
|
|
1366
1358
|
});
|
|
1367
1359
|
}
|
|
1368
|
-
|
|
1369
|
-
//#region extensions/matrix/src/matrix/monitor/event-context.ts
|
|
1360
|
+
// extensions/matrix/src/matrix/monitor/event-context.ts
|
|
1370
1361
|
function createMatrixEventContextResolver(params) {
|
|
1371
1362
|
const cache = /* @__PURE__ */ new Map();
|
|
1372
1363
|
const isThread = params.kind === "thread";
|
|
@@ -1413,8 +1404,7 @@ function createMatrixEventContextResolver(params) {
|
|
|
1413
1404
|
return context;
|
|
1414
1405
|
};
|
|
1415
1406
|
}
|
|
1416
|
-
|
|
1417
|
-
//#region extensions/matrix/src/matrix/monitor/ack-config.ts
|
|
1407
|
+
// extensions/matrix/src/matrix/monitor/ack-config.ts
|
|
1418
1408
|
function resolveMatrixAckReactionConfig(params) {
|
|
1419
1409
|
const matrixConfig = params.cfg.channels?.matrix;
|
|
1420
1410
|
const accountConfig = resolveMatrixAccountConfig({
|
|
@@ -1429,8 +1419,7 @@ function resolveMatrixAckReactionConfig(params) {
|
|
|
1429
1419
|
ackReactionScope: accountConfig.ackReactionScope ?? matrixConfig?.ackReactionScope ?? params.cfg.messages?.ackReactionScope ?? "group-mentions"
|
|
1430
1420
|
};
|
|
1431
1421
|
}
|
|
1432
|
-
|
|
1433
|
-
//#region extensions/matrix/src/matrix/monitor/preflight-audio.ts
|
|
1422
|
+
// extensions/matrix/src/matrix/monitor/preflight-audio.ts
|
|
1434
1423
|
function isMatrixAudioContent(params) {
|
|
1435
1424
|
if (params.msgtype === "m.audio") return true;
|
|
1436
1425
|
if (params.msgtype === "m.file" && typeof params.mimetype === "string") return params.mimetype.toLowerCase().startsWith("audio/");
|
|
@@ -1462,8 +1451,7 @@ async function resolveMatrixPreflightAudioTranscript(params) {
|
|
|
1462
1451
|
abortSignal: params.abortSignal
|
|
1463
1452
|
});
|
|
1464
1453
|
}
|
|
1465
|
-
|
|
1466
|
-
//#region extensions/matrix/src/matrix/monitor/handler-helpers.ts
|
|
1454
|
+
// extensions/matrix/src/matrix/monitor/handler-helpers.ts
|
|
1467
1455
|
const MATRIX_TOOL_PROGRESS_MAX_CHARS = 300;
|
|
1468
1456
|
const MAX_TRACKED_SHARED_DM_CONTEXT_NOTICES = 512;
|
|
1469
1457
|
function resolveMatrixMentionPrecheckText(params) {
|
|
@@ -1572,13 +1560,12 @@ function resolveMatrixAllowBotsMode(value) {
|
|
|
1572
1560
|
function formatMatrixToolProgressMarkdownCode(text) {
|
|
1573
1561
|
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, 299).trimEnd()}...`).replaceAll("`", "'")}\``;
|
|
1574
1562
|
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-BprM-Wmx.mjs").then((n) => n.s));
|
|
1563
|
+
// extensions/matrix/src/matrix/monitor/handler-runtime.ts
|
|
1564
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-C1qeMQAy.mjs").then((n) => n.s));
|
|
1578
1565
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1579
1566
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1580
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
1581
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
1567
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-ClY9h_FC.mjs"));
|
|
1568
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-dmhBHufd.mjs"));
|
|
1582
1569
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
1583
1570
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1584
1571
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -1587,12 +1574,11 @@ async function matrixTextWouldActivateMentions(client, text) {
|
|
|
1587
1574
|
});
|
|
1588
1575
|
return mentions.room === true || (mentions.user_ids?.length ?? 0) > 0;
|
|
1589
1576
|
}
|
|
1590
|
-
|
|
1591
|
-
//#region extensions/matrix/src/matrix/monitor/handler-context.ts
|
|
1577
|
+
// extensions/matrix/src/matrix/monitor/handler-context.ts
|
|
1592
1578
|
async function resolveMatrixInboundContext(config) {
|
|
1593
1579
|
const { handler, ingress, roomId, event, eventTs, resolveThreadContext, resolveReplyContext, senderId, sharedDmContextNoticeRooms } = config;
|
|
1594
1580
|
const { client, core, accountId, runtime, logVerboseMessage, groupPolicy, getRoomInfo, historyLimit, dmSessionScope, resolveStorePath: resolveStorePathImpl, createChannelInboundEnvelopeBuilderAsync: createChannelInboundEnvelopeBuilderImpl, finalizeInboundContext } = handler;
|
|
1595
|
-
const { cfg, resolveMessageIngress, route: _route, isDirectMessage, isRoom, effectiveRoomUsers, effectiveGroupAllowFrom, threadRootId, thread, senderName, bodyText, commandBodyText, roomConfig, messageId, inboundHistory, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, shouldRequireMention, commandAuthorized, locationPayload, media, preflightAudioTranscript, hasExplicitSessionBinding } = ingress;
|
|
1581
|
+
const { cfg, resolveMessageIngress, route: _route, isDirectMessage, isRoom, effectiveRoomUsers, effectiveGroupAllowFrom, threadRootId, thread, senderName, bodyText, commandBodyText, roomConfig, messageId, inboundHistory, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, shouldRequireMention, commandAuthorized, isControlCommand, locationPayload, media, preflightAudioTranscript, hasExplicitSessionBinding } = ingress;
|
|
1596
1582
|
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
1597
1583
|
cfg,
|
|
1598
1584
|
channel: "matrix",
|
|
@@ -1749,7 +1735,7 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1749
1735
|
GroupChannel: isRoom ? roomId : void 0,
|
|
1750
1736
|
GroupId: isRoom ? roomId : void 0,
|
|
1751
1737
|
...locationPayload?.context,
|
|
1752
|
-
CommandSource: "text",
|
|
1738
|
+
CommandSource: isControlCommand ? "text" : void 0,
|
|
1753
1739
|
NativeDirectUserId: isDirectMessage ? senderId : void 0
|
|
1754
1740
|
}
|
|
1755
1741
|
});
|
|
@@ -1788,8 +1774,7 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1788
1774
|
sharedDmContextNotice
|
|
1789
1775
|
};
|
|
1790
1776
|
}
|
|
1791
|
-
|
|
1792
|
-
//#region extensions/matrix/src/matrix/monitor/handler-draft-controller.ts
|
|
1777
|
+
// extensions/matrix/src/matrix/monitor/handler-draft-controller.ts
|
|
1793
1778
|
async function createMatrixDraftController(params) {
|
|
1794
1779
|
const { streaming, previewToolProgressEnabled, replyToMode, messageId, threadTarget, accountConfig, cfg, accountId, roomId, client, logVerboseMessage } = params;
|
|
1795
1780
|
const draftStreamingEnabled = streaming !== "off";
|
|
@@ -1928,8 +1913,7 @@ async function createMatrixDraftController(params) {
|
|
|
1928
1913
|
}
|
|
1929
1914
|
};
|
|
1930
1915
|
}
|
|
1931
|
-
|
|
1932
|
-
//#region extensions/matrix/src/matrix/monitor/room-history.ts
|
|
1916
|
+
// extensions/matrix/src/matrix/monitor/room-history.ts
|
|
1933
1917
|
/** Maximum entries retained per room (hard cap to bound memory). */
|
|
1934
1918
|
const DEFAULT_MAX_QUEUE_SIZE = 200;
|
|
1935
1919
|
/** Maximum number of rooms to retain queues for (FIFO eviction beyond this). */
|
|
@@ -2118,8 +2102,7 @@ function createRoomHistoryTracker(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE, maxRoom
|
|
|
2118
2102
|
}
|
|
2119
2103
|
};
|
|
2120
2104
|
}
|
|
2121
|
-
|
|
2122
|
-
//#region extensions/matrix/src/matrix/monitor/handler-ingress-access.ts
|
|
2105
|
+
// extensions/matrix/src/matrix/monitor/handler-ingress-access.ts
|
|
2123
2106
|
async function resolveMatrixIngressAccess(config) {
|
|
2124
2107
|
const { handler, params: paramsLocal, roomId, event, eventTs, senderId, isReactionEvent, readStoreAllowFrom, shouldSendPairingReply, resolveLiveAccountAllowlists, roomHistoryTracker, commitInboundEventIfClaimed } = config;
|
|
2125
2108
|
const { core, cfg, accountId, accountConfig, client, logVerboseMessage, groupPolicy, dmEnabled, dmPolicy, dmThreadReplies, threadReplies, roomsConfig, accountAllowBots, configuredBotUserIds, needsRoomAliasesForConfig, getRoomInfo, getMemberDisplayName } = handler;
|
|
@@ -2326,8 +2309,7 @@ async function resolveMatrixIngressAccess(config) {
|
|
|
2326
2309
|
effectiveRoomUsers
|
|
2327
2310
|
};
|
|
2328
2311
|
}
|
|
2329
|
-
|
|
2330
|
-
//#region src/channels/mention-gating.ts
|
|
2312
|
+
// src/channels/mention-gating.ts
|
|
2331
2313
|
function resolveBotThreadMentionPolicy(params) {
|
|
2332
2314
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
2333
2315
|
requireMention: params.requireMention,
|
|
@@ -2338,8 +2320,7 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
2338
2320
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
2339
2321
|
};
|
|
2340
2322
|
}
|
|
2341
|
-
|
|
2342
|
-
//#region extensions/matrix/src/matrix/monitor/media.ts
|
|
2323
|
+
// extensions/matrix/src/matrix/monitor/media.ts
|
|
2343
2324
|
const MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 3e4;
|
|
2344
2325
|
async function downloadMatrixMedia(params) {
|
|
2345
2326
|
if (typeof params.sizeBytes === "number" && params.sizeBytes > params.maxBytes) throw new MatrixMediaSizeLimitError();
|
|
@@ -2365,8 +2346,7 @@ async function downloadMatrixMedia(params) {
|
|
|
2365
2346
|
placeholder: "[matrix media]"
|
|
2366
2347
|
};
|
|
2367
2348
|
}
|
|
2368
|
-
|
|
2369
|
-
//#region extensions/matrix/src/matrix/monitor/mentions.ts
|
|
2349
|
+
// extensions/matrix/src/matrix/monitor/mentions.ts
|
|
2370
2350
|
const MATRIX_HTML_ENTITY_RE = /&(?:#x?[0-9a-f]+|amp|apos|gt|lt|nbsp|quot);/gi;
|
|
2371
2351
|
function decodeVisibleHtmlEntities(value) {
|
|
2372
2352
|
return value.replace(MATRIX_HTML_ENTITY_RE, (entity) => {
|
|
@@ -2491,8 +2471,7 @@ function resolveMentions(params) {
|
|
|
2491
2471
|
hasExplicitMention: explicitMention
|
|
2492
2472
|
};
|
|
2493
2473
|
}
|
|
2494
|
-
|
|
2495
|
-
//#region extensions/matrix/src/matrix/monitor/handler-ingress-content.ts
|
|
2474
|
+
// extensions/matrix/src/matrix/monitor/handler-ingress-content.ts
|
|
2496
2475
|
async function resolveMatrixIngressContent(config) {
|
|
2497
2476
|
const { handler, params: paramsLocal, access, roomId, event, eventType, isPollEvent, eventTs, senderId, roomHistoryTracker, resolveThreadContext, commitInboundEventIfClaimed } = config;
|
|
2498
2477
|
const { client, core, accountId, accountConfig, logger, logVerboseMessage, historyLimit, mediaMaxBytes, dmSessionScope, getMemberDisplayName } = handler;
|
|
@@ -2778,6 +2757,7 @@ async function resolveMatrixIngressContent(config) {
|
|
|
2778
2757
|
shouldBypassMention,
|
|
2779
2758
|
canDetectMention,
|
|
2780
2759
|
commandAuthorized,
|
|
2760
|
+
isControlCommand: allowTextCommands && hasControlCommandInMessage,
|
|
2781
2761
|
inboundHistory,
|
|
2782
2762
|
senderName,
|
|
2783
2763
|
bodyText,
|
|
@@ -2788,8 +2768,7 @@ async function resolveMatrixIngressContent(config) {
|
|
|
2788
2768
|
threadContext
|
|
2789
2769
|
};
|
|
2790
2770
|
}
|
|
2791
|
-
|
|
2792
|
-
//#region extensions/matrix/src/matrix/monitor/location.ts
|
|
2771
|
+
// extensions/matrix/src/matrix/monitor/location.ts
|
|
2793
2772
|
function decodeGeoUriParamValue(value) {
|
|
2794
2773
|
try {
|
|
2795
2774
|
return decodeURIComponent(value);
|
|
@@ -2846,8 +2825,7 @@ function resolveMatrixLocation(params) {
|
|
|
2846
2825
|
context: toLocationContext(location)
|
|
2847
2826
|
};
|
|
2848
2827
|
}
|
|
2849
|
-
|
|
2850
|
-
//#region extensions/matrix/src/matrix/monitor/handler-ingress-prefix.ts
|
|
2828
|
+
// extensions/matrix/src/matrix/monitor/handler-ingress-prefix.ts
|
|
2851
2829
|
async function readMatrixIngressPrefix(config) {
|
|
2852
2830
|
const { client, senderId, dropPreStartupMessages, eventTs, eventAge, startupMs, event, eventType, eventId, inboundDeduper, roomId, logVerboseMessage, directTracker, claimInboundReplay } = config;
|
|
2853
2831
|
const selfUserId = await client.getUserId();
|
|
@@ -2893,8 +2871,7 @@ async function readMatrixIngressPrefix(config) {
|
|
|
2893
2871
|
selfUserId
|
|
2894
2872
|
};
|
|
2895
2873
|
}
|
|
2896
|
-
|
|
2897
|
-
//#region extensions/matrix/src/matrix/monitor/replies.ts
|
|
2874
|
+
// extensions/matrix/src/matrix/monitor/replies.ts
|
|
2898
2875
|
function joinMatrixVisibleContent(contents) {
|
|
2899
2876
|
return contents.filter((content) => Boolean(content)).join("\n");
|
|
2900
2877
|
}
|
|
@@ -2989,8 +2966,7 @@ async function deliverMatrixReplies(params) {
|
|
|
2989
2966
|
}
|
|
2990
2967
|
return accepted.result();
|
|
2991
2968
|
}
|
|
2992
|
-
|
|
2993
|
-
//#region extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts
|
|
2969
|
+
// extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts
|
|
2994
2970
|
function createMatrixReplyDispatcher(config) {
|
|
2995
2971
|
const { cfg, prefixOptions, humanDelay, typingCallbacks, streaming, draftStream, draftController, client, roomId, runtime, replyToMode, threadTarget, replyToEventId, accountId, mediaLocalRoots, logVerboseMessage } = config;
|
|
2996
2972
|
const quietDraftStreaming = streaming === "quiet" || streaming === "progress";
|
|
@@ -3120,8 +3096,7 @@ function createMatrixReplyDispatcher(config) {
|
|
|
3120
3096
|
nonFinalReplyDeliveryFailed: () => nonFinalReplyDeliveryFailed
|
|
3121
3097
|
};
|
|
3122
3098
|
}
|
|
3123
|
-
|
|
3124
|
-
//#region extensions/matrix/src/matrix/monitor/handler-state.ts
|
|
3099
|
+
// extensions/matrix/src/matrix/monitor/handler-state.ts
|
|
3125
3100
|
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
3126
3101
|
const PAIRING_REPLY_COOLDOWN_MS = 3e5;
|
|
3127
3102
|
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
@@ -3208,8 +3183,7 @@ function createMatrixHandlerState(config) {
|
|
|
3208
3183
|
shouldSendPairingReply
|
|
3209
3184
|
};
|
|
3210
3185
|
}
|
|
3211
|
-
|
|
3212
|
-
//#region extensions/matrix/src/matrix/monitor/handler.ts
|
|
3186
|
+
// extensions/matrix/src/matrix/monitor/handler.ts
|
|
3213
3187
|
const SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE = "SESSION_RESTART_RECOVERY_TOMBSTONE";
|
|
3214
3188
|
const RESTART_RECOVERY_TOMBSTONE_NOTICE = "This session ended during gateway restart recovery and cannot accept more messages. Send /new or /reset to start a replacement session.";
|
|
3215
3189
|
function createMatrixRoomMessageHandler(params) {
|
|
@@ -3581,8 +3555,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3581
3555
|
}
|
|
3582
3556
|
};
|
|
3583
3557
|
}
|
|
3584
|
-
|
|
3585
|
-
//#region extensions/matrix/src/matrix/monitor/recent-invite.ts
|
|
3558
|
+
// extensions/matrix/src/matrix/monitor/recent-invite.ts
|
|
3586
3559
|
function shouldPromoteRecentInviteRoom(params) {
|
|
3587
3560
|
if (!params.roomInfo.nameResolved || !params.roomInfo.aliasesResolved) return false;
|
|
3588
3561
|
const roomAliases = [params.roomInfo.canonicalAlias ?? "", ...params.roomInfo.altAliases].filter(Boolean);
|
|
@@ -3593,13 +3566,12 @@ function shouldPromoteRecentInviteRoom(params) {
|
|
|
3593
3566
|
aliases: roomAliases
|
|
3594
3567
|
}).matchSource === void 0;
|
|
3595
3568
|
}
|
|
3596
|
-
|
|
3597
|
-
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3569
|
+
// extensions/matrix/src/matrix/monitor/startup.ts
|
|
3598
3570
|
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
3599
|
-
import("./setup-core-
|
|
3600
|
-
import("./device-health-
|
|
3601
|
-
import("./setup-core-
|
|
3602
|
-
import("./startup-verification-
|
|
3571
|
+
import("./setup-core-D2r4BivQ.mjs").then((n) => n.f),
|
|
3572
|
+
import("./device-health-DnKAXW1v.mjs").then((n) => n.t),
|
|
3573
|
+
import("./setup-core-D2r4BivQ.mjs").then((n) => n.u),
|
|
3574
|
+
import("./startup-verification-B3LEbW33.mjs")
|
|
3603
3575
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
3604
3576
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3605
3577
|
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
@@ -3661,8 +3633,7 @@ async function runMatrixStartupMaintenance(params, deps) {
|
|
|
3661
3633
|
params.logger.debug?.("Failed to resolve matrix verification status (non-fatal)", { error: String(err) });
|
|
3662
3634
|
}
|
|
3663
3635
|
}
|
|
3664
|
-
|
|
3665
|
-
//#region extensions/matrix/src/matrix/monitor/status.ts
|
|
3636
|
+
// extensions/matrix/src/matrix/monitor/status.ts
|
|
3666
3637
|
function cloneLastDisconnect(value) {
|
|
3667
3638
|
if (!value || typeof value === "string") return value ?? null;
|
|
3668
3639
|
return { ...value };
|
|
@@ -3689,7 +3660,17 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3689
3660
|
lastDisconnect: cloneLastDisconnect(status.lastDisconnect)
|
|
3690
3661
|
});
|
|
3691
3662
|
};
|
|
3663
|
+
let startupComplete = params.deferReadyUntilStartupComplete !== true;
|
|
3664
|
+
let pendingReadyAt = null;
|
|
3665
|
+
let pendingTransportActivity = false;
|
|
3692
3666
|
const noteConnected = (at = Date.now(), options) => {
|
|
3667
|
+
if (!startupComplete) {
|
|
3668
|
+
pendingReadyAt = at;
|
|
3669
|
+
pendingTransportActivity ||= options?.transportActivity === true;
|
|
3670
|
+
status.lastEventAt = at;
|
|
3671
|
+
emit();
|
|
3672
|
+
return;
|
|
3673
|
+
}
|
|
3693
3674
|
const lastConnectedAt = status.connected === true ? status.lastConnectedAt ?? at : at;
|
|
3694
3675
|
Object.assign(status, channelReadyPatch({
|
|
3695
3676
|
lastConnectedAt,
|
|
@@ -3702,6 +3683,8 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3702
3683
|
};
|
|
3703
3684
|
const noteDisconnected = (paramsLocal) => {
|
|
3704
3685
|
const at = paramsLocal.at ?? Date.now();
|
|
3686
|
+
pendingReadyAt = null;
|
|
3687
|
+
pendingTransportActivity = false;
|
|
3705
3688
|
const tokenInvalidated = isMatrixAccessTokenInvalidatedError(paramsLocal.error);
|
|
3706
3689
|
if (status.lifecycle === "blocked" && status.terminalDisconnect === true && !tokenInvalidated) {
|
|
3707
3690
|
status.connected = false;
|
|
@@ -3727,6 +3710,16 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3727
3710
|
};
|
|
3728
3711
|
emit();
|
|
3729
3712
|
return {
|
|
3713
|
+
markStartupComplete(at = Date.now()) {
|
|
3714
|
+
startupComplete = true;
|
|
3715
|
+
if (pendingReadyAt !== null) {
|
|
3716
|
+
const readyAt = Math.max(pendingReadyAt, at);
|
|
3717
|
+
const transportActivity = pendingTransportActivity;
|
|
3718
|
+
pendingReadyAt = null;
|
|
3719
|
+
pendingTransportActivity = false;
|
|
3720
|
+
noteConnected(readyAt, { transportActivity });
|
|
3721
|
+
}
|
|
3722
|
+
},
|
|
3730
3723
|
noteSyncState(state, error, at = Date.now()) {
|
|
3731
3724
|
if (isMatrixReadySyncState(state)) {
|
|
3732
3725
|
noteConnected(at, { transportActivity: state === "SYNCING" });
|
|
@@ -3764,8 +3757,7 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3764
3757
|
}
|
|
3765
3758
|
};
|
|
3766
3759
|
}
|
|
3767
|
-
|
|
3768
|
-
//#region extensions/matrix/src/matrix/monitor/sync-lifecycle.ts
|
|
3760
|
+
// extensions/matrix/src/matrix/monitor/sync-lifecycle.ts
|
|
3769
3761
|
function formatSyncLifecycleError(state, error) {
|
|
3770
3762
|
if (error instanceof Error) return error;
|
|
3771
3763
|
const message = typeof error === "string" && error.trim() ? error.trim() : void 0;
|
|
@@ -3818,8 +3810,7 @@ function createMatrixMonitorSyncLifecycle(params) {
|
|
|
3818
3810
|
}
|
|
3819
3811
|
};
|
|
3820
3812
|
}
|
|
3821
|
-
|
|
3822
|
-
//#region extensions/matrix/src/matrix/monitor/index.ts
|
|
3813
|
+
// extensions/matrix/src/matrix/monitor/index.ts
|
|
3823
3814
|
function resolveMatrixStreamingMode(streaming) {
|
|
3824
3815
|
const mode = streaming?.mode;
|
|
3825
3816
|
if (mode === "partial" || mode === "quiet" || mode === "progress") return mode;
|
|
@@ -3911,7 +3902,8 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
3911
3902
|
const statusController = createMatrixMonitorStatusController({
|
|
3912
3903
|
accountId: auth.accountId,
|
|
3913
3904
|
baseUrl: auth.homeserver,
|
|
3914
|
-
statusSink: opts.setStatus
|
|
3905
|
+
statusSink: opts.setStatus,
|
|
3906
|
+
deferReadyUntilStartupComplete: true
|
|
3915
3907
|
});
|
|
3916
3908
|
let cleanedUp = false;
|
|
3917
3909
|
let cleanupPromise = null;
|
|
@@ -4194,6 +4186,7 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4194
4186
|
await cleanup("stop");
|
|
4195
4187
|
return;
|
|
4196
4188
|
}
|
|
4189
|
+
statusController.markStartupComplete();
|
|
4197
4190
|
await Promise.race([waitUntilAbort(monitorLifecycleSignal, async () => {
|
|
4198
4191
|
try {
|
|
4199
4192
|
logVerboseMessage("matrix: stopping client");
|
|
@@ -4213,5 +4206,4 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4213
4206
|
throw err;
|
|
4214
4207
|
}
|
|
4215
4208
|
}
|
|
4216
|
-
//#endregion
|
|
4217
4209
|
export { monitorMatrixProvider };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { i as __exportAll } from "./doctor-contract-
|
|
2
|
-
import { i as requiresExplicitMatrixDefaultAccount, u as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
3
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-
|
|
4
|
-
import { a as createMatrixSetupDmPolicy, g as resolveDefaultMatrixAccountId, m as listMatrixAccountIds, n as finishMatrixSetupAfterConfigWrite, o as moveSingleMatrixAccountConfigToNamedAccount, p as updateMatrixAccountConfig, v as resolveMatrixAccountAsync } from "./setup-core-
|
|
5
|
-
import { r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-
|
|
6
|
-
import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-
|
|
7
|
-
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-
|
|
1
|
+
import { i as __exportAll } from "./doctor-contract-DybEjJcd.mjs";
|
|
2
|
+
import { i as requiresExplicitMatrixDefaultAccount, u as resolveMatrixEnvAuthReadiness } from "./account-selection-Co94mKNj.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CVM2a28p.mjs";
|
|
4
|
+
import { a as createMatrixSetupDmPolicy, g as resolveDefaultMatrixAccountId, m as listMatrixAccountIds, n as finishMatrixSetupAfterConfigWrite, o as moveSingleMatrixAccountConfigToNamedAccount, p as updateMatrixAccountConfig, v as resolveMatrixAccountAsync } from "./setup-core-D2r4BivQ.mjs";
|
|
5
|
+
import { r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-DltG_ZHJ.mjs";
|
|
6
|
+
import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-C77p4qT9.mjs";
|
|
7
|
+
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-O7rEnklr.mjs";
|
|
8
8
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
9
9
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { formatDocsLink, hasConfiguredSecretInput, mergeAllowFromEntries, normalizeAccountId as normalizeAccountId$1, promptAccountId, promptChannelAccessConfig, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
11
11
|
import { isPrivateOrLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
12
|
-
|
|
12
|
+
// extensions/matrix/src/onboarding.ts
|
|
13
13
|
var onboarding_exports = /* @__PURE__ */ __exportAll({ matrixOnboardingAdapter: () => matrixOnboardingAdapter });
|
|
14
14
|
const channel = "matrix";
|
|
15
15
|
const matrixInviteAutoJoinOptions = [
|
|
@@ -87,7 +87,7 @@ async function promptMatrixAllowFrom(params) {
|
|
|
87
87
|
pending.push(part);
|
|
88
88
|
}
|
|
89
89
|
if (pending.length > 0) {
|
|
90
|
-
const { resolveMatrixTargets } = await import("./resolve-targets-
|
|
90
|
+
const { resolveMatrixTargets } = await import("./resolve-targets-B8PAwHVS.mjs").then((n) => n.n);
|
|
91
91
|
const results = await resolveMatrixTargets({
|
|
92
92
|
cfg,
|
|
93
93
|
accountId,
|
|
@@ -204,7 +204,7 @@ async function configureMatrixAccessPrompts(params) {
|
|
|
204
204
|
resolvedIds.push(cleaned);
|
|
205
205
|
continue;
|
|
206
206
|
}
|
|
207
|
-
const { listMatrixDirectoryGroupsLive } = await import("./directory-live-
|
|
207
|
+
const { listMatrixDirectoryGroupsLive } = await import("./directory-live-B-csizuK.mjs").then((n) => n.t);
|
|
208
208
|
const matches = await listMatrixDirectoryGroupsLive({
|
|
209
209
|
cfg: next,
|
|
210
210
|
accountId: params.accountId,
|
|
@@ -454,5 +454,4 @@ const matrixOnboardingAdapter = {
|
|
|
454
454
|
dmPolicy,
|
|
455
455
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
456
456
|
};
|
|
457
|
-
//#endregion
|
|
458
457
|
export { onboarding_exports as n, matrixOnboardingAdapter as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as matrixPresentationCapabilities } from "./channel-
|
|
2
|
-
import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-
|
|
1
|
+
import { r as matrixPresentationCapabilities } from "./channel-CNjJyBS_.mjs";
|
|
2
|
+
import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-C1qeMQAy.mjs";
|
|
3
3
|
import { createMessageReceiptFromOutboundResults, createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
6
6
|
import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
7
7
|
import { renderMessagePresentationFallbackText, renderPresentationForDelivery } from "openclaw/plugin-sdk/interactive-runtime";
|
|
8
8
|
import { resolveSendableOutboundReplyParts, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
|
|
9
|
-
|
|
9
|
+
// extensions/matrix/src/outbound.ts
|
|
10
10
|
const MATRIX_OPENCLAW_PRESENTATION_KEY = "com.openclaw.presentation";
|
|
11
11
|
const MATRIX_OPENCLAW_PRESENTATION_TYPE = "message.presentation";
|
|
12
12
|
const MATRIX_EMPTY_PRESENTATION_FALLBACK_TEXT = "---";
|
|
@@ -181,5 +181,4 @@ const matrixOutbound = {
|
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
|
-
//#endregion
|
|
185
184
|
export { prepareMatrixReplyPayload as n, resolveMatrixExtraContent as r, matrixOutbound as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
2
|
-
import { d as syncMatrixOwnProfile, p as updateMatrixAccountConfig } from "./setup-core-
|
|
3
|
-
import { n as resolveMatrixConfigPath } from "./config-paths-
|
|
4
|
-
import { n as withResolvedActionClient } from "./client-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-Ck8TjD7L.mjs";
|
|
2
|
+
import { d as syncMatrixOwnProfile, p as updateMatrixAccountConfig } from "./setup-core-D2r4BivQ.mjs";
|
|
3
|
+
import { n as resolveMatrixConfigPath } from "./config-paths-DBpHxDyc.mjs";
|
|
4
|
+
import { n as withResolvedActionClient } from "./client-CV0MkCZG.mjs";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
|
-
|
|
6
|
+
// extensions/matrix/src/matrix/actions/profile.ts
|
|
7
7
|
async function updateMatrixOwnProfile(opts = {}) {
|
|
8
8
|
const displayName = opts.displayName?.trim();
|
|
9
9
|
const avatarUrl = opts.avatarUrl?.trim();
|
|
@@ -25,8 +25,7 @@ async function updateMatrixOwnProfile(opts = {}) {
|
|
|
25
25
|
});
|
|
26
26
|
}, "persist");
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
//#region extensions/matrix/src/profile-update.ts
|
|
28
|
+
// extensions/matrix/src/profile-update.ts
|
|
30
29
|
async function applyMatrixProfileUpdate(params) {
|
|
31
30
|
const runtime = getMatrixRuntime();
|
|
32
31
|
const persistedCfg = runtime.config.current();
|
|
@@ -61,5 +60,4 @@ async function applyMatrixProfileUpdate(params) {
|
|
|
61
60
|
configPath: resolveMatrixConfigPath(updated, accountId)
|
|
62
61
|
};
|
|
63
62
|
}
|
|
64
|
-
//#endregion
|
|
65
63
|
export { updateMatrixOwnProfile as n, applyMatrixProfileUpdate as t };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-
|
|
2
|
-
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync } from "./channel-
|
|
3
|
-
import { c as extractMatrixReactionAnnotation } from "./send-currentness-
|
|
4
|
-
import { p as resolveMatrixThreadRootId } from "./direct-management-
|
|
5
|
-
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-
|
|
1
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CVM2a28p.mjs";
|
|
2
|
+
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync } from "./channel-CNjJyBS_.mjs";
|
|
3
|
+
import { c as extractMatrixReactionAnnotation } from "./send-currentness-CAUVR-f3.mjs";
|
|
4
|
+
import { p as resolveMatrixThreadRootId } from "./direct-management-DDaWVbQI.mjs";
|
|
5
|
+
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-DMDBJos0.mjs";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
9
9
|
import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
10
|
-
|
|
11
|
-
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-
|
|
10
|
+
// extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
11
|
+
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-CNjJyBS_.mjs").then((n) => n.s));
|
|
12
12
|
const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
|
|
13
|
-
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-
|
|
13
|
+
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-C1qeMQAy.mjs").then((n) => n.s));
|
|
14
14
|
function buildMatrixApprovalTerminalText(result) {
|
|
15
15
|
const approval = result.approval;
|
|
16
16
|
const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
|
|
@@ -164,5 +164,4 @@ async function handleInboundMatrixReaction(params) {
|
|
|
164
164
|
});
|
|
165
165
|
params.logVerboseMessage(`matrix: reaction event enqueued room=${params.roomId} target=${reaction.eventId} sender=${params.senderId} emoji=${reaction.key}`);
|
|
166
166
|
}
|
|
167
|
-
//#endregion
|
|
168
167
|
export { handleInboundMatrixReaction };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as __exportAll } from "./doctor-contract-
|
|
2
|
-
import { i as normalizeMatrixMessagingTarget, n as isMatrixQualifiedUserId } from "./target-ids-
|
|
3
|
-
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-
|
|
1
|
+
import { i as __exportAll } from "./doctor-contract-DybEjJcd.mjs";
|
|
2
|
+
import { i as normalizeMatrixMessagingTarget, n as isMatrixQualifiedUserId } from "./target-ids-DltG_ZHJ.mjs";
|
|
3
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-B-csizuK.mjs";
|
|
4
4
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/matrix/src/resolve-targets.ts
|
|
6
6
|
var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
|
|
7
7
|
function findExactDirectoryMatches(matches, query) {
|
|
8
8
|
const normalized = normalizeOptionalLowercaseString(query);
|
|
@@ -77,5 +77,4 @@ async function resolveMatrixTargets(params) {
|
|
|
77
77
|
}
|
|
78
78
|
return results;
|
|
79
79
|
}
|
|
80
|
-
//#endregion
|
|
81
80
|
export { resolve_targets_exports as n, resolveMatrixTargets as t };
|