@openclaw/matrix 2026.5.12 → 2026.5.14-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.
Files changed (99) hide show
  1. package/dist/api.js +4 -4
  2. package/dist/{approval-handler.runtime-LpWmoFyw.js → approval-handler.runtime-Q8ZlmQv_.js} +5 -6
  3. package/dist/{approval-ids-DoC2z7tR.js → approval-ids-D6IQvvRE.js} +1 -1
  4. package/dist/{approval-reaction-auth-DbcA1gGd.js → approval-reaction-auth-99PRu7rF.js} +2 -2
  5. package/dist/{channel-B-R2dceO.js → channel-BLKRuTHs.js} +285 -26
  6. package/dist/channel-plugin-api.js +1 -1
  7. package/dist/{channel.runtime-DdtNY_To.js → channel.runtime-9qwvlUwp.js} +8 -8
  8. package/dist/{cli-Cq80go7q.js → cli-BeWdjXLV.js} +15 -17
  9. package/dist/{cli-metadata-OtekEqAD.js → cli-metadata-B2_76YSe.js} +1 -1
  10. package/dist/cli-metadata.js +1 -1
  11. package/dist/{client-DzjShjVN.js → client-D6fFVbNM.js} +2 -2
  12. package/dist/{client-bootstrap-Am_ZEH3x.js → client-bootstrap-DBwUKgC3.js} +3 -3
  13. package/dist/{client-CyxIx4Fv.js → client-oci1tD6-.js} +4 -5
  14. package/dist/{account-config-D2W-V1eQ.js → config-paths-msaDGRh6.js} +20 -2
  15. package/dist/{config-schema-B975BYl0.js → config-schema-BPCzSyjT.js} +102 -4
  16. package/dist/contract-api.js +5 -6
  17. package/dist/{create-client-DpoW106T.js → create-client-BahCtURn.js} +4 -4
  18. package/dist/{credentials-DV6fWXhC.js → credentials-DK0lK9cZ.js} +1 -1
  19. package/dist/{credentials-write.runtime-zniTq-Gr.js → credentials-write.runtime-DhPvBU-C.js} +1 -1
  20. package/dist/{crypto-runtime-DS6R8y_n.js → crypto-runtime-B-SPS5mv.js} +5 -5
  21. package/dist/{deps-CU5W9Ixu.js → deps-LqqGWPWt.js} +10 -14
  22. package/dist/{directory-live-Bn66SRSD.js → directory-live-BCfx1C0G.js} +3 -3
  23. package/dist/{doctor-KjAvjAJu.js → doctor-KuNYX5N3.js} +3 -3
  24. package/dist/doctor-contract-api.js +1 -1
  25. package/dist/{draft-stream-D_FlbmCh.js → draft-stream-BayHVmtO.js} +1 -2
  26. package/dist/{encryption-guidance-BPi3A_m3.js → encryption-guidance-1QoIvd-g.js} +1 -1
  27. package/dist/{http-client-C7AeVJay.js → http-client-DS3UoC_p.js} +1 -1
  28. package/dist/index.js +2 -2
  29. package/dist/{legacy-crypto-inspector-pB252vPO.js → legacy-crypto-inspector-_gWJGVQ_.js} +1 -1
  30. package/dist/{legacy-crypto-restore-Biw-w2ng.js → legacy-crypto-restore-B9eF1gob.js} +1 -1
  31. package/dist/{logging-DZHSPP5N.js → logging-bJ8EEe1G.js} +1 -1
  32. package/dist/{matrix-migration.runtime-DfjNMeoX.js → matrix-migration.runtime-Cf_wX9mk.js} +3 -3
  33. package/dist/{media-text-psyGloYl.js → media-text-4h4YwCGC.js} +1 -1
  34. package/dist/{messages-DQ8xXWiP.js → messages-BKTEUSwJ.js} +5 -5
  35. package/dist/{migration-snapshot.runtime-CKHE3xF9.js → migration-snapshot.runtime-C7yiKWS7.js} +1 -1
  36. package/dist/{monitor-C8cEvvTe.js → monitor-k-b_TmCm.js} +66 -46
  37. package/dist/plugin-entry.handlers.runtime.js +2 -2
  38. package/dist/probe.runtime-zExLz3Ek.js +3 -0
  39. package/dist/{profile-update-DleMeUHj.js → profile-update-BAAflurI.js} +2 -3
  40. package/dist/{reaction-events-CiARZfjk.js → reaction-events-Dimh8FUE.js} +6 -6
  41. package/dist/{resolve-targets-BbzYe9Qi.js → resolve-targets-DPqngj4V.js} +1 -1
  42. package/dist/{resolver.runtime-BWFMWEsg.js → resolver.runtime-C0RDK0VW.js} +1 -1
  43. package/dist/{route-D6rg-iXN.js → route-R-ajT21_.js} +1 -1
  44. package/dist/{runtime-api-DTKcXOhp.js → runtime-api-C-QeChQj.js} +1 -1
  45. package/dist/runtime-api.js +1 -1
  46. package/dist/runtime-heavy-api.js +2 -2
  47. package/dist/{sdk-DXWmb94u.js → sdk-BwfNtBhM.js} +301 -13
  48. package/dist/secret-contract-api.js +1 -1
  49. package/dist/{send-Df-pDuG6.js → send-CdoJ1pZY.js} +323 -6
  50. package/dist/{setup-bootstrap-DXWxzR7A.js → setup-bootstrap-krQU60Az.js} +4 -4
  51. package/dist/setup-core-CgOV8zmh.js +675 -0
  52. package/dist/setup-plugin-api.js +3 -4
  53. package/dist/{setup-surface-DuRQrrpU.js → setup-surface-BgUaEySF.js} +7 -10
  54. package/dist/{config-BR4uLzNs.js → shared-BlXw87Kp.js} +199 -9
  55. package/dist/{logger-CnZRVrux.js → startup-abort-br7BZHJQ.js} +32 -1
  56. package/dist/{startup-verification-Demyp0bP.js → startup-verification-CTfhD7V_.js} +2 -2
  57. package/dist/{storage-tC3ujLiW.js → storage-HI1nL3im.js} +1 -1
  58. package/dist/{subagent-hooks-DQbyqq9V.js → subagent-hooks-api-BgQgDwAS.js} +22 -1
  59. package/dist/subagent-hooks-api.js +1 -22
  60. package/dist/test-api.js +2 -2
  61. package/dist/thread-binding-api.js +1 -1
  62. package/dist/{thread-bindings--P1UYe7t.js → thread-bindings-8AyQOYDT.js} +2 -2
  63. package/dist/{tool-actions.runtime-AFGhzK--.js → tool-actions.runtime-BuCnleVD.js} +9 -9
  64. package/dist/{verification-BbGdzYQl.js → verification-DvC37Z_y.js} +2 -2
  65. package/openclaw.plugin.json +96 -0
  66. package/package.json +6 -6
  67. package/dist/accounts-Bm90Rzvp.js +0 -130
  68. package/dist/allowlist-sTzpCn5d.js +0 -68
  69. package/dist/config-paths-nsVaysCu.js +0 -19
  70. package/dist/config-update-wZX-HLMn.js +0 -143
  71. package/dist/direct-management--Y8ypgLv.js +0 -251
  72. package/dist/direct-room-XkutHjES.js +0 -76
  73. package/dist/exec-approvals-Crnh543m.js +0 -196
  74. package/dist/probe.runtime-NE73hi9o.js +0 -3
  75. package/dist/profile-BlHu0wDX.js +0 -111
  76. package/dist/recovery-key-store-BTJ6jz5v.js +0 -294
  77. package/dist/session-store-metadata-DQXjgNLt.js +0 -77
  78. package/dist/setup-core-B5X7HxAP.js +0 -116
  79. package/dist/setup-dm-policy-Ca3jA4YW.js +0 -195
  80. package/dist/shared-CkbpEI5j.js +0 -195
  81. package/dist/startup-abort-56edvmbM.js +0 -32
  82. /package/dist/{active-client-uhlxdhEy.js → active-client-DUi-lumi.js} +0 -0
  83. /package/dist/{approval-reactions-o2_tuH8D.js → approval-reactions-Cwd1PMCC.js} +0 -0
  84. /package/dist/{async-lock-uQfhfQIY.js → async-lock-SsmtFXtt.js} +0 -0
  85. /package/dist/{backup-health-Cabu_WQC.js → backup-health-3BHbHxyd.js} +0 -0
  86. /package/dist/{config-secret-input.runtime-DiKFehsE.js → config-secret-input.runtime-nbLCnJq7.js} +0 -0
  87. /package/dist/{crypto-node.runtime-pihzdpY7.js → crypto-node.runtime-D9qxgRPa.js} +0 -0
  88. /package/dist/{device-health-UVYpbA_W.js → device-health-Di9MUzFj.js} +0 -0
  89. /package/dist/{doctor-contract-D4-64QuJ.js → doctor-contract-s4gUPmRN.js} +0 -0
  90. /package/dist/{errors-CTcpEDq-.js → errors-BpHgvm2o.js} +0 -0
  91. /package/dist/{exec-approval-resolver-Bza9Dhlm.js → exec-approval-resolver-C8faS0XB.js} +0 -0
  92. /package/dist/{migration-snapshot-backup-DaCHTp8C.js → migration-snapshot-backup-BWTIFXgQ.js} +0 -0
  93. /package/dist/{reaction-common-ejrL19w-.js → reaction-common-B-QgNfEs.js} +0 -0
  94. /package/dist/{runtime-C6X4h_SJ.js → runtime-lwTSy9Yt.js} +0 -0
  95. /package/dist/{secret-contract-DcrJWCQI.js → secret-contract-e4SdhUtT.js} +0 -0
  96. /package/dist/{sync-state-C_beeevA.js → sync-state-Bx0gPaGA.js} +0 -0
  97. /package/dist/{thread-binding-api-Cq_E-E1K.js → thread-binding-api-Bx55B6hm.js} +0 -0
  98. /package/dist/{timeout-abort-signal-CtaIaP1v.js → timeout-abort-signal-sT0wAxVn.js} +0 -0
  99. /package/dist/{url-validation-DiK9j7jz.js → url-validation-CBZBxN3F.js} +0 -0
