@openclaw/matrix 2026.7.2-beta.7 → 2026.8.1-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.
Files changed (92) hide show
  1. package/dist/{account-selection-kqquRzCf.js → account-selection-CWuhuFn1.js} +7 -8
  2. package/dist/{accounts-DfngqebB.js → accounts-BCzyubQt.js} +3 -3
  3. package/dist/api.js +8 -11
  4. package/dist/{approval-handler.runtime-DSeaIsGa.js → approval-handler.runtime-CSvueU9P.js} +7 -6
  5. package/dist/{approval-ids-BdJGPAJT.js → approval-ids-CEcf-EiM.js} +1 -1
  6. package/dist/{approval-reaction-auth-BjOpELxu.js → approval-reaction-auth-CziKXatm.js} +2 -2
  7. package/dist/{approval-reactions-D-BxBK_L.js → approval-reactions-tXh9KYrW.js} +2 -8
  8. package/dist/auth-presence.js +2 -2
  9. package/dist/{channel-vj788dNZ.js → channel-CzQw5OZN.js} +376 -148
  10. package/dist/channel-plugin-api.js +1 -1
  11. package/dist/{channel.runtime-CLoF2S9T.js → channel.runtime-I9pBRQb3.js} +79 -55
  12. package/dist/{config-schema-Djxw3C6b.js → channel.setup-aNaa3Uyn.js} +51 -10
  13. package/dist/{cli-DMqfDE-q.js → cli-iR6QJ5U0.js} +16 -16
  14. package/dist/{cli-metadata-C7D53SND.js → cli-metadata-BmUYWjuM.js} +1 -1
  15. package/dist/cli-metadata.js +1 -1
  16. package/dist/client-BBQdBG7t.js +799 -0
  17. package/dist/{client-6eRENr7k.js → client-D8XghqmX.js} +4 -4
  18. package/dist/{client-bootstrap-XsIkHNt0.js → client-bootstrap-Co3RlItb.js} +25 -61
  19. package/dist/client-support-DLj4vDeu.js +93 -0
  20. package/dist/config-update-Bor_Pjsv.js +150 -0
  21. package/dist/contract-api.js +2 -2
  22. package/dist/{credentials-W2EmwRhu.js → credentials-BdAaWuiR.js} +2 -1
  23. package/dist/credentials-read-B37cQknZ.js +51 -0
  24. package/dist/credentials-state-B3cuUFwZ.js +27 -0
  25. package/dist/{credentials-write.runtime-Be9zNSUw.js → credentials-write.runtime-nAV2-5uR.js} +1 -1
  26. package/dist/{crypto-runtime-D9_6J5tZ.js → crypto-runtime-Bnz3zEcS.js} +55 -32
  27. package/dist/direct-room-RinHjtqX.js +71 -0
  28. package/dist/{directory-live-C8dVBiCc.js → directory-live-DLQzel12.js} +2 -3
  29. package/dist/{doctor-CM8ijNpW.js → doctor-EWf9CDso.js} +2 -2
  30. package/dist/{doctor-contract-BMSJkkAE.js → doctor-contract-DEt4O4Zt.js} +2 -3
  31. package/dist/doctor-contract-api.js +209 -91
  32. package/dist/{draft-stream-CtvOXq0Z.js → draft-stream-DQ7QNC-l.js} +20 -23
  33. package/dist/{encryption-guidance-CbEFe38F.js → encryption-guidance-DmLY8NiO.js} +1 -1
  34. package/dist/{env-auth-CQsYbz-p.js → env-auth-MVS-Vv41.js} +4 -3
  35. package/dist/{env-vars-B0NxQnPk.js → env-vars-dGqak9dN.js} +1 -1
  36. package/dist/{errors-C47hvAF8.js → errors-DKVS3_DO.js} +2 -5
  37. package/dist/{file-sync-store-DiiFsayX.js → file-sync-store-DjskBX2o.js} +24 -3
  38. package/dist/helper-api.js +2 -2
  39. package/dist/{idb-persistence-B6x7dMsF.js → idb-persistence-BM0P27Zg.js} +3 -2
  40. package/dist/{inbound-dedupe-CaBLblef.js → inbound-dedupe-RvSLqdsz.js} +2 -2
  41. package/dist/index.js +1 -1
  42. package/dist/{logger-D0GCSDQq.js → logger-B_71hN6W.js} +1 -1
  43. package/dist/{logging-DV-p52N0.js → logging-DRjvUOIh.js} +1 -1
  44. package/dist/{media-text-BTwzADS_.js → media-text-Dh-DpTc3.js} +4 -1
  45. package/dist/{messages-DxQJkhxs.js → messages-DEqg7HVy.js} +31 -11
  46. package/dist/{monitor-VyWlSLwo.js → monitor-FNrfkuWL.js} +413 -405
  47. package/dist/plugin-entry.handlers.runtime.js +3 -3
  48. package/dist/probe.runtime-NIJZYqc2.js +2 -0
  49. package/dist/profile-D-Wubo0A.js +108 -0
  50. package/dist/{profile-update-CffmyW_4.js → profile-update-BQlE5s2J.js} +3 -2
  51. package/dist/{reaction-events-B00WSi98.js → reaction-events-BKOLlnCo.js} +10 -7
  52. package/dist/{recovery-key-store-BNnHvXdk.js → recovery-key-store-CognuDys.js} +5 -4
  53. package/dist/{resolve-targets-nm2L48sh.js → resolve-targets-e7AI0P75.js} +2 -2
  54. package/dist/{resolver.runtime-DS6uPaEe.js → resolver.runtime-V8u0pHEb.js} +1 -1
  55. package/dist/{room-info-CAFZ3Z9J.js → room-info-BXQA7y10.js} +12 -3
  56. package/dist/runtime-api.js +7 -4
  57. package/dist/{sdk-bUytQHx7.js → sdk-NxK3vzMa.js} +242 -119
  58. package/dist/{secret-contract-M3hRmGO-.js → secret-contract-CufozuyJ.js} +1 -1
  59. package/dist/secret-contract-api.js +1 -1
  60. package/dist/{send-BldGYG8g.js → send-ClHgDZLT.js} +1477 -1210
  61. package/dist/session-binding-contract-api.js +2 -3
  62. package/dist/{setup-bootstrap-Deleiibz.js → setup-bootstrap-BGPjbA5N.js} +4 -4
  63. package/dist/{setup-core-BVfBv2ai.js → setup-core-DigrLebY.js} +17 -266
  64. package/dist/setup-plugin-api.js +1 -44
  65. package/dist/{setup-surface-BBq3WeqX.js → setup-surface-Dtn8sAWs.js} +15 -16
  66. package/dist/{startup-verification-wm3_i88s.js → startup-verification-Cs08ca8u.js} +3 -3
  67. package/dist/{storage-BvAkgzvT.js → storage-BsGuHngK.js} +3 -3
  68. package/dist/subagent-hooks-CMoZaARG.js +48 -0
  69. package/dist/subagent-hooks-api.js +1 -1
  70. package/dist/{target-ids-B-5aQxwn.js → target-ids-Nwx7cMVE.js} +11 -1
  71. package/dist/{thread-binding-api-DRbBZlhS.js → thread-binding-api-CzkeLZCU.js} +1 -1
  72. package/dist/thread-binding-api.js +1 -1
  73. package/dist/{thread-bindings-DGbl3vDW.js → thread-bindings-BYEGfw3h.js} +17 -10
  74. package/dist/thread-bindings-runtime.js +1 -1
  75. package/dist/{thread-bindings-shared-CKnY4LSd.js → thread-bindings-shared-oNPiyMWY.js} +1 -6
  76. package/dist/{tool-actions.runtime-uu9blSqO.js → tool-actions.runtime-ck6IJyP0.js} +36 -19
  77. package/dist/{verification-DYMQ1QpI.js → verification-CabtBTtB.js} +2 -2
  78. package/openclaw.plugin.json +61 -1
  79. package/package.json +4 -4
  80. package/dist/active-client-DXvz2gCo.js +0 -20
  81. package/dist/client-Dbso3-0V.js +0 -30
  82. package/dist/create-client-BmSU-q-D.js +0 -61
  83. package/dist/credentials-read-DVmFCm7X.js +0 -77
  84. package/dist/exec-approval-resolver-BCgqRtZS.js +0 -16
  85. package/dist/preflight-audio.runtime-BZxxQsxY.js +0 -11
  86. package/dist/probe.runtime-BuieqmS3.js +0 -3
  87. package/dist/record-shared-CWWx6fvI.js +0 -2
  88. package/dist/route-DY6at4qJ.js +0 -161
  89. package/dist/shared-CUMWxcMz.js +0 -673
  90. package/dist/subagent-hooks-dkPAF6Et.js +0 -143
  91. package/dist/sync-state-CWbp0QSY.js +0 -12
  92. package/dist/{runtime-api-D1xI_cvh.js → runtime-api-BGO16Fu8.js} +3 -3
