@openclaw/matrix 2026.11.5-beta.1 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-config-CVM2a28p.mjs → account-config-CRsKoMqJ.mjs} +2 -1
- package/dist/.setup/{account-selection-Cow3TMFO.mjs → account-selection-UUPhMBmu.mjs} +8 -5
- package/dist/.setup/{approval-handler.runtime-_0gqiVgR.mjs → approval-handler.runtime-Ca12_7Qa.mjs} +9 -8
- package/dist/.setup/{approval-reactions-Bz_8XB01.mjs → approval-reactions-BazmsDbe.mjs} +3 -2
- package/dist/.setup/{backup-health-BxH69np2.mjs → backup-health-Dm_YMVFT.mjs} +2 -1
- package/dist/.setup/{channel-ByHcZU28.mjs → channel-CX7k81dL.mjs} +38 -27
- package/dist/.setup/{channel.runtime-sNicWjmD.mjs → channel.runtime-K_hHX-9W.mjs} +12 -10
- package/dist/.setup/{channel.setup-Bmba21y9.mjs → channel.setup-B00zzOOL.mjs} +7 -5
- package/dist/.setup/{cli-B26pps0Q.mjs → cli-dz9hd2dR.mjs} +34 -25
- package/dist/.setup/{cli-metadata-CKGwVfmT.mjs → cli-metadata-CwUhA9CY.mjs} +5 -3
- package/dist/.setup/{client-N8TEwtmk.mjs → client-CFPYqaYK.mjs} +5 -4
- package/dist/.setup/{client-Bqu801rH.mjs → client-D1bsidwU.mjs} +26 -21
- package/dist/.setup/{client-bootstrap-k6Zm1M8Y.mjs → client-bootstrap-CTT0VF6v.mjs} +3 -2
- package/dist/.setup/{client-support-CqXAOZp3.mjs → client-support-B_Mp4Qk9.mjs} +3 -2
- package/dist/.setup/{config-paths-DBpHxDyc.mjs → config-paths-CnREYb1Y.mjs} +2 -1
- package/dist/.setup/{create-client-DaGljdrk.mjs → create-client-Ccf5wyS3.mjs} +9 -8
- package/dist/.setup/{credentials-DVmY0miU.mjs → credentials-kT20jk_u.mjs} +6 -5
- package/dist/.setup/{credentials-read-rPqEpuxv.mjs → credentials-read-CM6wXUjL.mjs} +6 -5
- package/dist/.setup/{credentials-state-jxq29yQw.mjs → credentials-state-B3cuUFwZ.mjs} +2 -1
- package/dist/.setup/{crypto-node.runtime-E_hqXGxm.mjs → crypto-node.runtime-6Aj_ltHQ.mjs} +2 -1
- package/dist/.setup/{crypto-runtime-KQupbxSM.mjs → crypto-runtime-DZNytKX5.mjs} +15 -10
- package/dist/.setup/{crypto-state-store-p1mdYTWH.mjs → crypto-state-store-BZLlwkv_.mjs} +4 -3
- package/dist/.setup/{crypto-store-ownership-7lVHeXWL.mjs → crypto-store-ownership-CiQ1l_O7.mjs} +4 -3
- package/dist/.setup/{crypto-unsafe-state-doctor-CG2nJk8P.mjs → crypto-unsafe-state-doctor-Dh1dtuSz.mjs} +8 -7
- package/dist/.setup/{deps-CVPT2Ros.mjs → deps-D-W_QQjz.mjs} +2 -1
- package/dist/.setup/{device-health-D7n-lPeb.mjs → device-health-Ck2YpEVN.mjs} +3 -2
- package/dist/.setup/{direct-management-D59C1WO-.mjs → direct-management-Dp1giZ34.mjs} +11 -7
- package/dist/.setup/{directory-live-YixmpyLW.mjs → directory-live-ufzRheWx.mjs} +6 -5
- package/dist/.setup/{doctor-contract-GiXgCj7k.mjs → doctor-contract-BANpMUbP.mjs} +3 -2
- package/dist/.setup/{draft-stream-C09OtoJZ.mjs → draft-stream-BPjjKSoI.mjs} +4 -3
- package/dist/.setup/{encryption-guidance-DfbEaKct.mjs → encryption-guidance-Br3Lv9Hm.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-C3rCm0Sn.mjs → exec-approvals-BwEOyI1-.mjs} +9 -6
- package/dist/.setup/{file-sync-store-NW6eDuai.mjs → file-sync-store-BpS12yaK.mjs} +36 -6
- package/dist/.setup/{http-client-CqnKFKUH.mjs → http-client-B_ohXrBm.mjs} +8 -5
- package/dist/.setup/{idb-persistence-CmoPtwDD.mjs → idb-persistence-BTOsltD9.mjs} +7 -6
- package/dist/.setup/{idb-persistence-lock-CH2K6d_3.mjs → idb-persistence-lock-Bh3ZLIsE.mjs} +2 -1
- package/dist/.setup/{joined-room-encryption-9sJK1kM-.mjs → joined-room-encryption-C0gHa2DG.mjs} +3 -2
- package/dist/.setup/{logger-B9TwnY6C.mjs → logger-CuAzdD8Q.mjs} +3 -2
- package/dist/.setup/{logging-Bnsn7s4r.mjs → logging-CoaEyRtA.mjs} +4 -3
- package/dist/.setup/{messages-BjzsVgS6.mjs → messages-DpJ9naJa.mjs} +14 -9
- package/dist/.setup/{monitor-D4vhbNUM.mjs → monitor-Rzl3naSn.mjs} +157 -63
- package/dist/.setup/{onboarding-DKmt3jpW.mjs → onboarding-BK-V2ZLT.mjs} +11 -10
- package/dist/.setup/{outbound-wsXTF0z_.mjs → outbound-DMMVmZjV.mjs} +4 -3
- package/dist/.setup/{profile-update-DX060MnL.mjs → profile-update-RLsY-gu6.mjs} +9 -7
- package/dist/.setup/{reaction-events-BMsatzs4.mjs → reaction-events-UA_g6jEX.mjs} +9 -8
- package/dist/.setup/{resolve-targets-Yz_3aN_2.mjs → resolve-targets-DYW8ULZS.mjs} +5 -4
- package/dist/.setup/{retired-state-Bs3Gqkge.mjs → retired-state-JGUEBE72.mjs} +7 -4
- package/dist/.setup/{room-info-OGKjk422.mjs → room-info-Dhc4efkA.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-CpwhcBQK.mjs → runtime-setter-api-i2MOXoT3.mjs} +1 -1
- package/dist/.setup/{sdk-BXcIyN-I.mjs → sdk-DPXiQ3jr.mjs} +46 -32
- package/dist/.setup/{secret-contract-AKnr45nw.mjs → secret-contract-DxyzKSzf.mjs} +3 -2
- package/dist/.setup/{secret-contract-api-DMSwMIxd.mjs → secret-contract-api-Dukgvike.mjs} +1 -1
- package/dist/.setup/{send-CWjH-l-T.mjs → send-HHAbKARg.mjs} +41 -25
- package/dist/.setup/{send-currentness-D1x6YP9O.mjs → send-currentness-DGxiiBn9.mjs} +4 -2
- package/dist/.setup/{setup-bootstrap-yKeGh4Iy.mjs → setup-bootstrap-DaT2j28V.mjs} +5 -4
- package/dist/.setup/{setup-core-BaKffgBi.mjs → setup-core-DcqQbLZv.mjs} +20 -13
- package/dist/.setup/setup-plugin-api-Cg4TelGZ.mjs +2 -0
- package/dist/.setup/{startup-verification-C-lhD0gk.mjs → startup-verification-UkaoSldm.mjs} +5 -4
- package/dist/.setup/{state-layout-walk-BqCZTHpp.mjs → state-layout-walk-BQMgMykU.mjs} +3 -2
- package/dist/.setup/{storage-BLLN9jYG.mjs → storage-C3N6YZIn.mjs} +10 -8
- package/dist/.setup/{storage-paths-e_Vq6cvw.mjs → storage-paths-B51JM-pC.mjs} +2 -1
- package/dist/.setup/{subagent-hooks-D-lCcLGQ.mjs → subagent-hooks-CfGAysJi.mjs} +3 -2
- package/dist/.setup/{sync-cache-state-B4hJFIPw.mjs → sync-cache-state-BKVaKRzQ.mjs} +5 -4
- package/dist/.setup/{sync-state-Cu1nagBV.mjs → sync-state-CWbp0QSY.mjs} +2 -1
- package/dist/.setup/{target-ids-DltG_ZHJ.mjs → target-ids-HhcaKX1n.mjs} +2 -1
- package/dist/.setup/{task-runner-CYyGHdNW.mjs → task-runner-DY3aKiQa.mjs} +2 -1
- package/dist/.setup/{thread-binding-api-OtSciHmZ.mjs → thread-binding-api-BvuaKpd0.mjs} +3 -2
- package/dist/.setup/{thread-bindings-BA2xESjV.mjs → thread-bindings-891JsKXF.mjs} +9 -7
- package/dist/.setup/{thread-bindings-shared-CBlJu3Wz.mjs → thread-bindings-shared-QmZOfX9Q.mjs} +2 -1
- package/dist/.setup/{tool-actions-CRuiVbqj.mjs → tool-actions-yFZH_7mC.mjs} +24 -19
- package/dist/.setup/{url-validation-DesoKUns.mjs → url-validation-By_2hsXr.mjs} +2 -1
- package/dist/.setup/{verification-C5x4Hy5Y.mjs → verification-CcZIVL8P.mjs} +5 -4
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +3 -2
- 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 +16 -13
- 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 +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +3 -2
- 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-B_t4waBw.mjs +0 -2
|
@@ -1,30 +1,32 @@
|
|
|
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 resolveMatrixInboundRouteAsync, i as resolveMatrixRoomConfig, n as resolveMatrixStoredSessionMeta, o as resolveMatrixThreadRouting } 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, n as withMatrixSendCurrentness } 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 { n as getMatrixMonitorTaskSignal, t as createMatrixMonitorTaskRunner } from "./task-runner-
|
|
10
|
-
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-
|
|
11
|
-
import { n as getMatrixEventProjection } from "./event-helpers-
|
|
12
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-
|
|
13
|
-
import { a as isMatrixAccessTokenInvalidatedError } from "./client-support-
|
|
14
|
-
import { a as isMatrixStartupAbortError, c as resolveMatrixAuth, l as resolveMatrixAuthContext, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as backfillMatrixAuthDeviceIdAfterStartup } from "./client-
|
|
15
|
-
import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-
|
|
16
|
-
import { a as isMatrixMediaSizeLimitError, i as MatrixMediaSizeLimitError } from "./http-client-
|
|
17
|
-
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-
|
|
18
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { r as
|
|
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-DcqQbLZv.mjs";
|
|
4
|
+
import { a as resolveMatrixInboundRouteAsync, i as resolveMatrixRoomConfig, n as resolveMatrixStoredSessionMeta, o as resolveMatrixThreadRouting } from "./channel-CX7k81dL.mjs";
|
|
5
|
+
import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-B00zzOOL.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, n as withMatrixSendCurrentness } from "./send-currentness-DGxiiBn9.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-Dp1giZ34.mjs";
|
|
9
|
+
import { n as getMatrixMonitorTaskSignal, t as createMatrixMonitorTaskRunner } from "./task-runner-DY3aKiQa.mjs";
|
|
10
|
+
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-HHAbKARg.mjs";
|
|
11
|
+
import { n as getMatrixEventProjection } from "./event-helpers-CxNgMQqH.mjs";
|
|
12
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-891JsKXF.mjs";
|
|
13
|
+
import { a as isMatrixAccessTokenInvalidatedError } from "./client-support-B_Mp4Qk9.mjs";
|
|
14
|
+
import { a as isMatrixStartupAbortError, c as resolveMatrixAuth, l as resolveMatrixAuthContext, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as backfillMatrixAuthDeviceIdAfterStartup } from "./client-D1bsidwU.mjs";
|
|
15
|
+
import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-DpJ9naJa.mjs";
|
|
16
|
+
import { a as isMatrixMediaSizeLimitError, i as MatrixMediaSizeLimitError } from "./http-client-B_ohXrBm.mjs";
|
|
17
|
+
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-DMMVmZjV.mjs";
|
|
18
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-DYW8ULZS.mjs";
|
|
19
|
+
import { n as emitMatrixLog } from "./logger-CuAzdD8Q.mjs";
|
|
20
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-Br3Lv9Hm.mjs";
|
|
21
|
+
import { n as isMatrixReadySyncState, r as isMatrixTerminalSyncState, t as isMatrixDisconnectedSyncState } from "./sync-state-CWbp0QSY.mjs";
|
|
22
|
+
import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-Dhc4efkA.mjs";
|
|
22
23
|
import { channelBlockedPatch, channelReadyPatch, channelStoppedPatch, createTransportActivityStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
23
24
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
24
25
|
import { createChannelDeliveryAccumulator, createChannelIngressError, createChannelIngressMonitor, createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, createReplyPrefixOptions, createTypingCallbacks, logTypingFailure, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
25
26
|
import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
26
27
|
import { normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalString, normalizeStringifiedEntries, normalizeUniqueTrimmedStringList, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
27
28
|
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
29
|
+
import { randomUUID } from "node:crypto";
|
|
28
30
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
29
31
|
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, canonicalizeAllowlistWithResolvedIds, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
30
32
|
import { normalizeStringEntries as normalizeStringEntries$1, truncateWithMarker } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
@@ -52,7 +54,7 @@ import { createChannelPreflightAudio, formatAudioTranscriptForAgent } from "open
|
|
|
52
54
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
53
55
|
import { buildInboundHistoryFromEntries } from "openclaw/plugin-sdk/reply-history";
|
|
54
56
|
import { decodeHtmlEntities } from "openclaw/plugin-sdk/html-entity-runtime";
|
|
55
|
-
|
|
57
|
+
//#region extensions/matrix/src/matrix/monitor/auto-join.ts
|
|
56
58
|
function registerMatrixAutoJoin(params) {
|
|
57
59
|
const { client, accountConfig, runtime } = params;
|
|
58
60
|
const core = getMatrixRuntime();
|
|
@@ -116,7 +118,8 @@ function registerMatrixAutoJoin(params) {
|
|
|
116
118
|
client.off("room.invite", onInvite);
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
|
-
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region extensions/matrix/src/matrix/monitor/config.ts
|
|
120
123
|
function normalizeMatrixUserLookupEntry(raw) {
|
|
121
124
|
return raw.replace(/^matrix:/i, "").replace(/^user:/i, "").trim();
|
|
122
125
|
}
|
|
@@ -394,7 +397,8 @@ async function resolveMatrixMonitorConfig(params) {
|
|
|
394
397
|
roomsConfig
|
|
395
398
|
};
|
|
396
399
|
}
|
|
397
|
-
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region extensions/matrix/src/matrix/monitor/direct.ts
|
|
398
402
|
const DM_CACHE_TTL_MS = 3e4;
|
|
399
403
|
const RECENT_INVITE_TTL_MS = 3e4;
|
|
400
404
|
const MAX_DM_ROOMS = 1024;
|
|
@@ -579,7 +583,8 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
579
583
|
}
|
|
580
584
|
};
|
|
581
585
|
}
|
|
582
|
-
|
|
586
|
+
//#endregion
|
|
587
|
+
//#region extensions/matrix/src/matrix/monitor/types.ts
|
|
583
588
|
const EventType = {
|
|
584
589
|
RoomMessage: "m.room.message",
|
|
585
590
|
RoomMessageEncrypted: "m.room.encrypted",
|
|
@@ -588,7 +593,8 @@ const EventType = {
|
|
|
588
593
|
Location: "m.location",
|
|
589
594
|
Reaction: MATRIX_REACTION_EVENT_TYPE
|
|
590
595
|
};
|
|
591
|
-
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region extensions/matrix/src/matrix/monitor/access-state.ts
|
|
592
598
|
function normalizeMatrixEntry(raw) {
|
|
593
599
|
return normalizeMatrixAllowList([raw ?? ""])[0] ?? null;
|
|
594
600
|
}
|
|
@@ -694,7 +700,8 @@ async function resolveMatrixMonitorCommandAccess(state, params) {
|
|
|
694
700
|
}
|
|
695
701
|
})).commandAccess;
|
|
696
702
|
}
|
|
697
|
-
|
|
703
|
+
//#endregion
|
|
704
|
+
//#region extensions/matrix/src/matrix/monitor/verification-utils.ts
|
|
698
705
|
const VERIFICATION_EVENT_PREFIX = "m.key.verification.";
|
|
699
706
|
const VERIFICATION_REQUEST_MSGTYPE = "m.key.verification.request";
|
|
700
707
|
const VERIFICATION_NOTICE_PREFIXES = [
|
|
@@ -722,11 +729,12 @@ const matrixVerificationConstants = {
|
|
|
722
729
|
eventPrefix: VERIFICATION_EVENT_PREFIX,
|
|
723
730
|
requestMsgtype: VERIFICATION_REQUEST_MSGTYPE
|
|
724
731
|
};
|
|
725
|
-
|
|
732
|
+
//#endregion
|
|
733
|
+
//#region extensions/matrix/src/matrix/monitor/verification-events.ts
|
|
726
734
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
727
735
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
728
736
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
729
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-
|
|
737
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-Dp1giZ34.mjs").then((n) => n.t), import("./direct-management-Dp1giZ34.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
|
|
730
738
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
731
739
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
732
740
|
})));
|
|
@@ -1011,7 +1019,8 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
1011
1019
|
routeVerificationSummary
|
|
1012
1020
|
};
|
|
1013
1021
|
}
|
|
1014
|
-
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region extensions/matrix/src/matrix/monitor/events.ts
|
|
1015
1024
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS = 12e4;
|
|
1016
1025
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_THRESHOLD = 3;
|
|
1017
1026
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT = 3;
|
|
@@ -1285,7 +1294,8 @@ function registerMatrixMonitorEvents(params) {
|
|
|
1285
1294
|
client.off("room.event", onRoomEvent);
|
|
1286
1295
|
};
|
|
1287
1296
|
}
|
|
1288
|
-
|
|
1297
|
+
//#endregion
|
|
1298
|
+
//#region extensions/matrix/src/matrix/monitor/event-context.ts
|
|
1289
1299
|
function summarizeMatrixMessageContextEvent(event) {
|
|
1290
1300
|
if (isPollStartType(event.type)) {
|
|
1291
1301
|
const pollSummary = parsePollStart(event.content);
|
|
@@ -1349,7 +1359,8 @@ function createMatrixEventContextResolver(params) {
|
|
|
1349
1359
|
return context;
|
|
1350
1360
|
};
|
|
1351
1361
|
}
|
|
1352
|
-
|
|
1362
|
+
//#endregion
|
|
1363
|
+
//#region extensions/matrix/src/matrix/monitor/ack-config.ts
|
|
1353
1364
|
function resolveMatrixAckReactionConfig(params) {
|
|
1354
1365
|
const matrixConfig = params.cfg.channels?.matrix;
|
|
1355
1366
|
const accountConfig = resolveMatrixAccountConfig({
|
|
@@ -1364,7 +1375,8 @@ function resolveMatrixAckReactionConfig(params) {
|
|
|
1364
1375
|
ackReactionScope: accountConfig.ackReactionScope ?? matrixConfig?.ackReactionScope ?? params.cfg.messages?.ackReactionScope ?? "group-mentions"
|
|
1365
1376
|
};
|
|
1366
1377
|
}
|
|
1367
|
-
|
|
1378
|
+
//#endregion
|
|
1379
|
+
//#region extensions/matrix/src/matrix/monitor/preflight-audio.ts
|
|
1368
1380
|
function isMatrixAudioContent(params) {
|
|
1369
1381
|
if (params.msgtype === "m.audio") return true;
|
|
1370
1382
|
if (params.msgtype === "m.file" && typeof params.mimetype === "string") return params.mimetype.toLowerCase().startsWith("audio/");
|
|
@@ -1374,7 +1386,8 @@ const matrixPreflightAudio = createChannelPreflightAudio({
|
|
|
1374
1386
|
channel: "matrix",
|
|
1375
1387
|
isAudio: isMatrixAudioContent
|
|
1376
1388
|
});
|
|
1377
|
-
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region extensions/matrix/src/matrix/monitor/handler-helpers.ts
|
|
1378
1391
|
const MATRIX_TOOL_PROGRESS_MAX_CHARS = 300;
|
|
1379
1392
|
const MAX_TRACKED_SHARED_DM_CONTEXT_NOTICES = 512;
|
|
1380
1393
|
function resolveMatrixMentionPrecheckText(params) {
|
|
@@ -1462,12 +1475,13 @@ function resolveMatrixAllowBotsMode(value) {
|
|
|
1462
1475
|
function formatMatrixToolProgressMarkdownCode(text) {
|
|
1463
1476
|
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, 299).trimEnd()}...`).replaceAll("`", "'")}\``;
|
|
1464
1477
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1478
|
+
//#endregion
|
|
1479
|
+
//#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
|
|
1480
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-HHAbKARg.mjs").then((n) => n.s));
|
|
1467
1481
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1468
1482
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1469
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
1470
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
1483
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-UA_g6jEX.mjs"));
|
|
1484
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-BPjjKSoI.mjs"));
|
|
1471
1485
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
1472
1486
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1473
1487
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -1476,7 +1490,8 @@ async function matrixTextWouldActivateMentions(client, text) {
|
|
|
1476
1490
|
});
|
|
1477
1491
|
return mentions.room === true || (mentions.user_ids?.length ?? 0) > 0;
|
|
1478
1492
|
}
|
|
1479
|
-
|
|
1493
|
+
//#endregion
|
|
1494
|
+
//#region extensions/matrix/src/matrix/monitor/handler-context.ts
|
|
1480
1495
|
async function resolveMatrixInboundContext(config) {
|
|
1481
1496
|
const { handler, ingress, roomId, event, eventTs, resolveThreadContext, resolveReplyContext, senderId, sharedDmContextNoticeRooms } = config;
|
|
1482
1497
|
const { client, core, accountId, runtime, logVerboseMessage, groupPolicy, getRoomInfo, historyLimit, dmSessionScope } = handler;
|
|
@@ -1606,7 +1621,8 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1606
1621
|
route: {
|
|
1607
1622
|
..._route,
|
|
1608
1623
|
routeSessionKey: _route.sessionKey,
|
|
1609
|
-
parentSessionKey:
|
|
1624
|
+
parentSessionKey: void 0,
|
|
1625
|
+
modelParentSessionKey: threadTarget && _route.matchedBy !== "binding.channel" ? _route.mainSessionKey : void 0
|
|
1610
1626
|
},
|
|
1611
1627
|
reply: {
|
|
1612
1628
|
to: `room:${roomId}`,
|
|
@@ -1675,7 +1691,8 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1675
1691
|
sharedDmContextNotice
|
|
1676
1692
|
};
|
|
1677
1693
|
}
|
|
1678
|
-
|
|
1694
|
+
//#endregion
|
|
1695
|
+
//#region extensions/matrix/src/matrix/monitor/handler-draft-controller.ts
|
|
1679
1696
|
async function createMatrixDraftController(params) {
|
|
1680
1697
|
const { streaming, previewToolProgressEnabled, replyToMode, messageId, threadTarget, accountConfig, cfg, accountId, roomId, client, logVerboseMessage } = params;
|
|
1681
1698
|
const draftStreamingEnabled = streaming !== "off";
|
|
@@ -1803,7 +1820,8 @@ async function createMatrixDraftController(params) {
|
|
|
1803
1820
|
}
|
|
1804
1821
|
};
|
|
1805
1822
|
}
|
|
1806
|
-
|
|
1823
|
+
//#endregion
|
|
1824
|
+
//#region extensions/matrix/src/matrix/monitor/room-history.ts
|
|
1807
1825
|
/** Maximum entries retained per room (hard cap to bound memory). */
|
|
1808
1826
|
const DEFAULT_MAX_QUEUE_SIZE = 200;
|
|
1809
1827
|
/** Maximum number of rooms to retain queues for (FIFO eviction beyond this). */
|
|
@@ -1995,7 +2013,8 @@ function createRoomHistoryTracker(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE, maxRoom
|
|
|
1995
2013
|
}
|
|
1996
2014
|
};
|
|
1997
2015
|
}
|
|
1998
|
-
|
|
2016
|
+
//#endregion
|
|
2017
|
+
//#region extensions/matrix/src/matrix/monitor/handler-ingress-access.ts
|
|
1999
2018
|
async function resolveMatrixIngressAccess(config) {
|
|
2000
2019
|
const { handler, params: paramsLocal, roomId, event, eventTs, senderId, isReactionEvent, readStoreAllowFrom, shouldSendPairingReply, resolveLiveAccountAllowlists, roomHistoryTracker } = config;
|
|
2001
2020
|
const { core, cfg, accountId, accountConfig, client, logVerboseMessage, groupPolicy, dmEnabled, dmPolicy, dmThreadReplies, threadReplies, roomsConfig, accountAllowBots, configuredBotUserIds, needsRoomAliasesForConfig, getRoomInfo, getMemberDisplayName } = handler;
|
|
@@ -2196,7 +2215,8 @@ async function resolveMatrixIngressAccess(config) {
|
|
|
2196
2215
|
effectiveRoomUsers
|
|
2197
2216
|
};
|
|
2198
2217
|
}
|
|
2199
|
-
|
|
2218
|
+
//#endregion
|
|
2219
|
+
//#region src/channels/mention-gating.ts
|
|
2200
2220
|
function resolveBotThreadMentionPolicy(params) {
|
|
2201
2221
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
2202
2222
|
requireMention: params.requireMention,
|
|
@@ -2207,7 +2227,8 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
2207
2227
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
2208
2228
|
};
|
|
2209
2229
|
}
|
|
2210
|
-
|
|
2230
|
+
//#endregion
|
|
2231
|
+
//#region extensions/matrix/src/matrix/monitor/media.ts
|
|
2211
2232
|
const MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 3e4;
|
|
2212
2233
|
async function downloadMatrixMedia(params) {
|
|
2213
2234
|
if (typeof params.sizeBytes === "number" && params.sizeBytes > params.maxBytes) throw new MatrixMediaSizeLimitError();
|
|
@@ -2233,7 +2254,8 @@ async function downloadMatrixMedia(params) {
|
|
|
2233
2254
|
placeholder: "[matrix media]"
|
|
2234
2255
|
};
|
|
2235
2256
|
}
|
|
2236
|
-
|
|
2257
|
+
//#endregion
|
|
2258
|
+
//#region extensions/matrix/src/matrix/monitor/mentions.ts
|
|
2237
2259
|
const MATRIX_HTML_ENTITY_RE = /&(?:#x?[0-9a-f]+|amp|apos|gt|lt|nbsp|quot);/gi;
|
|
2238
2260
|
function decodeVisibleHtmlEntities(value) {
|
|
2239
2261
|
return value.replace(MATRIX_HTML_ENTITY_RE, (entity) => {
|
|
@@ -2344,7 +2366,8 @@ function resolveMentions(params) {
|
|
|
2344
2366
|
hasExplicitMention: explicitMention
|
|
2345
2367
|
};
|
|
2346
2368
|
}
|
|
2347
|
-
|
|
2369
|
+
//#endregion
|
|
2370
|
+
//#region extensions/matrix/src/matrix/monitor/handler-ingress-content.ts
|
|
2348
2371
|
async function resolveMatrixIngressContent(config) {
|
|
2349
2372
|
const { handler, params: paramsLocal, access, roomId, event, eventType, isPollEvent, eventTs, senderId, roomHistoryTracker, resolveThreadContext } = config;
|
|
2350
2373
|
const { client, core, accountId, accountConfig, logger, logVerboseMessage, historyLimit, mediaMaxBytes, dmSessionScope, getMemberDisplayName } = handler;
|
|
@@ -2653,7 +2676,8 @@ async function resolveMatrixIngressContent(config) {
|
|
|
2653
2676
|
threadContext
|
|
2654
2677
|
};
|
|
2655
2678
|
}
|
|
2656
|
-
|
|
2679
|
+
//#endregion
|
|
2680
|
+
//#region extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts
|
|
2657
2681
|
function mergeMatrixReplyDeliveryResults(results) {
|
|
2658
2682
|
const single = results.length === 1 ? results[0] : void 0;
|
|
2659
2683
|
if (single?.visibleReplySent) return single;
|
|
@@ -2859,7 +2883,8 @@ function createMatrixReplyDispatcher(config) {
|
|
|
2859
2883
|
nonFinalReplyDeliveryFailed: () => nonFinalReplyDeliveryFailed
|
|
2860
2884
|
};
|
|
2861
2885
|
}
|
|
2862
|
-
|
|
2886
|
+
//#endregion
|
|
2887
|
+
//#region extensions/matrix/src/matrix/monitor/handler-state.ts
|
|
2863
2888
|
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
2864
2889
|
const PAIRING_REPLY_COOLDOWN_MS = 3e5;
|
|
2865
2890
|
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
@@ -2945,7 +2970,8 @@ function createMatrixHandlerState(config) {
|
|
|
2945
2970
|
shouldSendPairingReply
|
|
2946
2971
|
};
|
|
2947
2972
|
}
|
|
2948
|
-
|
|
2973
|
+
//#endregion
|
|
2974
|
+
//#region extensions/matrix/src/matrix/monitor/location.ts
|
|
2949
2975
|
function decodeGeoUriParamValue(value) {
|
|
2950
2976
|
try {
|
|
2951
2977
|
return decodeURIComponent(value);
|
|
@@ -2992,7 +3018,8 @@ function resolveMatrixLocation(params) {
|
|
|
2992
3018
|
context: toLocationContext(location)
|
|
2993
3019
|
};
|
|
2994
3020
|
}
|
|
2995
|
-
|
|
3021
|
+
//#endregion
|
|
3022
|
+
//#region extensions/matrix/src/matrix/monitor/handler.ts
|
|
2996
3023
|
const SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE = "SESSION_RESTART_RECOVERY_TOMBSTONE";
|
|
2997
3024
|
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.";
|
|
2998
3025
|
function createMatrixRoomMessageHandler(params) {
|
|
@@ -3332,7 +3359,8 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3332
3359
|
}
|
|
3333
3360
|
};
|
|
3334
3361
|
}
|
|
3335
|
-
|
|
3362
|
+
//#endregion
|
|
3363
|
+
//#region extensions/matrix/src/matrix/monitor/ingress.ts
|
|
3336
3364
|
const MatrixIngressPayloadError = createChannelIngressError("MatrixIngressPayloadError");
|
|
3337
3365
|
function inspectMatrixIngressEvent(raw) {
|
|
3338
3366
|
if (!raw || typeof raw.roomId !== "string" || !raw.roomId.trim() || !raw.event || typeof raw.event.event_id !== "string" || !raw.event.event_id.trim()) throw new MatrixIngressPayloadError("Matrix ingress event is missing its room or event ID");
|
|
@@ -3342,6 +3370,21 @@ function inspectMatrixIngressEvent(raw) {
|
|
|
3342
3370
|
};
|
|
3343
3371
|
}
|
|
3344
3372
|
function createMatrixIngressMonitor(params) {
|
|
3373
|
+
const diagnosticId = randomUUID();
|
|
3374
|
+
let diagnosticCount = 0;
|
|
3375
|
+
const observe = (phase, facts = {}) => {
|
|
3376
|
+
if (diagnosticCount >= 64) return;
|
|
3377
|
+
diagnosticCount += 1;
|
|
3378
|
+
try {
|
|
3379
|
+
emitMatrixLog("debug", "MatrixIngress", [JSON.stringify({
|
|
3380
|
+
monitor: diagnosticId,
|
|
3381
|
+
sequence: diagnosticCount,
|
|
3382
|
+
phase,
|
|
3383
|
+
...facts,
|
|
3384
|
+
exhausted: diagnosticCount === 64
|
|
3385
|
+
})]);
|
|
3386
|
+
} catch {}
|
|
3387
|
+
};
|
|
3345
3388
|
let queue = params.queue;
|
|
3346
3389
|
const getQueue = () => queue ??= getMatrixRuntime().state.openChannelIngressQueue({ accountId: params.accountId });
|
|
3347
3390
|
let lastReceivedAt = 0;
|
|
@@ -3367,11 +3410,23 @@ function createMatrixIngressMonitor(params) {
|
|
|
3367
3410
|
createClaimError: (kind) => new MatrixIngressPayloadError(kind === "invalid-version" ? "Matrix ingress payload version is unsupported" : "Matrix event identity changed after durable admission")
|
|
3368
3411
|
},
|
|
3369
3412
|
deliver: async ({ roomId, event, historical }, lifecycle) => {
|
|
3370
|
-
|
|
3371
|
-
if (
|
|
3413
|
+
observe("deliver-entered", { historical: historical === true });
|
|
3414
|
+
if (historical) {
|
|
3415
|
+
observe("historical-skipped");
|
|
3416
|
+
return;
|
|
3417
|
+
}
|
|
3418
|
+
if (event.type === EventType.RoomMessageEncrypted && !params.client.crypto) {
|
|
3419
|
+
observe("crypto-unavailable");
|
|
3420
|
+
return;
|
|
3421
|
+
}
|
|
3422
|
+
observe("hydrate-entered");
|
|
3372
3423
|
const [hydrated] = await params.client.hydrateEvents(roomId, [event]);
|
|
3424
|
+
observe("hydrate-returned", { hydrated: Boolean(hydrated) });
|
|
3373
3425
|
if (!hydrated || hydrated.type === EventType.RoomMessageEncrypted || getMatrixEventProjection(hydrated)?.decryptionFailure) throw new Error("Matrix ingress event is waiting for decryption");
|
|
3374
|
-
|
|
3426
|
+
observe("dispatch-entered");
|
|
3427
|
+
const result = await params.dispatch(roomId, hydrated, lifecycle);
|
|
3428
|
+
observe("dispatch-returned", { outcome: result?.kind ?? "void" });
|
|
3429
|
+
return result;
|
|
3375
3430
|
},
|
|
3376
3431
|
pollIntervalMs: 1e3,
|
|
3377
3432
|
retention: "standard",
|
|
@@ -3402,16 +3457,27 @@ function createMatrixIngressMonitor(params) {
|
|
|
3402
3457
|
});
|
|
3403
3458
|
}
|
|
3404
3459
|
if (events.length === 0) return;
|
|
3460
|
+
observe("sync-selected", {
|
|
3461
|
+
count: events.length,
|
|
3462
|
+
hasSavedSync
|
|
3463
|
+
});
|
|
3405
3464
|
await (initializeOrder ??= (async () => {
|
|
3465
|
+
observe("order-load-entered");
|
|
3406
3466
|
const ingressQueue = getQueue();
|
|
3407
3467
|
const { pending, claims } = ingressQueue.listUnsettled ? await ingressQueue.listUnsettled() : {
|
|
3408
3468
|
pending: await ingressQueue.listPending({ limit: "all" }),
|
|
3409
3469
|
claims: await ingressQueue.listClaims()
|
|
3410
3470
|
};
|
|
3471
|
+
observe("order-load-returned", {
|
|
3472
|
+
pending: pending.length,
|
|
3473
|
+
claims: claims.length
|
|
3474
|
+
});
|
|
3411
3475
|
for (const row of [...pending, ...claims]) lastReceivedAt = Math.max(lastReceivedAt, row.receivedAt);
|
|
3412
3476
|
})());
|
|
3413
3477
|
for (const event of events) {
|
|
3478
|
+
observe("admit-entered", { historical: event.historical === true });
|
|
3414
3479
|
const result = await monitor.admit(event, { receivedAt: Math.max(Date.now(), lastReceivedAt + 1) });
|
|
3480
|
+
observe("admit-returned", { outcome: result.kind === "durable" ? result.queueResult.kind : result.kind });
|
|
3415
3481
|
if (result.kind === "durable") {
|
|
3416
3482
|
const admitted = result.queueResult;
|
|
3417
3483
|
if (admitted.kind === "accepted" || admitted.kind === "pending" || admitted.kind === "claimed") lastReceivedAt = Math.max(lastReceivedAt, admitted.record.receivedAt);
|
|
@@ -3425,7 +3491,8 @@ function createMatrixIngressMonitor(params) {
|
|
|
3425
3491
|
waitForIdle: monitor.waitForIdle
|
|
3426
3492
|
};
|
|
3427
3493
|
}
|
|
3428
|
-
|
|
3494
|
+
//#endregion
|
|
3495
|
+
//#region extensions/matrix/src/matrix/monitor/recent-invite.ts
|
|
3429
3496
|
function shouldPromoteRecentInviteRoom(params) {
|
|
3430
3497
|
if (!params.roomInfo.nameResolved || !params.roomInfo.aliasesResolved) return false;
|
|
3431
3498
|
const roomAliases = [params.roomInfo.canonicalAlias ?? "", ...params.roomInfo.altAliases].filter(Boolean);
|
|
@@ -3436,12 +3503,13 @@ function shouldPromoteRecentInviteRoom(params) {
|
|
|
3436
3503
|
aliases: roomAliases
|
|
3437
3504
|
}).matchSource === void 0;
|
|
3438
3505
|
}
|
|
3439
|
-
|
|
3506
|
+
//#endregion
|
|
3507
|
+
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3440
3508
|
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
3441
|
-
import("./setup-core-
|
|
3442
|
-
import("./device-health-
|
|
3443
|
-
import("./setup-core-
|
|
3444
|
-
import("./startup-verification-
|
|
3509
|
+
import("./setup-core-DcqQbLZv.mjs").then((n) => n.f),
|
|
3510
|
+
import("./device-health-Ck2YpEVN.mjs").then((n) => n.t),
|
|
3511
|
+
import("./setup-core-DcqQbLZv.mjs").then((n) => n.u),
|
|
3512
|
+
import("./startup-verification-UkaoSldm.mjs")
|
|
3445
3513
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
3446
3514
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3447
3515
|
listStaleOpenClawMatrixDevices: deviceHealthModule.listStaleOpenClawMatrixDevices,
|
|
@@ -3503,7 +3571,8 @@ async function runMatrixStartupMaintenance(params) {
|
|
|
3503
3571
|
params.logger.debug?.("Failed to resolve matrix verification status (non-fatal)", { error: String(err) });
|
|
3504
3572
|
}
|
|
3505
3573
|
}
|
|
3506
|
-
|
|
3574
|
+
//#endregion
|
|
3575
|
+
//#region extensions/matrix/src/matrix/monitor/status.ts
|
|
3507
3576
|
function formatSyncError(error) {
|
|
3508
3577
|
if (!error) return null;
|
|
3509
3578
|
if (error instanceof Error) return error.message || error.name || "unknown";
|
|
@@ -3523,7 +3592,17 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3523
3592
|
const emit = () => {
|
|
3524
3593
|
params.statusSink?.({ ...status });
|
|
3525
3594
|
};
|
|
3595
|
+
let startupComplete = false;
|
|
3596
|
+
let pendingReadyAt = null;
|
|
3597
|
+
let pendingTransportActivity = false;
|
|
3526
3598
|
const noteConnected = (at = Date.now(), options) => {
|
|
3599
|
+
if (!startupComplete) {
|
|
3600
|
+
pendingReadyAt = at;
|
|
3601
|
+
pendingTransportActivity ||= options?.transportActivity === true;
|
|
3602
|
+
status.lastEventAt = at;
|
|
3603
|
+
emit();
|
|
3604
|
+
return;
|
|
3605
|
+
}
|
|
3527
3606
|
const lastConnectedAt = status.connected === true ? status.lastConnectedAt ?? at : at;
|
|
3528
3607
|
Object.assign(status, channelReadyPatch({
|
|
3529
3608
|
lastConnectedAt,
|
|
@@ -3536,6 +3615,8 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3536
3615
|
};
|
|
3537
3616
|
const noteDisconnected = (paramsLocal) => {
|
|
3538
3617
|
const at = paramsLocal.at ?? Date.now();
|
|
3618
|
+
pendingReadyAt = null;
|
|
3619
|
+
pendingTransportActivity = false;
|
|
3539
3620
|
const tokenInvalidated = isMatrixAccessTokenInvalidatedError(paramsLocal.error);
|
|
3540
3621
|
if (status.lifecycle === "blocked" && status.terminalDisconnect === true && !tokenInvalidated) {
|
|
3541
3622
|
status.connected = false;
|
|
@@ -3561,6 +3642,16 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3561
3642
|
};
|
|
3562
3643
|
emit();
|
|
3563
3644
|
return {
|
|
3645
|
+
markStartupComplete(at = Date.now()) {
|
|
3646
|
+
startupComplete = true;
|
|
3647
|
+
if (pendingReadyAt !== null) {
|
|
3648
|
+
const readyAt = Math.max(pendingReadyAt, at);
|
|
3649
|
+
const transportActivity = pendingTransportActivity;
|
|
3650
|
+
pendingReadyAt = null;
|
|
3651
|
+
pendingTransportActivity = false;
|
|
3652
|
+
noteConnected(readyAt, { transportActivity });
|
|
3653
|
+
}
|
|
3654
|
+
},
|
|
3564
3655
|
noteSyncState(state, error, at = Date.now()) {
|
|
3565
3656
|
if (isMatrixReadySyncState(state)) {
|
|
3566
3657
|
noteConnected(at, { transportActivity: state === "SYNCING" });
|
|
@@ -3598,7 +3689,8 @@ function createMatrixMonitorStatusController(params) {
|
|
|
3598
3689
|
}
|
|
3599
3690
|
};
|
|
3600
3691
|
}
|
|
3601
|
-
|
|
3692
|
+
//#endregion
|
|
3693
|
+
//#region extensions/matrix/src/matrix/monitor/index.ts
|
|
3602
3694
|
function resolveMatrixStreamingMode(streaming) {
|
|
3603
3695
|
const mode = streaming?.mode;
|
|
3604
3696
|
if (mode === "partial" || mode === "quiet" || mode === "progress") return mode;
|
|
@@ -4012,6 +4104,7 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4012
4104
|
await cleanup("stop");
|
|
4013
4105
|
return;
|
|
4014
4106
|
}
|
|
4107
|
+
statusController.markStartupComplete();
|
|
4015
4108
|
await Promise.race([waitUntilAbort(monitorLifecycleSignal, async () => {
|
|
4016
4109
|
try {
|
|
4017
4110
|
logVerboseMessage("matrix: stopping client");
|
|
@@ -4037,4 +4130,5 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4037
4130
|
throw err;
|
|
4038
4131
|
}
|
|
4039
4132
|
}
|
|
4133
|
+
//#endregion
|
|
4040
4134
|
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-UUPhMBmu.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-DcqQbLZv.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-By_2hsXr.mjs";
|
|
7
|
+
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-D-W_QQjz.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-DYW8ULZS.mjs").then((n) => n.n);
|
|
91
91
|
const results = await resolveMatrixTargets({
|
|
92
92
|
cfg,
|
|
93
93
|
accountId,
|
|
@@ -192,7 +192,7 @@ async function runMatrixConfigure(params) {
|
|
|
192
192
|
resolvedIds.push(cleaned);
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
|
-
const { listMatrixDirectoryGroupsLive } = await import("./directory-live-
|
|
195
|
+
const { listMatrixDirectoryGroupsLive } = await import("./directory-live-ufzRheWx.mjs").then((n) => n.t);
|
|
196
196
|
const matches = await listMatrixDirectoryGroupsLive({
|
|
197
197
|
cfg: accessCfg,
|
|
198
198
|
accountId: selectedAccountId,
|
|
@@ -442,4 +442,5 @@ const matrixOnboardingAdapter = {
|
|
|
442
442
|
dmPolicy,
|
|
443
443
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
444
444
|
};
|
|
445
|
+
//#endregion
|
|
445
446
|
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-CX7k81dL.mjs";
|
|
2
|
+
import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-HHAbKARg.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 { l as resolveMatrixAuthContext } from "./client-
|
|
5
|
-
import { n as withResolvedActionClient } from "./client-
|
|
6
|
-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
+
import { d as syncMatrixOwnProfile, p as updateMatrixAccountConfig } from "./setup-core-DcqQbLZv.mjs";
|
|
3
|
+
import { n as resolveMatrixConfigPath } from "./config-paths-CnREYb1Y.mjs";
|
|
4
|
+
import { l as resolveMatrixAuthContext } from "./client-D1bsidwU.mjs";
|
|
5
|
+
import { n as withResolvedActionClient } from "./client-CFPYqaYK.mjs";
|
|
6
|
+
//#region extensions/matrix/src/matrix/actions/profile.ts
|
|
7
7
|
async function updateMatrixOwnProfile(opts = {}) {
|
|
8
8
|
const runtime = getMatrixRuntime();
|
|
9
9
|
return await withResolvedActionClient(opts, async (client) => {
|
|
@@ -22,7 +22,8 @@ async function updateMatrixOwnProfile(opts = {}) {
|
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region extensions/matrix/src/profile-update.ts
|
|
26
27
|
async function applyMatrixProfileUpdate(params) {
|
|
27
28
|
const runtime = getMatrixRuntime();
|
|
28
29
|
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 };
|