@openclaw/matrix 2026.5.16-beta.4 → 2026.5.16-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -3,7 +3,7 @@ import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConf
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
5
  import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-CnUlkNmz.js";
6
- import { t as matrixPlugin } from "./channel-dMBvPDsp.js";
6
+ import { t as matrixPlugin } from "./channel-ClUVS-7H.js";
7
7
  import { n as matrixOnboardingAdapter } from "./setup-surface-BdT1ex7Z.js";
8
8
  import { t as createMatrixThreadBindingManager } from "./thread-bindings-CK8lw9qa.js";
9
9
  //#region extensions/matrix/api.ts
@@ -1,6 +1,6 @@
1
1
  import { a as resolveMatrixTargetIdentity } from "./target-ids-80nQ2gql.js";
2
2
  import { g as resolveMatrixAccount } from "./setup-core-CnUlkNmz.js";
3
- import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-dMBvPDsp.js";
3
+ import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-ClUVS-7H.js";
4
4
  import { a as sendMessageMatrix, i as reactMatrixMessage, p as repairMatrixDirectRooms, s as sendSingleTextMessageMatrix } from "./send-EorDXlGl.js";
5
5
  import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-Cwd1PMCC.js";
6
6
  import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-mMLZ7DIz.js";
@@ -1,4 +1,4 @@
1
- import { a as normalizeMatrixUserId } from "./config-schema-DpROObD_.js";
1
+ import { a as normalizeMatrixUserId } from "./config-schema-B1OTtJSg.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
1
  import { g as resolveMatrixAccount } from "./setup-core-CnUlkNmz.js";
2
- import { t as normalizeMatrixApproverId } from "./approval-ids-wB4z5Pen.js";
2
+ import { t as normalizeMatrixApproverId } from "./approval-ids-BG6ZMpPU.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) {
@@ -3,8 +3,8 @@ import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThrea
3
3
  import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-BWwIruri.js";
4
4
  import { c as resolveMatrixAccountConfig } from "./config-paths-msaDGRh6.js";
5
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-CnUlkNmz.js";
6
- import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-DpROObD_.js";
7
- import { t as normalizeMatrixApproverId } from "./approval-ids-wB4z5Pen.js";
6
+ import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-B1OTtJSg.js";
7
+ import { t as normalizeMatrixApproverId } from "./approval-ids-BG6ZMpPU.js";
8
8
  import { t as formatMatrixErrorMessage } from "./errors-BpHgvm2o.js";
9
9
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-s4gUPmRN.js";
10
10
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-e4SdhUtT.js";
@@ -596,7 +596,7 @@ const matrixNativeApprovalCapability = createApproverRestrictedNativeApprovalCap
596
596
  accountId,
597
597
  request
598
598
  }),
599
- load: async () => (await import("./approval-handler.runtime-Dcj6JaB_.js")).matrixApprovalNativeRuntime
599
+ load: async () => (await import("./approval-handler.runtime-BsELVBtu.js")).matrixApprovalNativeRuntime
600
600
  })
601
601
  });
602
602
  const splitMatrixApprovalCapability = splitChannelApprovalCapability(matrixNativeApprovalCapability);