@@ -1,2 +1,2 @@
1
- import { t as matrixPlugin } from "./channel-vj788dNZ.js";
1
+ import { t as matrixPlugin } from "./channel-CzQw5OZN.js";
2
2
  export { matrixPlugin };
@@ -1,19 +1,19 @@
1
- import { i as sendPollMatrix, o as sendTypingMatrix, r as sendMessageMatrix } from "./send-BldGYG8g.js";
1
+ import { b as reconcileMatrixUnknownSend, i as sendPollMatrix, o as sendTypingMatrix, r as sendMessageMatrix, y as cleanupMatrixDeliveryPlans } from "./send-ClHgDZLT.js";
2
2
  import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
3
- import { f as resolveMatrixAuth } from "./shared-CUMWxcMz.js";
4
- import "./client-Dbso3-0V.js";
5
- import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-C8dVBiCc.js";
6
- import { p as resolveOutboundSendDep, r as chunkTextForOutbound } from "./runtime-api-D1xI_cvh.js";
7
- import { t as resolveMatrixTargets } from "./resolve-targets-nm2L48sh.js";
3
+ import { c as resolveMatrixAuth } from "./client-BBQdBG7t.js";
4
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DLQzel12.js";
5
+ import { p as resolveOutboundSendDep, r as chunkTextForOutbound } from "./runtime-api-BGO16Fu8.js";
6
+ import { t as resolveMatrixTargets } from "./resolve-targets-e7AI0P75.js";
8
7
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
9
- import { createReplyToFanout } from "openclaw/plugin-sdk/channel-outbound";
10
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
+ import { createMessageReceiptFromOutboundResults, createReplyToFanout } from "openclaw/plugin-sdk/channel-outbound";
9
+ import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
11
10
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
12
11
  import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
