@openclaw/matrix 2026.5.9-beta.1 → 2026.5.10-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/api.js CHANGED
@@ -2,7 +2,7 @@ import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, n as getMatrixThrea
2
2
  import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-BWwIruri.js";
3
3
  import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-C7uQCTKn.js";
4
4
  import { a as resolveMatrixCredentialsPath, c as resolveMatrixLegacyFlatStoreRoot, i as resolveMatrixCredentialsFilename, l as sanitizeMatrixPathSegment, n as resolveMatrixAccountStorageRoot, o as resolveMatrixHomeserverKey, r as resolveMatrixCredentialsDir, s as resolveMatrixLegacyFlatStoragePaths, t as hashMatrixAccessToken } from "./storage-paths-BJLdnCjV.js";
5
- import { t as matrixPlugin } from "./channel-DJNir3Rb.js";
5
+ import { t as matrixPlugin } from "./channel-H_6lMgwf.js";
6
6
  import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-CfZy05oW.js";
7
7
  import { n as matrixOnboardingAdapter } from "./setup-surface-CqT_o61M.js";
8
8
  import { t as createMatrixThreadBindingManager } from "./thread-bindings-B9mesxXk.js";
@@ -9,7 +9,7 @@ import { a as isMatrixExecApprovalAuthorizedSender, c as shouldHandleMatrixAppro
9
9
  import { t as formatMatrixErrorMessage } from "./errors-CTcpEDq-.js";
10
10
  import { n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-nPLpEgHl.js";
11
11
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-D4-64QuJ.js";
12
- import { n as resolveMatrixRoomConfig, t as resolveMatrixStoredSessionMeta } from "./session-store-metadata-DI5SCofx.js";
12
+ import { n as resolveMatrixRoomConfig, t as resolveMatrixStoredSessionMeta } from "./session-store-metadata-DQXjgNLt.js";
13
13
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DcrJWCQI.js";
14
14
  import { a as namedAccountPromotionKeys, o as resolveSingleAccountPromotionTarget, s as singleAccountKeysToMove } from "./setup-dm-policy-2-r1FrQh.js";
15
15
  import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-CfZy05oW.js";
@@ -129,7 +129,7 @@ const matrixMessageActions = {
129
129
  return extractToolSend(args, "sendMessage");
130
130
  },
131
131
  handleAction: async (ctx) => {
132
- const { handleMatrixAction } = await import("./tool-actions.runtime-BIH49vRr.js");
132
+ const { handleMatrixAction } = await import("./tool-actions.runtime-ThYhfHtZ.js");
133
133
  const { action, params, cfg, accountId, mediaLocalRoots } = ctx;
134
134
  const dispatch = async (actionParams) => await handleMatrixAction({
135
135
  ...actionParams,
@@ -689,7 +689,7 @@ async function runMatrixStartupMaintenance(params) {
689
689
  //#region extensions/matrix/src/channel.ts
690
690
  let matrixStartupLock = Promise.resolve();
691
691
  const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-CqT_o61M.js").then((n) => n.t), "matrixSetupWizard");
692
- const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BQu0hTih.js"), "matrixChannelRuntime");
692
+ const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BnO9f0pR.js"), "matrixChannelRuntime");
693
693
  const meta = {
694
694
  id: "matrix",
695
695
  label: "Matrix",
@@ -1054,7 +1054,7 @@ const matrixPlugin = createChatChannelPlugin({
1054
1054
  await previousLock;
1055
1055
  let monitorMatrixProvider;
1056
1056
  try {
1057
- monitorMatrixProvider = (await import("./monitor-C_81r_Ck.js")).monitorMatrixProvider;
1057
+ monitorMatrixProvider = (await import("./monitor-BaRCKyLd.js")).monitorMatrixProvider;
1058
1058
  } finally {
1059
1059
  releaseLock();
1060
1060
  }
@@ -1,2 +1,2 @@
1
- import { t as matrixPlugin } from "./channel-DJNir3Rb.js";
1
+ import { t as matrixPlugin } from "./channel-H_6lMgwf.js";
2
2
  export { matrixPlugin };
@@ -3,7 +3,7 @@ import { t as isBunRuntime } from "./runtime-C6X4h_SJ.js";
3
3
  import { n as resolveMatrixAuth } from "./config--5-S2Akv.js";
4
4
  import "./client-_hckQNGW.js";
5
5
  import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DmOtMhyr.js";
6
- import { f as resolveOutboundSendDep, n as chunkTextForOutbound } from "./runtime-api-BXWBFIqm.js";
6
+ import { f as resolveOutboundSendDep, n as chunkTextForOutbound } from "./runtime-api-DTKcXOhp.js";
7
7
  import { t as resolveMatrixTargets } from "./resolve-targets-YtJnw1Tb.js";
8
8
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { createReplyToFanout } from "openclaw/plugin-sdk/outbound-runtime";
@@ -9,7 +9,7 @@ import { i as setMatrixSdkLogMode, r as setMatrixSdkConsoleLogging } from "./log
9
9
  import { n as withResolvedActionClient } from "./client-DkcXnm0X.js";
10
10
  import { r as resolveMatrixAuthContext } from "./config--5-S2Akv.js";
11
11
  import "./client-_hckQNGW.js";
12
- import { i as formatZonedTimestamp } from "./runtime-api-BXWBFIqm.js";
12
+ import { i as formatZonedTimestamp } from "./runtime-api-DTKcXOhp.js";
13
13
  import { isOpenClawManagedMatrixDevice, summarizeMatrixDeviceHealth } from "./device-health-UVYpbA_W.js";
14
14
  import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-DjeBNgIV.js";
15
15
  import { a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, g as runMatrixSelfVerification, h as restoreMatrixRoomKeyBackup, l as getMatrixVerificationSas, m as resetMatrixRoomKeyBackup, n as bootstrapMatrixVerification, p as requestMatrixVerification, r as cancelMatrixVerification, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-CZ2rDeHL.js";
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
2
2
  //#region extensions/matrix/src/cli-metadata.ts
3
3
  function registerMatrixCliMetadata(api) {
4
4
  api.registerCli(async ({ program }) => {
5
- const { registerMatrixCli } = await import("./cli-BmfTmg7x.js");
5
+ const { registerMatrixCli } = await import("./cli-CYZ9yVcB.js");
6
6
  registerMatrixCli({ program });
7
7
  }, { descriptors: [{
8
8
  name: "matrix",
@@ -1,2 +1,2 @@
1
- import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-B-PCEzrA.js";
1
+ import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-DPIHnoa6.js";
2
2
  export { cli_metadata_default as default, registerMatrixCliMetadata };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as registerMatrixCliMetadata } from "./cli-metadata-B-PCEzrA.js";
1
+ import { n as registerMatrixCliMetadata } from "./cli-metadata-DPIHnoa6.js";
2
2
  import { registerMatrixSubagentHooks } from "./subagent-hooks-api.js";
3
3
  import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
4
4
  //#region extensions/matrix/index.ts
@@ -4,7 +4,7 @@ import { t as getMatrixRuntime } from "./runtime-Dog86njy.js";
4
4
  import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-Bm90Rzvp.js";
5
5
  import { n as normalizeMatrixUserId, r as resolveMatrixAllowListMatch, t as normalizeMatrixAllowList } from "./allowlist-sTzpCn5d.js";
6
6
  import { r as isMatrixNotFoundError, t as formatMatrixErrorMessage } from "./errors-CTcpEDq-.js";
7
- import { a as canonicalizeAllowlistWithResolvedIds, c as formatAllowlistMatchMeta, d as logInboundDrop, f as logTypingFailure, h as toLocationContext, i as buildAllowlistResolutionSummary, l as formatLocationText, m as summarizeMapping, n as resolveMatrixRoomConfig, o as createReplyPrefixOptions, p as patchAllowlistUsersInConfigEntries, r as addAllowlistUserEntriesFromConfigEntry, s as createTypingCallbacks, t as resolveMatrixStoredSessionMeta, u as getAgentScopedMediaLocalRoots } from "./session-store-metadata-DI5SCofx.js";
7
+ import { a as canonicalizeAllowlistWithResolvedIds, c as formatLocationText, d as logTypingFailure, f as patchAllowlistUsersInConfigEntries, i as buildAllowlistResolutionSummary, l as getAgentScopedMediaLocalRoots, m as toLocationContext, n as resolveMatrixRoomConfig, o as createReplyPrefixOptions, p as summarizeMapping, r as addAllowlistUserEntriesFromConfigEntry, s as createTypingCallbacks, t as resolveMatrixStoredSessionMeta, u as logInboundDrop } from "./session-store-metadata-DQXjgNLt.js";
8
8
  import { i as resolveMatrixStateFilePath } from "./storage-tC3ujLiW.js";
9
9
  import { a as sendMessageMatrix, g as isPollStartType, h as isPollEventType, p as formatPollAsText, t as chunkMatrixText, v as parsePollStartContent } from "./send-Bo0DU1ca.js";
10
10
  import { i as promoteMatrixDirectRoomCandidate, s as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY } from "./direct-management-DMMMgtTB.js";
@@ -21,14 +21,13 @@ import { t as isBunRuntime } from "./runtime-C6X4h_SJ.js";
21
21
  import { n as resolveMatrixAuth, r as resolveMatrixAuthContext, t as backfillMatrixAuthDeviceIdAfterStartup } from "./config--5-S2Akv.js";
22
22
  import { i as resolveSharedMatrixClient, n as releaseSharedClientInstance } from "./shared-CpMoYKm1.js";
23
23
  import "./client-_hckQNGW.js";
24
- import { d as resolveDefaultGroupPolicy, h as warnMissingProviderGroupPolicyFallbackOnce, m as resolveThreadBindingMaxAgeMsForChannel, p as resolveThreadBindingIdleTimeoutMsForChannel, t as GROUP_POLICY_BLOCKED_LABEL, u as resolveAllowlistProviderRuntimeGroupPolicy } from "./runtime-api-BXWBFIqm.js";
24
+ import { d as resolveDefaultGroupPolicy, h as warnMissingProviderGroupPolicyFallbackOnce, m as resolveThreadBindingMaxAgeMsForChannel, p as resolveThreadBindingIdleTimeoutMsForChannel, t as GROUP_POLICY_BLOCKED_LABEL, u as resolveAllowlistProviderRuntimeGroupPolicy } from "./runtime-api-DTKcXOhp.js";
25
25
  import { t as resolveMatrixTargets } from "./resolve-targets-YtJnw1Tb.js";
26
26
  import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-BPi3A_m3.js";
27
27
  import { a as EventType, i as resolveMatrixThreadRouting, n as resolveMatrixReplyToEventId, o as RelationType, r as resolveMatrixThreadRootId, t as resolveMatrixInboundRoute } from "./route-D6rg-iXN.js";
28
28
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
29
29
  import { createPreviewMessageReceipt, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter } from "openclaw/plugin-sdk/channel-message";
30
30
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
31
- import { mergeDmAllowFromSources } from "openclaw/plugin-sdk/allow-from";
32
31
  import { loadSessionStore, resolveSessionStoreEntry } from "openclaw/plugin-sdk/session-store-runtime";
33
32
  import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";
34
33
  import { format } from "node:util";
@@ -36,8 +35,8 @@ import { resolveAckReaction } from "openclaw/plugin-sdk/channel-feedback";
36
35
  import { hasFinalInboundReplyDispatch } from "openclaw/plugin-sdk/inbound-reply-dispatch";
37
36
  import { waitUntilAbort } from "openclaw/plugin-sdk/channel-lifecycle";
38
37
  import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
38
+ import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
39
39
  import { createChannelProgressDraftGate, formatChannelProgressDraftLine, formatChannelProgressDraftLineForEntry, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, resolveChannelProgressDraftMaxLines } from "openclaw/plugin-sdk/channel-streaming";
40
- import { resolveControlCommandGate } from "openclaw/plugin-sdk/command-gating";
41
40
  import { evaluateSupplementalContextVisibility, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
42
41
  import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
43
42
  import { escapeRegExp } from "openclaw/plugin-sdk/text-runtime";
@@ -554,55 +553,107 @@ function createDirectRoomTracker(client, opts = {}) {
554
553
  }
555
554
  //#endregion
556
555
  //#region extensions/matrix/src/matrix/monitor/access-state.ts
557
- function resolveMatrixMonitorAccessState(params) {
558
- const effectiveAllowFrom = normalizeMatrixAllowList(mergeDmAllowFromSources({
559
- allowFrom: normalizeMatrixAllowList(params.allowFrom),
560
- storeAllowFrom: params.storeAllowFrom,
561
- dmPolicy: params.dmPolicy
562
- }));
556
+ function normalizeMatrixEntry(raw) {
557
+ return normalizeMatrixAllowList([raw ?? ""])[0] ?? null;
558
+ }
559
+ const matrixIngressIdentity = defineStableChannelIngressIdentity({
560
+ key: "sender-id",
561
+ normalize: normalizeMatrixEntry,
562
+ matchEntry({ subject, entry }) {
563
+ const senderId = subject.identifiers[0]?.value;
564
+ return entry.value === "*" || resolveMatrixAllowListMatch({
565
+ allowList: [entry.value],
566
+ userId: senderId ?? ""
567
+ }).allowed;
568
+ }
569
+ });
570
+ function resolveMatrixGroupIngress(params) {
571
+ if (params.groupPolicy === "disabled") return {
572
+ groupPolicy: "disabled",
573
+ groupAllowFrom: []
574
+ };
575
+ if (params.effectiveRoomUsers.length > 0) return {
576
+ groupPolicy: "allowlist",
577
+ groupAllowFrom: params.effectiveRoomUsers
578
+ };
579
+ if (params.groupPolicy === "allowlist" && params.effectiveGroupAllowFrom.length > 0) return {
580
+ groupPolicy: "allowlist",
581
+ groupAllowFrom: params.effectiveGroupAllowFrom
582
+ };
583
+ return {
584
+ groupPolicy: "open",
585
+ groupAllowFrom: []
586
+ };
587
+ }
588
+ async function resolveMatrixMonitorAccessState(params) {
589
+ const dmPolicy = params.dmPolicy ?? "pairing";
590
+ const groupPolicy = params.groupPolicy ?? "open";
563
591
  const effectiveGroupAllowFrom = normalizeMatrixAllowList(params.groupAllowFrom);
564
592
  const effectiveRoomUsers = normalizeMatrixAllowList(params.roomUsers);
565
- const commandAllowFrom = params.isRoom ? [] : effectiveAllowFrom;
566
- const directAllowMatch = resolveMatrixAllowListMatch({
567
- allowList: effectiveAllowFrom,
568
- userId: params.senderId
593
+ const groupIngress = resolveMatrixGroupIngress({
594
+ groupPolicy,
595
+ effectiveGroupAllowFrom,
596
+ effectiveRoomUsers
569
597
  });
570
- const roomUserMatch = params.isRoom && effectiveRoomUsers.length > 0 ? resolveMatrixAllowListMatch({
571
- allowList: effectiveRoomUsers,
572
- userId: params.senderId
573
- }) : null;
574
- const groupAllowMatch = effectiveGroupAllowFrom.length > 0 ? resolveMatrixAllowListMatch({
575
- allowList: effectiveGroupAllowFrom,
576
- userId: params.senderId
577
- }) : null;
578
- const commandAllowMatch = commandAllowFrom.length > 0 ? resolveMatrixAllowListMatch({
579
- allowList: commandAllowFrom,
580
- userId: params.senderId
581
- }) : null;
598
+ const accountId = params.accountId ?? "default";
599
+ const eventKind = params.eventKind ?? "message";
582
600
  return {
583
- effectiveAllowFrom,
584
601
  effectiveGroupAllowFrom,
585
602
  effectiveRoomUsers,
586
- groupAllowConfigured: effectiveGroupAllowFrom.length > 0,
587
- directAllowMatch,
588
- roomUserMatch,
589
- groupAllowMatch,
590
- commandAuthorizers: [
591
- {
592
- configured: commandAllowFrom.length > 0,
593
- allowed: commandAllowMatch?.allowed ?? false
603
+ messageIngress: await createChannelIngressResolver({
604
+ channelId: "matrix",
605
+ accountId,
606
+ identity: matrixIngressIdentity,
607
+ readStoreAllowFrom: async () => params.storeAllowFrom
608
+ }).message({
609
+ subject: { stableId: params.senderId },
610
+ conversation: {
611
+ kind: params.isRoom ? "group" : "direct",
612
+ id: params.isRoom ? "matrix-room" : "matrix-dm"
594
613
  },
595
- {
596
- configured: effectiveRoomUsers.length > 0,
597
- allowed: roomUserMatch?.allowed ?? false
614
+ event: {
615
+ kind: eventKind,
616
+ authMode: "inbound",
617
+ mayPair: params.isRoom ? false : eventKind === "message"
598
618
  },
599
- {
600
- configured: effectiveGroupAllowFrom.length > 0,
601
- allowed: groupAllowMatch?.allowed ?? false
602
- }
603
- ]
619
+ dmPolicy,
620
+ groupPolicy: params.isRoom ? groupIngress.groupPolicy : "disabled",
621
+ policy: { groupAllowFromFallbackToAllowFrom: false },
622
+ allowFrom: params.allowFrom,
623
+ ...params.isRoom ? { groupAllowFrom: groupIngress.groupAllowFrom } : {}
624
+ }),
625
+ accountId,
626
+ senderId: params.senderId,
627
+ isRoom: params.isRoom
604
628
  };
605
629
  }
630
+ async function resolveMatrixMonitorCommandAccess(state, params) {
631
+ const commandAllowFrom = state.isRoom ? [] : state.messageIngress.senderAccess.effectiveAllowFrom;
632
+ const commandGroupAllowFrom = state.effectiveRoomUsers.length > 0 ? state.effectiveRoomUsers : state.effectiveGroupAllowFrom;
633
+ return (await createChannelIngressResolver({
634
+ channelId: "matrix",
635
+ accountId: state.accountId,
636
+ identity: matrixIngressIdentity
637
+ }).command({
638
+ subject: { stableId: state.senderId },
639
+ conversation: {
640
+ kind: state.isRoom ? "group" : "direct",
641
+ id: state.isRoom ? "matrix-room" : "matrix-dm"
642
+ },
643
+ dmPolicy: "allowlist",
644
+ groupPolicy: "allowlist",
645
+ policy: { groupAllowFromFallbackToAllowFrom: false },
646
+ allowFrom: commandAllowFrom,
647
+ groupAllowFrom: commandGroupAllowFrom,
648
+ command: {
649
+ useAccessGroups: params.useAccessGroups,
650
+ allowTextCommands: params.allowTextCommands,
651
+ hasControlCommand: params.hasControlCommand,
652
+ groupOwnerAllowFrom: "none",
653
+ commandGroupAllowFromFallbackToAllowFrom: false
654
+ }
655
+ })).commandAccess;
656
+ }
606
657
  //#endregion
607
658
  //#region extensions/matrix/src/matrix/monitor/verification-utils.ts
608
659
  const VERIFICATION_EVENT_PREFIX = "m.key.verification.";
@@ -818,15 +869,16 @@ async function isVerificationNoticeAuthorized(params) {
818
869
  return false;
819
870
  }
820
871
  const storeAllowFrom = params.dmPolicy !== "allowlist" && params.dmPolicy !== "open" ? await params.readStoreAllowFrom() : [];
821
- if (resolveMatrixMonitorAccessState({
872
+ if ((await resolveMatrixMonitorAccessState({
822
873
  allowFrom: params.allowFrom,
823
874
  storeAllowFrom,
824
875
  dmPolicy: params.dmPolicy,
876
+ groupPolicy: "open",
825
877
  groupAllowFrom: [],
826
878
  roomUsers: [],
827
879
  senderId: params.senderId,
828
880
  isRoom: false
829
- }).directAllowMatch.allowed) return true;
881
+ })).messageIngress.senderAccess.decision === "allow") return true;
830
882
  params.logVerboseMessage(`matrix: blocked verification sender ${params.senderId} (dmPolicy=${params.dmPolicy})`);
831
883
  return false;
832
884
  }
@@ -2173,7 +2225,7 @@ function createMatrixRoomMessageHandler(params) {
2173
2225
  cfg: liveCfg,
2174
2226
  accountId
2175
2227
  });
2176
- const { effectiveAllowFrom, effectiveGroupAllowFrom, effectiveRoomUsers, groupAllowConfigured, directAllowMatch, roomUserMatch, groupAllowMatch, commandAuthorizers } = resolveMatrixMonitorAccessState({
2228
+ const accessState = await resolveMatrixMonitorAccessState({
2177
2229
  allowFrom: await resolveCachedLiveAllowlist({
2178
2230
  cfg: liveCfg,
2179
2231
  entries: liveAccountAllowlists.dmAllowFrom,
@@ -2185,6 +2237,7 @@ function createMatrixRoomMessageHandler(params) {
2185
2237
  }),
2186
2238
  storeAllowFrom,
2187
2239
  dmPolicy,
2240
+ groupPolicy,
2188
2241
  groupAllowFrom: await resolveCachedLiveAllowlist({
2189
2242
  cfg: liveCfg,
2190
2243
  entries: liveAccountAllowlists.groupAllowFrom,
@@ -2196,16 +2249,20 @@ function createMatrixRoomMessageHandler(params) {
2196
2249
  }),
2197
2250
  roomUsers,
2198
2251
  senderId,
2199
- isRoom
2252
+ isRoom,
2253
+ accountId,
2254
+ eventKind: isReactionEvent ? "reaction" : "message"
2200
2255
  });
2256
+ const { effectiveGroupAllowFrom, effectiveRoomUsers, messageIngress } = accessState;
2257
+ const ingressDecision = messageIngress.ingress;
2201
2258
  if (isDirectMessage) {
2202
2259
  if (!dmEnabled || dmPolicy === "disabled") {
2203
2260
  await commitInboundEventIfClaimed();
2204
2261
  return;
2205
2262
  }
2206
- const allowMatchMeta = formatAllowlistMatchMeta(directAllowMatch);
2207
- if (!directAllowMatch.allowed) {
2208
- if (!isReactionEvent && dmPolicy === "pairing") {
2263
+ const senderReason = messageIngress.senderAccess.reasonCode;
2264
+ if (ingressDecision.decision !== "allow") {
2265
+ if (ingressDecision.admission === "pairing-required") {
2209
2266
  const senderName = await getSenderName();
2210
2267
  const { code, created } = await core.channel.pairing.upsertPairingRequest({
2211
2268
  channel: "matrix",
@@ -2219,7 +2276,7 @@ function createMatrixRoomMessageHandler(params) {
2219
2276
  idLine: `Your Matrix user id: ${senderId}`,
2220
2277
  code
2221
2278
  });
2222
- logVerboseMessage(created ? `matrix pairing request sender=${senderId} name=${senderName ?? "unknown"} (${allowMatchMeta})` : `matrix pairing reminder sender=${senderId} name=${senderName ?? "unknown"} (${allowMatchMeta})`);
2279
+ logVerboseMessage(created ? `matrix pairing request sender=${senderId} name=${senderName ?? "unknown"} (reason=${senderReason})` : `matrix pairing reminder sender=${senderId} name=${senderName ?? "unknown"} (reason=${senderReason})`);
2223
2280
  try {
2224
2281
  const { sendMessageMatrix } = await loadMatrixSendModule();
2225
2282
  await sendMessageMatrix(`room:${roomId}`, created ? pairingReply : `${pairingReply}\n\nPairing request is still pending approval. Reusing existing code.`, {
@@ -2238,19 +2295,14 @@ function createMatrixRoomMessageHandler(params) {
2238
2295
  }
2239
2296
  }
2240
2297
  if (isReactionEvent || dmPolicy !== "pairing") {
2241
- logVerboseMessage(`matrix: blocked ${isReactionEvent ? "reaction" : "dm"} sender ${senderId} (dmPolicy=${dmPolicy}, ${allowMatchMeta})`);
2298
+ logVerboseMessage(`matrix: blocked ${isReactionEvent ? "reaction" : "dm"} sender ${senderId} (dmPolicy=${dmPolicy}, reason=${senderReason})`);
2242
2299
  await commitInboundEventIfClaimed();
2243
2300
  }
2244
2301
  return;
2245
2302
  }
2246
2303
  }
2247
- if (isRoom && roomUserMatch && !roomUserMatch.allowed) {
2248
- logVerboseMessage(`matrix: blocked sender ${senderId} (room users allowlist, ${roomMatchMeta}, ${formatAllowlistMatchMeta(roomUserMatch)})`);
2249
- await commitInboundEventIfClaimed();
2250
- return;
2251
- }
2252
- if (isRoom && groupPolicy === "allowlist" && effectiveRoomUsers.length === 0 && groupAllowConfigured && groupAllowMatch && !groupAllowMatch.allowed) {
2253
- logVerboseMessage(`matrix: blocked sender ${senderId} (groupAllowFrom, ${roomMatchMeta}, ${formatAllowlistMatchMeta(groupAllowMatch)})`);
2304
+ if (isRoom && ingressDecision.decision !== "allow") {
2305
+ logVerboseMessage(`matrix: blocked sender ${senderId} (ingress=${ingressDecision.reasonCode}, ${roomMatchMeta})`);
2254
2306
  await commitInboundEventIfClaimed();
2255
2307
  return;
2256
2308
  }
@@ -2351,14 +2403,13 @@ function createMatrixRoomMessageHandler(params) {
2351
2403
  mentionRegexes: agentMentionRegexes
2352
2404
  });
2353
2405
  const hasControlCommandInMessage = core.channel.text.hasControlCommand(commandCheckText, cfg);
2354
- const commandGate = resolveControlCommandGate({
2406
+ const commandAccess = await resolveMatrixMonitorCommandAccess(accessState, {
2355
2407
  useAccessGroups,
2356
- authorizers: commandAuthorizers,
2357
2408
  allowTextCommands,
2358
2409
  hasControlCommand: hasControlCommandInMessage
2359
2410
  });
2360
- const commandAuthorized = commandGate.commandAuthorized;
2361
- if (isRoom && commandGate.shouldBlock) {
2411
+ const commandAuthorized = commandAccess.authorized;
2412
+ if (isRoom && commandAccess.shouldBlockControlCommand) {
2362
2413
  logInboundDrop({
2363
2414
  log: logVerboseMessage,
2364
2415
  channel: "matrix",
@@ -2492,7 +2543,6 @@ function createMatrixRoomMessageHandler(params) {
2492
2543
  triggerSnapshot: preparedTrigger,
2493
2544
  threadRootId,
2494
2545
  thread,
2495
- effectiveAllowFrom,
2496
2546
  effectiveGroupAllowFrom,
2497
2547
  effectiveRoomUsers
2498
2548
  };
@@ -2,7 +2,6 @@ import "./timeout-abort-signal-CtaIaP1v.js";
2
2
  import "openclaw/plugin-sdk/account-id";
3
3
  import { resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingMaxAgeMsForChannel } from "openclaw/plugin-sdk/conversation-runtime";
4
4
  import "openclaw/plugin-sdk/channel-message";
5
- import "openclaw/plugin-sdk/channel-policy";
6
5
  import { chunkTextForOutbound as chunkTextForOutbound$1 } from "openclaw/plugin-sdk/text-chunking";
7
6
  import { createActionGate as createActionGate$1, jsonResult, readNumberParam as readNumberParam$1, readReactionParams, readStringArrayParam, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/channel-actions";
8
7
  import "openclaw/plugin-sdk/routing";
@@ -1,6 +1,6 @@
1
1
  import { a as resolveMatrixTargetIdentity, i as resolveMatrixDirectUserId } from "./target-ids-80nQ2gql.js";
2
2
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
3
- import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, canonicalizeAllowlistWithResolvedIds, formatAllowlistMatchMeta, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
3
+ import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, canonicalizeAllowlistWithResolvedIds, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
4
4
  import { createReplyPrefixOptions, createTypingCallbacks } from "openclaw/plugin-sdk/channel-reply-options-runtime";
5
5
  import { formatLocationText, toLocationContext } from "openclaw/plugin-sdk/channel-location";
6
6
  import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/agent-media-payload";
@@ -74,4 +74,4 @@ function resolveMatrixStoredSessionMeta(entry) {
74
74
  };
75
75
  }
76
76
  //#endregion
77
- export { canonicalizeAllowlistWithResolvedIds as a, formatAllowlistMatchMeta as c, logInboundDrop as d, logTypingFailure as f, toLocationContext as h, buildAllowlistResolutionSummary as i, formatLocationText as l, summarizeMapping as m, resolveMatrixRoomConfig as n, createReplyPrefixOptions as o, patchAllowlistUsersInConfigEntries as p, addAllowlistUserEntriesFromConfigEntry as r, createTypingCallbacks as s, resolveMatrixStoredSessionMeta as t, getAgentScopedMediaLocalRoots as u };
77
+ export { canonicalizeAllowlistWithResolvedIds as a, formatLocationText as c, logTypingFailure as d, patchAllowlistUsersInConfigEntries as f, buildAllowlistResolutionSummary as i, getAgentScopedMediaLocalRoots as l, toLocationContext as m, resolveMatrixRoomConfig as n, createReplyPrefixOptions as o, summarizeMapping as p, addAllowlistUserEntriesFromConfigEntry as r, createTypingCallbacks as s, resolveMatrixStoredSessionMeta as t, logInboundDrop as u };
package/dist/test-api.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { r as setMatrixRuntime } from "./runtime-Dog86njy.js";
2
- import { t as matrixPlugin } from "./channel-DJNir3Rb.js";
2
+ import { t as matrixPlugin } from "./channel-H_6lMgwf.js";
3
3
  import { t as MatrixClient } from "./sdk-B2vZA27-.js";
4
4
  export { MatrixClient, matrixPlugin, setMatrixRuntime };
@@ -4,7 +4,7 @@ import { _ as parsePollStart, d as buildPollResponseContent, g as isPollStartTyp
4
4
  import { i as buildMatrixReactionRelationsPath, o as selectOwnMatrixReactionEventIds, s as summarizeMatrixReactionEvents } from "./reaction-common-ejrL19w-.js";
5
5
  import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-DkcXnm0X.js";
6
6
  import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as sendMatrixMessage, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessages, s as EventType, t as deleteMatrixMessage } from "./messages-BpihMh82.js";
7
- import { a as jsonResult, c as readStringArrayParam, l as readStringParam, o as readNumberParam, r as createActionGate, s as readReactionParams } from "./runtime-api-BXWBFIqm.js";
7
+ import { a as jsonResult, c as readStringArrayParam, l as readStringParam, o as readNumberParam, r as createActionGate, s as readReactionParams } from "./runtime-api-DTKcXOhp.js";
8
8
  import { t as applyMatrixProfileUpdate } from "./profile-update-DjeBNgIV.js";
9
9
  import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-CZ2rDeHL.js";
10
10
  import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "id": "matrix",
3
+ "commandAliases": [
4
+ {
5
+ "name": "matrix"
6
+ }
7
+ ],
3
8
  "activation": {
4
- "onStartup": false
9
+ "onStartup": false,
10
+ "onCommands": [
11
+ "matrix"
12
+ ]
5
13
  },
6
14
  "channels": [
7
15
  "matrix"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.5.9-beta.1",
3
+ "version": "2026.5.10-beta.2",
4
4
  "description": "OpenClaw Matrix channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,7 @@
21
21
  "openclaw": "workspace:*"
22
22
  },
23
23
  "peerDependencies": {
24
- "openclaw": ">=2026.5.9-beta.1"
24
+ "openclaw": ">=2026.5.10-beta.2"
25
25
  },
26
26
  "peerDependenciesMeta": {
27
27
  "openclaw": {
@@ -86,10 +86,10 @@
86
86
  "allowInvalidConfigRecovery": true
87
87
  },
88
88
  "compat": {
89
- "pluginApi": ">=2026.5.9-beta.1"
89
+ "pluginApi": ">=2026.5.10-beta.2"
90
90
  },
91
91
  "build": {
92
- "openclawVersion": "2026.5.9-beta.1"
92
+ "openclawVersion": "2026.5.10-beta.2"
93
93
  },
94
94
  "release": {
95
95
  "publishToClawHub": true,