@@ -948,7 +948,7 @@ async function runMatrixStartupMaintenance(params) {
948
948
  //#region extensions/matrix/src/channel.ts
949
949
  let matrixStartupLock = Promise.resolve();
950
950
  const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-BdT1ex7Z.js").then((n) => n.t), "matrixSetupWizard");
951
- const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CTUadFsd.js"), "matrixChannelRuntime");
951
+ const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-B1QurRaj.js"), "matrixChannelRuntime");
952
952
  const meta = {
953
953
  id: "matrix",
954
954
  label: "Matrix",
@@ -1111,7 +1111,11 @@ const matrixChannelOutbound = {
1111
1111
  buttons: true,
1112
1112
  selects: true,
1113
1113
  context: true,
1114
- divider: true
1114
+ divider: true,
1115
+ limits: { text: {
1116
+ markdownDialect: "markdown",
1117
+ supportsEdit: true
1118
+ } }
1115
1119
  },
1116
1120
  shouldSuppressLocalPayloadPrompt: ({ cfg, accountId, payload }) => shouldSuppressLocalMatrixExecApprovalPrompt({
1117
1121
  cfg,
@@ -1314,7 +1318,7 @@ const matrixPlugin = createChatChannelPlugin({
1314
1318
  await previousLock;
1315
1319
  let monitorMatrixProvider;
1316
1320
  try {
1317
- monitorMatrixProvider = (await import("./monitor-DrLsF0eK.js")).monitorMatrixProvider;
1321
+ monitorMatrixProvider = (await import("./monitor-4YYdKe_C.js")).monitorMatrixProvider;
1318
1322
  } finally {
1319
1323
  releaseLock();
1320
1324
  }
@@ -1,2 +1,2 @@
1
- import { t as matrixPlugin } from "./channel-dMBvPDsp.js";
1
+ import { t as matrixPlugin } from "./channel-ClUVS-7H.js";
2
2
  export { matrixPlugin };
@@ -134,7 +134,11 @@ const matrixChannelRuntime = {
134
134
  buttons: true,
135
135
  selects: true,
136
136
  context: true,
137
- divider: true
137
+ divider: true,
138
+ limits: { text: {
139
+ markdownDialect: "markdown",
140
+ supportsEdit: true
141
+ } }
138
142
  },
139
143
  renderPresentation: ({ payload, presentation }) => renderMatrixPresentationPayload({
140
144
  payload,
@@ -142,6 +142,10 @@ const matrixChannelConfigUiHints = {
142
142
  label: "Matrix Progress Max Lines",
143
143
  help: "Maximum number of compact progress lines to keep below the draft label (default: 8)."
144
144
  },
145
+ "streaming.progress.maxLineChars": {
146
+ label: "Matrix Progress Max Line Chars",
147
+ help: "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes."
148
+ },
145
149
  "streaming.progress.toolProgress": {
146
150
  label: "Matrix Progress Tool Lines",
147
151
  help: "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery."
@@ -212,6 +216,7 @@ const matrixStreamingSchema = z.object({
212
216
  label: z.union([z.string(), z.literal(false)]).optional(),
213
217
  labels: z.array(z.string()).optional(),
214
218
  maxLines: z.number().int().positive().optional(),
219
+ maxLineChars: z.number().int().positive().optional(),
215
220
  toolProgress: z.boolean().optional()
216
221
  }).strict().optional(),
217
222
  preview: z.object({ toolProgress: z.boolean().optional() }).strict().optional()
@@ -2,8 +2,8 @@ import { t as isMatrixQualifiedUserId } from "./target-ids-80nQ2gql.js";
2
2
  import { c as resolveMatrixAccountConfig, s as resolveMatrixAccountAllowlistConfig } from "./config-paths-msaDGRh6.js";
3
3
  import { t as getMatrixRuntime } from "./runtime-Dog86njy.js";
4
4
  import { m as resolveConfiguredMatrixBotUserIds } from "./setup-core-CnUlkNmz.js";
5
- import { a as buildAllowlistResolutionSummary, c as createTypingCallbacks, d as logInboundDrop, f as logTypingFailure, h as toLocationContext, i as addAllowlistUserEntriesFromConfigEntry, l as formatLocationText, m as summarizeMapping, n as resolveMatrixStoredSessionMeta, o as canonicalizeAllowlistWithResolvedIds, p as patchAllowlistUsersInConfigEntries, r as resolveMatrixRoomConfig, s as createReplyPrefixOptions, u as getAgentScopedMediaLocalRoots } from "./channel-dMBvPDsp.js";
6
- import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./config-schema-DpROObD_.js";
5
+ import { a as buildAllowlistResolutionSummary, c as createTypingCallbacks, d as logInboundDrop, f as logTypingFailure, h as toLocationContext, i as addAllowlistUserEntriesFromConfigEntry, l as formatLocationText, m as summarizeMapping, n as resolveMatrixStoredSessionMeta, o as canonicalizeAllowlistWithResolvedIds, p as patchAllowlistUsersInConfigEntries, r as resolveMatrixRoomConfig, s as createReplyPrefixOptions, u as getAgentScopedMediaLocalRoots } from "./channel-ClUVS-7H.js";
6
+ import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./config-schema-B1OTtJSg.js";
7
7
  import { r as isMatrixNotFoundError, t as formatMatrixErrorMessage } from "./errors-BpHgvm2o.js";
8
8
  import { i as resolveMatrixStateFilePath } from "./storage-HI1nL3im.js";
9
9
  import { D as parsePollStartContent, S as formatPollAsText, T as isPollStartType, _ as readJoinedMatrixMembers, a as sendMessageMatrix, f as promoteMatrixDirectRoomCandidate, g as isStrictDirectMembership, h as hasDirectMatrixMemberFlag, t as chunkMatrixText, v as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, w as isPollEventType } from "./send-EorDXlGl.js";
@@ -24,9 +24,11 @@ import { a as EventType, i as resolveMatrixThreadRouting, n as resolveMatrixRepl
24
24
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
25
25
  import { createPreviewMessageReceipt, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter } from "openclaw/plugin-sdk/channel-message";
26
26
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
27
+ import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
27
28
  import { loadSessionStore, resolveSessionStoreEntry } from "openclaw/plugin-sdk/session-store-runtime";
28
29
  import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";
29
30
  import { format } from "node:util";
31
+ import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement } from "openclaw/plugin-sdk/reply-payload";
30
32
  import { resolveAckReaction } from "openclaw/plugin-sdk/channel-feedback";
31
33
  import { hasFinalInboundReplyDispatch } from "openclaw/plugin-sdk/inbound-reply-dispatch";
32
34
  import { waitUntilAbort } from "openclaw/plugin-sdk/channel-lifecycle";
@@ -2018,7 +2020,7 @@ function loadSessionBindingRuntime() {
2018
2020
  return sessionBindingRuntimePromise;
2019
2021
  }
2020
2022
  function loadMatrixReactionEvents() {
2021
- matrixReactionEventsPromise ??= import("./reaction-events-QfQs2osk.js");
2023
+ matrixReactionEventsPromise ??= import("./reaction-events-1XDDYTnu.js");
2022
2024
  return matrixReactionEventsPromise;
2023
2025
  }
2024
2026
  function loadMatrixDraftStream() {
@@ -3070,11 +3072,16 @@ function createMatrixRoomMessageHandler(params) {
3070
3072
  deliver: async (payload, info) => {
3071
3073
  if (draftStream && info.kind !== "tool" && !payload.isCompactionNotice) {
3072
3074
  const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
3075
+ const ttsSupplement = getReplyPayloadTtsSupplement(payload);
3076
+ const fallbackPayload = ttsSupplement && ttsSupplement.visibleTextAlreadyDelivered !== true && !payload.text?.trim() ? {
3077
+ ...payload,
3078
+ text: ttsSupplement.spokenText
3079
+ } : payload;
3073
3080
  if (draftConsumed) {
3074
3081
  await draftStream.discardPending();
3075
3082
  await deliverMatrixReplies({
3076
3083
  cfg,
3077
- replies: [payload],
3084
+ replies: [fallbackPayload],
3078
3085
  roomId,
3079
3086
  client,
3080
3087
  runtime,
@@ -3139,7 +3146,7 @@ function createMatrixRoomMessageHandler(params) {
3139
3146
  await redactMatrixDraftEvent(client, roomId, draftEventId);
3140
3147
  await deliverMatrixReplies({
3141
3148
  cfg,
3142
- replies: [payload],
3149
+ replies: [fallbackPayload],
3143
3150
  roomId,
3144
3151
  client,
3145
3152
  runtime,
@@ -3155,7 +3162,7 @@ function createMatrixRoomMessageHandler(params) {
3155
3162
  draftConsumed = true;
3156
3163
  } else if (draftEventId && hasMedia && !payloadReplyMismatch) {
3157
3164
  let textEditOk = !mustDeliverFinalNormally;
3158
- const payloadText = payload.text;
3165
+ const payloadText = payload.text ?? ttsSupplement?.spokenText;
3159
3166
  const payloadTextMatchesDraft = typeof payloadText === "string" && draftStream.matchesPreparedText(payloadText);
3160
3167
  const reusesDraftTextUnchanged = typeof payloadText === "string" && Boolean(payloadText.trim()) && payloadTextMatchesDraft;
3161
3168
  if (textEditOk && payloadText && (quietDraftStreaming || typeof payloadText === "string" && !payloadTextMatchesDraft)) {
@@ -3168,13 +3175,13 @@ function createMatrixRoomMessageHandler(params) {
3168
3175
  extraContent: quietDraftStreaming ? buildMatrixFinalizedPreviewContent() : void 0
3169
3176
  }).then(() => true, () => false);
3170
3177
  } else if (textEditOk && reusesDraftTextUnchanged) textEditOk = await draftStream.finalizeLive();
3171
- const reusesDraftAsFinalText = Boolean(payload.text?.trim()) && textEditOk;
3178
+ const reusesDraftAsFinalText = Boolean(payloadText?.trim()) && textEditOk;
3172
3179
  if (!reusesDraftAsFinalText) await redactMatrixDraftEvent(client, roomId, draftEventId);
3173
3180
  await deliverMatrixReplies({
3174
3181
  cfg,
3175
- replies: [{
3182
+ replies: [ttsSupplement && reusesDraftAsFinalText ? buildTtsSupplementMediaPayload(payload) : {
3176
3183
  ...payload,
3177
- text: reusesDraftAsFinalText ? void 0 : payload.text
3184
+ text: reusesDraftAsFinalText ? void 0 : payload.text ?? (ttsSupplement?.visibleTextAlreadyDelivered === true ? void 0 : ttsSupplement?.spokenText)
3178
3185
  }],
3179
3186
  roomId,
3180
3187
  client,
@@ -3192,7 +3199,7 @@ function createMatrixRoomMessageHandler(params) {
3192
3199
  if (draftRedacted && draftEventId) await redactMatrixDraftEvent(client, roomId, draftEventId);
3193
3200
  const deliveredFallback = await deliverMatrixReplies({
3194
3201
  cfg,
3195
- replies: [payload],
3202
+ replies: [fallbackPayload],
3196
3203
  roomId,
3197
3204
  client,
3198
3205
  runtime,
@@ -3258,6 +3265,10 @@ function createMatrixRoomMessageHandler(params) {
3258
3265
  normalizeEntry: normalizeMatrixUserId
3259
3266
  });
3260
3267
  })() : null;
3268
+ const inboundLastRouteSessionKey = resolveInboundLastRouteSessionKey({
3269
+ route: _route,
3270
+ sessionKey: _route.sessionKey
3271
+ });
3261
3272
  const turnResult = await core.channel.turn.run({
3262
3273
  channel: "matrix",
3263
3274
  accountId: _route.accountId,
@@ -3280,11 +3291,11 @@ function createMatrixRoomMessageHandler(params) {
3280
3291
  botLoopProtection,
3281
3292
  record: {
3282
3293
  updateLastRoute: isDirectMessage ? {
3283
- sessionKey: _route.mainSessionKey,
3294
+ sessionKey: inboundLastRouteSessionKey,
3284
3295
  channel: "matrix",
3285
3296
  to: `room:${roomId}`,
3286
3297
  accountId: _route.accountId,
3287
- mainDmOwnerPin: pinnedMainDmOwner ? {
3298
+ mainDmOwnerPin: inboundLastRouteSessionKey === _route.mainSessionKey && pinnedMainDmOwner ? {
3288
3299
  ownerRecipient: pinnedMainDmOwner,
3289
3300
  senderRecipient: normalizeMatrixUserId(senderId),
3290
3301
  onSkip: ({ ownerRecipient, senderRecipient }) => {
@@ -7,7 +7,7 @@ import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-ru
7
7
  let approvalReactionAuthPromise;
8
8
  let execApprovalResolverPromise;
9
9
  function loadApprovalReactionAuth() {
10
- approvalReactionAuthPromise ??= import("./approval-reaction-auth-WbN5AstS.js");
10
+ approvalReactionAuthPromise ??= import("./approval-reaction-auth-BTy3BiII.js");
11
11
  return approvalReactionAuthPromise;
12
12
  }
13
13
  function loadExecApprovalResolver() {
@@ -1,5 +1,5 @@
1
1
  import { g as resolveMatrixAccount, n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-CnUlkNmz.js";
2
- import { r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-DpROObD_.js";
2
+ import { r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-B1OTtJSg.js";
3
3
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
4
4
  const matrixSetupPlugin = {
5
5
  id: "matrix",
package/dist/test-api.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { r as setMatrixRuntime } from "./runtime-Dog86njy.js";
2
- import { t as matrixPlugin } from "./channel-dMBvPDsp.js";
2
+ import { t as matrixPlugin } from "./channel-ClUVS-7H.js";
3
3
  import { t as MatrixClient } from "./sdk-DDUAi9uh.js";
4
4
  export { MatrixClient, matrixPlugin, setMatrixRuntime };
@@ -370,6 +370,11 @@
370
370
  "exclusiveMinimum": 0,
371
371
  "maximum": 9007199254740991
372
372
  },
373
+ "maxLineChars": {
374
+ "type": "integer",
375
+ "exclusiveMinimum": 0,
376
+ "maximum": 9007199254740991
377
+ },
373
378
  "toolProgress": {
374
379
  "type": "boolean"
375
380
  }
@@ -893,6 +898,10 @@
893
898
  "label": "Matrix Progress Max Lines",
894
899
  "help": "Maximum number of compact progress lines to keep below the draft label (default: 8)."
895
900
  },
901
+ "streaming.progress.maxLineChars": {
902
+ "label": "Matrix Progress Max Line Chars",
903
+ "help": "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes."
904
+ },
896
905
  "streaming.progress.toolProgress": {
897
906
  "label": "Matrix Progress Tool Lines",
898
907
  "help": "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.5.16-beta.4",
3
+ "version": "2026.5.16-beta.6",
4
4
  "description": "OpenClaw Matrix channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  "openclaw": "workspace:*"
23
23
  },
24
24
  "peerDependencies": {
25
- "openclaw": ">=2026.5.16-beta.4"
25
+ "openclaw": ">=2026.5.16-beta.6"
26
26
  },
27
27
  "peerDependenciesMeta": {
28
28
  "openclaw": {
@@ -87,10 +87,10 @@
87
87
  "allowInvalidConfigRecovery": true
88
88
  },
89
89
  "compat": {
90
- "pluginApi": ">=2026.5.16-beta.4"
90
+ "pluginApi": ">=2026.5.16-beta.6"
91
91
  },
92
92
  "build": {
93
- "openclawVersion": "2026.5.16-beta.4"
93
+ "openclawVersion": "2026.5.16-beta.6"
94
94
  },
95
95
  "release": {
96
96
  "publishToClawHub": true,