@openclaw/matrix 2026.7.2-beta.1 → 2026.7.2-beta.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/{account-selection-Bz00QTmQ.js → account-selection-kqquRzCf.js} +5 -5
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime--Ei44Vo2.js → approval-handler.runtime-BEa98wwG.js} +5 -5
- package/dist/{approval-ids-C_2kSMdJ.js → approval-ids-Dfn7oQAm.js} +1 -1
- package/dist/{approval-reaction-auth-TdVPcgxP.js → approval-reaction-auth-kXkCJBGi.js} +2 -2
- package/dist/{approval-reactions-BgU51JGd.js → approval-reactions-D-BxBK_L.js} +1 -1
- package/dist/auth-presence.js +13 -21
- package/dist/{channel-CxqDh7mS.js → channel-j331Xd7b.js} +14 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-wNfJc57I.js → channel.runtime-BIwlVfQw.js} +15 -16
- package/dist/{cli-o00oTJhx.js → cli-0EcKfqFw.js} +25 -15
- package/dist/{cli-metadata-Gf3HSJ2c.js → cli-metadata-Xq1Xb15R.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-ClHisZbf.js → client-BtG4quUl.js} +2 -2
- package/dist/{client-DP0nmFxK.js → client-CA0PULls.js} +2 -2
- package/dist/{client-bootstrap-PqYOS-mO.js → client-bootstrap-Dk5EAn3n.js} +1 -1
- package/dist/{config-schema-CG9goLWp.js → config-schema-B5GRV8wL.js} +8 -10
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-D9z9RjCM.js → create-client-WQExaby_.js} +4 -4
- package/dist/credentials-W2EmwRhu.js +65 -0
- package/dist/credentials-read-DVmFCm7X.js +77 -0
- package/dist/{credentials-write.runtime-J_EUt5WP.js → credentials-write.runtime-Be9zNSUw.js} +1 -1
- package/dist/{crypto-runtime-BHcxauC4.js → crypto-runtime-CAff-n15.js} +4 -4
- package/dist/{directory-live-DPy2aaPF.js → directory-live-DiC-0XBC.js} +3 -3
- package/dist/{doctor-BGTs609f.js → doctor-DwUVm5Lw.js} +1 -1
- package/dist/{doctor-contract-D2qTLe-C.js → doctor-contract-BA2Y6Crx.js} +1 -1
- package/dist/doctor-contract-api.js +117 -11
- package/dist/{draft-stream-De7uikGn.js → draft-stream-CTLKtJJ0.js} +1 -1
- package/dist/{encryption-guidance-BFfgq7c7.js → encryption-guidance-CbEFe38F.js} +1 -1
- package/dist/{file-sync-store-Cxb0ckyX.js → file-sync-store-CPkgnSXp.js} +23 -6
- package/dist/helper-api.js +2 -2
- package/dist/{http-client-W4TJQM6r.js → http-client-BmrgOZTL.js} +2 -2
- package/dist/{idb-persistence-iUZoHZkp.js → idb-persistence-Dyy6ipgU.js} +3 -3
- package/dist/{inbound-dedupe-DcMs0YXL.js → inbound-dedupe-CaBLblef.js} +19 -38
- package/dist/index.js +1 -1
- package/dist/{logger-BMClpI5b.js → logger-D0GCSDQq.js} +1 -1
- package/dist/{logging-CFJrbDAN.js → logging-QH-48Gr6.js} +1 -1
- package/dist/{media-text-DWaotsZB.js → media-text-BMXEXb1j.js} +1 -1
- package/dist/{messages-Dm3K4ZvM.js → messages-3UBHfZrN.js} +3 -3
- package/dist/{monitor-C_kgPPeV.js → monitor-BtUIds8T.js} +135 -136
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-sBV-Govx.js +3 -0
- package/dist/{profile-update-iUHCoks3.js → profile-update-Bh2XtJwN.js} +3 -3
- package/dist/{reaction-events-0tubdHRM.js → reaction-events-BwAKtUyQ.js} +3 -3
- package/dist/record-shared-CWWx6fvI.js +2 -0
- package/dist/{recovery-key-store-Bx0zTJcB.js → recovery-key-store-CW6eePfp.js} +2 -2
- package/dist/{resolve-targets-DlLrfWDy.js → resolve-targets-DVoj-YxB.js} +1 -1
- package/dist/{resolver.runtime-MeaT1zXx.js → resolver.runtime-CC0VVsAt.js} +1 -1
- package/dist/{runtime-CveSqMOP.js → runtime-6S3DNFNv.js} +1 -1
- package/dist/runtime-api.js +6 -6
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{sdk-CI8E2TKg.js → sdk-CIDZXWpZ.js} +7 -7
- package/dist/{secret-contract-OZoQf0kI.js → secret-contract-M3hRmGO-.js} +21 -5
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-C7xuGWpv.js → send-BJbrdmNm.js} +4 -3
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/{setup-bootstrap-CCsexWTZ.js → setup-bootstrap-DGPOOdz-.js} +2 -2
- package/dist/{setup-core-DlmTyIP0.js → setup-core-XCdAx1nY.js} +3 -3
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-2SS94JV0.js → setup-surface-CzUiTe_k.js} +6 -6
- package/dist/{shared-DgvN5rBx.js → shared-DquM1oz6.js} +7 -7
- package/dist/{startup-verification-CbIyF7z1.js → startup-verification-CA00kebL.js} +3 -3
- package/dist/{storage-BtSOar8T.js → storage-CzHxeF5E.js} +9 -9
- package/dist/{thread-bindings-BI8MHWp9.js → thread-bindings-Cw194yEn.js} +4 -4
- package/dist/{tool-actions.runtime-CnyhVPoY.js → tool-actions.runtime-C0jgWYhX.js} +19 -15
- package/dist/{verification-DLSe3sP7.js → verification-DjxyWTNP.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +70 -70
- package/package.json +4 -4
- package/dist/async-lock-BcLS4KOc.js +0 -19
- package/dist/credentials-DnhsLAuR.js +0 -56
- package/dist/credentials-read-BtS-HRT5.js +0 -112
- package/dist/probe.runtime-Dry8PTWC.js +0 -3
- package/dist/record-shared-CvzjvHRn.js +0 -2
- package/dist/{deps-DDbghaZH.js → deps-CcVJfvRM.js} +1 -1
- package/dist/{storage-paths-B4_I9iqO.js → storage-paths-gUmSydsW.js} +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-BZWN9tGS.js";
|
|
2
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
3
|
-
import { m as resolveConfiguredMatrixBotUserIds } from "./setup-core-
|
|
4
|
-
import { a as buildAllowlistResolutionSummary, c as createTypingCallbacks, d as logInboundDrop, f as logTypingFailure, h as toLocationContext, i as addAllowlistUserEntriesFromConfigEntry, l as formatLocationText, m as summarizeMapping, n as resolveMatrixStoredSessionMeta, o as canonicalizeAllowlistWithResolvedIds, p as patchAllowlistUsersInConfigEntries, r as resolveMatrixRoomConfig, s as createReplyPrefixOptions, u as getAgentScopedMediaLocalRoots } from "./channel-
|
|
5
|
-
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./config-schema-
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
3
|
+
import { m as resolveConfiguredMatrixBotUserIds } from "./setup-core-XCdAx1nY.js";
|
|
4
|
+
import { a as buildAllowlistResolutionSummary, c as createTypingCallbacks, d as logInboundDrop, f as logTypingFailure, h as toLocationContext, i as addAllowlistUserEntriesFromConfigEntry, l as formatLocationText, m as summarizeMapping, n as resolveMatrixStoredSessionMeta, o as canonicalizeAllowlistWithResolvedIds, p as patchAllowlistUsersInConfigEntries, r as resolveMatrixRoomConfig, s as createReplyPrefixOptions, u as getAgentScopedMediaLocalRoots } from "./channel-j331Xd7b.js";
|
|
5
|
+
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./config-schema-B5GRV8wL.js";
|
|
6
6
|
import { t as isMatrixQualifiedUserId } from "./target-ids-B-5aQxwn.js";
|
|
7
7
|
import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
|
|
8
|
-
import { D as parsePollStartContent, S as formatPollAsText, T as isPollStartType, _ as readJoinedMatrixMembers, a as sendMessageMatrix, f as promoteMatrixDirectRoomCandidate, g as isStrictDirectMembership, h as hasDirectMatrixMemberFlag, t as chunkMatrixText, v as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, w as isPollEventType } from "./send-
|
|
9
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-
|
|
10
|
-
import { i as createMatrixInboundEventDeduper } from "./inbound-dedupe-
|
|
11
|
-
import { a as resolveMatrixMessageAttachment, c as fetchMatrixPollSnapshot, i as isLikelyBareFilename, n as formatMatrixMediaUnavailableText, o as resolveMatrixMessageBody, r as formatMatrixMessageText, t as formatMatrixMediaTooLargeText } from "./media-text-
|
|
8
|
+
import { D as parsePollStartContent, S as formatPollAsText, T as isPollStartType, _ as readJoinedMatrixMembers, a as sendMessageMatrix, f as promoteMatrixDirectRoomCandidate, g as isStrictDirectMembership, h as hasDirectMatrixMemberFlag, t as chunkMatrixText, v as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, w as isPollEventType } from "./send-BJbrdmNm.js";
|
|
9
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-Cw194yEn.js";
|
|
10
|
+
import { i as createMatrixInboundEventDeduper } from "./inbound-dedupe-CaBLblef.js";
|
|
11
|
+
import { a as resolveMatrixMessageAttachment, c as fetchMatrixPollSnapshot, i as isLikelyBareFilename, n as formatMatrixMediaUnavailableText, o as resolveMatrixMessageBody, r as formatMatrixMessageText, t as formatMatrixMediaTooLargeText } from "./media-text-BMXEXb1j.js";
|
|
12
12
|
import { n as setActiveMatrixClient } from "./active-client-DXvz2gCo.js";
|
|
13
13
|
import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
|
|
14
|
-
import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, l as isMatrixStartupAbortError, n as releaseSharedClientInstance, p as resolveMatrixAuthContext, u as throwIfMatrixStartupAborted } from "./shared-
|
|
15
|
-
import "./client-
|
|
16
|
-
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-
|
|
14
|
+
import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, l as isMatrixStartupAbortError, n as releaseSharedClientInstance, p as resolveMatrixAuthContext, u as throwIfMatrixStartupAborted } from "./shared-DquM1oz6.js";
|
|
15
|
+
import "./client-CA0PULls.js";
|
|
16
|
+
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-BmrgOZTL.js";
|
|
17
17
|
import { d as resolveAllowlistProviderRuntimeGroupPolicy, f as resolveDefaultGroupPolicy, g as warnMissingProviderGroupPolicyFallbackOnce, h as resolveThreadBindingMaxAgeMsForChannel, m as resolveThreadBindingIdleTimeoutMsForChannel, t as GROUP_POLICY_BLOCKED_LABEL } from "./runtime-api-D1xI_cvh.js";
|
|
18
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
19
|
-
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-
|
|
18
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-DVoj-YxB.js";
|
|
19
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-CbEFe38F.js";
|
|
20
20
|
import { n as isMatrixReadySyncState, r as isMatrixTerminalSyncState, t as isMatrixDisconnectedSyncState } from "./sync-state-CWbp0QSY.js";
|
|
21
21
|
import { a as EventType, i as resolveMatrixThreadRouting, n as resolveMatrixReplyToEventId, o as RelationType, r as resolveMatrixThreadRootId, t as resolveMatrixInboundRoute } from "./route-DY6at4qJ.js";
|
|
22
22
|
import { t as createMatrixRoomInfoResolver } from "./room-info-B6vKD5DF.js";
|
|
@@ -25,8 +25,8 @@ import { buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate,
|
|
|
25
25
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
26
26
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
27
27
|
import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
28
|
-
import { buildChannelInboundEventContext, hasFinalInboundReplyDispatch, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
29
|
-
import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
|
|
28
|
+
import { buildChannelInboundEventContext, createChannelInboundEnvelopeBuilder, hasFinalInboundReplyDispatch, resolveInboundMentionDecision, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
29
|
+
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
30
30
|
import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
31
31
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
32
32
|
import { format } from "node:util";
|
|
@@ -36,6 +36,7 @@ import { resolveAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
|
36
36
|
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
37
37
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
38
38
|
import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
39
|
+
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
39
40
|
import { evaluateSupplementalContextVisibility, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
40
41
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
41
42
|
import { buildInboundHistoryFromEntries } from "openclaw/plugin-sdk/reply-history";
|
|
@@ -817,7 +818,7 @@ const matrixVerificationConstants = {
|
|
|
817
818
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
818
819
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
819
820
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
820
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-
|
|
821
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-BJbrdmNm.js").then((n) => n.d), import("./send-BJbrdmNm.js").then((n) => n.m)]).then(([directManagementModule, directRoomModule]) => ({
|
|
821
822
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
822
823
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
823
824
|
})));
|
|
@@ -2081,14 +2082,6 @@ function createRoomHistoryTrackerInternal(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE,
|
|
|
2081
2082
|
discarded: true
|
|
2082
2083
|
};
|
|
2083
2084
|
},
|
|
2084
|
-
getPendingHistory(agentId, roomId, limit, threadRootId) {
|
|
2085
|
-
const queue = findScopedQueue(roomId, threadRootId);
|
|
2086
|
-
if (!queue) return [];
|
|
2087
|
-
return computePendingHistory(queue, agentId, roomId, limit, void 0, void 0, threadRootId);
|
|
2088
|
-
},
|
|
2089
|
-
recordTrigger(roomId, entry, threadRootId) {
|
|
2090
|
-
return appendToQueue(getScopedQueue(roomId, threadRootId), entry);
|
|
2091
|
-
},
|
|
2092
2085
|
prepareTrigger(agentId, roomId, limit, entry, threadRootId) {
|
|
2093
2086
|
return prepareTriggerInternal(agentId, roomId, limit, entry, threadRootId);
|
|
2094
2087
|
},
|
|
@@ -2212,11 +2205,11 @@ function createMatrixThreadContextResolver(params) {
|
|
|
2212
2205
|
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
2213
2206
|
const PAIRING_REPLY_COOLDOWN_MS = 5 * 6e4;
|
|
2214
2207
|
const MATRIX_TOOL_PROGRESS_MAX_CHARS = 300;
|
|
2215
|
-
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-
|
|
2208
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-BJbrdmNm.js").then((n) => n.l));
|
|
2216
2209
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
2217
2210
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
2218
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
2219
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
2211
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-BwAKtUyQ.js"));
|
|
2212
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-CTLKtJJ0.js"));
|
|
2220
2213
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
2221
2214
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
2222
2215
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -2227,12 +2220,6 @@ async function matrixTextWouldActivateMentions(client, text) {
|
|
|
2227
2220
|
}
|
|
2228
2221
|
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
2229
2222
|
const MAX_TRACKED_SHARED_DM_CONTEXT_NOTICES = 512;
|
|
2230
|
-
var MatrixRetryableInboundError = class extends Error {
|
|
2231
|
-
constructor(message, options) {
|
|
2232
|
-
super(message, options);
|
|
2233
|
-
this.name = "MatrixRetryableInboundError";
|
|
2234
|
-
}
|
|
2235
|
-
};
|
|
2236
2223
|
async function redactMatrixDraftEvent(client, roomId, draftEventId) {
|
|
2237
2224
|
await client.redactEvent(roomId, draftEventId).catch(() => {});
|
|
2238
2225
|
}
|
|
@@ -2342,7 +2329,7 @@ function formatMatrixToolProgressMarkdownCode(text) {
|
|
|
2342
2329
|
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, MATRIX_TOOL_PROGRESS_MAX_CHARS - 1).trimEnd()}...`).replaceAll("`", "'")}\``;
|
|
2343
2330
|
}
|
|
2344
2331
|
function createMatrixRoomMessageHandler(params) {
|
|
2345
|
-
const { client, core, cfg, accountId, accountConfig, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], roomsConfig, accountAllowBots, configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, threadReplies, dmThreadReplies, dmSessionScope, streaming, previewToolProgressEnabled, blockStreamingEnabled, dmEnabled, dmPolicy, textLimit, mediaMaxBytes, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, needsRoomAliasesForConfig, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist } = params;
|
|
2332
|
+
const { client, core, cfg, accountId, accountConfig, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], roomsConfig, accountAllowBots, configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, threadReplies, dmThreadReplies, dmSessionScope, streaming, previewToolProgressEnabled, blockStreamingEnabled, dmEnabled, dmPolicy, textLimit, mediaMaxBytes, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, needsRoomAliasesForConfig, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist, resolveStorePath: resolveStorePathImpl = resolveStorePath, createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl = createChannelInboundEnvelopeBuilder, finalizeInboundContext, resolveHumanDelayConfig: resolveHumanDelayConfigImpl = resolveHumanDelayConfig } = params;
|
|
2346
2333
|
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
2347
2334
|
cfg,
|
|
2348
2335
|
channel: "matrix",
|
|
@@ -2427,7 +2414,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
2427
2414
|
};
|
|
2428
2415
|
return async (roomId, event) => {
|
|
2429
2416
|
const eventId = typeof event.event_id === "string" ? event.event_id.trim() : "";
|
|
2430
|
-
let
|
|
2417
|
+
let inboundReplayClaim;
|
|
2431
2418
|
let draftStreamRef;
|
|
2432
2419
|
let draftConsumed = false;
|
|
2433
2420
|
try {
|
|
@@ -2445,12 +2432,9 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
2445
2432
|
const eventTs = event.origin_server_ts;
|
|
2446
2433
|
const eventAge = event.unsigned?.age;
|
|
2447
2434
|
const commitInboundEventIfClaimed = async () => {
|
|
2448
|
-
if (!
|
|
2449
|
-
await
|
|
2450
|
-
|
|
2451
|
-
eventId
|
|
2452
|
-
});
|
|
2453
|
-
claimedInboundEvent = false;
|
|
2435
|
+
if (!inboundReplayClaim) return;
|
|
2436
|
+
await inboundReplayClaim.commit();
|
|
2437
|
+
inboundReplayClaim = void 0;
|
|
2454
2438
|
};
|
|
2455
2439
|
const readIngressPrefix = async () => {
|
|
2456
2440
|
const selfUserId = await client.getUserId();
|
|
@@ -2475,11 +2459,12 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
2475
2459
|
if (relates && "rel_type" in relates && relates.rel_type === RelationType.Replace) return;
|
|
2476
2460
|
if (hasBundledMatrixReplacementRelation(event)) return;
|
|
2477
2461
|
if (eventId && inboundDeduper) {
|
|
2478
|
-
|
|
2462
|
+
const claim = await inboundDeduper.claim({
|
|
2479
2463
|
roomId,
|
|
2480
2464
|
eventId
|
|
2481
2465
|
});
|
|
2482
|
-
if (
|
|
2466
|
+
if (claim.kind === "claimed") inboundReplayClaim = claim.handle;
|
|
2467
|
+
else if (claim.kind !== "invalid") {
|
|
2483
2468
|
logVerboseMessage(`matrix: skip duplicate inbound event room=${roomId} id=${eventId}`);
|
|
2484
2469
|
return;
|
|
2485
2470
|
}
|
|
@@ -2837,9 +2822,23 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
2837
2822
|
return;
|
|
2838
2823
|
}
|
|
2839
2824
|
const shouldRequireMention = isRoom ? roomConfig?.autoReply === true ? false : roomConfig?.autoReply === false ? true : typeof roomConfig?.requireMention === "boolean" ? roomConfig?.requireMention : true : false;
|
|
2840
|
-
const
|
|
2825
|
+
const mentionDecision = resolveInboundMentionDecision({
|
|
2826
|
+
facts: {
|
|
2827
|
+
canDetectMention: true,
|
|
2828
|
+
wasMentioned,
|
|
2829
|
+
hasAnyMention: hasExplicitMention
|
|
2830
|
+
},
|
|
2831
|
+
policy: {
|
|
2832
|
+
isGroup: isRoom,
|
|
2833
|
+
requireMention: shouldRequireMention,
|
|
2834
|
+
allowTextCommands,
|
|
2835
|
+
hasControlCommand: hasControlCommandInMessage,
|
|
2836
|
+
commandAuthorized
|
|
2837
|
+
}
|
|
2838
|
+
});
|
|
2839
|
+
const { effectiveWasMentioned, shouldBypassMention } = mentionDecision;
|
|
2841
2840
|
const canDetectMention = agentMentionRegexes.length > 0 || hasExplicitMention;
|
|
2842
|
-
if (
|
|
2841
|
+
if (mentionDecision.shouldSkip) {
|
|
2843
2842
|
const pendingHistoryBody = preflightAudioTranscript ? formatMatrixAudioTranscript(preflightAudioTranscript) : pendingHistoryText || pendingHistoryPollText;
|
|
2844
2843
|
if (historyLimit > 0 && pendingHistoryBody) {
|
|
2845
2844
|
const pendingEntry = {
|
|
@@ -2972,6 +2971,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
2972
2971
|
isRoom,
|
|
2973
2972
|
shouldRequireMention,
|
|
2974
2973
|
wasMentioned,
|
|
2974
|
+
effectiveWasMentioned,
|
|
2975
2975
|
shouldBypassMention,
|
|
2976
2976
|
canDetectMention,
|
|
2977
2977
|
commandAuthorized,
|
|
@@ -3014,7 +3014,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3014
3014
|
})();
|
|
3015
3015
|
if (!resolvedIngressResult) return;
|
|
3016
3016
|
if ("deferredPrefix" in resolvedIngressResult) return;
|
|
3017
|
-
const { route: _route, hasExplicitSessionBinding, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, commandBodyText, media, preflightAudioTranscript, locationPayload, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection, effectiveGroupAllowFrom, effectiveRoomUsers } = resolvedIngressResult;
|
|
3017
|
+
const { route: _route, hasExplicitSessionBinding, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, commandBodyText, media, preflightAudioTranscript, locationPayload, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection, effectiveGroupAllowFrom, effectiveRoomUsers } = resolvedIngressResult;
|
|
3018
3018
|
const replyToEventId = resolveMatrixReplyToEventId(event.content);
|
|
3019
3019
|
const threadTarget = thread.threadId;
|
|
3020
3020
|
const isRoomContextSenderAllowed = (contextSenderId) => {
|
|
@@ -3062,11 +3062,10 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3062
3062
|
const roomName = (isRoom ? await getRoomInfo(roomId) : void 0)?.name;
|
|
3063
3063
|
const envelopeFrom = isDirectMessage ? senderName : roomName ?? roomId;
|
|
3064
3064
|
const textWithId = `${bodyText}\n[matrix event id: ${messageId} room: ${roomId}]`;
|
|
3065
|
-
const storePath =
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
sessionKey: _route.sessionKey
|
|
3065
|
+
const storePath = resolveStorePathImpl(cfg.session?.store, { agentId: _route.agentId });
|
|
3066
|
+
const buildEnvelope = createChannelInboundEnvelopeBuilderImpl({
|
|
3067
|
+
cfg,
|
|
3068
|
+
route: _route
|
|
3070
3069
|
});
|
|
3071
3070
|
const sharedDmNoticeSessionKey = threadTarget ? _route.mainSessionKey || _route.sessionKey : _route.sessionKey;
|
|
3072
3071
|
const sharedDmContextNotice = isDirectMessage ? hasExplicitSessionBinding ? null : resolveMatrixSharedDmContextNotice({
|
|
@@ -3078,12 +3077,10 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3078
3077
|
sentRooms: sharedDmContextNoticeRooms,
|
|
3079
3078
|
logVerboseMessage
|
|
3080
3079
|
}) : null;
|
|
3081
|
-
const body =
|
|
3080
|
+
const body = buildEnvelope({
|
|
3082
3081
|
channel: "Matrix",
|
|
3083
3082
|
from: envelopeFrom,
|
|
3084
3083
|
timestamp: eventTs ?? void 0,
|
|
3085
|
-
previousTimestamp,
|
|
3086
|
-
envelope: envelopeOptions,
|
|
3087
3084
|
body: textWithId
|
|
3088
3085
|
});
|
|
3089
3086
|
const groupSystemPrompt = normalizeOptionalString(roomConfig?.systemPrompt);
|
|
@@ -3094,8 +3091,8 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3094
3091
|
}).include);
|
|
3095
3092
|
const ctxPayload = buildChannelInboundEventContext({
|
|
3096
3093
|
channel: "matrix",
|
|
3097
|
-
finalize: core.channel.reply.finalizeInboundContext,
|
|
3098
3094
|
contextVisibility: contextVisibilityMode,
|
|
3095
|
+
finalize: finalizeInboundContext,
|
|
3099
3096
|
supplemental: {
|
|
3100
3097
|
quote: replyContext ? {
|
|
3101
3098
|
id: threadTarget ? void 0 : replyToEventId ?? void 0,
|
|
@@ -3132,6 +3129,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3132
3129
|
},
|
|
3133
3130
|
route: {
|
|
3134
3131
|
agentId: _route.agentId,
|
|
3132
|
+
dmScope: _route.dmScope,
|
|
3135
3133
|
accountId: _route.accountId,
|
|
3136
3134
|
routeSessionKey: _route.sessionKey
|
|
3137
3135
|
},
|
|
@@ -3185,7 +3183,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3185
3183
|
isMentionableGroup: isRoom,
|
|
3186
3184
|
requireMention: shouldRequireMention,
|
|
3187
3185
|
canDetectMention,
|
|
3188
|
-
effectiveWasMentioned
|
|
3186
|
+
effectiveWasMentioned,
|
|
3189
3187
|
shouldBypassMention
|
|
3190
3188
|
}));
|
|
3191
3189
|
if (shouldAckReaction() && messageId) loadMatrixSendModule().then(({ reactMatrixMessage }) => reactMatrixMessage(roomId, messageId, ackReaction, client)).catch((err) => {
|
|
@@ -3202,7 +3200,6 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3202
3200
|
const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, _route.agentId);
|
|
3203
3201
|
let finalReplyDeliveryFailed = false;
|
|
3204
3202
|
let nonFinalReplyDeliveryFailed = false;
|
|
3205
|
-
let retryableReplyDeliveryFailed = false;
|
|
3206
3203
|
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
3207
3204
|
cfg,
|
|
3208
3205
|
agentId: _route.agentId,
|
|
@@ -3263,16 +3260,20 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3263
3260
|
let currentDraftReplyToId = draftReplyToId;
|
|
3264
3261
|
let previewToolProgressSuppressed = false;
|
|
3265
3262
|
let previewToolProgressLines = [];
|
|
3263
|
+
let latestPlan;
|
|
3264
|
+
let latestPlanExplanation;
|
|
3266
3265
|
const progressConfigEntry = params.accountConfig ?? cfg.channels?.matrix;
|
|
3267
3266
|
const progressSeed = `${_route.accountId}:${roomId}`;
|
|
3268
3267
|
const renderProgressDraft = () => {
|
|
3269
|
-
if (!draftStream
|
|
3268
|
+
if (!draftStream) return;
|
|
3270
3269
|
const previewText = formatChannelProgressDraftText({
|
|
3271
3270
|
entry: progressConfigEntry,
|
|
3272
3271
|
lines: previewToolProgressLines,
|
|
3273
3272
|
seed: progressSeed,
|
|
3274
3273
|
formatLine: formatMatrixToolProgressMarkdownCode,
|
|
3275
|
-
bullet: "-"
|
|
3274
|
+
bullet: "-",
|
|
3275
|
+
narration: latestPlanExplanation,
|
|
3276
|
+
plan: latestPlan
|
|
3276
3277
|
});
|
|
3277
3278
|
if (!previewText) return;
|
|
3278
3279
|
draftStream.update(previewText);
|
|
@@ -3293,7 +3294,9 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3293
3294
|
lines: previewToolProgressLines,
|
|
3294
3295
|
seed: progressSeed,
|
|
3295
3296
|
formatLine: formatMatrixToolProgressMarkdownCode,
|
|
3296
|
-
bullet: "-"
|
|
3297
|
+
bullet: "-",
|
|
3298
|
+
narration: latestPlanExplanation,
|
|
3299
|
+
plan: latestPlan
|
|
3297
3300
|
}));
|
|
3298
3301
|
return;
|
|
3299
3302
|
}
|
|
@@ -3302,14 +3305,30 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3302
3305
|
const progressActive = await progressDraftGate.noteWork();
|
|
3303
3306
|
if ((alreadyStarted || progressActive) && progressDraftGate.hasStarted) renderProgressDraft();
|
|
3304
3307
|
};
|
|
3308
|
+
const pushPlanProgress = async (steps, explanation) => {
|
|
3309
|
+
latestPlan = steps?.length ? steps.map((entry) => ({ ...entry })) : void 0;
|
|
3310
|
+
latestPlanExplanation = explanation?.replace(/\s+/g, " ").trim() || void 0;
|
|
3311
|
+
if (!draftStream || previewToolProgressSuppressed) return;
|
|
3312
|
+
if (!progressDraftStreaming) {
|
|
3313
|
+
renderProgressDraft();
|
|
3314
|
+
return;
|
|
3315
|
+
}
|
|
3316
|
+
const alreadyStarted = progressDraftGate.hasStarted;
|
|
3317
|
+
await progressDraftGate.startNow();
|
|
3318
|
+
if (alreadyStarted && progressDraftGate.hasStarted) renderProgressDraft();
|
|
3319
|
+
};
|
|
3305
3320
|
const suppressPreviewToolProgressForAnswerText = (text) => {
|
|
3306
3321
|
if (!text?.trim()) return;
|
|
3307
3322
|
previewToolProgressSuppressed = true;
|
|
3308
3323
|
previewToolProgressLines = [];
|
|
3324
|
+
latestPlan = void 0;
|
|
3325
|
+
latestPlanExplanation = void 0;
|
|
3309
3326
|
};
|
|
3310
3327
|
const resetPreviewToolProgress = () => {
|
|
3311
3328
|
previewToolProgressSuppressed = false;
|
|
3312
3329
|
previewToolProgressLines = [];
|
|
3330
|
+
latestPlan = void 0;
|
|
3331
|
+
latestPlanExplanation = void 0;
|
|
3313
3332
|
};
|
|
3314
3333
|
const buildPreviewToolProgressReplyOptions = () => {
|
|
3315
3334
|
if (!shouldSuppressDefaultToolProgressMessages) return {};
|
|
@@ -3345,13 +3364,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3345
3364
|
},
|
|
3346
3365
|
onPlanUpdate: async (payload) => {
|
|
3347
3366
|
if (payload.phase !== "update") return;
|
|
3348
|
-
await
|
|
3349
|
-
event: "plan",
|
|
3350
|
-
phase: payload.phase,
|
|
3351
|
-
title: payload.title,
|
|
3352
|
-
explanation: payload.explanation,
|
|
3353
|
-
steps: payload.steps
|
|
3354
|
-
}));
|
|
3367
|
+
await pushPlanProgress(payload.steps, payload.explanation);
|
|
3355
3368
|
},
|
|
3356
3369
|
onApprovalEvent: async (payload) => {
|
|
3357
3370
|
if (payload.phase !== "requested") return;
|
|
@@ -3427,9 +3440,22 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3427
3440
|
currentDraftBlockOffset = 0;
|
|
3428
3441
|
latestDraftFullText = "";
|
|
3429
3442
|
};
|
|
3430
|
-
const
|
|
3443
|
+
const resetDraftDeliveryState = async () => {
|
|
3444
|
+
await draftStream?.discardPending();
|
|
3445
|
+
draftStream?.reset();
|
|
3446
|
+
draftConsumed = false;
|
|
3447
|
+
currentDraftMessageGeneration = 0;
|
|
3448
|
+
currentDraftBlockOffset = 0;
|
|
3449
|
+
latestDraftFullText = "";
|
|
3450
|
+
pendingDraftBoundaries.length = 0;
|
|
3451
|
+
latestQueuedDraftBoundaryOffsets.clear();
|
|
3452
|
+
currentDraftReplyToId = draftReplyToId;
|
|
3453
|
+
progressDraftGate.reset();
|
|
3454
|
+
resetPreviewToolProgress();
|
|
3455
|
+
};
|
|
3456
|
+
const { deliver: deliverReply, onError: onReplyError, ...turnDispatcherOptions } = {
|
|
3431
3457
|
...prefixOptions,
|
|
3432
|
-
humanDelay:
|
|
3458
|
+
humanDelay: resolveHumanDelayConfigImpl(cfg, _route.agentId),
|
|
3433
3459
|
deliver: async (payload, info) => {
|
|
3434
3460
|
if (draftStream && info.kind !== "tool" && !payload.isCompactionNotice) {
|
|
3435
3461
|
const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
|
|
@@ -3607,7 +3633,6 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3607
3633
|
});
|
|
3608
3634
|
},
|
|
3609
3635
|
onError: (err, info) => {
|
|
3610
|
-
if (err instanceof MatrixRetryableInboundError) retryableReplyDeliveryFailed = true;
|
|
3611
3636
|
if (info.kind === "final") finalReplyDeliveryFailed = true;
|
|
3612
3637
|
else nonFinalReplyDeliveryFailed = true;
|
|
3613
3638
|
if (info.kind === "block") advanceDraftBlockBoundary({ fallbackToLatestEnd: true });
|
|
@@ -3615,7 +3640,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3615
3640
|
},
|
|
3616
3641
|
onReplyStart: typingCallbacks.onReplyStart,
|
|
3617
3642
|
onIdle: typingCallbacks.onIdle
|
|
3618
|
-
}
|
|
3643
|
+
};
|
|
3619
3644
|
const pinnedMainDmOwner = isDirectMessage ? await (async () => {
|
|
3620
3645
|
const livePinnedCfg = core.config.current();
|
|
3621
3646
|
const livePinnedAllowlists = resolveMatrixAccountAllowlistConfig({
|
|
@@ -3654,12 +3679,14 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3654
3679
|
raw: event
|
|
3655
3680
|
}),
|
|
3656
3681
|
resolveTurn: () => ({
|
|
3682
|
+
cfg,
|
|
3657
3683
|
channel: "matrix",
|
|
3658
3684
|
accountId: _route.accountId,
|
|
3659
|
-
|
|
3660
|
-
|
|
3685
|
+
route: {
|
|
3686
|
+
agentId: _route.agentId,
|
|
3687
|
+
sessionKey: _route.sessionKey
|
|
3688
|
+
},
|
|
3661
3689
|
ctxPayload,
|
|
3662
|
-
recordInboundSession: core.channel.session.recordInboundSession,
|
|
3663
3690
|
botLoopProtection,
|
|
3664
3691
|
record: {
|
|
3665
3692
|
updateLastRoute: isDirectMessage ? {
|
|
@@ -3683,14 +3710,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3683
3710
|
});
|
|
3684
3711
|
}
|
|
3685
3712
|
},
|
|
3686
|
-
|
|
3687
|
-
dispatcher,
|
|
3688
|
-
onSettled: () => {
|
|
3689
|
-
markRunComplete();
|
|
3690
|
-
markDispatchIdle();
|
|
3691
|
-
}
|
|
3692
|
-
}),
|
|
3693
|
-
runDispatch: async () => {
|
|
3713
|
+
afterRecord: async () => {
|
|
3694
3714
|
if (sharedDmContextNotice && markTrackedRoomIfFirst(sharedDmContextNoticeRooms, roomId)) try {
|
|
3695
3715
|
await client.sendMessage(roomId, {
|
|
3696
3716
|
msgtype: "m.notice",
|
|
@@ -3699,45 +3719,35 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3699
3719
|
} catch (err) {
|
|
3700
3720
|
logVerboseMessage(`matrix: failed sending shared DM session notice room=${roomId}: ${String(err)}`);
|
|
3701
3721
|
}
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
...buildPreviewToolProgressReplyOptions(),
|
|
3732
|
-
onModelSelected
|
|
3733
|
-
}
|
|
3734
|
-
});
|
|
3735
|
-
} finally {
|
|
3736
|
-
progressDraftGate.cancel();
|
|
3737
|
-
markRunComplete();
|
|
3738
|
-
}
|
|
3739
|
-
}
|
|
3740
|
-
});
|
|
3722
|
+
},
|
|
3723
|
+
delivery: {
|
|
3724
|
+
deliver: deliverReply,
|
|
3725
|
+
onError: (err, info) => onReplyError(err, info)
|
|
3726
|
+
},
|
|
3727
|
+
dispatcherOptions: {
|
|
3728
|
+
...turnDispatcherOptions,
|
|
3729
|
+
onSettled: () => progressDraftGate.cancel()
|
|
3730
|
+
},
|
|
3731
|
+
replyOptions: {
|
|
3732
|
+
skillFilter: roomConfig?.skills,
|
|
3733
|
+
disableBlockStreaming: !blockStreamingEnabled,
|
|
3734
|
+
onPartialReply: draftStream ? (payload) => {
|
|
3735
|
+
if (progressDraftStreaming) return;
|
|
3736
|
+
latestDraftFullText = payload.text ?? "";
|
|
3737
|
+
suppressPreviewToolProgressForAnswerText(latestDraftFullText);
|
|
3738
|
+
updateDraftFromLatestFullText();
|
|
3739
|
+
} : void 0,
|
|
3740
|
+
onBlockReplyQueued: draftStream ? (payload, context) => {
|
|
3741
|
+
if (payload.isCompactionNotice === true) return;
|
|
3742
|
+
queueDraftBlockBoundary(payload, context);
|
|
3743
|
+
} : void 0,
|
|
3744
|
+
onAssistantMessageStart: draftStream ? () => {
|
|
3745
|
+
resetDraftBlockOffsets();
|
|
3746
|
+
resetPreviewToolProgress();
|
|
3747
|
+
} : void 0,
|
|
3748
|
+
onQueuedFollowupAdmitted: draftStream ? resetDraftDeliveryState : void 0,
|
|
3749
|
+
...buildPreviewToolProgressReplyOptions(),
|
|
3750
|
+
onModelSelected
|
|
3741
3751
|
}
|
|
3742
3752
|
})
|
|
3743
3753
|
}
|
|
@@ -3749,19 +3759,11 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3749
3759
|
const { dispatchResult } = turnResult;
|
|
3750
3760
|
const { queuedFinal, counts } = dispatchResult;
|
|
3751
3761
|
if (finalReplyDeliveryFailed) {
|
|
3752
|
-
if (retryableReplyDeliveryFailed) {
|
|
3753
|
-
logVerboseMessage(`matrix: final reply delivery failed room=${roomId} id=${messageId}; leaving event uncommitted`);
|
|
3754
|
-
return;
|
|
3755
|
-
}
|
|
3756
3762
|
logVerboseMessage(`matrix: final reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
|
|
3757
3763
|
await commitInboundEventIfClaimed();
|
|
3758
3764
|
return;
|
|
3759
3765
|
}
|
|
3760
3766
|
if (!queuedFinal && nonFinalReplyDeliveryFailed) {
|
|
3761
|
-
if (retryableReplyDeliveryFailed) {
|
|
3762
|
-
logVerboseMessage(`matrix: non-final reply delivery failed room=${roomId} id=${messageId}; leaving event uncommitted`);
|
|
3763
|
-
return;
|
|
3764
|
-
}
|
|
3765
3767
|
logVerboseMessage(`matrix: non-final reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
|
|
3766
3768
|
await commitInboundEventIfClaimed();
|
|
3767
3769
|
return;
|
|
@@ -3784,10 +3786,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3784
3786
|
const draftEventId = await draftStreamRef.stop().catch(() => void 0);
|
|
3785
3787
|
if (draftEventId && !draftConsumed) await redactMatrixDraftEvent(client, roomId, draftEventId);
|
|
3786
3788
|
}
|
|
3787
|
-
|
|
3788
|
-
roomId,
|
|
3789
|
-
eventId
|
|
3790
|
-
});
|
|
3789
|
+
inboundReplayClaim?.release();
|
|
3791
3790
|
}
|
|
3792
3791
|
};
|
|
3793
3792
|
}
|
|
@@ -3806,10 +3805,10 @@ function shouldPromoteRecentInviteRoom(params) {
|
|
|
3806
3805
|
//#endregion
|
|
3807
3806
|
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3808
3807
|
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
3809
|
-
import("./setup-core-
|
|
3808
|
+
import("./setup-core-XCdAx1nY.js").then((n) => n.s),
|
|
3810
3809
|
import("./device-health-D4LBxuPq.js"),
|
|
3811
|
-
import("./setup-core-
|
|
3812
|
-
import("./startup-verification-
|
|
3810
|
+
import("./setup-core-XCdAx1nY.js").then((n) => n.a),
|
|
3811
|
+
import("./startup-verification-CA00kebL.js")
|
|
3813
3812
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
3814
3813
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3815
3814
|
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
@@ -2,7 +2,7 @@ import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
|
|
|
2
2
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/matrix/src/plugin-entry.runtime.ts
|
|
5
|
-
const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-
|
|
5
|
+
const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-DjxyWTNP.js").then((n) => n.y));
|
|
6
6
|
function sendError(respond, err) {
|
|
7
7
|
respond(false, { error: formatMatrixErrorMessage(err) });
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
2
|
-
import { c as resolveMatrixConfigPath, l as updateMatrixAccountConfig, o as syncMatrixOwnProfile } from "./setup-core-
|
|
3
|
-
import { n as withResolvedActionClient } from "./client-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
2
|
+
import { c as resolveMatrixConfigPath, l as updateMatrixAccountConfig, o as syncMatrixOwnProfile } from "./setup-core-XCdAx1nY.js";
|
|
3
|
+
import { n as withResolvedActionClient } from "./client-BtG4quUl.js";
|
|
4
4
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
//#region extensions/matrix/src/matrix/actions/profile.ts
|
|
6
6
|
async function updateMatrixOwnProfile(opts = {}) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
|
|
2
2
|
import { a as extractMatrixReactionAnnotation } from "./reaction-common-DkrQdBSZ.js";
|
|
3
|
-
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-
|
|
3
|
+
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-D-BxBK_L.js";
|
|
4
4
|
import { i as resolveMatrixThreadRouting, r as resolveMatrixThreadRootId, t as resolveMatrixInboundRoute } from "./route-DY6at4qJ.js";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
8
8
|
//#region extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
9
|
-
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-
|
|
9
|
+
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-kXkCJBGi.js"));
|
|
10
10
|
const loadExecApprovalResolver = createLazyRuntimeModule(() => import("./exec-approval-resolver-BCgqRtZS.js"));
|
|
11
|
-
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-
|
|
11
|
+
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-BJbrdmNm.js").then((n) => n.l));
|
|
12
12
|
function buildMatrixApprovalTerminalText(result) {
|
|
13
13
|
const approval = result.approval;
|
|
14
14
|
const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as formatMatrixErrorReason, t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
|
|
2
|
-
import { A as writeMatrixRecoveryKeyStateForPath, C as readLegacyMatrixRecoveryKeyFile, E as readMatrixRecoveryKeyStateForPath, v as migrateLegacyMatrixRecoveryKeyFilePathToStore } from "./storage-
|
|
3
|
-
import { n as LogService } from "./logger-
|
|
2
|
+
import { A as writeMatrixRecoveryKeyStateForPath, C as readLegacyMatrixRecoveryKeyFile, E as readMatrixRecoveryKeyStateForPath, v as migrateLegacyMatrixRecoveryKeyFilePathToStore } from "./storage-CzHxeF5E.js";
|
|
3
|
+
import { n as LogService } from "./logger-D0GCSDQq.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { decodeRecoveryKey } from "matrix-js-sdk/lib/crypto-api/recovery-key.js";
|
|
6
6
|
//#region extensions/matrix/src/matrix/sdk/recovery-key-store.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { n as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-B-5aQxwn.js";
|
|
3
|
-
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DiC-0XBC.js";
|
|
4
4
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/matrix/src/resolve-targets.ts
|
|
6
6
|
var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
1
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-DVoj-YxB.js";
|
|
2
2
|
//#region extensions/matrix/src/resolver.runtime.ts
|
|
3
3
|
const matrixResolverRuntime = { resolveMatrixTargets };
|
|
4
4
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
2
|
//#region extensions/matrix/src/runtime.ts
|
|
3
|
-
const { setRuntime: setMatrixRuntime,
|
|
3
|
+
const { setRuntime: setMatrixRuntime, getRuntime: getMatrixRuntime, tryGetRuntime: getOptionalMatrixRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "matrix",
|
|
5
5
|
errorMessage: "Matrix runtime not initialized"
|
|
6
6
|
});
|