@openclaw/matrix 2026.11.1 → 2026.11.3
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-CVM2a28p.mjs → account-config-CRsKoMqJ.mjs} +2 -1
- package/dist/.setup/{account-selection-BPFpdMIw.mjs → account-selection-CWsL5zIU.mjs} +8 -5
- package/dist/.setup/{approval-handler.runtime-BvuXpzus.mjs → approval-handler.runtime-Co2elSYS.mjs} +9 -8
- package/dist/.setup/{approval-reactions-DMDBJos0.mjs → approval-reactions-D2pEUrFS.mjs} +3 -2
- package/dist/.setup/{backup-health-BxH69np2.mjs → backup-health-Dm_YMVFT.mjs} +2 -1
- package/dist/.setup/{channel-DYRabwmj.mjs → channel-BBvOdxTc.mjs} +44 -30
- package/dist/.setup/{channel.runtime-C0VWk0Ch.mjs → channel.runtime-DyX4mM8d.mjs} +10 -8
- package/dist/.setup/{channel.setup-Dp7V9AgV.mjs → channel.setup-p6oll48W.mjs} +15 -7
- package/dist/.setup/{cli-umlumhB6.mjs → cli-C2XKMk1U.mjs} +39 -28
- package/dist/.setup/{cli-metadata-DemZndyG.mjs → cli-metadata-C60BW1oa.mjs} +5 -3
- package/dist/.setup/{client-BIsYqIzM.mjs → client-BEl7PU1_.mjs} +25 -19
- package/dist/.setup/{client-DL_aELCJ.mjs → client-Cxv-iMwp.mjs} +5 -4
- package/dist/.setup/{client-bootstrap-kdsygurH.mjs → client-bootstrap-D1vLveT2.mjs} +3 -2
- package/dist/.setup/{client-support-CFofPPPm.mjs → client-support-D-xHScuo.mjs} +5 -3
- package/dist/.setup/{config-paths-DBpHxDyc.mjs → config-paths-CnREYb1Y.mjs} +2 -1
- package/dist/.setup/{create-client-BFkMM7SP.mjs → create-client-CrY1E3hg.mjs} +9 -8
- package/dist/.setup/{credentials-read-BOuCoy-p.mjs → credentials-read-Dj7Hj87M.mjs} +6 -5
- package/dist/.setup/{credentials-state-jxq29yQw.mjs → credentials-state-B3cuUFwZ.mjs} +2 -1
- package/dist/.setup/{credentials-B3MlOOom.mjs → credentials-udso1z0C.mjs} +6 -5
- package/dist/.setup/{crypto-node.runtime-E_hqXGxm.mjs → crypto-node.runtime-6Aj_ltHQ.mjs} +2 -1
- package/dist/.setup/{crypto-runtime-s3ogwLRO.mjs → crypto-runtime-DqX7VD1W.mjs} +19 -12
- package/dist/.setup/{crypto-state-store-CM57gchf.mjs → crypto-state-store-DclM-fO5.mjs} +5 -3
- package/dist/.setup/{crypto-store-ownership-Bratn-Np.mjs → crypto-store-ownership-Dr-T40Rp.mjs} +4 -3
- package/dist/.setup/{crypto-unsafe-state-doctor-ClzRgr8z.mjs → crypto-unsafe-state-doctor-BG9qMu0B.mjs} +8 -7
- package/dist/.setup/{deps-O7rEnklr.mjs → deps-L_1bUAGL.mjs} +2 -1
- package/dist/.setup/{device-health-CmvwmCHB.mjs → device-health-D6_ECUVe.mjs} +3 -2
- package/dist/.setup/{direct-management-BOYMqZJQ.mjs → direct-management-ZcjZgYEl.mjs} +11 -7
- package/dist/.setup/{directory-live-tItssg9q.mjs → directory-live-_yaRaktv.mjs} +6 -5
- package/dist/.setup/{doctor-contract-GiXgCj7k.mjs → doctor-contract-BANpMUbP.mjs} +3 -2
- package/dist/.setup/{draft-stream-Buru5huX.mjs → draft-stream-vO_qjwJb.mjs} +4 -3
- package/dist/.setup/{encryption-guidance-CLloQ6H7.mjs → encryption-guidance-BLUoN4aV.mjs} +4 -3
- package/dist/.setup/{env-vars-Bh1iOXJ1.mjs → env-vars-aEBngJPa.mjs} +2 -1
- package/dist/.setup/{errors-CL3YJV8U.mjs → errors-Bw4EHwKX.mjs} +2 -1
- package/dist/.setup/{event-helpers-DDUjVVf7.mjs → event-helpers-CxNgMQqH.mjs} +2 -1
- package/dist/.setup/{exec-approvals-CWeSpE6V.mjs → exec-approvals-BFT-ee9F.mjs} +9 -6
- package/dist/.setup/{file-sync-store-D1sEtAap.mjs → file-sync-store-BxUPmUoJ.mjs} +6 -5
- package/dist/.setup/{http-client-CxTmU1kT.mjs → http-client-ByR4STVQ.mjs} +7 -4
- package/dist/.setup/{idb-persistence-BF0MZglD.mjs → idb-persistence-C2TsCHY2.mjs} +7 -6
- package/dist/.setup/{idb-persistence-lock-CH2K6d_3.mjs → idb-persistence-lock-Bh3ZLIsE.mjs} +2 -1
- package/dist/.setup/{inbound-dedupe-CZnOq0ja.mjs → inbound-dedupe-sW_gaR44.mjs} +3 -2
- package/dist/.setup/{joined-room-encryption-Dl7Sb9FF.mjs → joined-room-encryption-DBbLkdvv.mjs} +3 -2
- package/dist/.setup/{logger-BX5kXvh1.mjs → logger-CuAzdD8Q.mjs} +5 -4
- package/dist/.setup/{logging-BWPjyW9s.mjs → logging-CoaEyRtA.mjs} +22 -15
- package/dist/.setup/{messages-Dt51OgyD.mjs → messages-TuEa_BPZ.mjs} +14 -9
- package/dist/.setup/{monitor-BrBbFO8h.mjs → monitor-B86Ll4B8.mjs} +166 -77
- package/dist/.setup/{onboarding-QfFvgZ85.mjs → onboarding-DOLEjkg2.mjs} +11 -10
- package/dist/.setup/{outbound-B8h2BwR2.mjs → outbound-BWsyqwt1.mjs} +4 -3
- package/dist/.setup/{profile-update-DiXtw0NM.mjs → profile-update-DiXSVBki.mjs} +8 -6
- package/dist/.setup/{reaction-events-xTg2_wZJ.mjs → reaction-events-CuUeYcBC.mjs} +9 -8
- package/dist/.setup/{resolve-targets-vlr765on.mjs → resolve-targets-Dd70hGcM.mjs} +5 -4
- package/dist/.setup/{retired-state-vIr2IB90.mjs → retired-state-C4UnLIg4.mjs} +5 -38
- package/dist/.setup/{room-info-BSvDbUmt.mjs → room-info-C13IUffQ.mjs} +8 -6
- package/dist/.setup/{runtime-Ck8TjD7L.mjs → runtime-1kn1P6io.mjs} +2 -1
- package/dist/.setup/{runtime-doctor-migrations-CSvRANPN.mjs → runtime-doctor-migrations-hxP-CXX7.mjs} +10 -5
- package/dist/.setup/runtime-setter-api-DtxDAM-x.mjs +3 -0
- package/dist/.setup/{sdk-BYR5_wri.mjs → sdk-DNW03GqJ.mjs} +47 -32
- package/dist/.setup/{secret-contract-AKnr45nw.mjs → secret-contract-DxyzKSzf.mjs} +3 -2
- package/dist/.setup/secret-contract-api-CiuSYjUy.mjs +3 -0
- package/dist/.setup/{send-BMe_VcxP.mjs → send-BGgwE5pV.mjs} +40 -24
- package/dist/.setup/{send-currentness-CAUVR-f3.mjs → send-currentness-C2rMVVIQ.mjs} +4 -2
- package/dist/.setup/{setup-bootstrap-Ch6r7Szn.mjs → setup-bootstrap-BCbltIf_.mjs} +5 -4
- package/dist/.setup/{setup-core-CRUekZa3.mjs → setup-core-Di6NtQ_J.mjs} +20 -13
- package/dist/.setup/setup-plugin-api-ORC_4yEA.mjs +3 -0
- package/dist/.setup/sqlite-state-LByPx4Yp.mjs +37 -0
- package/dist/.setup/{startup-verification-Cv_NoW_O.mjs → startup-verification-8xvGpdtK.mjs} +6 -4
- package/dist/.setup/{state-layout-walk-BqCZTHpp.mjs → state-layout-walk-BQMgMykU.mjs} +3 -2
- package/dist/.setup/{storage-B94yQdJy.mjs → storage-CN4dxdtV.mjs} +11 -8
- package/dist/.setup/{storage-paths-e_Vq6cvw.mjs → storage-paths-B51JM-pC.mjs} +2 -1
- package/dist/.setup/{subagent-hooks-CT-rdJmh.mjs → subagent-hooks-CSY4iwa_.mjs} +3 -2
- package/dist/.setup/{sync-cache-state-B-FayxeA.mjs → sync-cache-state-L1kwjhjj.mjs} +6 -4
- package/dist/.setup/{target-ids-DltG_ZHJ.mjs → target-ids-HhcaKX1n.mjs} +2 -1
- package/dist/.setup/{thread-binding-api-OtSciHmZ.mjs → thread-binding-api-BvuaKpd0.mjs} +3 -2
- package/dist/.setup/{thread-bindings-CB-jqrf4.mjs → thread-bindings-pNgPVdof.mjs} +10 -7
- package/dist/.setup/{thread-bindings-shared-FMu_szTm.mjs → thread-bindings-shared-CPjUA0Ib.mjs} +2 -1
- package/dist/.setup/{tool-actions-DjPJ6tpr.mjs → tool-actions-CFC7ZpIt.mjs} +23 -18
- package/dist/.setup/{url-validation-C77p4qT9.mjs → url-validation-CF6pG6eE.mjs} +2 -1
- package/dist/.setup/{verification-BqjyjLoq.mjs → verification-CuT5ZBDO.mjs} +5 -4
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +3 -2
- package/dist/channel-plugin-api.js +2 -1
- package/dist/cli-metadata.js +2 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +18 -14
- package/dist/helper-api.js +3 -3
- package/dist/index.js +4 -3
- package/dist/plugin-entry.handlers.runtime.js +4 -3
- package/dist/runtime-api.js +8 -7
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +2 -1
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +2 -1
- package/dist/thread-bindings-runtime.js +2 -1
- package/package.json +4 -4
- package/dist/.setup/runtime-setter-api-CpwhcBQK.mjs +0 -2
- package/dist/.setup/secret-contract-api-DMSwMIxd.mjs +0 -2
- package/dist/.setup/setup-plugin-api-BZPY4Dt2.mjs +0 -2
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +0 -1
|
@@ -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-1kn1P6io.mjs";
|
|
2
|
+
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
3
|
+
import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-Di6NtQ_J.mjs";
|
|
4
|
+
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-BBvOdxTc.mjs";
|
|
5
|
+
import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-p6oll48W.mjs";
|
|
6
|
+
import { n as isMatrixQualifiedUserId, r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-HhcaKX1n.mjs";
|
|
7
|
+
import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-C2rMVVIQ.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-ZcjZgYEl.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-BGgwE5pV.mjs";
|
|
10
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-pNgPVdof.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-BEl7PU1_.mjs";
|
|
12
|
+
import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-TuEa_BPZ.mjs";
|
|
13
|
+
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-ByR4STVQ.mjs";
|
|
14
|
+
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-BWsyqwt1.mjs";
|
|
15
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-Dd70hGcM.mjs";
|
|
16
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-BLUoN4aV.mjs";
|
|
17
|
+
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-sW_gaR44.mjs";
|
|
18
|
+
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-D-xHScuo.mjs";
|
|
19
|
+
import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-C13IUffQ.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
|
+
//#region 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,7 +109,8 @@ function registerMatrixAutoJoin(params) {
|
|
|
109
109
|
client.off("room.invite", onInvite);
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region extensions/matrix/src/matrix/monitor/config.ts
|
|
113
114
|
function normalizeMatrixUserLookupEntry(raw) {
|
|
114
115
|
return raw.replace(/^matrix:/i, "").replace(/^user:/i, "").trim();
|
|
115
116
|
}
|
|
@@ -399,7 +400,8 @@ async function resolveMatrixMonitorConfig(params) {
|
|
|
399
400
|
roomsConfig
|
|
400
401
|
};
|
|
401
402
|
}
|
|
402
|
-
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region extensions/matrix/src/matrix/monitor/direct.ts
|
|
403
405
|
const DM_CACHE_TTL_MS = 3e4;
|
|
404
406
|
const RECENT_INVITE_TTL_MS = 3e4;
|
|
405
407
|
const MAX_DM_ROOMS = 1024;
|
|
@@ -595,7 +597,8 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
595
597
|
}
|
|
596
598
|
};
|
|
597
599
|
}
|
|
598
|
-
|
|
600
|
+
//#endregion
|
|
601
|
+
//#region extensions/matrix/src/matrix/monitor/types.ts
|
|
599
602
|
const EventType = {
|
|
600
603
|
RoomMessage: "m.room.message",
|
|
601
604
|
RoomMessageEncrypted: "m.room.encrypted",
|
|
@@ -603,7 +606,8 @@ const EventType = {
|
|
|
603
606
|
Location: "m.location",
|
|
604
607
|
Reaction: MATRIX_REACTION_EVENT_TYPE
|
|
605
608
|
};
|
|
606
|
-
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region extensions/matrix/src/matrix/monitor/access-state.ts
|
|
607
611
|
function normalizeMatrixEntry(raw) {
|
|
608
612
|
return normalizeMatrixAllowList([raw ?? ""])[0] ?? null;
|
|
609
613
|
}
|
|
@@ -709,7 +713,8 @@ async function resolveMatrixMonitorCommandAccess(state, params) {
|
|
|
709
713
|
}
|
|
710
714
|
})).commandAccess;
|
|
711
715
|
}
|
|
712
|
-
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region extensions/matrix/src/matrix/monitor/verification-utils.ts
|
|
713
718
|
const VERIFICATION_EVENT_PREFIX = "m.key.verification.";
|
|
714
719
|
const VERIFICATION_REQUEST_MSGTYPE = "m.key.verification.request";
|
|
715
720
|
const VERIFICATION_NOTICE_PREFIXES = [
|
|
@@ -737,11 +742,12 @@ const matrixVerificationConstants = {
|
|
|
737
742
|
eventPrefix: VERIFICATION_EVENT_PREFIX,
|
|
738
743
|
requestMsgtype: VERIFICATION_REQUEST_MSGTYPE
|
|
739
744
|
};
|
|
740
|
-
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region extensions/matrix/src/matrix/monitor/verification-events.ts
|
|
741
747
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
742
748
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
743
749
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
744
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-
|
|
750
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-ZcjZgYEl.mjs").then((n) => n.t), import("./direct-management-ZcjZgYEl.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
|
|
745
751
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
746
752
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
747
753
|
})));
|
|
@@ -1039,7 +1045,8 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
1039
1045
|
routeVerificationSummary
|
|
1040
1046
|
};
|
|
1041
1047
|
}
|
|
1042
|
-
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region extensions/matrix/src/matrix/monitor/events.ts
|
|
1043
1050
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS = 12e4;
|
|
1044
1051
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_THRESHOLD = 3;
|
|
1045
1052
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT = 3;
|
|
@@ -1339,7 +1346,8 @@ function registerMatrixMonitorEvents(params) {
|
|
|
1339
1346
|
client.off("room.event", onRoomEvent);
|
|
1340
1347
|
};
|
|
1341
1348
|
}
|
|
1342
|
-
|
|
1349
|
+
//#endregion
|
|
1350
|
+
//#region extensions/matrix/src/matrix/monitor/context-summary.ts
|
|
1343
1351
|
const MAX_CONTEXT_BODY_LENGTH = 500;
|
|
1344
1352
|
function truncateMatrixContextBody(value) {
|
|
1345
1353
|
if (value.length <= MAX_CONTEXT_BODY_LENGTH) return value;
|
|
@@ -1357,7 +1365,8 @@ function summarizeMatrixMessageContextEvent(event) {
|
|
|
1357
1365
|
msgtype: normalizeOptionalString(content.msgtype)
|
|
1358
1366
|
});
|
|
1359
1367
|
}
|
|
1360
|
-
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region extensions/matrix/src/matrix/monitor/event-context.ts
|
|
1361
1370
|
function createMatrixEventContextResolver(params) {
|
|
1362
1371
|
const cache = /* @__PURE__ */ new Map();
|
|
1363
1372
|
const isThread = params.kind === "thread";
|
|
@@ -1404,7 +1413,8 @@ function createMatrixEventContextResolver(params) {
|
|
|
1404
1413
|
return context;
|
|
1405
1414
|
};
|
|
1406
1415
|
}
|
|
1407
|
-
|
|
1416
|
+
//#endregion
|
|
1417
|
+
//#region extensions/matrix/src/matrix/monitor/ack-config.ts
|
|
1408
1418
|
function resolveMatrixAckReactionConfig(params) {
|
|
1409
1419
|
const matrixConfig = params.cfg.channels?.matrix;
|
|
1410
1420
|
const accountConfig = resolveMatrixAccountConfig({
|
|
@@ -1419,7 +1429,8 @@ function resolveMatrixAckReactionConfig(params) {
|
|
|
1419
1429
|
ackReactionScope: accountConfig.ackReactionScope ?? matrixConfig?.ackReactionScope ?? params.cfg.messages?.ackReactionScope ?? "group-mentions"
|
|
1420
1430
|
};
|
|
1421
1431
|
}
|
|
1422
|
-
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region extensions/matrix/src/matrix/monitor/preflight-audio.ts
|
|
1423
1434
|
function isMatrixAudioContent(params) {
|
|
1424
1435
|
if (params.msgtype === "m.audio") return true;
|
|
1425
1436
|
if (params.msgtype === "m.file" && typeof params.mimetype === "string") return params.mimetype.toLowerCase().startsWith("audio/");
|
|
@@ -1451,7 +1462,8 @@ async function resolveMatrixPreflightAudioTranscript(params) {
|
|
|
1451
1462
|
abortSignal: params.abortSignal
|
|
1452
1463
|
});
|
|
1453
1464
|
}
|
|
1454
|
-
|
|
1465
|
+
//#endregion
|
|
1466
|
+
//#region extensions/matrix/src/matrix/monitor/handler-helpers.ts
|
|
1455
1467
|
const MATRIX_TOOL_PROGRESS_MAX_CHARS = 300;
|
|
1456
1468
|
const MAX_TRACKED_SHARED_DM_CONTEXT_NOTICES = 512;
|
|
1457
1469
|
function resolveMatrixMentionPrecheckText(params) {
|
|
@@ -1560,12 +1572,13 @@ function resolveMatrixAllowBotsMode(value) {
|
|
|
1560
1572
|
function formatMatrixToolProgressMarkdownCode(text) {
|
|
1561
1573
|
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, 299).trimEnd()}...`).replaceAll("`", "'")}\``;
|
|
1562
1574
|
}
|
|
1563
|
-
|
|
1564
|
-
|
|
1575
|
+
//#endregion
|
|
1576
|
+
//#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
|
|
1577
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-BGgwE5pV.mjs").then((n) => n.s));
|
|
1565
1578
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1566
1579
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1567
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
1568
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
1580
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-CuUeYcBC.mjs"));
|
|
1581
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-vO_qjwJb.mjs"));
|
|
1569
1582
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
1570
1583
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1571
1584
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -1574,7 +1587,8 @@ async function matrixTextWouldActivateMentions(client, text) {
|
|
|
1574
1587
|
});
|
|
1575
1588
|
return mentions.room === true || (mentions.user_ids?.length ?? 0) > 0;
|
|
1576
1589
|
}
|
|
1577
|
-
|
|
1590
|
+
//#endregion
|
|
1591
|
+
//#region extensions/matrix/src/matrix/monitor/handler-context.ts
|
|
1578
1592
|
async function resolveMatrixInboundContext(config) {
|
|
1579
1593
|
const { handler, ingress, roomId, event, eventTs, resolveThreadContext, resolveReplyContext, senderId, sharedDmContextNoticeRooms } = config;
|
|
1580
1594
|
const { client, core, accountId, runtime, logVerboseMessage, groupPolicy, getRoomInfo, historyLimit, dmSessionScope, resolveStorePath: resolveStorePathImpl, createChannelInboundEnvelopeBuilderAsync: createChannelInboundEnvelopeBuilderImpl, finalizeInboundContext } = handler;
|
|
@@ -1774,7 +1788,8 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1774
1788
|
sharedDmContextNotice
|
|
1775
1789
|
};
|
|
1776
1790
|
}
|
|
1777
|
-
|
|
1791
|
+
//#endregion
|
|
1792
|
+
//#region extensions/matrix/src/matrix/monitor/handler-draft-controller.ts
|
|
1778
1793
|
async function createMatrixDraftController(params) {
|
|
1779
1794
|
const { streaming, previewToolProgressEnabled, replyToMode, messageId, threadTarget, accountConfig, cfg, accountId, roomId, client, logVerboseMessage } = params;
|
|
1780
1795
|
const draftStreamingEnabled = streaming !== "off";
|
|
@@ -1913,7 +1928,8 @@ async function createMatrixDraftController(params) {
|
|
|
1913
1928
|
}
|
|
1914
1929
|
};
|
|
1915
1930
|
}
|
|
1916
|
-
|
|
1931
|
+
//#endregion
|
|
1932
|
+
//#region extensions/matrix/src/matrix/monitor/room-history.ts
|
|
1917
1933
|
/** Maximum entries retained per room (hard cap to bound memory). */
|
|
1918
1934
|
const DEFAULT_MAX_QUEUE_SIZE = 200;
|
|
1919
1935
|
/** Maximum number of rooms to retain queues for (FIFO eviction beyond this). */
|
|
@@ -2102,7 +2118,8 @@ function createRoomHistoryTracker(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE, maxRoom
|
|
|
2102
2118
|
}
|
|
2103
2119
|
};
|
|
2104
2120
|
}
|
|
2105
|
-
|
|
2121
|
+
//#endregion
|
|
2122
|
+
//#region extensions/matrix/src/matrix/monitor/handler-ingress-access.ts
|
|
2106
2123
|
async function resolveMatrixIngressAccess(config) {
|
|
2107
2124
|
const { handler, params: paramsLocal, roomId, event, eventTs, senderId, isReactionEvent, readStoreAllowFrom, shouldSendPairingReply, resolveLiveAccountAllowlists, roomHistoryTracker, commitInboundEventIfClaimed } = config;
|
|
2108
2125
|
const { core, cfg, accountId, accountConfig, client, logVerboseMessage, groupPolicy, dmEnabled, dmPolicy, dmThreadReplies, threadReplies, roomsConfig, accountAllowBots, configuredBotUserIds, needsRoomAliasesForConfig, getRoomInfo, getMemberDisplayName } = handler;
|
|
@@ -2309,7 +2326,8 @@ async function resolveMatrixIngressAccess(config) {
|
|
|
2309
2326
|
effectiveRoomUsers
|
|
2310
2327
|
};
|
|
2311
2328
|
}
|
|
2312
|
-
|
|
2329
|
+
//#endregion
|
|
2330
|
+
//#region src/channels/mention-gating.ts
|
|
2313
2331
|
function resolveBotThreadMentionPolicy(params) {
|
|
2314
2332
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
2315
2333
|
requireMention: params.requireMention,
|
|
@@ -2320,7 +2338,8 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
2320
2338
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
2321
2339
|
};
|
|
2322
2340
|
}
|
|
2323
|
-
|
|
2341
|
+
//#endregion
|
|
2342
|
+
//#region extensions/matrix/src/matrix/monitor/media.ts
|
|
2324
2343
|
const MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 3e4;
|
|
2325
2344
|
async function downloadMatrixMedia(params) {
|
|
2326
2345
|
if (typeof params.sizeBytes === "number" && params.sizeBytes > params.maxBytes) throw new MatrixMediaSizeLimitError();
|
|
@@ -2346,7 +2365,8 @@ async function downloadMatrixMedia(params) {
|
|
|
2346
2365
|
placeholder: "[matrix media]"
|
|
2347
2366
|
};
|
|
2348
2367
|
}
|
|
2349
|
-
|
|
2368
|
+
//#endregion
|
|
2369
|
+
//#region extensions/matrix/src/matrix/monitor/mentions.ts
|
|
2350
2370
|
const MATRIX_HTML_ENTITY_RE = /&(?:#x?[0-9a-f]+|amp|apos|gt|lt|nbsp|quot);/gi;
|
|
2351
2371
|
function decodeVisibleHtmlEntities(value) {
|
|
2352
2372
|
return value.replace(MATRIX_HTML_ENTITY_RE, (entity) => {
|
|
@@ -2354,8 +2374,69 @@ function decodeVisibleHtmlEntities(value) {
|
|
|
2354
2374
|
return decoded === "\xA0" ? " " : decoded;
|
|
2355
2375
|
});
|
|
2356
2376
|
}
|
|
2377
|
+
/**
|
|
2378
|
+
* Replaces each `<[^>]+>` with a space. No tag can end after the last `>`, so the
|
|
2379
|
+
* regex only runs on that prefix and an unterminated `<` run stays linear.
|
|
2380
|
+
*/
|
|
2381
|
+
function stripHtmlTags(value) {
|
|
2382
|
+
const end = value.lastIndexOf(">") + 1;
|
|
2383
|
+
return value.slice(0, end).replace(/<[^>]+>/g, " ") + value.slice(end);
|
|
2384
|
+
}
|
|
2385
|
+
/**
|
|
2386
|
+
* `href` and label of each anchor, matching the captures of
|
|
2387
|
+
* `/<a\b[^>]*href=(["'])(https:\/\/matrix\.to\/#[^"']+)\1[^>]*>(.*?)<\/a>/gis`: the last
|
|
2388
|
+
* usable `href=` inside the opening tag wins, the quoted value may contain `>`, and the
|
|
2389
|
+
* label ends at the first `</a>`. Each `<a` start is resolved from precomputed next-`>`,
|
|
2390
|
+
* next-quote and next-`</a>` positions plus a forward-only candidate cursor, so the scan
|
|
2391
|
+
* is linear in the length of sender-controlled HTML.
|
|
2392
|
+
*/
|
|
2393
|
+
function* matrixToAnchors(html) {
|
|
2394
|
+
const length = html.length;
|
|
2395
|
+
const nextGt = new Int32Array(length + 1).fill(length);
|
|
2396
|
+
const nextQuote = new Int32Array(length + 1).fill(length);
|
|
2397
|
+
for (let index = length - 1; index >= 0; index -= 1) {
|
|
2398
|
+
const char = html[index];
|
|
2399
|
+
nextGt[index] = char === ">" ? index : nextGt[index + 1];
|
|
2400
|
+
nextQuote[index] = char === "\"" || char === "'" ? index : nextQuote[index + 1];
|
|
2401
|
+
}
|
|
2402
|
+
const closes = Array.from(html.matchAll(/<\/a>/gi), (match) => match.index);
|
|
2403
|
+
let nextClose = 0;
|
|
2404
|
+
const candidates = [];
|
|
2405
|
+
for (const match of html.matchAll(/href=(["'])https:\/\/matrix\.to\/#/gi)) {
|
|
2406
|
+
const valueStart = match.index + 5 + 1;
|
|
2407
|
+
const restStart = match.index + match[0].length;
|
|
2408
|
+
const valueEnd = nextQuote[restStart];
|
|
2409
|
+
if (valueEnd === restStart || valueEnd === length || html[valueEnd] !== match[1]) continue;
|
|
2410
|
+
const tagEnd = nextGt[valueEnd + 1];
|
|
2411
|
+
if (tagEnd === length) continue;
|
|
2412
|
+
while (nextClose < closes.length && closes[nextClose] <= tagEnd) nextClose += 1;
|
|
2413
|
+
if (nextClose === closes.length) break;
|
|
2414
|
+
candidates.push({
|
|
2415
|
+
start: match.index,
|
|
2416
|
+
href: html.slice(valueStart, valueEnd),
|
|
2417
|
+
labelStart: tagEnd + 1,
|
|
2418
|
+
labelEnd: closes[nextClose]
|
|
2419
|
+
});
|
|
2420
|
+
}
|
|
2421
|
+
let resumeAt = 0;
|
|
2422
|
+
let candidatesBefore = 0;
|
|
2423
|
+
for (const open of html.matchAll(/<a\b/gi)) {
|
|
2424
|
+
if (open.index < resumeAt) continue;
|
|
2425
|
+
const firstStart = open.index + open[0].length;
|
|
2426
|
+
const lastStart = nextGt[firstStart] - 1;
|
|
2427
|
+
while (candidatesBefore < candidates.length && candidates[candidatesBefore].start <= lastStart) candidatesBefore += 1;
|
|
2428
|
+
const candidate = candidates[candidatesBefore - 1];
|
|
2429
|
+
if (candidate && candidate.start >= firstStart) {
|
|
2430
|
+
yield {
|
|
2431
|
+
href: candidate.href,
|
|
2432
|
+
label: html.slice(candidate.labelStart, candidate.labelEnd)
|
|
2433
|
+
};
|
|
2434
|
+
resumeAt = candidate.labelEnd + 4;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2357
2438
|
function extractVisibleMentionText(value) {
|
|
2358
|
-
return normalizeLowercaseStringOrEmpty(decodeVisibleHtmlEntities((value ?? "").replace(
|
|
2439
|
+
return normalizeLowercaseStringOrEmpty(decodeVisibleHtmlEntities(stripHtmlTags(value ?? "").replace(/[\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g, "")).replace(/\s+/g, " "));
|
|
2359
2440
|
}
|
|
2360
2441
|
function resolveMatrixUserLocalpart(userId) {
|
|
2361
2442
|
const trimmed = userId.trim();
|
|
@@ -2433,22 +2514,17 @@ function hasVisibleRoomMention(value) {
|
|
|
2433
2514
|
*/
|
|
2434
2515
|
function checkFormattedBodyMention(params) {
|
|
2435
2516
|
if (!params.formattedBody || !params.userId) return false;
|
|
2436
|
-
for (const
|
|
2437
|
-
const
|
|
2438
|
-
|
|
2439
|
-
if (
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
displayName: params.displayName
|
|
2448
|
-
})) return true;
|
|
2449
|
-
} catch {
|
|
2450
|
-
continue;
|
|
2451
|
-
}
|
|
2517
|
+
for (const { href, label: visibleLabel } of matrixToAnchors(params.formattedBody)) try {
|
|
2518
|
+
const parsed = new URL(href);
|
|
2519
|
+
if (decodeURIComponent(parsed.hash.replace(/^#\/?/, "").trim()) !== params.userId.trim()) continue;
|
|
2520
|
+
if (isVisibleMentionLabel({
|
|
2521
|
+
text: visibleLabel,
|
|
2522
|
+
userId: params.userId,
|
|
2523
|
+
mentionRegexes: params.mentionRegexes,
|
|
2524
|
+
displayName: params.displayName
|
|
2525
|
+
})) return true;
|
|
2526
|
+
} catch {
|
|
2527
|
+
continue;
|
|
2452
2528
|
}
|
|
2453
2529
|
return false;
|
|
2454
2530
|
}
|
|
@@ -2471,7 +2547,8 @@ function resolveMentions(params) {
|
|
|
2471
2547
|
hasExplicitMention: explicitMention
|
|
2472
2548
|
};
|
|
2473
2549
|
}
|
|
2474
|
-
|
|
2550
|
+
//#endregion
|
|
2551
|
+
//#region extensions/matrix/src/matrix/monitor/handler-ingress-content.ts
|
|
2475
2552
|
async function resolveMatrixIngressContent(config) {
|
|
2476
2553
|
const { handler, params: paramsLocal, access, roomId, event, eventType, isPollEvent, eventTs, senderId, roomHistoryTracker, resolveThreadContext, commitInboundEventIfClaimed } = config;
|
|
2477
2554
|
const { client, core, accountId, accountConfig, logger, logVerboseMessage, historyLimit, mediaMaxBytes, dmSessionScope, getMemberDisplayName } = handler;
|
|
@@ -2768,7 +2845,8 @@ async function resolveMatrixIngressContent(config) {
|
|
|
2768
2845
|
threadContext
|
|
2769
2846
|
};
|
|
2770
2847
|
}
|
|
2771
|
-
|
|
2848
|
+
//#endregion
|
|
2849
|
+
//#region extensions/matrix/src/matrix/monitor/location.ts
|
|
2772
2850
|
function decodeGeoUriParamValue(value) {
|
|
2773
2851
|
try {
|
|
2774
2852
|
return decodeURIComponent(value);
|
|
@@ -2825,7 +2903,8 @@ function resolveMatrixLocation(params) {
|
|
|
2825
2903
|
context: toLocationContext(location)
|
|
2826
2904
|
};
|
|
2827
2905
|
}
|
|
2828
|
-
|
|
2906
|
+
//#endregion
|
|
2907
|
+
//#region extensions/matrix/src/matrix/monitor/handler-ingress-prefix.ts
|
|
2829
2908
|
async function readMatrixIngressPrefix(config) {
|
|
2830
2909
|
const { client, senderId, dropPreStartupMessages, eventTs, eventAge, startupMs, event, eventType, eventId, inboundDeduper, roomId, logVerboseMessage, directTracker, claimInboundReplay } = config;
|
|
2831
2910
|
const selfUserId = await client.getUserId();
|
|
@@ -2871,7 +2950,8 @@ async function readMatrixIngressPrefix(config) {
|
|
|
2871
2950
|
selfUserId
|
|
2872
2951
|
};
|
|
2873
2952
|
}
|
|
2874
|
-
|
|
2953
|
+
//#endregion
|
|
2954
|
+
//#region extensions/matrix/src/matrix/monitor/replies.ts
|
|
2875
2955
|
function joinMatrixVisibleContent(contents) {
|
|
2876
2956
|
return contents.filter((content) => Boolean(content)).join("\n");
|
|
2877
2957
|
}
|
|
@@ -2966,7 +3046,8 @@ async function deliverMatrixReplies(params) {
|
|
|
2966
3046
|
}
|
|
2967
3047
|
return accepted.result();
|
|
2968
3048
|
}
|
|
2969
|
-
|
|
3049
|
+
//#endregion
|
|
3050
|
+
//#region extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts
|
|
2970
3051
|
function createMatrixReplyDispatcher(config) {
|
|
2971
3052
|
const { cfg, prefixOptions, humanDelay, typingCallbacks, streaming, draftStream, draftController, client, roomId, runtime, replyToMode, threadTarget, replyToEventId, accountId, mediaLocalRoots, logVerboseMessage } = config;
|
|
2972
3053
|
const quietDraftStreaming = streaming === "quiet" || streaming === "progress";
|
|
@@ -3096,7 +3177,8 @@ function createMatrixReplyDispatcher(config) {
|
|
|
3096
3177
|
nonFinalReplyDeliveryFailed: () => nonFinalReplyDeliveryFailed
|
|
3097
3178
|
};
|
|
3098
3179
|
}
|
|
3099
|
-
|
|
3180
|
+
//#endregion
|
|
3181
|
+
//#region extensions/matrix/src/matrix/monitor/handler-state.ts
|
|
3100
3182
|
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
3101
3183
|
const PAIRING_REPLY_COOLDOWN_MS = 3e5;
|
|
3102
3184
|
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
@@ -3183,7 +3265,8 @@ function createMatrixHandlerState(config) {
|
|
|
3183
3265
|
shouldSendPairingReply
|
|
3184
3266
|
};
|
|
3185
3267
|
}
|
|
3186
|
-
|
|
3268
|
+
//#endregion
|
|
3269
|
+
//#region extensions/matrix/src/matrix/monitor/handler.ts
|
|
3187
3270
|
const SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE = "SESSION_RESTART_RECOVERY_TOMBSTONE";
|
|
3188
3271
|
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.";
|
|
3189
3272
|
function createMatrixRoomMessageHandler(params) {
|
|
@@ -3555,7 +3638,8 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3555
3638
|
}
|
|
3556
3639
|
};
|
|
3557
3640
|
}
|
|
3558
|
-
|
|
3641
|
+
//#endregion
|
|
3642
|
+
//#region extensions/matrix/src/matrix/monitor/recent-invite.ts
|
|
3559
3643
|
function shouldPromoteRecentInviteRoom(params) {
|
|
3560
3644
|
if (!params.roomInfo.nameResolved || !params.roomInfo.aliasesResolved) return false;
|
|
3561
3645
|
const roomAliases = [params.roomInfo.canonicalAlias ?? "", ...params.roomInfo.altAliases].filter(Boolean);
|
|
@@ -3566,12 +3650,13 @@ function shouldPromoteRecentInviteRoom(params) {
|
|
|
3566
3650
|
aliases: roomAliases
|
|
3567
3651
|
}).matchSource === void 0;
|
|
3568
3652
|
}
|
|
3569
|
-
|
|
3653
|
+
//#endregion
|
|
3654
|
+
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3570
3655
|
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
3571
|
-
import("./setup-core-
|
|
3572
|
-
import("./device-health-
|
|
3573
|
-
import("./setup-core-
|
|
3574
|
-
import("./startup-verification-
|
|
3656
|
+
import("./setup-core-Di6NtQ_J.mjs").then((n) => n.f),
|
|
3657
|
+
import("./device-health-D6_ECUVe.mjs").then((n) => n.t),
|
|
3658
|
+
import("./setup-core-Di6NtQ_J.mjs").then((n) => n.u),
|
|
3659
|
+
import("./startup-verification-8xvGpdtK.mjs")
|
|
3575
3660
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
3576
3661
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3577
3662
|
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
@@ -3633,7 +3718,8 @@ async function runMatrixStartupMaintenance(params, deps) {
|
|
|
3633
3718
|
params.logger.debug?.("Failed to resolve matrix verification status (non-fatal)", { error: String(err) });
|
|
3634
3719
|
}
|
|
3635
3720
|
}
|
|
3636
|
-
|
|
3721
|
+
//#endregion
|
|
3722
|
+
//#region extensions/matrix/src/matrix/monitor/status.ts
|
|
3637
3723
|
function cloneLastDisconnect(value) {
|
|
3638
3724
|
if (!value || typeof value === "string") return value ?? null;
|
|
3639
3725
|
return { ...value };
|
|
@@ -3757,7 +3843,8 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3757
3843
|
}
|
|
3758
3844
|
};
|
|
3759
3845
|
}
|
|
3760
|
-
|
|
3846
|
+
//#endregion
|
|
3847
|
+
//#region extensions/matrix/src/matrix/monitor/sync-lifecycle.ts
|
|
3761
3848
|
function formatSyncLifecycleError(state, error) {
|
|
3762
3849
|
if (error instanceof Error) return error;
|
|
3763
3850
|
const message = typeof error === "string" && error.trim() ? error.trim() : void 0;
|
|
@@ -3810,7 +3897,8 @@ function createMatrixMonitorSyncLifecycle(params) {
|
|
|
3810
3897
|
}
|
|
3811
3898
|
};
|
|
3812
3899
|
}
|
|
3813
|
-
|
|
3900
|
+
//#endregion
|
|
3901
|
+
//#region extensions/matrix/src/matrix/monitor/index.ts
|
|
3814
3902
|
function resolveMatrixStreamingMode(streaming) {
|
|
3815
3903
|
const mode = streaming?.mode;
|
|
3816
3904
|
if (mode === "partial" || mode === "quiet" || mode === "progress") return mode;
|
|
@@ -4206,4 +4294,5 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4206
4294
|
throw err;
|
|
4207
4295
|
}
|
|
4208
4296
|
}
|
|
4297
|
+
//#endregion
|
|
4209
4298
|
export { monitorMatrixProvider };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
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 { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { i as requiresExplicitMatrixDefaultAccount, u as resolveMatrixEnvAuthReadiness } from "./account-selection-CWsL5zIU.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.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-Di6NtQ_J.mjs";
|
|
5
|
+
import { r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-HhcaKX1n.mjs";
|
|
6
|
+
import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-CF6pG6eE.mjs";
|
|
7
|
+
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-L_1bUAGL.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
|
+
//#region 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-Dd70hGcM.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-_yaRaktv.mjs").then((n) => n.t);
|
|
208
208
|
const matches = await listMatrixDirectoryGroupsLive({
|
|
209
209
|
cfg: next,
|
|
210
210
|
accountId: params.accountId,
|
|
@@ -454,4 +454,5 @@ const matrixOnboardingAdapter = {
|
|
|
454
454
|
dmPolicy,
|
|
455
455
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
456
456
|
};
|
|
457
|
+
//#endregion
|
|
457
458
|
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-BBvOdxTc.mjs";
|
|
2
|
+
import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-BGgwE5pV.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
|
+
//#region 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,4 +181,5 @@ const matrixOutbound = {
|
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
|
+
//#endregion
|
|
184
185
|
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-1kn1P6io.mjs";
|
|
2
|
+
import { d as syncMatrixOwnProfile, p as updateMatrixAccountConfig } from "./setup-core-Di6NtQ_J.mjs";
|
|
3
|
+
import { n as resolveMatrixConfigPath } from "./config-paths-CnREYb1Y.mjs";
|
|
4
|
+
import { n as withResolvedActionClient } from "./client-Cxv-iMwp.mjs";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
|
-
|
|
6
|
+
//#region 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,7 +25,8 @@ async function updateMatrixOwnProfile(opts = {}) {
|
|
|
25
25
|
});
|
|
26
26
|
}, "persist");
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region extensions/matrix/src/profile-update.ts
|
|
29
30
|
async function applyMatrixProfileUpdate(params) {
|
|
30
31
|
const runtime = getMatrixRuntime();
|
|
31
32
|
const persistedCfg = runtime.config.current();
|
|
@@ -60,4 +61,5 @@ async function applyMatrixProfileUpdate(params) {
|
|
|
60
61
|
configPath: resolveMatrixConfigPath(updated, accountId)
|
|
61
62
|
};
|
|
62
63
|
}
|
|
64
|
+
//#endregion
|
|
63
65
|
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-CRsKoMqJ.mjs";
|
|
2
|
+
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync } from "./channel-BBvOdxTc.mjs";
|
|
3
|
+
import { c as extractMatrixReactionAnnotation } from "./send-currentness-C2rMVVIQ.mjs";
|
|
4
|
+
import { p as resolveMatrixThreadRootId } from "./direct-management-ZcjZgYEl.mjs";
|
|
5
|
+
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-D2pEUrFS.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
|
+
//#region extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
11
|
+
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-BBvOdxTc.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-BGgwE5pV.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,4 +164,5 @@ 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
|
|
167
168
|
export { handleInboundMatrixReaction };
|