@openclaw/matrix 2026.7.2-beta.7 → 2026.8.1-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 (83) 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 +7 -10
  4. package/dist/{approval-handler.runtime-DSeaIsGa.js → approval-handler.runtime-CJXCUdRg.js} +5 -5
  5. package/dist/{approval-ids-BdJGPAJT.js → approval-ids-7rf7etWE.js} +1 -1
  6. package/dist/{approval-reaction-auth-BjOpELxu.js → approval-reaction-auth-wBwbEDpZ.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-VSrHgTON.js} +156 -136
  10. package/dist/channel-plugin-api.js +1 -1
  11. package/dist/{channel.runtime-CLoF2S9T.js → channel.runtime-pOOL0uT_.js} +70 -56
  12. package/dist/{config-schema-Djxw3C6b.js → channel.setup-PpxRP9Du.js} +50 -3
  13. package/dist/{cli-DMqfDE-q.js → cli-CkTfKC_c.js} +16 -16
  14. package/dist/{cli-metadata-C7D53SND.js → cli-metadata-B1d1aGM5.js} +1 -1
  15. package/dist/cli-metadata.js +1 -1
  16. package/dist/client-CeGw0G5S.js +784 -0
  17. package/dist/{client-bootstrap-XsIkHNt0.js → client-bootstrap-BFwT_2VT.js} +25 -61
  18. package/dist/{client-6eRENr7k.js → client-sJesKQmp.js} +4 -4
  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-Bvg2wAnR.js} +1 -2
  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 +202 -90
  32. package/dist/{draft-stream-CtvOXq0Z.js → draft-stream-BRi7PRRS.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-JudlYOSc.js} +1 -1
  45. package/dist/{messages-DxQJkhxs.js → messages-BW0s-6Y9.js} +7 -7
  46. package/dist/{monitor-VyWlSLwo.js → monitor-Ddfc-vjX.js} +394 -384
  47. package/dist/plugin-entry.handlers.runtime.js +3 -3
  48. package/dist/probe.runtime-Dr91B_X3.js +2 -0
  49. package/dist/profile-D-Wubo0A.js +108 -0
  50. package/dist/{profile-update-CffmyW_4.js → profile-update-BkgWYDIp.js} +3 -2
  51. package/dist/{reaction-events-B00WSi98.js → reaction-events-nfUbFLdV.js} +9 -6
  52. package/dist/{recovery-key-store-BNnHvXdk.js → recovery-key-store-CognuDys.js} +5 -4
  53. package/dist/{resolve-targets-nm2L48sh.js → resolve-targets-BJAPY4Vb.js} +1 -1
  54. package/dist/{resolver.runtime-DS6uPaEe.js → resolver.runtime-LWJELYq5.js} +1 -1
  55. package/dist/{room-info-CAFZ3Z9J.js → room-info-BXQA7y10.js} +12 -3
  56. package/dist/runtime-api.js +6 -3
  57. package/dist/{sdk-bUytQHx7.js → sdk-DjaQFCHc.js} +229 -120
  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-ZDLU4JTk.js} +1462 -1196
  61. package/dist/session-binding-contract-api.js +1 -1
  62. package/dist/{setup-bootstrap-Deleiibz.js → setup-bootstrap-BaXkhgJg.js} +4 -4
  63. package/dist/{setup-core-BVfBv2ai.js → setup-core-DQn6b5vi.js} +17 -266
  64. package/dist/setup-plugin-api.js +1 -44
  65. package/dist/{setup-surface-BBq3WeqX.js → setup-surface-DlhJdrNI.js} +9 -11
  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/{thread-bindings-DGbl3vDW.js → thread-bindings-CcHZP3w2.js} +7 -4
  69. package/dist/{tool-actions.runtime-uu9blSqO.js → tool-actions.runtime-DmdRL0bN.js} +35 -18
  70. package/dist/{verification-DYMQ1QpI.js → verification-C7ig-bQE.js} +2 -2
  71. package/openclaw.plugin.json +54 -1
  72. package/package.json +4 -4
  73. package/dist/active-client-DXvz2gCo.js +0 -20
  74. package/dist/client-Dbso3-0V.js +0 -30
  75. package/dist/create-client-BmSU-q-D.js +0 -61
  76. package/dist/credentials-read-DVmFCm7X.js +0 -77
  77. package/dist/exec-approval-resolver-BCgqRtZS.js +0 -16
  78. package/dist/preflight-audio.runtime-BZxxQsxY.js +0 -11
  79. package/dist/probe.runtime-BuieqmS3.js +0 -3
  80. package/dist/record-shared-CWWx6fvI.js +0 -2
  81. package/dist/shared-CUMWxcMz.js +0 -673
  82. package/dist/sync-state-CWbp0QSY.js +0 -12
  83. package/dist/{runtime-api-D1xI_cvh.js → runtime-api-BGO16Fu8.js} +3 -3
