@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,8 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { t as isRecord } from "./record-shared-CWWx6fvI.js";
3
2
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
4
- import { M as resolveMatrixSqliteStateEnv, t as claimCurrentTokenStorageState } from "./storage-BvAkgzvT.js";
5
- import { n as LogService } from "./logger-D0GCSDQq.js";
3
+ import { M as resolveMatrixSqliteStateEnv, t as claimCurrentTokenStorageState } from "./storage-BsGuHngK.js";
4
+ import { n as LogService } from "./logger-B_71hN6W.js";
5
+ import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { createHash, randomUUID } from "node:crypto";
7
7
  import path from "node:path";
8
8
  import fs from "node:fs/promises";
@@ -108,6 +108,7 @@ var SqliteBackedMatrixSyncStore = class extends MemoryStore {
108
108
  this.savedSync = null;
109
109
  this.cleanShutdown = false;
110
110
  this.dirty = false;
111
+ this.frozen = false;
111
112
  this.persistTimer = null;
112
113
  this.persistPromise = null;
113
114
  this.stateKey = SYNC_CACHE_STATE_KEY;
@@ -154,6 +155,7 @@ var SqliteBackedMatrixSyncStore = class extends MemoryStore {
154
155
  return Promise.resolve(this.savedSync?.nextBatch ?? null);
155
156
  }
156
157
  setSyncData(syncData) {
158
+ if (this.frozen) return Promise.resolve();
157
159
  this.accumulator.accumulate(syncData);
158
160
  this.savedSync = this.accumulator.getJSON();
159
161
  this.markDirtyAndSchedulePersist();
@@ -163,6 +165,7 @@ var SqliteBackedMatrixSyncStore = class extends MemoryStore {
163
165
  return Promise.resolve(this.savedClientOptions ? cloneJson(this.savedClientOptions) : void 0);
164
166
  }
165
167
  storeClientOptions(options) {
168
+ if (this.frozen) return Promise.resolve();
166
169
  this.savedClientOptions = cloneJson(options);
167
170
  super.storeClientOptions(options);
168
171
  this.markDirtyAndSchedulePersist();
@@ -195,6 +198,23 @@ var SqliteBackedMatrixSyncStore = class extends MemoryStore {
195
198
  this.cleanShutdown = true;
196
199
  this.dirty = true;
197
200
  }
201
+ async freezeSyncCursorPersistence() {
202
+ this.frozen = true;
203
+ if (this.persistTimer) {
204
+ clearTimeout(this.persistTimer);
205
+ this.persistTimer = null;
206
+ }
207
+ await this.persistPromise;
208
+ }
209
+ discardPendingSyncCursorPersistence() {
210
+ this.frozen = true;
211
+ if (this.persistTimer) {
212
+ clearTimeout(this.persistTimer);
213
+ this.persistTimer = null;
214
+ }
215
+ this.cleanShutdown = false;
216
+ this.dirty = false;
217
+ }
198
218
  async flush() {
199
219
  if (this.persistTimer) {
200
220
  clearTimeout(this.persistTimer);
@@ -208,6 +228,7 @@ var SqliteBackedMatrixSyncStore = class extends MemoryStore {
208
228
  }
209
229
  }
210
230
  markDirtyAndSchedulePersist() {
231
+ if (this.frozen) return;
211
232
  this.cleanShutdown = false;
212
233
  this.dirty = true;
213
234
  if (this.persistTimer) return;
@@ -1,4 +1,4 @@
1
- import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-kqquRzCf.js";
2
- import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-B0NxQnPk.js";
1
+ import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-CWuhuFn1.js";
2
+ import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-dGqak9dN.js";
3
3
  import { a as resolveMatrixCredentialsPath, i as resolveMatrixCredentialsFilename, n as resolveMatrixAccountStorageRoot, o as resolveMatrixHomeserverKey, r as resolveMatrixCredentialsDir, s as sanitizeMatrixPathSegment, t as hashMatrixAccessToken } from "./storage-paths-gUmSydsW.js";
4
4
  export { findMatrixAccountEntry, getMatrixScopedEnvVarNames, hashMatrixAccessToken, listMatrixEnvAccountIds, requiresExplicitMatrixDefaultAccount, resolveConfiguredMatrixAccountIds, resolveMatrixAccountStorageRoot, resolveMatrixChannelConfig, resolveMatrixCredentialsDir, resolveMatrixCredentialsFilename, resolveMatrixCredentialsPath, resolveMatrixDefaultOrOnlyAccountId, resolveMatrixEnvAccountToken, resolveMatrixHomeserverKey, sanitizeMatrixPathSegment };
@@ -1,5 +1,5 @@
1
- import { D as writeMatrixIdbSnapshotJson, f as MATRIX_IDB_SNAPSHOT_FILENAME, w as readMatrixIdbSnapshotJson } from "./storage-BvAkgzvT.js";
2
- import { n as LogService } from "./logger-D0GCSDQq.js";
1
+ import { D as writeMatrixIdbSnapshotJson, f as MATRIX_IDB_SNAPSHOT_FILENAME, w as readMatrixIdbSnapshotJson } from "./storage-BsGuHngK.js";
2
+ import { n as LogService } from "./logger-B_71hN6W.js";
3
3
  import { n as MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS } from "./idb-persistence-lock-DAJ49nZX.js";
4
4
  import path from "node:path";
5
5
  import { toErrorObject } from "openclaw/plugin-sdk/error-runtime";
@@ -209,6 +209,7 @@ async function persistIdbToDisk(params) {
209
209
  if (err instanceof MatrixIdbSnapshotMigrationRequiredError) throw err;
210
210
  if (!callbackStarted && fs.existsSync(snapshotPath)) throwLegacySnapshotMigrationRequired();
211
211
  LogService.warn("IdbPersistence", "Failed to persist IndexedDB snapshot:", err);
212
+ if (params?.strict) throw err;
212
213
  }
213
214
  }
214
215
  function readLegacyMatrixIdbSnapshotStateUnlocked(storageRootDir) {
@@ -1,4 +1,4 @@
1
- import { n as LogService } from "./logger-D0GCSDQq.js";
1
+ import { n as LogService } from "./logger-B_71hN6W.js";
2
2
  import { createChannelReplayGuard, resolvePersistentDedupePluginStateNamespace } from "openclaw/plugin-sdk/persistent-dedupe";
3
3
  //#region extensions/matrix/src/matrix/monitor/inbound-dedupe.ts
4
4
  const MATRIX_INBOUND_DEDUPE_PLUGIN_ID = "matrix";
@@ -45,4 +45,4 @@ function createMatrixInboundEventDeduper(params) {
45
45
  });
46
46
  }
47
47
  //#endregion
48
- export { resolveMatrixInboundDedupeStateNamespace as a, createMatrixInboundEventDeduper as i, MATRIX_INBOUND_DEDUPE_TTL_MS as n, buildMatrixInboundDedupeEventKey as r, MATRIX_INBOUND_DEDUPE_STATE_MAX_ENTRIES as t };
48
+ export { MATRIX_INBOUND_DEDUPE_STATE_MAX_ENTRIES, MATRIX_INBOUND_DEDUPE_TTL_MS, buildMatrixInboundDedupeEventKey, createMatrixInboundEventDeduper, resolveMatrixInboundDedupeStateNamespace };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as registerMatrixCliMetadata } from "./cli-metadata-C7D53SND.js";
1
+ import { n as registerMatrixCliMetadata } from "./cli-metadata-BmUYWjuM.js";
2
2
  import { registerMatrixSubagentHooks } from "./subagent-hooks-api.js";
3
3
  import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
4
4
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
@@ -1,6 +1,6 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
2
  import { format } from "node:util";
3
- import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
3
+ import { redactSensitiveText } from "openclaw/plugin-sdk/security-runtime";
4
4
  //#region extensions/matrix/src/matrix/sdk/logger.ts
5
5
  function noop() {}
6
6
  let forceConsoleLogging = false;
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as setMatrixConsoleLogging, n as LogService, t as ConsoleLogger } from "./logger-D0GCSDQq.js";
2
+ import { i as setMatrixConsoleLogging, n as LogService, t as ConsoleLogger } from "./logger-B_71hN6W.js";
3
3
  import { logger } from "matrix-js-sdk/lib/logger.js";
4
4
  //#region extensions/matrix/src/matrix/client/logging.ts
5
5
  var logging_exports = /* @__PURE__ */ __exportAll({
@@ -1,4 +1,4 @@
1
- import { C as formatPollResultsAsText, D as parsePollStartContent, O as resolvePollReferenceEventId, S as formatPollAsText, T as isPollStartType, w as isPollEventType, x as buildPollResultsSummary } from "./send-BldGYG8g.js";
1
+ import { _ as parsePollStartContent, d as buildPollResultsSummary, f as formatPollAsText, h as isPollStartType, m as isPollEventType, p as formatPollResultsAsText, v as resolvePollReferenceEventId } from "./send-ClHgDZLT.js";
2
2
  import path from "node:path";
3
3
  //#region extensions/matrix/src/matrix/poll-summary.ts
4
4
  function resolveMatrixPollRootEventId(event) {
@@ -10,11 +10,14 @@ function resolveMatrixPollRootEventId(event) {
10
10
  }
11
11
  async function readAllPollRelations(client, roomId, pollEventId) {
12
12
  const relationEvents = [];
13
+ const seenCursors = /* @__PURE__ */ new Set();
13
14
  let nextBatch;
14
15
  do {
15
16
  const page = await client.getRelations(roomId, pollEventId, "m.reference", void 0, { from: nextBatch });
16
17
  relationEvents.push(...page.events);
17
18
  nextBatch = page.nextBatch ?? void 0;
19
+ if (nextBatch && seenCursors.has(nextBatch)) throw new Error("Matrix poll pagination returned a repeated cursor");
20
+ if (nextBatch) seenCursors.add(nextBatch);
18
21
  } while (nextBatch);
19
22
  return relationEvents;
20
23
  }
@@ -1,13 +1,12 @@
1
- import { r as isMatrixNotFoundError } from "./errors-C47hvAF8.js";
2
- import { T as isPollStartType, r as sendMessageMatrix, t as editMessageMatrix, w as isPollEventType } from "./send-BldGYG8g.js";
3
1
  import { n as MATRIX_REACTION_EVENT_TYPE } from "./reaction-common-DkrQdBSZ.js";
4
- import { a as resolveMatrixMessageAttachment, l as resolveMatrixPollRootEventId, o as resolveMatrixMessageBody, s as fetchMatrixPollMessageSummary } from "./media-text-BTwzADS_.js";
5
- import { r as withResolvedRoomAction } from "./client-6eRENr7k.js";
6
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
- import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
2
+ import { h as isPollStartType, m as isPollEventType, r as sendMessageMatrix, t as editMessageMatrix } from "./send-ClHgDZLT.js";
3
+ import { a as resolveMatrixMessageAttachment, l as resolveMatrixPollRootEventId, o as resolveMatrixMessageBody, s as fetchMatrixPollMessageSummary } from "./media-text-Dh-DpTc3.js";
4
+ import { r as withResolvedRoomAction } from "./client-D8XghqmX.js";
5
+ import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.js";
6
+ import { asNullableObjectRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
7
  //#region extensions/matrix/src/matrix/actions/limits.ts
9
8
  function resolveMatrixActionLimit(raw, fallback) {
10
- return resolveIntegerOption(raw, fallback, { min: 1 });
9
+ return Math.max(1, Math.floor(raw !== void 0 && Number.isFinite(raw) ? raw : fallback));
11
10
  }
12
11
  //#endregion
13
12
  //#region extensions/matrix/src/matrix/actions/types.ts
@@ -19,6 +18,26 @@ const EventType = {
19
18
  };
20
19
  //#endregion
21
20
  //#region extensions/matrix/src/matrix/actions/summary.ts
21
+ function parseMatrixRawEvent(value) {
22
+ const event = asNullableObjectRecord(value);
23
+ const content = asNullableObjectRecord(event?.content);
24
+ if (!event || typeof event.event_id !== "string" || typeof event.sender !== "string" || typeof event.type !== "string" || typeof event.origin_server_ts !== "number" || !content) return null;
25
+ const unsigned = asNullableObjectRecord(event.unsigned);
26
+ const relations = asNullableObjectRecord(unsigned?.["m.relations"]);
27
+ return {
28
+ event_id: event.event_id,
29
+ sender: event.sender,
30
+ type: event.type,
31
+ origin_server_ts: event.origin_server_ts,
32
+ content,
33
+ ...unsigned ? { unsigned: {
34
+ ...typeof unsigned.age === "number" ? { age: unsigned.age } : {},
35
+ ...relations ? { "m.relations": relations } : {},
36
+ ...unsigned.redacted_because !== void 0 ? { redacted_because: unsigned.redacted_because } : {}
37
+ } } : {},
38
+ ...typeof event.state_key === "string" ? { state_key: event.state_key } : {}
39
+ };
40
+ }
22
41
  function resolveBundledMatrixReplacementContent(event) {
23
42
  const rawReplacement = event.unsigned?.["m.relations"]?.["m.replace"];
24
43
  if (!rawReplacement || typeof rawReplacement !== "object" || event.state_key !== void 0) return;
@@ -73,7 +92,8 @@ async function readPinnedEvents(client, roomId) {
73
92
  }
74
93
  async function fetchEventSummary(client, roomId, eventId) {
75
94
  try {
76
- const raw = await client.getEvent(roomId, eventId);
95
+ const raw = parseMatrixRawEvent(await client.getEvent(roomId, eventId));
96
+ if (!raw) return null;
77
97
  if (raw.unsigned?.redacted_because) return null;
78
98
  const pollSummary = await fetchMatrixPollMessageSummary(client, roomId, raw);
79
99
  if (pollSummary) return pollSummary;
@@ -113,6 +133,7 @@ async function sendMatrixMessage(to, content, opts = {}) {
113
133
  return await sendMessageMatrix(to, content, {
114
134
  cfg: opts.cfg,
115
135
  mediaUrl: opts.mediaUrl,
136
+ ...opts.mediaAccess ? { mediaAccess: opts.mediaAccess } : {},
116
137
  mediaLocalRoots: opts.mediaLocalRoots,
117
138
  replyToId: opts.replyToId,
118
139
  threadId: opts.threadId,
@@ -124,9 +145,8 @@ async function sendMatrixMessage(to, content, opts = {}) {
124
145
  }
125
146
  async function editMatrixMessage(roomId, messageId, content, opts = {}) {
126
147
  if (!opts.cfg) throw new Error("Matrix message actions require a resolved runtime config.");
127
- const trimmed = content.trim();
128
- if (!trimmed) throw new Error("Matrix edit requires content");
129
- return { eventId: await editMessageMatrix(roomId, messageId, trimmed, {
148
+ if (!content.trim()) throw new Error("Matrix edit requires content");
149
+ return { eventId: await editMessageMatrix(roomId, messageId, content.trimEnd(), {
130
150
  cfg: opts.cfg,
131
151
  accountId: opts.accountId ?? void 0,
132
152
  client: opts.client,