12
+ import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
13
13
  import { renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
14
- import { resolvePayloadMediaUrls, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
14
+ import { resolveSendableOutboundReplyParts, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
15
15
  //#region extensions/matrix/src/matrix/probe.ts
16
- const loadMatrixProbeRuntimeDeps = createLazyRuntimeModule(() => import("./probe.runtime-BuieqmS3.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient })));
16
+ const loadMatrixProbeRuntimeDeps = createLazyRuntimeModule(() => import("./probe.runtime-NIJZYqc2.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient })));
17
17
  async function probeMatrix(params) {
18
18
  return await runChannelProbe(void 0, async () => {
19
19
  const result = {
@@ -35,9 +35,9 @@ async function probeMatrix(params) {
35
35
  };
36
36
  const { createMatrixClient } = await loadMatrixProbeRuntimeDeps();
37
37
  const inputUserId = normalizeOptionalString(params.userId);
38
- const client = await createMatrixClient({
38
+ const userId = await (await createMatrixClient({
39
39
  homeserver: params.homeserver,
40
- userId: inputUserId,
40
+ userId: void 0,
41
41
  accessToken: params.accessToken,
42
42
  deviceId: params.deviceId,
43
43
  persistStorage: false,
@@ -46,11 +46,15 @@ async function probeMatrix(params) {
46
46
  allowPrivateNetwork: params.allowPrivateNetwork,
47
47
  ssrfPolicy: params.ssrfPolicy,
48
48
  dispatcherPolicy: params.dispatcherPolicy
49
- });
49
+ })).getUserId();
50
+ if (inputUserId && inputUserId !== userId) return {
51
+ ...result,
52
+ error: "Matrix access token user does not match configured userId"
53
+ };
50
54
  return {
51
55
  ...result,
52
56
  ok: true,
53
- userId: await client.getUserId() ?? null
57
+ userId
54
58
  };
55
59
  }, (error) => ({
56
60
  ok: false,
@@ -63,12 +67,19 @@ async function probeMatrix(params) {
63
67
  const MATRIX_OPENCLAW_PRESENTATION_KEY = "com.openclaw.presentation";
64
68
  const MATRIX_OPENCLAW_PRESENTATION_TYPE = "message.presentation";
65
69
  const MATRIX_EMPTY_PRESENTATION_FALLBACK_TEXT = "---";
66
- function toRecord(value) {
67
- return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
70
+ function toMatrixOutboundResult(result) {
71
+ const { roomId, ...delivery } = result;
72
+ return {
73
+ ...delivery,
74
+ target: {
75
+ kind: "room",
76
+ id: roomId
77
+ }
78
+ };
68
79
  }
69
80
  function resolveMatrixChannelData(payload) {
70
- const raw = toRecord(payload.channelData)?.matrix;
71
- return toRecord(raw) ?? {};
81
+ const raw = asOptionalRecord(payload.channelData)?.matrix;
82
+ return asOptionalRecord(raw) ?? {};
72
83
  }
73
84
  function buildMatrixPresentationContent(presentation) {
74
85
  return {
@@ -78,7 +89,7 @@ function buildMatrixPresentationContent(presentation) {
78
89
  };
79
90
  }
80
91
  function resolveMatrixPresentationContent(payload) {
81
- const presentation = toRecord(toRecord(resolveMatrixChannelData(payload).extraContent)?.[MATRIX_OPENCLAW_PRESENTATION_KEY]);
92
+ const presentation = asOptionalRecord(asOptionalRecord(resolveMatrixChannelData(payload).extraContent)?.[MATRIX_OPENCLAW_PRESENTATION_KEY]);
82
93
  if (!presentation || presentation.version !== 1 || presentation.type !== MATRIX_OPENCLAW_PRESENTATION_TYPE) return;
83
94
  return presentation;
84
95
  }
@@ -112,15 +123,13 @@ function resolveMatrixExtraContent(payload) {
112
123
  }
113
124
  function resolveMatrixDeliveryProgress(onDeliveryResult) {
114
125
  return onDeliveryResult ? async (result) => {
115
- await onDeliveryResult({
116
- channel: "matrix",
117
- ...result
118
- });
126
+ await onDeliveryResult(attachChannelToResult("matrix", toMatrixOutboundResult(result)));
119
127
  } : void 0;
120
128
  }
121
129
  //#endregion
122
130
  //#region extensions/matrix/src/channel.runtime.ts
123
131
  const matrixChannelRuntime = {
132
+ cleanupMatrixDeliveryPlans,
124
133
  listMatrixDirectoryGroupsLive,
125
134
  listMatrixDirectoryPeersLive,
126
135
  matrixOutbound: {
@@ -143,7 +152,7 @@ const matrixChannelRuntime = {
143
152
  payload,
144
153
  presentation
145
154
  }),
146
- sendPayload: async ({ cfg, to, payload, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, replyToIdSource, replyToMode, threadId, accountId, audioAsVoice, onDeliveryResult }) => {
155
+ sendPayload: async ({ cfg, to, payload, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, replyToIdSource, replyToMode, threadId, accountId, audioAsVoice, deliveryQueueId, onPlatformSendDispatch, onDeliveryResult }) => {
147
156
  const send = resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix;
148
157
  const resolvedThreadId = threadId !== void 0 && threadId !== null ? String(threadId) : void 0;
149
158
  const resolveReplyToId = createReplyToFanout({
@@ -151,13 +160,14 @@ const matrixChannelRuntime = {
151
160
  ...replyToIdSource !== void 0 ? { replyToIdSource } : {},
152
161
  ...replyToMode !== void 0 ? { replyToMode } : {}
153
162
  });
154
- const urls = resolvePayloadMediaUrls(payload);
163
+ const urls = resolveSendableOutboundReplyParts(payload).mediaUrls;
155
164
  const payloadText = resolveMatrixPayloadText(payload);
156
165
  if (urls.length > 0) {
166
+ const sentResults = [];
157
167
  const lastResult = await sendPayloadMediaSequence({
158
168
  text: payloadText,
159
169
  mediaUrls: urls,
160
- send: async ({ text, mediaUrl, isFirst }) => await send(to, text, {
170
+ send: async ({ text, mediaUrl, index, isFirst }) => await send(to, text, {
161
171
  cfg,
162
172
  mediaUrl,
163
173
  mediaAccess,
@@ -167,17 +177,32 @@ const matrixChannelRuntime = {
167
177
  threadId: resolvedThreadId,
168
178
  accountId: accountId ?? void 0,
169
179
  audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
180
+ deliveryQueueId,
181
+ deliveryPartIndex: index,
182
+ deliveryPartCount: urls.length,
183
+ onPlatformSendDispatch,
170
184
  extraContent: isFirst ? resolveMatrixExtraContent(payload) : void 0,
171
185
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
172
- })
186
+ }),
187
+ onResult: (result) => {
188
+ sentResults.push(result);
189
+ }
173
190
  });
174
- if (lastResult !== void 0) return {
175
- channel: "matrix",
176
- messageId: lastResult.messageId,
177
- roomId: lastResult.roomId
178
- };
191
+ if (lastResult !== void 0) {
192
+ const receipt = createMessageReceiptFromOutboundResults({ results: sentResults });
193
+ receipt.parts = receipt.parts.map((part, index) => ({
194
+ ...part,
195
+ index
196
+ }));
197
+ return attachChannelToResult("matrix", toMatrixOutboundResult({
198
+ ...lastResult,
199
+ primaryMessageId: receipt.primaryPlatformMessageId,
200
+ receipt,
201
+ content: sentResults.map((result) => result.content).join("\n")
202
+ }));
203
+ }
179
204
  }
180
- const result = await send(to, payloadText, {
205
+ return attachChannelToResult("matrix", toMatrixOutboundResult(await send(to, payloadText, {
181
206
  cfg,
182
207
  mediaAccess,
183
208
  mediaLocalRoots,
@@ -186,47 +211,45 @@ const matrixChannelRuntime = {
186
211
  threadId: resolvedThreadId,
187
212
  accountId: accountId ?? void 0,
188
213
  audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
214
+ deliveryQueueId,
215
+ deliveryPartIndex: 0,
216
+ deliveryPartCount: 1,
217
+ onPlatformSendDispatch,
189
218
  extraContent: resolveMatrixExtraContent(payload),
190
219
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
191
- });
192
- return {
193
- channel: "matrix",
194
- messageId: result.messageId,
195
- roomId: result.roomId
196
- };
220
+ })));
197
221
  },
198
- sendText: async ({ cfg, to, text, deps, replyToId, threadId, accountId, audioAsVoice, onDeliveryResult }) => {
199
- const result = await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
222
+ sendText: async ({ cfg, to, text, deps, replyToId, threadId, accountId, audioAsVoice, deliveryQueueId, deliveryPartIndex, deliveryPartCount, onPlatformSendDispatch, onDeliveryResult }) => {
223
+ return attachChannelToResult("matrix", toMatrixOutboundResult(await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
200
224
  cfg,
201
225
  replyToId: replyToId ?? void 0,
202
226
  threadId: threadId !== void 0 && threadId !== null ? String(threadId) : void 0,
203
227
  accountId: accountId ?? void 0,
204
228
  audioAsVoice,
229
+ deliveryQueueId,
230
+ deliveryPartIndex,
231
+ ...deliveryQueueId !== void 0 ? { deliveryPartCount } : {},
232
+ onPlatformSendDispatch,
205
233
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
206
- });
207
- return {
208
- channel: "matrix",
209
- messageId: result.messageId,
210
- roomId: result.roomId
211
- };
234
+ })));
212
235
  },
213
- sendMedia: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, mediaReadFile, deps, replyToId, threadId, accountId, audioAsVoice, onDeliveryResult }) => {
214
- const result = await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
236
+ sendMedia: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, threadId, accountId, audioAsVoice, deliveryQueueId, deliveryPartIndex, deliveryPartCount, onPlatformSendDispatch, onDeliveryResult }) => {
237
+ return attachChannelToResult("matrix", toMatrixOutboundResult(await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
215
238
  cfg,
216
239
  mediaUrl,
217
240
  mediaLocalRoots,
218
241
  mediaReadFile,
242
+ mediaAccess,
219
243
  replyToId: replyToId ?? void 0,
220
244
  threadId: threadId !== void 0 && threadId !== null ? String(threadId) : void 0,
221
245
  accountId: accountId ?? void 0,
222
246
  audioAsVoice,
247
+ deliveryQueueId,
248
+ deliveryPartIndex,
249
+ ...deliveryQueueId !== void 0 ? { deliveryPartCount } : {},
250
+ onPlatformSendDispatch,
223
251
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
224
- });
225
- return {
226
- channel: "matrix",
227
- messageId: result.messageId,
228
- roomId: result.roomId
229
- };
252
+ })));
230
253
  },
231
254
  sendPoll: async ({ cfg, to, poll, threadId, accountId }) => {
232
255
  const result = await sendPollMatrix(to, poll, {
@@ -245,6 +268,7 @@ const matrixChannelRuntime = {
245
268
  probeMatrix,
246
269
  resolveMatrixAuth,
247
270
  resolveMatrixTargets,
271
+ reconcileMatrixUnknownSend,
248
272
  sendMessageMatrix,
249
273
  sendTypingMatrix
250
274
  };
@@ -1,13 +1,15 @@
1
1
  import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
2
- import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-DfngqebB.js";
2
+ import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-BCzyubQt.js";
3
+ import { r as matrixSetupContract, t as createMatrixSetupWizardProxy } from "./setup-core-DigrLebY.js";
3
4
  import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
4
5
  import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
5
6
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
6
7
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
8
+ import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
7
9
  import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
8
10
  import { normalizeStringEntries as normalizeStringEntries$1 } from "openclaw/plugin-sdk/string-normalization-runtime";
11
+ import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
9
12
  import { AllowFromListSchema, BlockStreamingCoalesceSchema, ContextVisibilityModeSchema, GroupPolicySchema, MarkdownConfigSchema, MentionPatternsPolicySchema, buildChannelConfigSchema, buildGroupEntrySchema, buildNestedDmConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
10
- import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
11
13
  import { z } from "zod";
12
14
  //#region extensions/matrix/src/matrix/monitor/allowlist.ts
13
15
  function normalizeAllowList(list) {
@@ -17,13 +19,7 @@ function normalizeMatrixUser(raw) {
17
19
  const value = (raw ?? "").trim();
18
20
  if (!value) return "";
19
21
  if (!value.startsWith("@") || !value.includes(":")) return normalizeLowercaseStringOrEmpty(value);
20
- const withoutAt = value.slice(1);
21
- const splitIndex = withoutAt.indexOf(":");
22
- if (splitIndex === -1) return normalizeLowercaseStringOrEmpty(value);
23
- const localpart = normalizeLowercaseStringOrEmpty(withoutAt.slice(0, splitIndex));
24
- const server = normalizeLowercaseStringOrEmpty(withoutAt.slice(splitIndex + 1));
25
- if (!server) return normalizeLowercaseStringOrEmpty(value);
26
- return `@${localpart}:${server}`;
22
+ return value;
27
23
  }
28
24
  function normalizeMatrixUserId(raw) {
29
25
  const trimmed = (raw ?? "").trim();
@@ -228,6 +224,7 @@ function hasCanonicalMatrixAccountStreaming(account) {
228
224
  const MatrixChannelConfigSchema = buildChannelConfigSchema(z.object({
229
225
  name: z.string().optional(),
230
226
  enabled: z.boolean().optional(),
227
+ configWrites: z.boolean().optional(),
231
228
  defaultAccount: z.string().optional(),
232
229
  accounts: z.record(z.string(), z.unknown().refine(hasCanonicalMatrixAccountStreaming, { message: "flat or scalar streaming values are no longer supported; use streaming.* and run \"openclaw doctor --fix\"" })).optional(),
233
230
  markdown: MarkdownConfigSchema,
@@ -298,5 +295,49 @@ const MatrixChannelConfigSchema = buildChannelConfigSchema(z.object({
298
295
  rooms: z.object({}).catchall(matrixRoomSchema).optional(),
299
296
  actions: matrixActionSchema
300
297
  }), { uiHints: matrixChannelConfigUiHints });
298
+ const matrixPluginBase = {
299
+ id: "matrix",
300
+ meta: {
301
+ id: "matrix",
302
+ label: "Matrix",
303
+ selectionLabel: "Matrix (plugin)",
304
+ docsPath: "/channels/matrix",
305
+ docsLabel: "matrix",
306
+ blurb: "open protocol; configure a homeserver + access token.",
307
+ order: 70,
308
+ quickstartAllowFrom: true
309
+ },
310
+ setupWizard: createMatrixSetupWizardProxy(async () => ({ matrixSetupWizard: (await import("./setup-surface-Dtn8sAWs.js").then((n) => n.t)).matrixSetupWizard })),
311
+ setupContract: matrixSetupContract,
312
+ capabilities: {
313
+ chatTypes: [
314
+ "direct",
315
+ "group",
316
+ "thread"
317
+ ],
318
+ polls: true,
319
+ reactions: true,
320
+ threads: true,
321
+ media: true
322
+ },
323
+ reload: { configPrefixes: ["channels.matrix"] },
324
+ configSchema: MatrixChannelConfigSchema,
325
+ config: {
326
+ ...matrixConfigAdapter,
327
+ isConfigured: (account) => account.configured,
328
+ describeAccount: (account) => describeAccountSnapshot({
329
+ account,
330
+ configured: account.configured,
331
+ extra: { baseUrl: account.homeserver }
332
+ })
333
+ }
334
+ };
335
+ const matrixSetupPlugin = {
336
+ ...matrixPluginBase,
337
+ config: {
338
+ ...matrixPluginBase.config,
339
+ hasConfiguredState: ({ cfg }) => resolveMatrixAccount({ cfg }).configured
340
+ }
341
+ };
301
342
  //#endregion
302
- export { normalizeMatrixUserId as a, normalizeMatrixAllowList as i, DEFAULT_ACCOUNT_ID$1 as n, resolveMatrixAllowListMatch as o, matrixConfigAdapter as r, MatrixChannelConfigSchema as t };
343
+ export { normalizeMatrixUserId as a, normalizeMatrixAllowList as i, matrixSetupPlugin as n, resolveMatrixAllowListMatch as o, DEFAULT_ACCOUNT_ID$1 as r, matrixPluginBase as t };
@@ -1,19 +1,19 @@
1
1
  import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
2
2
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
3
- import { i as resolveMatrixAccount } from "./accounts-DfngqebB.js";
4
- import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
5
- import { l as resolveMatrixConfigPath, n as matrixSetupAdapter, u as updateMatrixAccountConfig } from "./setup-core-BVfBv2ai.js";
6
- import { n as withResolvedActionClient } from "./client-6eRENr7k.js";
7
- import { p as resolveMatrixAuthContext } from "./shared-CUMWxcMz.js";
8
- import "./client-Dbso3-0V.js";
9
- import { a as formatZonedTimestamp } from "./runtime-api-D1xI_cvh.js";
3
+ import { i as resolveMatrixAccount } from "./accounts-BCzyubQt.js";
4
+ import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-Bor_Pjsv.js";
5
+ import { n as matrixSetupAdapter } from "./setup-core-DigrLebY.js";
6
+ import { n as withResolvedActionClient } from "./client-D8XghqmX.js";
7
+ import { l as resolveMatrixAuthContext } from "./client-BBQdBG7t.js";
8
+ import { a as formatZonedTimestamp } from "./runtime-api-BGO16Fu8.js";
10
9
  import { t as resolveMatrixRoomKeyBackupIssue } from "./backup-health-Dm_YMVFT.js";
11
- import { i as setMatrixSdkLogMode, r as setMatrixSdkConsoleLogging } from "./logging-DV-p52N0.js";
10
+ import { i as setMatrixSdkLogMode, r as setMatrixSdkConsoleLogging } from "./logging-DRjvUOIh.js";
12
11
  import { n as isOpenClawManagedMatrixDevice, r as summarizeMatrixDeviceHealth } from "./device-health-B4-YXtJR.js";
13
- import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-CffmyW_4.js";
14
- 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-DYMQ1QpI.js";
12
+ import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-BQlE5s2J.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-CabtBTtB.js";
15
14
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
16
15
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
16
+ import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
17
17
  import { parseStrictInteger, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
18
18
  import { readByteStreamWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
19
19
  //#region extensions/matrix/src/cli-shared.ts
@@ -122,7 +122,7 @@ async function runMatrixCliCommand(config) {
122
122
  else config.onText(result, config.verbose);
123
123
  if (config.shouldFail?.(result)) markCliFailure();
124
124
  } catch (err) {
125
- const message = formatMatrixErrorMessage(err);
125
+ const message = formatErrorMessage(err);
126
126
  if (config.json) printJson(config.onJsonError ? config.onJsonError(message) : { error: message });
127
127
  else {
128
128
  console.error(`${config.errorPrefix}: ${formatMatrixCliText(message)}`);
@@ -412,7 +412,7 @@ async function addMatrixAccount(params) {
412
412
  backupVersion: null
413
413
  };
414
414
  if (accountConfig.encryption === true) {
415
- const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-Deleiibz.js");
415
+ const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-BGPjbA5N.js");
416
416
  verificationBootstrap = await maybeBootstrapNewEncryptedMatrixAccount({
417
417
  previousCfg: cfg,
418
418
  cfg: updated,
@@ -458,7 +458,7 @@ async function addMatrixAccount(params) {
458
458
  avatarUpdated: false,
459
459
  resolvedAvatarUrl: null,
460
460
  convertedAvatarFromHttp: false,
461
- error: formatMatrixErrorMessage(err)
461
+ error: formatErrorMessage(err)
462
462
  };
463
463
  }
464
464
  let deviceHealth;
@@ -475,7 +475,7 @@ async function addMatrixAccount(params) {
475
475
  deviceHealth = {
476
476
  currentDeviceId: null,
477
477
  staleOpenClawDeviceIds: [],
478
- error: formatMatrixErrorMessage(err)
478
+ error: formatErrorMessage(err)
479
479
  };
480
480
  }
481
481
  return {
@@ -595,8 +595,8 @@ function registerMatrixDeviceCommands(root) {
595
595
  }
596
596
  //#endregion
597
597
  //#region extensions/matrix/src/cli-direct.ts
598
- const loadMatrixActionClientModule = createLazyRuntimeModule(() => import("./client-6eRENr7k.js").then((n) => n.t));
599
- const loadMatrixDirectManagementModule = createLazyRuntimeModule(() => import("./send-BldGYG8g.js").then((n) => n.l));
598
+ const loadMatrixActionClientModule = createLazyRuntimeModule(() => import("./client-D8XghqmX.js").then((n) => n.t));
599
+ const loadMatrixDirectManagementModule = createLazyRuntimeModule(() => import("./send-ClHgDZLT.js").then((n) => n.S));
600
600
  function printDirectRoomCandidate(room) {
601
601
  const members = room.joinedMembers === null ? "unavailable" : room.joinedMembers.map((member) => formatMatrixCliText(member)).join(", ") || "none";
602
602
  console.log(`- ${formatMatrixCliText(room.roomId)} [${room.source}] strict=${room.strict ? "yes" : "no"} joined=${members}`);
@@ -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-DMqfDE-q.js");
5
+ const { registerMatrixCli } = await import("./cli-iR6QJ5U0.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-C7D53SND.js";
1
+ import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-BmUYWjuM.js";
2
2
  export { cli_metadata_default as default, registerMatrixCliMetadata };