@@ -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-ZDLU4JTk.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-CeGw0G5S.js";
4
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-Bvg2wAnR.js";
5
+ import { p as resolveOutboundSendDep, r as chunkTextForOutbound } from "./runtime-api-BGO16Fu8.js";
6
+ import { t as resolveMatrixTargets } from "./resolve-targets-BJAPY4Vb.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-Dr91B_X3.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,9 @@ 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;
68
- }
69
70
  function resolveMatrixChannelData(payload) {
70
- const raw = toRecord(payload.channelData)?.matrix;
71
- return toRecord(raw) ?? {};
71
+ const raw = asOptionalRecord(payload.channelData)?.matrix;
72
+ return asOptionalRecord(raw) ?? {};
72
73
  }
73
74
  function buildMatrixPresentationContent(presentation) {
74
75
  return {
@@ -78,7 +79,7 @@ function buildMatrixPresentationContent(presentation) {
78
79
  };
79
80
  }
80
81
  function resolveMatrixPresentationContent(payload) {
81
- const presentation = toRecord(toRecord(resolveMatrixChannelData(payload).extraContent)?.[MATRIX_OPENCLAW_PRESENTATION_KEY]);
82
+ const presentation = asOptionalRecord(asOptionalRecord(resolveMatrixChannelData(payload).extraContent)?.[MATRIX_OPENCLAW_PRESENTATION_KEY]);
82
83
  if (!presentation || presentation.version !== 1 || presentation.type !== MATRIX_OPENCLAW_PRESENTATION_TYPE) return;
83
84
  return presentation;
84
85
  }
@@ -112,15 +113,13 @@ function resolveMatrixExtraContent(payload) {
112
113
  }
113
114
  function resolveMatrixDeliveryProgress(onDeliveryResult) {
114
115
  return onDeliveryResult ? async (result) => {
115
- await onDeliveryResult({
116
- channel: "matrix",
117
- ...result
118
- });
116
+ await onDeliveryResult(attachChannelToResult("matrix", result));
119
117
  } : void 0;
120
118
  }
121
119
  //#endregion
122
120
  //#region extensions/matrix/src/channel.runtime.ts
123
121
  const matrixChannelRuntime = {
122
+ cleanupMatrixDeliveryPlans,
124
123
  listMatrixDirectoryGroupsLive,
125
124
  listMatrixDirectoryPeersLive,
126
125
  matrixOutbound: {
@@ -143,7 +142,7 @@ const matrixChannelRuntime = {
143
142
  payload,
144
143
  presentation
145
144
  }),
146
- sendPayload: async ({ cfg, to, payload, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, replyToIdSource, replyToMode, threadId, accountId, audioAsVoice, onDeliveryResult }) => {
145
+ sendPayload: async ({ cfg, to, payload, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, replyToIdSource, replyToMode, threadId, accountId, audioAsVoice, deliveryQueueId, onPlatformSendDispatch, onDeliveryResult }) => {
147
146
  const send = resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix;
148
147
  const resolvedThreadId = threadId !== void 0 && threadId !== null ? String(threadId) : void 0;
149
148
  const resolveReplyToId = createReplyToFanout({
@@ -151,13 +150,14 @@ const matrixChannelRuntime = {
151
150
  ...replyToIdSource !== void 0 ? { replyToIdSource } : {},
152
151
  ...replyToMode !== void 0 ? { replyToMode } : {}
153
152
  });
154
- const urls = resolvePayloadMediaUrls(payload);
153
+ const urls = resolveSendableOutboundReplyParts(payload).mediaUrls;
155
154
  const payloadText = resolveMatrixPayloadText(payload);
156
155
  if (urls.length > 0) {
156
+ const sentResults = [];
157
157
  const lastResult = await sendPayloadMediaSequence({
158
158
  text: payloadText,
159
159
  mediaUrls: urls,
160
- send: async ({ text, mediaUrl, isFirst }) => await send(to, text, {
160
+ send: async ({ text, mediaUrl, index, isFirst }) => await send(to, text, {
161
161
  cfg,
162
162
  mediaUrl,
163
163
  mediaAccess,
@@ -167,17 +167,32 @@ const matrixChannelRuntime = {
167
167
  threadId: resolvedThreadId,
168
168
  accountId: accountId ?? void 0,
169
169
  audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
170
+ deliveryQueueId,
171
+ deliveryPartIndex: index,
172
+ deliveryPartCount: urls.length,
173
+ onPlatformSendDispatch,
170
174
  extraContent: isFirst ? resolveMatrixExtraContent(payload) : void 0,
171
175
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
172
- })
176
+ }),
177
+ onResult: (result) => {
178
+ sentResults.push(result);
179
+ }
173
180
  });
174
- if (lastResult !== void 0) return {
175
- channel: "matrix",
176
- messageId: lastResult.messageId,
177
- roomId: lastResult.roomId
178
- };
181
+ if (lastResult !== void 0) {
182
+ const receipt = createMessageReceiptFromOutboundResults({ results: sentResults });
183
+ receipt.parts = receipt.parts.map((part, index) => ({
184
+ ...part,
185
+ index
186
+ }));
187
+ return attachChannelToResult("matrix", {
188
+ ...lastResult,
189
+ primaryMessageId: receipt.primaryPlatformMessageId,
190
+ receipt,
191
+ content: sentResults.map((result) => result.content).join("\n")
192
+ });
193
+ }
179
194
  }
180
- const result = await send(to, payloadText, {
195
+ return attachChannelToResult("matrix", await send(to, payloadText, {
181
196
  cfg,
182
197
  mediaAccess,
183
198
  mediaLocalRoots,
@@ -186,47 +201,45 @@ const matrixChannelRuntime = {
186
201
  threadId: resolvedThreadId,
187
202
  accountId: accountId ?? void 0,
188
203
  audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
204
+ deliveryQueueId,
205
+ deliveryPartIndex: 0,
206
+ deliveryPartCount: 1,
207
+ onPlatformSendDispatch,
189
208
  extraContent: resolveMatrixExtraContent(payload),
190
209
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
191
- });
192
- return {
193
- channel: "matrix",
194
- messageId: result.messageId,
195
- roomId: result.roomId
196
- };
210
+ }));
197
211
  },
198
- sendText: async ({ cfg, to, text, deps, replyToId, threadId, accountId, audioAsVoice, onDeliveryResult }) => {
199
- const result = await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
212
+ sendText: async ({ cfg, to, text, deps, replyToId, threadId, accountId, audioAsVoice, deliveryQueueId, deliveryPartIndex, deliveryPartCount, onPlatformSendDispatch, onDeliveryResult }) => {
213
+ return attachChannelToResult("matrix", await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
200
214
  cfg,
201
215
  replyToId: replyToId ?? void 0,
202
216
  threadId: threadId !== void 0 && threadId !== null ? String(threadId) : void 0,
203
217
  accountId: accountId ?? void 0,
204
218
  audioAsVoice,
219
+ deliveryQueueId,
220
+ deliveryPartIndex,
221
+ ...deliveryQueueId !== void 0 ? { deliveryPartCount } : {},
222
+ onPlatformSendDispatch,
205
223
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
206
- });
207
- return {
208
- channel: "matrix",
209
- messageId: result.messageId,
210
- roomId: result.roomId
211
- };
224
+ }));
212
225
  },
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, {
226
+ sendMedia: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, threadId, accountId, audioAsVoice, deliveryQueueId, deliveryPartIndex, deliveryPartCount, onPlatformSendDispatch, onDeliveryResult }) => {
227
+ return attachChannelToResult("matrix", await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
215
228
  cfg,
216
229
  mediaUrl,
217
230
  mediaLocalRoots,
218
231
  mediaReadFile,
232
+ mediaAccess,
219
233
  replyToId: replyToId ?? void 0,
220
234
  threadId: threadId !== void 0 && threadId !== null ? String(threadId) : void 0,
221
235
  accountId: accountId ?? void 0,
222
236
  audioAsVoice,
237
+ deliveryQueueId,
238
+ deliveryPartIndex,
239
+ ...deliveryQueueId !== void 0 ? { deliveryPartCount } : {},
240
+ onPlatformSendDispatch,
223
241
  onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
224
- });
225
- return {
226
- channel: "matrix",
227
- messageId: result.messageId,
228
- roomId: result.roomId
229
- };
242
+ }));
230
243
  },