package/dist/api.js CHANGED
@@ -2,10 +2,10 @@ 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-B-R2dceO.js";
6
- import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-B5X7HxAP.js";
7
- import { n as matrixOnboardingAdapter } from "./setup-surface-DuRQrrpU.js";
8
- import { t as createMatrixThreadBindingManager } from "./thread-bindings--P1UYe7t.js";
5
+ import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-CgOV8zmh.js";
6
+ import { t as matrixPlugin } from "./channel-BLKRuTHs.js";
7
+ import { n as matrixOnboardingAdapter } from "./setup-surface-BgUaEySF.js";
8
+ import { t as createMatrixThreadBindingManager } from "./thread-bindings-8AyQOYDT.js";
9
9
  //#region extensions/matrix/api.ts
10
10
  const matrixSessionBindingAdapterChannels = ["matrix"];
11
11
  //#endregion
@@ -1,10 +1,9 @@
1
1
  import { a as resolveMatrixTargetIdentity } from "./target-ids-80nQ2gql.js";
2
- import { i as resolveMatrixAccount } from "./accounts-Bm90Rzvp.js";
3
- import { c as shouldHandleMatrixApprovalRequest, r as isMatrixAnyApprovalClientEnabled } from "./exec-approvals-Crnh543m.js";
4
- import { a as sendMessageMatrix, i as reactMatrixMessage, s as sendSingleTextMessageMatrix } from "./send-Df-pDuG6.js";
5
- import { a as repairMatrixDirectRooms } from "./direct-management--Y8ypgLv.js";
6
- import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-o2_tuH8D.js";
7
- import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-DQ8xXWiP.js";
2
+ import { g as resolveMatrixAccount } from "./setup-core-CgOV8zmh.js";
3
+ import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-BLKRuTHs.js";
4
+ import { a as sendMessageMatrix, i as reactMatrixMessage, p as repairMatrixDirectRooms, s as sendSingleTextMessageMatrix } from "./send-CdoJ1pZY.js";
5
+ import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-Cwd1PMCC.js";
6
+ import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-BKTEUSwJ.js";
8
7
  import { listMessageReceiptPlatformIds, resolveMessageReceiptPrimaryId } from "openclaw/plugin-sdk/channel-message";
9
8
  import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
10
9
  import { setTimeout } from "node:timers/promises";
@@ -1,4 +1,4 @@
1
- import { n as normalizeMatrixUserId } from "./allowlist-sTzpCn5d.js";
1
+ import { a as normalizeMatrixUserId } from "./config-schema-BPCzSyjT.js";
2
2
  //#region extensions/matrix/src/approval-ids.ts
3
3
  function normalizeMatrixApproverId(value) {
4
4
  return normalizeMatrixUserId(String(value)) || void 0;
@@ -1,5 +1,5 @@
1
- import { i as resolveMatrixAccount } from "./accounts-Bm90Rzvp.js";
2
- import { t as normalizeMatrixApproverId } from "./approval-ids-DoC2z7tR.js";
1
+ import { g as resolveMatrixAccount } from "./setup-core-CgOV8zmh.js";
2
+ import { t as normalizeMatrixApproverId } from "./approval-ids-D6IQvvRE.js";
3
3
  import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
4
4
  //#region extensions/matrix/src/approval-reaction-auth.ts
5
5
  function normalizeMatrixExecApproverId(value) {
@@ -1,21 +1,16 @@
1
1
  import { a as resolveMatrixTargetIdentity, i as resolveMatrixDirectUserId, n as normalizeMatrixMessagingTarget, r as normalizeMatrixResolvableTarget } from "./target-ids-80nQ2gql.js";
2
2
  import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKey } from "./thread-bindings-shared-DK-d-oYX.js";
3
3
  import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-BWwIruri.js";
4
- import { a as resolveMatrixAccountConfig } from "./account-config-D2W-V1eQ.js";
5
- import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-Bm90Rzvp.js";
6
- import { n as normalizeMatrixUserId } from "./allowlist-sTzpCn5d.js";
7
- import { t as normalizeMatrixApproverId } from "./approval-ids-DoC2z7tR.js";
8
- import { a as isMatrixExecApprovalAuthorizedSender, c as shouldHandleMatrixApprovalRequest, d as matrixApprovalAuth, i as isMatrixApprovalClientEnabled, l as shouldSuppressLocalMatrixExecApprovalPrompt, n as getMatrixExecApprovalApprovers, o as isMatrixExecApprovalClientEnabled, r as isMatrixAnyApprovalClientEnabled, s as resolveMatrixExecApprovalTarget, t as getMatrixApprovalApprovers, u as getMatrixApprovalAuthApprovers } from "./exec-approvals-Crnh543m.js";
9
- import { t as formatMatrixErrorMessage } from "./errors-CTcpEDq-.js";
10
- import { n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-B975BYl0.js";
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-DQXjgNLt.js";
13
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DcrJWCQI.js";
14
- import { a as namedAccountPromotionKeys, o as resolveSingleAccountPromotionTarget, s as singleAccountKeysToMove } from "./setup-dm-policy-Ca3jA4YW.js";
15
- import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-B5X7HxAP.js";
16
- import { i as autoPrepareLegacyMatrixCrypto, o as autoMigrateLegacyMatrixState, r as resolveMatrixMigrationStatus } from "./matrix-migration.runtime-DfjNMeoX.js";
17
- import { t as maybeCreateMatrixMigrationSnapshot } from "./migration-snapshot-backup-DaCHTp8C.js";
18
- import { n as resolveMatrixInboundConversation } from "./thread-binding-api-Cq_E-E1K.js";
4
+ import { c as resolveMatrixAccountConfig } from "./config-paths-msaDGRh6.js";
5
+ import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, n as matrixSetupAdapter, p as listMatrixAccountIds, t as createMatrixSetupWizardProxy, u as namedAccountPromotionKeys } from "./setup-core-CgOV8zmh.js";
6
+ import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-BPCzSyjT.js";
7
+ import { t as normalizeMatrixApproverId } from "./approval-ids-D6IQvvRE.js";
8
+ import { t as formatMatrixErrorMessage } from "./errors-BpHgvm2o.js";
9
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-s4gUPmRN.js";
10
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-e4SdhUtT.js";
11
+ import { i as autoPrepareLegacyMatrixCrypto, o as autoMigrateLegacyMatrixState, r as resolveMatrixMigrationStatus } from "./matrix-migration.runtime-Cf_wX9mk.js";
12
+ import { t as maybeCreateMatrixMigrationSnapshot } from "./migration-snapshot-backup-BWTIFXgQ.js";
13
+ import { n as resolveMatrixInboundConversation } from "./thread-binding-api-Bx55B6hm.js";
19
14
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
20
15
  import { createScopedAccountReplyToModeResolver } from "openclaw/plugin-sdk/conversation-runtime";
21
16
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -34,10 +29,18 @@ import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
34
29
  import { Type } from "typebox";
35
30
  import { createApproverRestrictedNativeApprovalCapability, createChannelApprovalCapability, splitChannelApprovalCapability } from "openclaw/plugin-sdk/approval-delivery-runtime";
36
31
  import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
37
- import { createChannelNativeOriginTargetResolver, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
38
- import { parseThreadSessionSuffix } from "openclaw/plugin-sdk/routing";
32
+ import { createChannelNativeOriginTargetResolver, resolveApprovalRequestChannelAccountId, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
33
+ import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
34
+ import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, canonicalizeAllowlistWithResolvedIds, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
35
+ import { createChannelExecApprovalProfile, getExecApprovalReplyMetadata, isChannelExecApprovalClientEnabledFromConfig, isChannelExecApprovalTargetRecipient, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
36
+ import { normalizeAccountId as normalizeAccountId$1, parseThreadSessionSuffix } from "openclaw/plugin-sdk/routing";
39
37
  import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
40
38
  import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
39
+ import { createReplyPrefixOptions, createTypingCallbacks } from "openclaw/plugin-sdk/channel-reply-options-runtime";
40
+ import { formatLocationText, toLocationContext } from "openclaw/plugin-sdk/channel-location";
41
+ import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/agent-media-payload";
42
+ import { logInboundDrop, logTypingFailure } from "openclaw/plugin-sdk/channel-logging";
43
+ import { buildChannelKeyCandidates, resolveChannelEntryMatch } from "openclaw/plugin-sdk/channel-targets";
41
44
  import { loadSessionStore, resolveSessionStoreEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
42
45
  //#region extensions/matrix/src/actions.ts
43
46
  const MATRIX_PLUGIN_HANDLED_ACTIONS = new Set([
@@ -129,7 +132,7 @@ const matrixMessageActions = {
129
132
  return extractToolSend(args, "sendMessage");
130
133
  },
131
134
  handleAction: async (ctx) => {
132
- const { handleMatrixAction } = await import("./tool-actions.runtime-AFGhzK--.js");
135
+ const { handleMatrixAction } = await import("./tool-actions.runtime-BuCnleVD.js");
133
136
  const { action, params, cfg, accountId, mediaLocalRoots } = ctx;
134
137
  const dispatch = async (actionParams) => await handleMatrixAction({
135
138
  ...actionParams,
@@ -269,6 +272,194 @@ const matrixMessageActions = {
269
272
  }
270
273
  };
271
274
  //#endregion
275
+ //#region extensions/matrix/src/approval-auth.ts
276
+ function getMatrixApprovalAuthApprovers(params) {
277
+ return resolveApprovalApprovers({
278
+ allowFrom: resolveMatrixAccount(params).config.dm?.allowFrom,
279
+ normalizeApprover: normalizeMatrixApproverId
280
+ });
281
+ }
282
+ const matrixApprovalAuth = createResolvedApproverActionAuthAdapter({
283
+ channelLabel: "Matrix",
284
+ resolveApprovers: ({ cfg, accountId }) => getMatrixApprovalAuthApprovers({
285
+ cfg,
286
+ accountId
287
+ }),
288
+ normalizeSenderId: (value) => normalizeMatrixApproverId(value)
289
+ });
290
+ //#endregion
291
+ //#region extensions/matrix/src/exec-approvals.ts
292
+ function normalizeMatrixExecApproverId(value) {
293
+ const normalized = normalizeMatrixApproverId(value);
294
+ return normalized === "*" ? void 0 : normalized;
295
+ }
296
+ function resolveMatrixExecApprovalConfig(params) {
297
+ const account = resolveMatrixAccount(params);
298
+ const config = account.config.execApprovals;
299
+ if (!config) return;
300
+ return {
301
+ ...config,
302
+ enabled: account.enabled && account.configured ? config.enabled : false
303
+ };
304
+ }
305
+ function countMatrixExecApprovalEligibleAccounts(params) {
306
+ return listMatrixAccountIds(params.cfg).filter((accountId) => {
307
+ const account = resolveMatrixAccount({
308
+ cfg: params.cfg,
309
+ accountId
310
+ });
311
+ if (!account.enabled || !account.configured) return false;
312
+ const config = resolveMatrixExecApprovalConfig({
313
+ cfg: params.cfg,
314
+ accountId
315
+ });
316
+ const filters = config?.enabled ? {
317
+ agentFilter: config.agentFilter,
318
+ sessionFilter: config.sessionFilter
319
+ } : {
320
+ agentFilter: void 0,
321
+ sessionFilter: void 0
322
+ };
323
+ return isChannelExecApprovalClientEnabledFromConfig({
324
+ enabled: config?.enabled,
325
+ approverCount: getMatrixApprovalApprovers({
326
+ cfg: params.cfg,
327
+ accountId,
328
+ approvalKind: params.approvalKind
329
+ }).length
330
+ }) && matchesApprovalRequestFilters({
331
+ request: params.request.request,
332
+ agentFilter: filters.agentFilter,
333
+ sessionFilter: filters.sessionFilter
334
+ });
335
+ }).length;
336
+ }
337
+ function matchesMatrixRequestAccount(params) {
338
+ const turnSourceChannel = normalizeLowercaseStringOrEmpty(params.request.request.turnSourceChannel);
339
+ const boundAccountId = resolveApprovalRequestChannelAccountId({
340
+ cfg: params.cfg,
341
+ request: params.request,
342
+ channel: "matrix"
343
+ });
344
+ if (turnSourceChannel && turnSourceChannel !== "matrix" && !boundAccountId) return countMatrixExecApprovalEligibleAccounts({
345
+ cfg: params.cfg,
346
+ request: params.request,
347
+ approvalKind: params.approvalKind
348
+ }) <= 1;
349
+ return !boundAccountId || !params.accountId || normalizeAccountId$1(boundAccountId) === normalizeAccountId$1(params.accountId);
350
+ }
351
+ function getMatrixExecApprovalApprovers(params) {
352
+ const account = resolveMatrixAccount(params).config;
353
+ return resolveApprovalApprovers({
354
+ explicit: account.execApprovals?.approvers,
355
+ allowFrom: account.dm?.allowFrom,
356
+ normalizeApprover: normalizeMatrixExecApproverId
357
+ });
358
+ }
359
+ function resolveMatrixApprovalKind(request) {
360
+ return request.id.startsWith("plugin:") ? "plugin" : "exec";
361
+ }
362
+ function getMatrixApprovalApprovers(params) {
363
+ if (params.approvalKind === "plugin") return getMatrixApprovalAuthApprovers({
364
+ cfg: params.cfg,
365
+ accountId: params.accountId
366
+ });
367
+ return getMatrixExecApprovalApprovers(params);
368
+ }
369
+ function isMatrixExecApprovalTargetRecipient(params) {
370
+ return isChannelExecApprovalTargetRecipient({
371
+ ...params,
372
+ channel: "matrix",
373
+ normalizeSenderId: normalizeMatrixApproverId,
374
+ matchTarget: ({ target, normalizedSenderId }) => normalizeMatrixApproverId(target.to) === normalizedSenderId
375
+ });
376
+ }
377
+ const matrixExecApprovalProfile = createChannelExecApprovalProfile({
378
+ resolveConfig: resolveMatrixExecApprovalConfig,
379
+ resolveApprovers: getMatrixExecApprovalApprovers,
380
+ normalizeSenderId: normalizeMatrixApproverId,
381
+ isTargetRecipient: isMatrixExecApprovalTargetRecipient,
382
+ matchesRequestAccount: (params) => matchesMatrixRequestAccount({
383
+ ...params,
384
+ approvalKind: "exec"
385
+ })
386
+ });
387
+ const isMatrixExecApprovalClientEnabled = matrixExecApprovalProfile.isClientEnabled;
388
+ matrixExecApprovalProfile.isApprover;
389
+ const isMatrixExecApprovalAuthorizedSender = matrixExecApprovalProfile.isAuthorizedSender;
390
+ const resolveMatrixExecApprovalTarget = matrixExecApprovalProfile.resolveTarget;
391
+ matrixExecApprovalProfile.shouldHandleRequest;
392
+ function isMatrixApprovalClientEnabled(params) {
393
+ if (params.approvalKind === "exec") return isMatrixExecApprovalClientEnabled(params);
394
+ return isChannelExecApprovalClientEnabledFromConfig({
395
+ enabled: resolveMatrixExecApprovalConfig(params)?.enabled,
396
+ approverCount: getMatrixApprovalApprovers(params).length
397
+ });
398
+ }
399
+ function isMatrixAnyApprovalClientEnabled(params) {
400
+ return isMatrixApprovalClientEnabled({
401
+ ...params,
402
+ approvalKind: "exec"
403
+ }) || isMatrixApprovalClientEnabled({
404
+ ...params,
405
+ approvalKind: "plugin"
406
+ });
407
+ }
408
+ function shouldHandleMatrixApprovalRequest(params) {
409
+ const approvalKind = resolveMatrixApprovalKind(params.request);
410
+ if (!matchesMatrixRequestAccount({
411
+ ...params,
412
+ approvalKind
413
+ })) return false;
414
+ const config = resolveMatrixExecApprovalConfig(params);
415
+ if (!isChannelExecApprovalClientEnabledFromConfig({
416
+ enabled: config?.enabled,
417
+ approverCount: getMatrixApprovalApprovers({
418
+ ...params,
419
+ approvalKind
420
+ }).length
421
+ })) return false;
422
+ return matchesApprovalRequestFilters({
423
+ request: params.request.request,
424
+ agentFilter: config?.agentFilter,
425
+ sessionFilter: config?.sessionFilter
426
+ });
427
+ }
428
+ function buildFilterCheckRequest(params) {
429
+ if (params.metadata.approvalKind === "plugin") return {
430
+ id: params.metadata.approvalId,
431
+ request: {
432
+ title: "Plugin Approval Required",
433
+ description: "",
434
+ agentId: params.metadata.agentId ?? null,
435
+ sessionKey: params.metadata.sessionKey ?? null
436
+ },
437
+ createdAtMs: 0,
438
+ expiresAtMs: 0
439
+ };
440
+ return {
441
+ id: params.metadata.approvalId,
442
+ request: {
443
+ command: "",
444
+ agentId: params.metadata.agentId ?? null,
445
+ sessionKey: params.metadata.sessionKey ?? null
446
+ },
447
+ createdAtMs: 0,
448
+ expiresAtMs: 0
449
+ };
450
+ }
451
+ function shouldSuppressLocalMatrixExecApprovalPrompt(params) {
452
+ if (!matrixExecApprovalProfile.shouldSuppressLocalPrompt(params)) return false;
453
+ const metadata = getExecApprovalReplyMetadata(params.payload);
454
+ if (!metadata) return false;
455
+ const request = buildFilterCheckRequest({ metadata });
456
+ return shouldHandleMatrixApprovalRequest({
457
+ cfg: params.cfg,
458
+ accountId: params.accountId,
459
+ request
460
+ });
461
+ }
462
+ //#endregion
272
463
  //#region extensions/matrix/src/approval-native.ts
273
464
  function normalizeComparableTarget(value) {
274
465
  const target = resolveMatrixTargetIdentity(value);
@@ -405,7 +596,7 @@ const matrixNativeApprovalCapability = createApproverRestrictedNativeApprovalCap
405
596
  accountId,
406
597
  request
407
598
  }),
408
- load: async () => (await import("./approval-handler.runtime-LpWmoFyw.js")).matrixApprovalNativeRuntime
599
+ load: async () => (await import("./approval-handler.runtime-Q8ZlmQv_.js")).matrixApprovalNativeRuntime
409
600
  })
410
601
  });
411
602
  const splitMatrixApprovalCapability = splitChannelApprovalCapability(matrixNativeApprovalCapability);
@@ -513,6 +704,30 @@ function createMatrixPairingText(sendMessageMatrix) {
513
704
  };
514
705
  }
515
706
  //#endregion
707
+ //#region extensions/matrix/src/matrix/monitor/rooms.ts
708
+ function readLegacyRoomAllowAlias(room) {
709
+ const rawRoom = room;
710
+ return typeof rawRoom?.allow === "boolean" ? rawRoom.allow : void 0;
711
+ }
712
+ function resolveMatrixRoomConfig(params) {
713
+ const rooms = params.rooms ?? {};
714
+ const allowlistConfigured = Object.keys(rooms).length > 0;
715
+ const { entry: matched, key: matchedKey, wildcardEntry, wildcardKey } = resolveChannelEntryMatch({
716
+ entries: rooms,
717
+ keys: buildChannelKeyCandidates(params.roomId, `room:${params.roomId}`, ...params.aliases),
718
+ wildcardKey: "*"
719
+ });
720
+ const resolved = matched ?? wildcardEntry;
721
+ const legacyAllow = readLegacyRoomAllowAlias(resolved);
722
+ return {
723
+ allowed: resolved ? resolved.enabled !== false && legacyAllow !== false : false,
724
+ allowlistConfigured,
725
+ config: resolved,
726
+ matchKey: matchedKey ?? wildcardKey,
727
+ matchSource: matched ? "direct" : wildcardEntry ? "wildcard" : void 0
728
+ };
729
+ }
730
+ //#endregion
516
731
  //#region extensions/matrix/src/group-mentions.ts
517
732
  function resolveMatrixRoomConfigForGroup(params) {
518
733
  const roomId = normalizeMatrixResolvableTarget(params.groupId?.trim() ?? "");
@@ -543,7 +758,7 @@ function resolveMatrixGroupToolPolicy(params) {
543
758
  }
544
759
  //#endregion
545
760
  //#region extensions/matrix/src/resolver.ts
546
- const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-BWFMWEsg.js"), "matrixResolverRuntime");
761
+ const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-C0RDK0VW.js"), "matrixResolverRuntime");
547
762
  const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs, kind, runtime }) => (await loadMatrixChannelRuntime$1()).resolveMatrixTargets({
548
763
  cfg,
549
764
  accountId,
@@ -552,6 +767,50 @@ const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs,
552
767
  runtime
553
768
  }) };
554
769
  //#endregion
770
+ //#region extensions/matrix/src/matrix/session-store-metadata.ts
771
+ function trimMaybeString(value) {
772
+ if (typeof value !== "string") return;
773
+ const trimmed = value.trim();
774
+ return trimmed.length > 0 ? trimmed : void 0;
775
+ }
776
+ function resolveMatrixRoomTargetId(value) {
777
+ const trimmed = trimMaybeString(value);
778
+ if (!trimmed) return;
779
+ const target = resolveMatrixTargetIdentity(trimmed);
780
+ return target?.kind === "room" && target.id.startsWith("!") ? target.id : void 0;
781
+ }
782
+ function resolveMatrixSessionAccountId(value) {
783
+ const trimmed = trimMaybeString(value);
784
+ return trimmed ? normalizeAccountId(trimmed) : void 0;
785
+ }
786
+ function resolveMatrixStoredRoomId(params) {
787
+ return resolveMatrixRoomTargetId(params.deliveryTo) ?? resolveMatrixRoomTargetId(params.lastTo) ?? resolveMatrixRoomTargetId(params.originNativeChannelId) ?? resolveMatrixRoomTargetId(params.originTo);
788
+ }
789
+ function resolveMatrixStoredSessionMeta(entry) {
790
+ if (!entry) return null;
791
+ const channel = trimMaybeString(entry.deliveryContext?.channel) ?? trimMaybeString(entry.lastChannel) ?? trimMaybeString(entry.origin?.provider);
792
+ const accountId = resolveMatrixSessionAccountId(entry.deliveryContext?.accountId ?? entry.lastAccountId ?? entry.origin?.accountId) ?? void 0;
793
+ const roomId = resolveMatrixStoredRoomId({
794
+ deliveryTo: entry.deliveryContext?.to,
795
+ lastTo: entry.lastTo,
796
+ originNativeChannelId: entry.origin?.nativeChannelId,
797
+ originTo: entry.origin?.to
798
+ });
799
+ const chatType = trimMaybeString(entry.origin?.chatType) ?? trimMaybeString(entry.chatType) ?? void 0;
800
+ const directUserId = chatType === "direct" ? trimMaybeString(entry.origin?.nativeDirectUserId) ?? resolveMatrixDirectUserId({
801
+ from: trimMaybeString(entry.origin?.from),
802
+ to: (roomId ? `room:${roomId}` : void 0) ?? trimMaybeString(entry.deliveryContext?.to) ?? trimMaybeString(entry.lastTo) ?? trimMaybeString(entry.origin?.to),
803
+ chatType
804
+ }) : void 0;
805
+ if (!channel && !accountId && !roomId && !directUserId) return null;
806
+ return {
807
+ ...channel ? { channel } : {},
808
+ ...accountId ? { accountId } : {},
809
+ ...roomId ? { roomId } : {},
810
+ ...directUserId ? { directUserId } : {}
811
+ };
812
+ }
813
+ //#endregion
555
814
  //#region extensions/matrix/src/session-route.ts
556
815
  function resolveEffectiveMatrixAccountId(params) {
557
816
  return normalizeAccountId(params.accountId ?? resolveDefaultMatrixAccountId(params.cfg));
@@ -688,8 +947,8 @@ async function runMatrixStartupMaintenance(params) {
688
947
  //#endregion
689
948
  //#region extensions/matrix/src/channel.ts
690
949
  let matrixStartupLock = Promise.resolve();
691
- const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-DuRQrrpU.js").then((n) => n.t), "matrixSetupWizard");
692
- const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-DdtNY_To.js"), "matrixChannelRuntime");
950
+ const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-BgUaEySF.js").then((n) => n.t), "matrixSetupWizard");
951
+ const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-9qwvlUwp.js"), "matrixChannelRuntime");
693
952
  const meta = {
694
953
  id: "matrix",
695
954
  label: "Matrix",
@@ -713,12 +972,12 @@ const matrixDoctor = {
713
972
  warnOnEmptyGroupSenderAllowlist: true,
714
973
  legacyConfigRules,
715
974
  normalizeCompatibilityConfig,
716
- runConfigSequence: async ({ cfg, env, shouldRepair }) => await (await import("./doctor-KjAvjAJu.js")).runMatrixDoctorSequence({
975
+ runConfigSequence: async ({ cfg, env, shouldRepair }) => await (await import("./doctor-KuNYX5N3.js")).runMatrixDoctorSequence({
717
976
  cfg,
718
977
  env,
719
978
  shouldRepair
720
979
  }),
721
- cleanStaleConfig: async ({ cfg }) => await (await import("./doctor-KjAvjAJu.js")).cleanStaleMatrixPluginConfig(cfg)
980
+ cleanStaleConfig: async ({ cfg }) => await (await import("./doctor-KuNYX5N3.js")).cleanStaleMatrixPluginConfig(cfg)
722
981
  };
723
982
  const listMatrixDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister({
724
983
  kind: "user",
@@ -1055,7 +1314,7 @@ const matrixPlugin = createChatChannelPlugin({
1055
1314
  await previousLock;
1056
1315
  let monitorMatrixProvider;
1057
1316
  try {
1058
- monitorMatrixProvider = (await import("./monitor-C8cEvvTe.js")).monitorMatrixProvider;
1317
+ monitorMatrixProvider = (await import("./monitor-k-b_TmCm.js")).monitorMatrixProvider;
1059
1318
  } finally {
1060
1319
  releaseLock();
1061
1320
  }
@@ -1114,4 +1373,4 @@ const matrixPlugin = createChatChannelPlugin({
1114
1373
  outbound: matrixChannelOutbound
1115
1374
  });
1116
1375
  //#endregion
1117
- export { matrixPlugin as t };
1376
+ export { shouldHandleMatrixApprovalRequest as _, buildAllowlistResolutionSummary as a, createTypingCallbacks as c, logInboundDrop as d, logTypingFailure as f, isMatrixAnyApprovalClientEnabled as g, toLocationContext as h, addAllowlistUserEntriesFromConfigEntry as i, formatLocationText as l, summarizeMapping as m, resolveMatrixStoredSessionMeta as n, canonicalizeAllowlistWithResolvedIds as o, patchAllowlistUsersInConfigEntries as p, resolveMatrixRoomConfig as r, createReplyPrefixOptions as s, matrixPlugin as t, getAgentScopedMediaLocalRoots as u };
@@ -1,2 +1,2 @@
1
- import { t as matrixPlugin } from "./channel-B-R2dceO.js";
1
+ import { t as matrixPlugin } from "./channel-BLKRuTHs.js";
2
2
  export { matrixPlugin };
@@ -1,10 +1,10 @@
1
- import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-Df-pDuG6.js";
2
- import { t as isBunRuntime } from "./runtime-C6X4h_SJ.js";
3
- import { n as resolveMatrixAuth } from "./config-BR4uLzNs.js";
4
- import "./client-CyxIx4Fv.js";
5
- import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-Bn66SRSD.js";
6
- import { f as resolveOutboundSendDep, n as chunkTextForOutbound } from "./runtime-api-DTKcXOhp.js";
7
- import { t as resolveMatrixTargets } from "./resolve-targets-BbzYe9Qi.js";
1
+ import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-CdoJ1pZY.js";
2
+ import { t as isBunRuntime } from "./runtime-lwTSy9Yt.js";
3
+ import { l as resolveMatrixAuth } from "./shared-BlXw87Kp.js";
4
+ import "./client-oci1tD6-.js";
5
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-BCfx1C0G.js";
6
+ import { f as resolveOutboundSendDep, n as chunkTextForOutbound } from "./runtime-api-C-QeChQj.js";
7
+ import { t as resolveMatrixTargets } from "./resolve-targets-DPqngj4V.js";
8
8
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { createReplyToFanout } from "openclaw/plugin-sdk/outbound-runtime";
10
10
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -13,7 +13,7 @@ import { resolvePayloadMediaUrls } from "openclaw/plugin-sdk/reply-payload";
13
13
  //#region extensions/matrix/src/matrix/probe.ts
14
14
  let matrixProbeRuntimeDepsPromise;
15
15
  async function loadMatrixProbeRuntimeDeps() {
16
- matrixProbeRuntimeDepsPromise ??= import("./probe.runtime-NE73hi9o.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient }));
16
+ matrixProbeRuntimeDepsPromise ??= import("./probe.runtime-zExLz3Ek.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient }));
17
17
  return await matrixProbeRuntimeDepsPromise;
18
18
  }
19
19
  async function probeMatrix(params) {
@@ -1,18 +1,16 @@
1
- import { a as resolveMatrixAccountConfig } from "./account-config-D2W-V1eQ.js";
1
+ import { c as resolveMatrixAccountConfig } from "./config-paths-msaDGRh6.js";
2
2
  import { t as getMatrixRuntime } from "./runtime-Dog86njy.js";
3
- import { i as resolveMatrixAccount } from "./accounts-Bm90Rzvp.js";
4
- import { t as formatMatrixErrorMessage } from "./errors-CTcpEDq-.js";
5
- import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-wZX-HLMn.js";
6
- import { n as matrixSetupAdapter } from "./setup-core-B5X7HxAP.js";
7
- import { t as resolveMatrixRoomKeyBackupIssue } from "./backup-health-Cabu_WQC.js";
8
- import { i as setMatrixSdkLogMode, r as setMatrixSdkConsoleLogging } from "./logging-DZHSPP5N.js";
9
- import { n as withResolvedActionClient } from "./client-DzjShjVN.js";
10
- import { r as resolveMatrixAuthContext } from "./config-BR4uLzNs.js";
11
- import "./client-CyxIx4Fv.js";
12
- import { i as formatZonedTimestamp } from "./runtime-api-DTKcXOhp.js";
13
- import { isOpenClawManagedMatrixDevice, summarizeMatrixDeviceHealth } from "./device-health-UVYpbA_W.js";
14
- import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-DleMeUHj.js";
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-BbGdzYQl.js";
3
+ import { c as resolveMatrixConfigPath, g as resolveMatrixAccount, l as updateMatrixAccountConfig, n as matrixSetupAdapter } from "./setup-core-CgOV8zmh.js";
4
+ import { t as formatMatrixErrorMessage } from "./errors-BpHgvm2o.js";
5
+ import { t as resolveMatrixRoomKeyBackupIssue } from "./backup-health-3BHbHxyd.js";
6
+ import { i as setMatrixSdkLogMode, r as setMatrixSdkConsoleLogging } from "./logging-bJ8EEe1G.js";
7
+ import { n as withResolvedActionClient } from "./client-D6fFVbNM.js";
8
+ import { u as resolveMatrixAuthContext } from "./shared-BlXw87Kp.js";
9
+ import "./client-oci1tD6-.js";
10
+ import { i as formatZonedTimestamp } from "./runtime-api-C-QeChQj.js";
11
+ import { isOpenClawManagedMatrixDevice, summarizeMatrixDeviceHealth } from "./device-health-Di9MUzFj.js";
12
+ import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-BAAflurI.js";
13
+ 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-DvC37Z_y.js";
16
14
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
17
15
  //#region extensions/matrix/src/matrix/actions/devices.ts
18
16
  async function listMatrixOwnDevices(opts = {}) {
@@ -39,11 +37,11 @@ let matrixCliExitScheduled = false;
39
37
  let matrixActionClientModulePromise;
40
38
  let matrixDirectManagementModulePromise;
41
39
  function loadMatrixActionClientModule() {
42
- matrixActionClientModulePromise ??= import("./client-DzjShjVN.js").then((n) => n.t);
40
+ matrixActionClientModulePromise ??= import("./client-D6fFVbNM.js").then((n) => n.t);
43
41
  return matrixActionClientModulePromise;
44
42
  }
45
43
  function loadMatrixDirectManagementModule() {
46
- matrixDirectManagementModulePromise ??= import("./direct-management--Y8ypgLv.js").then((n) => n.t);
44
+ matrixDirectManagementModulePromise ??= import("./send-CdoJ1pZY.js").then((n) => n.d);
47
45
  return matrixDirectManagementModulePromise;
48
46
  }
49
47
  function scheduleMatrixCliExit() {
@@ -209,7 +207,7 @@ async function addMatrixAccount(params) {
209
207
  backupVersion: null
210
208
  };
211
209
  if (accountConfig.encryption === true) {
212
- const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-DXWxzR7A.js");
210
+ const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-krQU60Az.js");
213
211
  verificationBootstrap = await maybeBootstrapNewEncryptedMatrixAccount({
214
212
  previousCfg: cfg,
215
213
  cfg: updated,
@@ -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-Cq80go7q.js");
5
+ const { registerMatrixCli } = await import("./cli-BeWdjXLV.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-OtekEqAD.js";
1
+ import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-B2_76YSe.js";
2
2
  export { cli_metadata_default as default, registerMatrixCliMetadata };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
2
- import { u as resolveMatrixRoomId } from "./send-Df-pDuG6.js";
3
- import { n as withResolvedRuntimeMatrixClient } from "./client-bootstrap-Am_ZEH3x.js";
2
+ import { u as resolveMatrixRoomId } from "./send-CdoJ1pZY.js";
3
+ import { n as withResolvedRuntimeMatrixClient } from "./client-bootstrap-DBwUKgC3.js";
4
4
  //#region extensions/matrix/src/matrix/actions/client.ts
5
5
  var client_exports = /* @__PURE__ */ __exportAll({
6
6
  withResolvedActionClient: () => withResolvedActionClient,
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
2
- import { t as getActiveMatrixClient } from "./active-client-uhlxdhEy.js";
3
- import { t as isBunRuntime } from "./runtime-C6X4h_SJ.js";
2
+ import { t as getActiveMatrixClient } from "./active-client-DUi-lumi.js";
3
+ import { t as isBunRuntime } from "./runtime-lwTSy9Yt.js";
4
4
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
5
5
  //#region extensions/matrix/src/matrix/client-bootstrap.ts
6
6
  var client_bootstrap_exports = /* @__PURE__ */ __exportAll({
@@ -10,7 +10,7 @@ var client_bootstrap_exports = /* @__PURE__ */ __exportAll({
10
10
  });
11
11
  let matrixSharedClientRuntimeDepsPromise;
12
12
  async function loadMatrixSharedClientRuntimeDeps() {
13
- matrixSharedClientRuntimeDepsPromise ??= Promise.all([import("./client-CyxIx4Fv.js").then((n) => n.t), import("./shared-CkbpEI5j.js").then((n) => n.a)]).then(([clientModule, sharedModule]) => ({
13
+ matrixSharedClientRuntimeDepsPromise ??= Promise.all([import("./client-oci1tD6-.js").then((n) => n.t), import("./shared-BlXw87Kp.js").then((n) => n.a)]).then(([clientModule, sharedModule]) => ({
14
14
  acquireSharedMatrixClient: clientModule.acquireSharedMatrixClient,
15
15
  resolveMatrixAuthContext: clientModule.resolveMatrixAuthContext,
16
16
  releaseSharedClientInstance: sharedModule.releaseSharedClientInstance
@@ -1,11 +1,10 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-DUslC3ob.js";
2
2
  import { t as getMatrixScopedEnvVarNames } from "./env-vars-C7uQCTKn.js";
3
3
  import { i as resolveScopedMatrixEnvConfig, r as resolveMatrixEnvAuthReadiness, t as hasReadyMatrixEnvAuth } from "./env-auth-BJqGI8M6.js";
4
- import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-DiK9j7jz.js";
5
- import { t as isBunRuntime } from "./runtime-C6X4h_SJ.js";
6
- import { i as resolveMatrixConfigForAccount, n as resolveMatrixAuth, r as resolveMatrixAuthContext, t as backfillMatrixAuthDeviceIdAfterStartup } from "./config-BR4uLzNs.js";
7
- import { t as createMatrixClient } from "./create-client-DpoW106T.js";
8
- import { i as resolveSharedMatrixClient, n as releaseSharedClientInstance, o as stopSharedClientForAccount, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient } from "./shared-CkbpEI5j.js";
4
+ import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-CBZBxN3F.js";
5
+ import { t as isBunRuntime } from "./runtime-lwTSy9Yt.js";
6
+ import { c as backfillMatrixAuthDeviceIdAfterStartup, d as resolveMatrixConfigForAccount, i as resolveSharedMatrixClient, l as resolveMatrixAuth, n as releaseSharedClientInstance, o as stopSharedClientForAccount, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient, u as resolveMatrixAuthContext } from "./shared-BlXw87Kp.js";
7
+ import { t as createMatrixClient } from "./create-client-BahCtURn.js";
9
8
  //#region extensions/matrix/src/matrix/client.ts
10
9
  var client_exports = /* @__PURE__ */ __exportAll({
11
10
  acquireSharedMatrixClient: () => acquireSharedMatrixClient,
@@ -59,7 +59,8 @@ function resolveMatrixAccountConfig(params) {
59
59
  nestedObjectKeys: [
60
60
  "dm",
61
61
  "actions",
62
- "execApprovals"
62
+ "execApprovals",
63
+ "botLoopProtection"
63
64
  ]
64
65
  });
65
66
  const accountConfig = findMatrixAccountConfig(params.cfg, accountId);
@@ -93,4 +94,21 @@ function resolveMatrixAccountAllowlistConfig(params) {
93
94
  };
94
95
  }
95
96
  //#endregion
96
- export { resolveMatrixAccountConfig as a, resolveMatrixAccountAllowlistConfig as i, hasExplicitMatrixAccountConfig as n, resolveMatrixBaseConfig as o, listNormalizedMatrixAccountIds as r, findMatrixAccountConfig as t };
97
+ //#region extensions/matrix/src/matrix/config-paths.ts
98
+ function shouldStoreMatrixAccountAtTopLevel(cfg, accountId) {
99
+ if (normalizeAccountId(accountId) !== DEFAULT_ACCOUNT_ID) return false;
100
+ const accounts = cfg.channels?.matrix?.accounts;
101
+ return !accounts || Object.keys(accounts).length === 0;
102
+ }
103
+ function resolveMatrixConfigPath(cfg, accountId) {
104
+ const normalizedAccountId = normalizeAccountId(accountId);
105
+ if (shouldStoreMatrixAccountAtTopLevel(cfg, normalizedAccountId)) return "channels.matrix";
106
+ return `channels.matrix.accounts.${normalizedAccountId}`;
107
+ }
108
+ function resolveMatrixConfigFieldPath(cfg, accountId, fieldPath) {
109
+ const suffix = fieldPath.trim().replace(/^\.+/, "");
110
+ if (!suffix) return resolveMatrixConfigPath(cfg, accountId);
111
+ return `${resolveMatrixConfigPath(cfg, accountId)}.${suffix}`;
112
+ }
113
+ //#endregion
114
+ export { hasExplicitMatrixAccountConfig as a, resolveMatrixAccountConfig as c, findMatrixAccountConfig as i, resolveMatrixBaseConfig as l, resolveMatrixConfigPath as n, listNormalizedMatrixAccountIds as o, shouldStoreMatrixAccountAtTopLevel as r, resolveMatrixAccountAllowlistConfig as s, resolveMatrixConfigFieldPath as t };