231
244
  sendPoll: async ({ cfg, to, poll, threadId, accountId }) => {
232
245
  const result = await sendPollMatrix(to, poll, {
@@ -245,6 +258,7 @@ const matrixChannelRuntime = {
245
258
  probeMatrix,
246
259
  resolveMatrixAuth,
247
260
  resolveMatrixTargets,
261
+ reconcileMatrixUnknownSend,
248
262
  sendMessageMatrix,
249
263
  sendTypingMatrix
250
264
  };
@@ -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-DQn6b5vi.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) {
@@ -228,6 +230,7 @@ function hasCanonicalMatrixAccountStreaming(account) {
228
230
  const MatrixChannelConfigSchema = buildChannelConfigSchema(z.object({
229
231
  name: z.string().optional(),
230
232
  enabled: z.boolean().optional(),
233
+ configWrites: z.boolean().optional(),
231
234
  defaultAccount: z.string().optional(),
232
235
  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
236
  markdown: MarkdownConfigSchema,
@@ -298,5 +301,49 @@ const MatrixChannelConfigSchema = buildChannelConfigSchema(z.object({
298
301
  rooms: z.object({}).catchall(matrixRoomSchema).optional(),
299
302
  actions: matrixActionSchema
300
303
  }), { uiHints: matrixChannelConfigUiHints });
304
+ const matrixPluginBase = {
305
+ id: "matrix",
306
+ meta: {
307
+ id: "matrix",
308
+ label: "Matrix",
309
+ selectionLabel: "Matrix (plugin)",
310
+ docsPath: "/channels/matrix",
311
+ docsLabel: "matrix",
312
+ blurb: "open protocol; configure a homeserver + access token.",
313
+ order: 70,
314
+ quickstartAllowFrom: true
315
+ },
316
+ setupWizard: createMatrixSetupWizardProxy(async () => ({ matrixSetupWizard: (await import("./setup-surface-DlhJdrNI.js").then((n) => n.t)).matrixSetupWizard })),
317
+ setupContract: matrixSetupContract,
318
+ capabilities: {
319
+ chatTypes: [
320
+ "direct",
321
+ "group",
322
+ "thread"
323
+ ],
324
+ polls: true,
325
+ reactions: true,
326
+ threads: true,
327
+ media: true
328
+ },
329
+ reload: { configPrefixes: ["channels.matrix"] },
330
+ configSchema: MatrixChannelConfigSchema,
331
+ config: {
332
+ ...matrixConfigAdapter,
333
+ isConfigured: (account) => account.configured,
334
+ describeAccount: (account) => describeAccountSnapshot({
335
+ account,
336
+ configured: account.configured,
337
+ extra: { baseUrl: account.homeserver }
338
+ })
339
+ }
340
+ };
341
+ const matrixSetupPlugin = {
342
+ ...matrixPluginBase,
343
+ config: {
344
+ ...matrixPluginBase.config,
345
+ hasConfiguredState: ({ cfg }) => resolveMatrixAccount({ cfg }).configured
346
+ }
347
+ };
301
348
  //#endregion
302
- export { normalizeMatrixUserId as a, normalizeMatrixAllowList as i, DEFAULT_ACCOUNT_ID$1 as n, resolveMatrixAllowListMatch as o, matrixConfigAdapter as r, MatrixChannelConfigSchema as t };
349
+ 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-DQn6b5vi.js";
6
+ import { n as withResolvedActionClient } from "./client-sJesKQmp.js";
7
+ import { l as resolveMatrixAuthContext } from "./client-CeGw0G5S.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-BkgWYDIp.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-C7ig-bQE.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-BaXkhgJg.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-sJesKQmp.js").then((n) => n.t));
599
+ const loadMatrixDirectManagementModule = createLazyRuntimeModule(() => import("./send-ZDLU4JTk.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-CkTfKC_c.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-B1d1aGM5.js";
2
2
  export { cli_metadata_default as default, registerMatrixCliMetadata };