@openclaw/matrix 2026.7.2-beta.2 → 2026.7.2-beta.4

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 (90) hide show
  1. package/dist/{account-selection-Bz00QTmQ.js → account-selection-kqquRzCf.js} +5 -5
  2. package/dist/api.js +6 -6
  3. package/dist/{approval-handler.runtime-BQZdg_dJ.js → approval-handler.runtime-AsawryfP.js} +4 -4
  4. package/dist/{approval-ids-De4IhOSN.js → approval-ids-XAMP8vN9.js} +1 -1
  5. package/dist/{approval-reaction-auth-BLJKPLku.js → approval-reaction-auth-DButmM13.js} +2 -2
  6. package/dist/auth-presence.js +13 -21
  7. package/dist/{channel-B1woOUgk.js → channel-MBtrY36B.js} +19 -13
  8. package/dist/channel-plugin-api.js +1 -1
  9. package/dist/{channel.runtime-BvJm9z0w.js → channel.runtime-Bi4Dgy2P.js} +15 -16
  10. package/dist/{cli-CLWOkMvw.js → cli-CcPuMyCk.js} +15 -12
  11. package/dist/{cli-metadata-9Naf7in0.js → cli-metadata-DAhDhbYX.js} +1 -1
  12. package/dist/cli-metadata.js +1 -1
  13. package/dist/{client-BUai6s29.js → client-BwX6rURh.js} +2 -2
  14. package/dist/{client-CPuYbNL8.js → client-Dg8dk8NW.js} +2 -2
  15. package/dist/{client-bootstrap-CNVF73sF.js → client-bootstrap-ZAaO9fZ-.js} +1 -1
  16. package/dist/{config-schema-BTSatSY3.js → config-schema-CggnuwnJ.js} +4 -5
  17. package/dist/contract-api.js +2 -2
  18. package/dist/{create-client-85ttAWDP.js → create-client-Und1YmJ2.js} +4 -4
  19. package/dist/credentials-W2EmwRhu.js +65 -0
  20. package/dist/credentials-read-DVmFCm7X.js +77 -0
  21. package/dist/{credentials-write.runtime-BDtpqvj0.js → credentials-write.runtime-Be9zNSUw.js} +1 -1
  22. package/dist/{crypto-runtime-DoEB5RpM.js → crypto-runtime-_j7TpS7k.js} +3 -3
  23. package/dist/{directory-live-0TyS9xep.js → directory-live-B6fbX6jf.js} +3 -3
  24. package/dist/{doctor-BGTs609f.js → doctor-C0LPJGTz.js} +1 -1
  25. package/dist/doctor-contract-CWVdlRQR.js +183 -0
  26. package/dist/doctor-contract-api.js +220 -73
  27. package/dist/{draft-stream-GOdPZMBm.js → draft-stream-BfibauH1.js} +1 -1
  28. package/dist/{encryption-guidance-BFfgq7c7.js → encryption-guidance-CbEFe38F.js} +1 -1
  29. package/dist/{file-sync-store-CUE9WwD2.js → file-sync-store-DUEWCEjb.js} +21 -4
  30. package/dist/helper-api.js +2 -2
  31. package/dist/{http-client-Jw5_bwQo.js → http-client-DOyTG9l2.js} +2 -2
  32. package/dist/{idb-persistence-BiHEEzD7.js → idb-persistence-C6zQfW2w.js} +73 -64
  33. package/dist/index.js +1 -1
  34. package/dist/{media-text-DPCtdFjk.js → media-text-Cv1VIHXW.js} +1 -1
  35. package/dist/{messages-DCRbGLMh.js → messages-ClTgfFl6.js} +3 -3
  36. package/dist/{monitor-C5EOF9et.js → monitor-2BjKS9RV.js} +93 -92
  37. package/dist/plugin-entry.handlers.runtime.js +1 -1
  38. package/dist/probe.runtime-BWkgfbiE.js +3 -0
  39. package/dist/{profile-update-DompcDyu.js → profile-update-C2My3TML.js} +2 -2
  40. package/dist/{reaction-events-QUgxkQKQ.js → reaction-events-Cj6thhmc.js} +2 -2
  41. package/dist/record-shared-CWWx6fvI.js +2 -0
  42. package/dist/{recovery-key-store-B2RglalK.js → recovery-key-store-0O8ARdT_.js} +1 -1
  43. package/dist/{resolve-targets-Cx1VVArA.js → resolve-targets-Dn11HT76.js} +1 -1
  44. package/dist/{resolver.runtime-PPrv3ZHu.js → resolver.runtime-Zguh0hH9.js} +1 -1
  45. package/dist/runtime-api.js +3 -3
  46. package/dist/{sdk-1TXuSiXZ.js → sdk-DiRXiRRf.js} +5 -5
  47. package/dist/{secret-contract-OZoQf0kI.js → secret-contract-M3hRmGO-.js} +21 -5
  48. package/dist/secret-contract-api.js +1 -1
  49. package/dist/{send-yre1krm8.js → send-CZCmDQu8.js} +4 -3
  50. package/dist/session-binding-contract-api.js +1 -1
  51. package/dist/{setup-bootstrap-DXVRCd4G.js → setup-bootstrap-C9w01xQK.js} +2 -2
  52. package/dist/{setup-core-CYQRY2oG.js → setup-core-D6gyoyeg.js} +109 -21
  53. package/dist/setup-plugin-api.js +4 -3
  54. package/dist/{setup-surface-BjvRQzK6.js → setup-surface-DZIEWtQC.js} +8 -6
  55. package/dist/{shared-BfW4lxGu.js → shared-C7Vm9RxI.js} +6 -6
  56. package/dist/{startup-verification-DSiyDKM5.js → startup-verification-D1nscMh8.js} +2 -2
  57. package/dist/{storage-DD-EnNJE.js → storage-BrkTJZov.js} +11 -44
  58. package/dist/{thread-bindings-U5ZroBeZ.js → thread-bindings-BcYBELC7.js} +3 -3
  59. package/dist/{tool-actions.runtime-BlfTr9b0.js → tool-actions.runtime-Dbco_Vwn.js} +7 -7
  60. package/dist/{verification-CGnI9k1O.js → verification-DhMBWxOJ.js} +2 -2
  61. package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
  62. package/node_modules/music-metadata/lib/common/Util.js +7 -1
  63. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +23 -3
  64. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
  65. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
  66. package/node_modules/music-metadata/lib/mp4/AtomToken.js +38 -13
  67. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
  68. package/node_modules/music-metadata/package.json +6 -6
  69. package/node_modules/typebox/build/compile/validator.d.mts +1 -4
  70. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  71. package/node_modules/typebox/build/guard/guard.mjs +5 -2
  72. package/node_modules/typebox/build/guard/string.mjs +16 -4
  73. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  74. package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
  75. package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
  76. package/node_modules/typebox/build/typebox.d.mts +1 -1
  77. package/node_modules/typebox/build/typebox.mjs +1 -1
  78. package/node_modules/typebox/package.json +1 -1
  79. package/node_modules/typebox/readme.md +29 -32
  80. package/npm-shrinkwrap.json +11 -11
  81. package/openclaw.plugin.json +7 -20
  82. package/package.json +111 -28
  83. package/dist/async-lock-BcLS4KOc.js +0 -19
  84. package/dist/credentials-CncWUieb.js +0 -56
  85. package/dist/credentials-read-CwNJrmwu.js +0 -112
  86. package/dist/doctor-contract-D2qTLe-C.js +0 -312
  87. package/dist/probe.runtime-BBvciVfo.js +0 -3
  88. package/dist/record-shared-CvzjvHRn.js +0 -2
  89. package/dist/{deps-DDbghaZH.js → deps-CcVJfvRM.js} +1 -1
  90. package/dist/{storage-paths-B4_I9iqO.js → storage-paths-gUmSydsW.js} +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as buildTimeoutAbortSignal } from "./timeout-abort-signal-DMrgRFIy.js";
2
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
3
2
  import { parseMediaContentLength } from "openclaw/plugin-sdk/media-runtime";
3
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
4
4
  import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
5
5
  import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
6
6
  import { closeDispatcher, createPinnedDispatcher, resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-dispatcher";
@@ -211,7 +211,7 @@ async function fetchWithMatrixGuardedRedirects(params) {
211
211
  headers.delete("content-type");
212
212
  headers.delete("content-length");
213
213
  }
214
- response.body?.cancel();
214
+ response.body?.cancel().catch(() => void 0);
215
215
  await closeDispatcher(dispatcher);
216
216
  currentUrl = nextUrl;
217
217
  } catch (error) {
@@ -1,17 +1,24 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { D as writeMatrixIdbSnapshotJson, T as readMatrixIdbSnapshotJson, f as MATRIX_IDB_SNAPSHOT_FILENAME } from "./storage-DD-EnNJE.js";
1
+ import { D as writeMatrixIdbSnapshotJson, f as MATRIX_IDB_SNAPSHOT_FILENAME, w as readMatrixIdbSnapshotJson } from "./storage-BrkTJZov.js";
3
2
  import { n as LogService } from "./logger-D0GCSDQq.js";
4
3
  import { n as MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS } from "./idb-persistence-lock-DAJ49nZX.js";
5
- import fs from "node:fs";
6
4
  import path from "node:path";
7
- import { indexedDB } from "fake-indexeddb";
5
+ import fs from "node:fs";
8
6
  import { withFileLock } from "openclaw/plugin-sdk/file-lock";
7
+ import { indexedDB } from "fake-indexeddb";
9
8
  //#region extensions/matrix/src/matrix/sdk/idb-persistence.ts
10
- var idb_persistence_exports = /* @__PURE__ */ __exportAll({
11
- persistIdbToDisk: () => persistIdbToDisk,
12
- readLegacyMatrixIdbSnapshotState: () => readLegacyMatrixIdbSnapshotState,
13
- restoreIdbFromDisk: () => restoreIdbFromDisk
14
- });
9
+ const LEGACY_SNAPSHOT_DIAGNOSTIC = {
10
+ code: "matrix-idb-snapshot-requires-doctor",
11
+ message: "Matrix IndexedDB snapshot exists outside canonical SQLite state",
12
+ remediation: "openclaw doctor --fix"
13
+ };
14
+ var MatrixIdbSnapshotMigrationRequiredError = class extends Error {
15
+ constructor() {
16
+ super(`${LEGACY_SNAPSHOT_DIAGNOSTIC.message}; run ${LEGACY_SNAPSHOT_DIAGNOSTIC.remediation}`);
17
+ this.code = LEGACY_SNAPSHOT_DIAGNOSTIC.code;
18
+ this.remediation = LEGACY_SNAPSHOT_DIAGNOSTIC.remediation;
19
+ this.name = "MatrixIdbSnapshotMigrationRequiredError";
20
+ }
21
+ };
15
22
  function isValidIdbIndexSnapshot(value) {
16
23
  if (!value || typeof value !== "object") return false;
17
24
  const candidate = value;
@@ -38,6 +45,13 @@ function parseSnapshotPayload(data) {
38
45
  if (!parsed.every((entry) => isValidIdbDatabaseSnapshot(entry))) throw new Error("Malformed IndexedDB snapshot payload");
39
46
  return parsed;
40
47
  }
48
+ function isValidMatrixIdbSnapshotJson(data) {
49
+ try {
50
+ return parseSnapshotPayload(data) !== null;
51
+ } catch {
52
+ return false;
53
+ }
54
+ }
41
55
  function idbReq(req) {
42
56
  return new Promise((resolve, reject) => {
43
57
  req.addEventListener("success", () => resolve(req.result), { once: true });
@@ -135,88 +149,83 @@ function resolveDefaultIdbSnapshotPath() {
135
149
  return path.join(stateDir, "matrix", "crypto-idb-snapshot.json");
136
150
  }
137
151
  async function restoreIdbFromDisk(snapshotPath) {
138
- const candidatePaths = snapshotPath ? [snapshotPath] : [resolveDefaultIdbSnapshotPath()];
139
- for (const resolvedPath of candidatePaths) {
140
- const storageRootDir = path.dirname(resolvedPath);
141
- try {
142
- if (await withFileLock(resolvedPath, MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, async () => {
143
- try {
144
- const storedSnapshotJson = readMatrixIdbSnapshotJson(storageRootDir);
145
- if (storedSnapshotJson) {
146
- const snapshot = parseSnapshotPayload(storedSnapshotJson);
147
- if (snapshot) {
148
- await restoreIndexedDatabases(snapshot);
149
- LogService.info("IdbPersistence", `Restored ${snapshot.length} IndexedDB database(s) from Matrix SQLite state`);
150
- return true;
151
- }
152
- }
153
- } catch (err) {
154
- LogService.warn("IdbPersistence", "Failed to restore IndexedDB snapshot from SQLite:", err);
155
- }
156
- if (!fs.existsSync(resolvedPath)) return false;
157
- const data = fs.readFileSync(resolvedPath, "utf8");
158
- const snapshot = parseSnapshotPayload(data);
159
- if (!snapshot) return false;
160
- let migratedToSqlite = false;
161
- try {
162
- writeMatrixIdbSnapshotJson({
163
- storageRootDir,
164
- snapshotJson: data,
165
- databaseCount: snapshot.length
166
- });
167
- archiveLegacyIdbSnapshotFile(resolvedPath);
168
- migratedToSqlite = true;
169
- } catch (err) {
170
- LogService.warn("IdbPersistence", `Failed to migrate IndexedDB snapshot to SQLite from ${resolvedPath}:`, err);
171
- }
172
- await restoreIndexedDatabases(snapshot);
173
- LogService.info("IdbPersistence", migratedToSqlite ? `Migrated and restored ${snapshot.length} IndexedDB database(s) from ${resolvedPath}` : `Restored ${snapshot.length} IndexedDB database(s) from legacy snapshot ${resolvedPath}`);
174
- return true;
175
- })) return true;
176
- } catch (err) {
177
- LogService.warn("IdbPersistence", `Failed to restore IndexedDB snapshot from ${resolvedPath}:`, err);
178
- continue;
179
- }
152
+ const resolvedPath = snapshotPath ?? resolveDefaultIdbSnapshotPath();
153
+ const storageRootDir = path.dirname(resolvedPath);
154
+ let callbackStarted = false;
155
+ try {
156
+ return await withFileLock(resolvedPath, MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, async () => {
157
+ callbackStarted = true;
158
+ let storedSnapshotJson;
159
+ try {
160
+ storedSnapshotJson = readMatrixIdbSnapshotJson(storageRootDir);
161
+ } catch (err) {
162
+ if (fs.existsSync(resolvedPath)) throwLegacySnapshotMigrationRequired();
163
+ throw err;
164
+ }
165
+ throwIfLegacySnapshotNeedsDoctor(resolvedPath, storedSnapshotJson);
166
+ if (!storedSnapshotJson) return false;
167
+ const snapshot = parseSnapshotPayload(storedSnapshotJson);
168
+ if (!snapshot) return false;
169
+ await restoreIndexedDatabases(snapshot);
170
+ LogService.info("IdbPersistence", `Restored ${snapshot.length} IndexedDB database(s) from Matrix SQLite state`);
171
+ return true;
172
+ });
173
+ } catch (err) {
174
+ if (err instanceof MatrixIdbSnapshotMigrationRequiredError) throw err;
175
+ if (!callbackStarted && fs.existsSync(resolvedPath)) throwLegacySnapshotMigrationRequired();
176
+ LogService.warn("IdbPersistence", "Failed to restore IndexedDB snapshot from SQLite:", err);
177
+ return false;
180
178
  }
181
- return false;
182
179
  }
183
180
  async function persistIdbToDisk(params) {
184
181
  const snapshotPath = params?.snapshotPath ?? resolveDefaultIdbSnapshotPath();
182
+ let callbackStarted = false;
185
183
  try {
186
184
  fs.mkdirSync(path.dirname(snapshotPath), { recursive: true });
187
185
  const persistedCount = await withFileLock(snapshotPath, MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, async () => {
186
+ callbackStarted = true;
187
+ const storageRootDir = path.dirname(snapshotPath);
188
+ let storedSnapshotJson;
189
+ try {
190
+ storedSnapshotJson = readMatrixIdbSnapshotJson(storageRootDir);
191
+ } catch (err) {
192
+ if (fs.existsSync(snapshotPath)) throwLegacySnapshotMigrationRequired();
193
+ throw err;
194
+ }
195
+ throwIfLegacySnapshotNeedsDoctor(snapshotPath, storedSnapshotJson);
188
196
  const snapshot = await dumpIndexedDatabases(params?.databasePrefix);
189
197
  if (snapshot.length === 0) return 0;
190
198
  writeMatrixIdbSnapshotJson({
191
- storageRootDir: path.dirname(snapshotPath),
199
+ storageRootDir,
192
200
  snapshotJson: JSON.stringify(snapshot),
193
201
  databaseCount: snapshot.length
194
202
  });
195
- archiveLegacyIdbSnapshotFile(snapshotPath);
196
203
  return snapshot.length;
197
204
  });
198
205
  if (persistedCount === 0) return;
199
206
  LogService.debug("IdbPersistence", `Persisted ${persistedCount} IndexedDB database(s) to Matrix SQLite state`);
200
207
  } catch (err) {
208
+ if (err instanceof MatrixIdbSnapshotMigrationRequiredError) throw err;
209
+ if (!callbackStarted && fs.existsSync(snapshotPath)) throwLegacySnapshotMigrationRequired();
201
210
  LogService.warn("IdbPersistence", "Failed to persist IndexedDB snapshot:", err);
202
211
  }
203
212
  }
204
- async function readLegacyMatrixIdbSnapshotState(storageRootDir) {
213
+ function readLegacyMatrixIdbSnapshotStateUnlocked(storageRootDir) {
205
214
  const snapshotPath = path.join(storageRootDir, MATRIX_IDB_SNAPSHOT_FILENAME);
206
215
  if (!fs.existsSync(snapshotPath)) return null;
216
+ const data = fs.readFileSync(snapshotPath, "utf8");
207
217
  try {
208
- return await withFileLock(snapshotPath, MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, async () => {
209
- return parseSnapshotPayload(fs.readFileSync(snapshotPath, "utf8"));
210
- });
218
+ return parseSnapshotPayload(data);
211
219
  } catch {
212
220
  return null;
213
221
  }
214
222
  }
215
- function archiveLegacyIdbSnapshotFile(snapshotPath) {
216
- if (!fs.existsSync(snapshotPath)) return;
217
- const archivedPath = `${snapshotPath}.migrated`;
218
- if (fs.existsSync(archivedPath)) return;
219
- fs.renameSync(snapshotPath, archivedPath);
223
+ function throwIfLegacySnapshotNeedsDoctor(snapshotPath, storedSnapshotJson) {
224
+ if (fs.existsSync(snapshotPath) && (!storedSnapshotJson || !isValidMatrixIdbSnapshotJson(storedSnapshotJson))) throwLegacySnapshotMigrationRequired();
225
+ }
226
+ function throwLegacySnapshotMigrationRequired() {
227
+ LogService.warn("IdbPersistence", LEGACY_SNAPSHOT_DIAGNOSTIC);
228
+ throw new MatrixIdbSnapshotMigrationRequiredError();
220
229
  }
221
230
  function toLintErrorObject(value, fallbackMessage) {
222
231
  if (value instanceof Error) return value;
@@ -226,4 +235,4 @@ function toLintErrorObject(value, fallbackMessage) {
226
235
  return error;
227
236
  }
228
237
  //#endregion
229
- export { restoreIdbFromDisk as i, persistIdbToDisk as n, readLegacyMatrixIdbSnapshotState as r, idb_persistence_exports as t };
238
+ export { restoreIdbFromDisk as i, persistIdbToDisk as n, readLegacyMatrixIdbSnapshotStateUnlocked as r, isValidMatrixIdbSnapshotJson as t };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as registerMatrixCliMetadata } from "./cli-metadata-9Naf7in0.js";
1
+ import { n as registerMatrixCliMetadata } from "./cli-metadata-DAhDhbYX.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,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-yre1krm8.js";
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-CZCmDQu8.js";
2
2
  import path from "node:path";
3
3
  //#region extensions/matrix/src/matrix/poll-summary.ts
4
4
  function resolveMatrixPollRootEventId(event) {
@@ -1,8 +1,8 @@
1
1
  import { r as isMatrixNotFoundError } from "./errors-C47hvAF8.js";
2
- import { T as isPollStartType, a as sendMessageMatrix, n as editMessageMatrix, w as isPollEventType } from "./send-yre1krm8.js";
2
+ import { T as isPollStartType, a as sendMessageMatrix, n as editMessageMatrix, w as isPollEventType } from "./send-CZCmDQu8.js";
3
3
  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-DPCtdFjk.js";
5
- import { r as withResolvedRoomAction } from "./client-BUai6s29.js";
4
+ import { a as resolveMatrixMessageAttachment, l as resolveMatrixPollRootEventId, o as resolveMatrixMessageBody, s as fetchMatrixPollMessageSummary } from "./media-text-Cv1VIHXW.js";
5
+ import { r as withResolvedRoomAction } from "./client-BwX6rURh.js";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
8
8
  //#region extensions/matrix/src/matrix/actions/limits.ts
@@ -1,22 +1,22 @@
1
1
  import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-BZWN9tGS.js";
2
2
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
3
- import { m as resolveConfiguredMatrixBotUserIds } from "./setup-core-CYQRY2oG.js";
4
- 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-B1woOUgk.js";
5
- import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./config-schema-BTSatSY3.js";
3
+ import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-D6gyoyeg.js";
4
+ 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-MBtrY36B.js";
5
+ import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./config-schema-CggnuwnJ.js";
6
6
  import { t as isMatrixQualifiedUserId } from "./target-ids-B-5aQxwn.js";
7
7
  import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
8
- 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-yre1krm8.js";
9
- import { t as createMatrixThreadBindingManager } from "./thread-bindings-U5ZroBeZ.js";
8
+ 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-CZCmDQu8.js";
9
+ import { t as createMatrixThreadBindingManager } from "./thread-bindings-BcYBELC7.js";
10
10
  import { i as createMatrixInboundEventDeduper } from "./inbound-dedupe-CaBLblef.js";
11
- import { a as resolveMatrixMessageAttachment, c as fetchMatrixPollSnapshot, i as isLikelyBareFilename, n as formatMatrixMediaUnavailableText, o as resolveMatrixMessageBody, r as formatMatrixMessageText, t as formatMatrixMediaTooLargeText } from "./media-text-DPCtdFjk.js";
11
+ import { a as resolveMatrixMessageAttachment, c as fetchMatrixPollSnapshot, i as isLikelyBareFilename, n as formatMatrixMediaUnavailableText, o as resolveMatrixMessageBody, r as formatMatrixMessageText, t as formatMatrixMediaTooLargeText } from "./media-text-Cv1VIHXW.js";
12
12
  import { n as setActiveMatrixClient } from "./active-client-DXvz2gCo.js";
13
13
  import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
14
- import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, l as isMatrixStartupAbortError, n as releaseSharedClientInstance, p as resolveMatrixAuthContext, u as throwIfMatrixStartupAborted } from "./shared-BfW4lxGu.js";
15
- import "./client-CPuYbNL8.js";
16
- import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-Jw5_bwQo.js";
14
+ import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, l as isMatrixStartupAbortError, n as releaseSharedClientInstance, p as resolveMatrixAuthContext, u as throwIfMatrixStartupAborted } from "./shared-C7Vm9RxI.js";
15
+ import "./client-Dg8dk8NW.js";
16
+ import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-DOyTG9l2.js";
17
17
  import { d as resolveAllowlistProviderRuntimeGroupPolicy, f as resolveDefaultGroupPolicy, g as warnMissingProviderGroupPolicyFallbackOnce, h as resolveThreadBindingMaxAgeMsForChannel, m as resolveThreadBindingIdleTimeoutMsForChannel, t as GROUP_POLICY_BLOCKED_LABEL } from "./runtime-api-D1xI_cvh.js";
18
- import { t as resolveMatrixTargets } from "./resolve-targets-Cx1VVArA.js";
19
- import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-BFfgq7c7.js";
18
+ import { t as resolveMatrixTargets } from "./resolve-targets-Dn11HT76.js";
19
+ import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-CbEFe38F.js";
20
20
  import { n as isMatrixReadySyncState, r as isMatrixTerminalSyncState, t as isMatrixDisconnectedSyncState } from "./sync-state-CWbp0QSY.js";
21
21
  import { a as EventType, i as resolveMatrixThreadRouting, n as resolveMatrixReplyToEventId, o as RelationType, r as resolveMatrixThreadRootId, t as resolveMatrixInboundRoute } from "./route-DY6at4qJ.js";
22
22
  import { t as createMatrixRoomInfoResolver } from "./room-info-B6vKD5DF.js";
@@ -25,8 +25,8 @@ import { buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate,
25
25
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
26
26
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
27
27
  import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
28
- import { buildChannelInboundEventContext, hasFinalInboundReplyDispatch, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
29
- import { getSessionEntry } from "openclaw/plugin-sdk/session-store-runtime";
28
+ import { buildChannelInboundEventContext, createChannelInboundEnvelopeBuilder, hasFinalInboundReplyDispatch, resolveInboundMentionDecision, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
29
+ import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
30
30
  import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
31
31
  import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
32
32
  import { format } from "node:util";
@@ -36,6 +36,7 @@ import { resolveAckReaction } from "openclaw/plugin-sdk/channel-feedback";
36
36
  import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
37
37
  import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
38
38
  import { createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
39
+ import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
39
40
  import { evaluateSupplementalContextVisibility, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
40
41
  import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
41
42
  import { buildInboundHistoryFromEntries } from "openclaw/plugin-sdk/reply-history";
@@ -817,7 +818,7 @@ const matrixVerificationConstants = {
817
818
  const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
818
819
  const SAS_NOTICE_RETRY_DELAY_MS = 750;
819
820
  const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
820
- const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-yre1krm8.js").then((n) => n.d), import("./send-yre1krm8.js").then((n) => n.m)]).then(([directManagementModule, directRoomModule]) => ({
821
+ const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-CZCmDQu8.js").then((n) => n.d), import("./send-CZCmDQu8.js").then((n) => n.m)]).then(([directManagementModule, directRoomModule]) => ({
821
822
  inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
822
823
  isStrictDirectRoom: directRoomModule.isStrictDirectRoom
823
824
  })));
@@ -1690,8 +1691,10 @@ async function resolveMatrixPreflightAudioTranscript(params) {
1690
1691
  if (params.abortSignal?.aborted) return;
1691
1692
  const transcript = await transcribeFirstAudio({
1692
1693
  ctx: {
1693
- MediaPaths: [params.mediaPath],
1694
- MediaTypes: params.mediaContentType ? [params.mediaContentType] : void 0,
1694
+ media: [{
1695
+ path: params.mediaPath,
1696
+ contentType: params.mediaContentType
1697
+ }],
1695
1698
  Provider: "matrix",
1696
1699
  Surface: "matrix",
1697
1700
  OriginatingChannel: "matrix",
@@ -2204,11 +2207,11 @@ function createMatrixThreadContextResolver(params) {
2204
2207
  const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
2205
2208
  const PAIRING_REPLY_COOLDOWN_MS = 5 * 6e4;
2206
2209
  const MATRIX_TOOL_PROGRESS_MAX_CHARS = 300;
2207
- const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-yre1krm8.js").then((n) => n.l));
2210
+ const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-CZCmDQu8.js").then((n) => n.l));
2208
2211
  const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
2209
2212
  const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
2210
- const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-QUgxkQKQ.js"));
2211
- const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-GOdPZMBm.js"));
2213
+ const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-Cj6thhmc.js"));
2214
+ const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-BfibauH1.js"));
2212
2215
  async function matrixTextWouldActivateMentions(client, text) {
2213
2216
  const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
2214
2217
  const mentions = await resolveMatrixMentionsForBody({
@@ -2328,7 +2331,7 @@ function formatMatrixToolProgressMarkdownCode(text) {
2328
2331
  return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, MATRIX_TOOL_PROGRESS_MAX_CHARS - 1).trimEnd()}...`).replaceAll("`", "'")}\``;
2329
2332
  }
2330
2333
  function createMatrixRoomMessageHandler(params) {
2331
- const { client, core, cfg, accountId, accountConfig, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], roomsConfig, accountAllowBots, configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, threadReplies, dmThreadReplies, dmSessionScope, streaming, previewToolProgressEnabled, blockStreamingEnabled, dmEnabled, dmPolicy, textLimit, mediaMaxBytes, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, needsRoomAliasesForConfig, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist } = params;
2334
+ const { client, core, cfg, accountId, accountConfig, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], roomsConfig, accountAllowBots, configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, threadReplies, dmThreadReplies, dmSessionScope, streaming, previewToolProgressEnabled, blockStreamingEnabled, dmEnabled, dmPolicy, textLimit, mediaMaxBytes, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, needsRoomAliasesForConfig, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist, resolveStorePath: resolveStorePathImpl = resolveStorePath, createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl = createChannelInboundEnvelopeBuilder, finalizeInboundContext, resolveHumanDelayConfig: resolveHumanDelayConfigImpl = resolveHumanDelayConfig } = params;
2332
2335
  const contextVisibilityMode = resolveChannelContextVisibilityMode({
2333
2336
  cfg,
2334
2337
  channel: "matrix",
@@ -2796,7 +2799,7 @@ function createMatrixRoomMessageHandler(params) {
2796
2799
  cfg,
2797
2800
  surface: "matrix"
2798
2801
  });
2799
- const useAccessGroups = cfg.commands?.useAccessGroups !== false;
2802
+ const useAccessGroups = true;
2800
2803
  const commandCheckText = stripMatrixMentionPrefix({
2801
2804
  text: mentionPrecheckText,
2802
2805
  userId: selfUserId,
@@ -2821,9 +2824,23 @@ function createMatrixRoomMessageHandler(params) {
2821
2824
  return;
2822
2825
  }
2823
2826
  const shouldRequireMention = isRoom ? roomConfig?.autoReply === true ? false : roomConfig?.autoReply === false ? true : typeof roomConfig?.requireMention === "boolean" ? roomConfig?.requireMention : true : false;
2824
- const shouldBypassMention = allowTextCommands && isRoom && shouldRequireMention && !wasMentioned && !hasExplicitMention && commandAuthorized && hasControlCommandInMessage;
2827
+ const mentionDecision = resolveInboundMentionDecision({
2828
+ facts: {
2829
+ canDetectMention: true,
2830
+ wasMentioned,
2831
+ hasAnyMention: hasExplicitMention
2832
+ },
2833
+ policy: {
2834
+ isGroup: isRoom,
2835
+ requireMention: shouldRequireMention,
2836
+ allowTextCommands,
2837
+ hasControlCommand: hasControlCommandInMessage,
2838
+ commandAuthorized
2839
+ }
2840
+ });
2841
+ const { effectiveWasMentioned, shouldBypassMention } = mentionDecision;
2825
2842
  const canDetectMention = agentMentionRegexes.length > 0 || hasExplicitMention;
2826
- if (isRoom && shouldRequireMention && !wasMentioned && !shouldBypassMention) {
2843
+ if (mentionDecision.shouldSkip) {
2827
2844
  const pendingHistoryBody = preflightAudioTranscript ? formatMatrixAudioTranscript(preflightAudioTranscript) : pendingHistoryText || pendingHistoryPollText;
2828
2845
  if (historyLimit > 0 && pendingHistoryBody) {
2829
2846
  const pendingEntry = {
@@ -2956,6 +2973,7 @@ function createMatrixRoomMessageHandler(params) {
2956
2973
  isRoom,
2957
2974
  shouldRequireMention,
2958
2975
  wasMentioned,
2976
+ effectiveWasMentioned,
2959
2977
  shouldBypassMention,
2960
2978
  canDetectMention,
2961
2979
  commandAuthorized,
@@ -2998,7 +3016,7 @@ function createMatrixRoomMessageHandler(params) {
2998
3016
  })();
2999
3017
  if (!resolvedIngressResult) return;
3000
3018
  if ("deferredPrefix" in resolvedIngressResult) return;
3001
- const { route: _route, hasExplicitSessionBinding, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, commandBodyText, media, preflightAudioTranscript, locationPayload, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection, effectiveGroupAllowFrom, effectiveRoomUsers } = resolvedIngressResult;
3019
+ const { route: _route, hasExplicitSessionBinding, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, commandBodyText, media, preflightAudioTranscript, locationPayload, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection, effectiveGroupAllowFrom, effectiveRoomUsers } = resolvedIngressResult;
3002
3020
  const replyToEventId = resolveMatrixReplyToEventId(event.content);
3003
3021
  const threadTarget = thread.threadId;
3004
3022
  const isRoomContextSenderAllowed = (contextSenderId) => {
@@ -3046,11 +3064,10 @@ function createMatrixRoomMessageHandler(params) {
3046
3064
  const roomName = (isRoom ? await getRoomInfo(roomId) : void 0)?.name;
3047
3065
  const envelopeFrom = isDirectMessage ? senderName : roomName ?? roomId;
3048
3066
  const textWithId = `${bodyText}\n[matrix event id: ${messageId} room: ${roomId}]`;
3049
- const storePath = core.channel.session.resolveStorePath(cfg.session?.store, { agentId: _route.agentId });
3050
- const envelopeOptions = core.channel.reply.resolveEnvelopeFormatOptions(cfg);
3051
- const previousTimestamp = core.channel.session.readSessionUpdatedAt({
3052
- storePath,
3053
- sessionKey: _route.sessionKey
3067
+ const storePath = resolveStorePathImpl(cfg.session?.store, { agentId: _route.agentId });
3068
+ const buildEnvelope = createChannelInboundEnvelopeBuilderImpl({
3069
+ cfg,
3070
+ route: _route
3054
3071
  });
3055
3072
  const sharedDmNoticeSessionKey = threadTarget ? _route.mainSessionKey || _route.sessionKey : _route.sessionKey;
3056
3073
  const sharedDmContextNotice = isDirectMessage ? hasExplicitSessionBinding ? null : resolveMatrixSharedDmContextNotice({
@@ -3062,12 +3079,10 @@ function createMatrixRoomMessageHandler(params) {
3062
3079
  sentRooms: sharedDmContextNoticeRooms,
3063
3080
  logVerboseMessage
3064
3081
  }) : null;
3065
- const body = core.channel.reply.formatAgentEnvelope({
3082
+ const body = buildEnvelope({
3066
3083
  channel: "Matrix",
3067
3084
  from: envelopeFrom,
3068
3085
  timestamp: eventTs ?? void 0,
3069
- previousTimestamp,
3070
- envelope: envelopeOptions,
3071
3086
  body: textWithId
3072
3087
  });
3073
3088
  const groupSystemPrompt = normalizeOptionalString(roomConfig?.systemPrompt);
@@ -3078,8 +3093,8 @@ function createMatrixRoomMessageHandler(params) {
3078
3093
  }).include);
3079
3094
  const ctxPayload = buildChannelInboundEventContext({
3080
3095
  channel: "matrix",
3081
- finalize: core.channel.reply.finalizeInboundContext,
3082
3096
  contextVisibility: contextVisibilityMode,
3097
+ finalize: finalizeInboundContext,
3083
3098
  supplemental: {
3084
3099
  quote: replyContext ? {
3085
3100
  id: threadTarget ? void 0 : replyToEventId ?? void 0,
@@ -3116,6 +3131,7 @@ function createMatrixRoomMessageHandler(params) {
3116
3131
  },
3117
3132
  route: {
3118
3133
  agentId: _route.agentId,
3134
+ dmScope: _route.dmScope,
3119
3135
  accountId: _route.accountId,
3120
3136
  routeSessionKey: _route.sessionKey
3121
3137
  },
@@ -3132,6 +3148,7 @@ function createMatrixRoomMessageHandler(params) {
3132
3148
  bodyForAgent: bodyText,
3133
3149
  inboundHistory: inboundHistory && inboundHistory.length > 0 ? inboundHistory : void 0
3134
3150
  },
3151
+ sessionTranscript: { historyLimit: isRoom ? historyLimit : 0 },
3135
3152
  access: {
3136
3153
  ...isRoom ? { mentions: {
3137
3154
  canDetectMention: true,
@@ -3169,7 +3186,7 @@ function createMatrixRoomMessageHandler(params) {
3169
3186
  isMentionableGroup: isRoom,
3170
3187
  requireMention: shouldRequireMention,
3171
3188
  canDetectMention,
3172
- effectiveWasMentioned: wasMentioned || shouldBypassMention,
3189
+ effectiveWasMentioned,
3173
3190
  shouldBypassMention
3174
3191
  }));
3175
3192
  if (shouldAckReaction() && messageId) loadMatrixSendModule().then(({ reactMatrixMessage }) => reactMatrixMessage(roomId, messageId, ackReaction, client)).catch((err) => {
@@ -3350,7 +3367,7 @@ function createMatrixRoomMessageHandler(params) {
3350
3367
  },
3351
3368
  onPlanUpdate: async (payload) => {
3352
3369
  if (payload.phase !== "update") return;
3353
- await pushPlanProgress(payload.planSteps, payload.explanation);
3370
+ await pushPlanProgress(payload.steps, payload.explanation);
3354
3371
  },
3355
3372
  onApprovalEvent: async (payload) => {
3356
3373
  if (payload.phase !== "requested") return;
@@ -3439,9 +3456,9 @@ function createMatrixRoomMessageHandler(params) {
3439
3456
  progressDraftGate.reset();
3440
3457
  resetPreviewToolProgress();
3441
3458
  };
3442
- const { dispatcher, replyOptions, markDispatchIdle, markRunComplete } = core.channel.reply.createReplyDispatcherWithTyping({
3459
+ const { deliver: deliverReply, onError: onReplyError, ...turnDispatcherOptions } = {
3443
3460
  ...prefixOptions,
3444
- humanDelay: core.channel.reply.resolveHumanDelayConfig(cfg, _route.agentId),
3461
+ humanDelay: resolveHumanDelayConfigImpl(cfg, _route.agentId),
3445
3462
  deliver: async (payload, info) => {
3446
3463
  if (draftStream && info.kind !== "tool" && !payload.isCompactionNotice) {
3447
3464
  const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
@@ -3626,7 +3643,7 @@ function createMatrixRoomMessageHandler(params) {
3626
3643
  },
3627
3644
  onReplyStart: typingCallbacks.onReplyStart,
3628
3645
  onIdle: typingCallbacks.onIdle
3629
- });
3646
+ };
3630
3647
  const pinnedMainDmOwner = isDirectMessage ? await (async () => {
3631
3648
  const livePinnedCfg = core.config.current();
3632
3649
  const livePinnedAllowlists = resolveMatrixAccountAllowlistConfig({
@@ -3665,12 +3682,14 @@ function createMatrixRoomMessageHandler(params) {
3665
3682
  raw: event
3666
3683
  }),
3667
3684
  resolveTurn: () => ({
3685
+ cfg,
3668
3686
  channel: "matrix",
3669
3687
  accountId: _route.accountId,
3670
- routeSessionKey: _route.sessionKey,
3671
- storePath,
3688
+ route: {
3689
+ agentId: _route.agentId,
3690
+ sessionKey: _route.sessionKey
3691
+ },
3672
3692
  ctxPayload,
3673
- recordInboundSession: core.channel.session.recordInboundSession,
3674
3693
  botLoopProtection,
3675
3694
  record: {
3676
3695
  updateLastRoute: isDirectMessage ? {
@@ -3694,14 +3713,7 @@ function createMatrixRoomMessageHandler(params) {
3694
3713
  });
3695
3714
  }
3696
3715
  },
3697
- onPreDispatchFailure: () => core.channel.reply.settleReplyDispatcher({
3698
- dispatcher,
3699
- onSettled: () => {
3700
- markRunComplete();
3701
- markDispatchIdle();
3702
- }
3703
- }),
3704
- runDispatch: async () => {
3716
+ afterRecord: async () => {
3705
3717
  if (sharedDmContextNotice && markTrackedRoomIfFirst(sharedDmContextNoticeRooms, roomId)) try {
3706
3718
  await client.sendMessage(roomId, {
3707
3719
  msgtype: "m.notice",
@@ -3710,46 +3722,35 @@ function createMatrixRoomMessageHandler(params) {
3710
3722
  } catch (err) {
3711
3723
  logVerboseMessage(`matrix: failed sending shared DM session notice room=${roomId}: ${String(err)}`);
3712
3724
  }
3713
- return await core.channel.reply.withReplyDispatcher({
3714
- dispatcher,
3715
- onSettled: () => {
3716
- markDispatchIdle();
3717
- },
3718
- run: async () => {
3719
- try {
3720
- return await core.channel.reply.dispatchReplyFromConfig({
3721
- ctx: ctxPayload,
3722
- cfg,
3723
- dispatcher,
3724
- replyOptions: {
3725
- ...replyOptions,
3726
- skillFilter: roomConfig?.skills,
3727
- disableBlockStreaming: !blockStreamingEnabled,
3728
- onPartialReply: draftStream ? (payload) => {
3729
- if (progressDraftStreaming) return;
3730
- latestDraftFullText = payload.text ?? "";
3731
- suppressPreviewToolProgressForAnswerText(latestDraftFullText);
3732
- updateDraftFromLatestFullText();
3733
- } : void 0,
3734
- onBlockReplyQueued: draftStream ? (payload, context) => {
3735
- if (payload.isCompactionNotice === true) return;
3736
- queueDraftBlockBoundary(payload, context);
3737
- } : void 0,
3738
- onAssistantMessageStart: draftStream ? () => {
3739
- resetDraftBlockOffsets();
3740
- resetPreviewToolProgress();
3741
- } : void 0,
3742
- onQueuedFollowupAdmitted: draftStream ? resetDraftDeliveryState : void 0,
3743
- ...buildPreviewToolProgressReplyOptions(),
3744
- onModelSelected
3745
- }
3746
- });
3747
- } finally {
3748
- progressDraftGate.cancel();
3749
- markRunComplete();
3750
- }
3751
- }
3752
- });
3725
+ },
3726
+ delivery: {
3727
+ deliver: deliverReply,
3728
+ onError: (err, info) => onReplyError(err, info)
3729
+ },
3730
+ dispatcherOptions: {
3731
+ ...turnDispatcherOptions,
3732
+ onSettled: () => progressDraftGate.cancel()
3733
+ },
3734
+ replyOptions: {
3735
+ skillFilter: roomConfig?.skills,
3736
+ disableBlockStreaming: !blockStreamingEnabled,
3737
+ onPartialReply: draftStream ? (payload) => {
3738
+ if (progressDraftStreaming) return;
3739
+ latestDraftFullText = payload.text ?? "";
3740
+ suppressPreviewToolProgressForAnswerText(latestDraftFullText);
3741
+ updateDraftFromLatestFullText();
3742
+ } : void 0,
3743
+ onBlockReplyQueued: draftStream ? (payload, context) => {
3744
+ if (payload.isCompactionNotice === true) return;
3745
+ queueDraftBlockBoundary(payload, context);
3746
+ } : void 0,
3747
+ onAssistantMessageStart: draftStream ? () => {
3748
+ resetDraftBlockOffsets();
3749
+ resetPreviewToolProgress();
3750
+ } : void 0,
3751
+ onQueuedFollowupAdmitted: draftStream ? resetDraftDeliveryState : void 0,
3752
+ ...buildPreviewToolProgressReplyOptions(),
3753
+ onModelSelected
3753
3754
  }
3754
3755
  })
3755
3756
  }
@@ -3807,10 +3808,10 @@ function shouldPromoteRecentInviteRoom(params) {
3807
3808
  //#endregion
3808
3809
  //#region extensions/matrix/src/matrix/monitor/startup.ts
3809
3810
  const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
3810
- import("./setup-core-CYQRY2oG.js").then((n) => n.s),
3811
+ import("./setup-core-D6gyoyeg.js").then((n) => n.c),
3811
3812
  import("./device-health-D4LBxuPq.js"),
3812
- import("./setup-core-CYQRY2oG.js").then((n) => n.a),
3813
- import("./startup-verification-DSiyDKM5.js")
3813
+ import("./setup-core-D6gyoyeg.js").then((n) => n.o),
3814
+ import("./startup-verification-D1nscMh8.js")
3814
3815
  ]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
3815
3816
  updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
3816
3817
  summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
@@ -2,7 +2,7 @@ import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
2
2
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
3
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/matrix/src/plugin-entry.runtime.ts
5
- const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-CGnI9k1O.js").then((n) => n.y));
5
+ const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-DhMBWxOJ.js").then((n) => n.y));
6
6
  function sendError(respond, err) {
7
7
  respond(false, { error: formatMatrixErrorMessage(err) });
8
8
  }
@@ -0,0 +1,3 @@
1
+ import { t as createMatrixClient } from "./create-client-Und1YmJ2.js";
2
+ import "./client-Dg8dk8NW.js";
3
+ export { createMatrixClient };
@@ -1,6 +1,6 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
- import { c as resolveMatrixConfigPath, l as updateMatrixAccountConfig, o as syncMatrixOwnProfile } from "./setup-core-CYQRY2oG.js";
3
- import { n as withResolvedActionClient } from "./client-BUai6s29.js";
2
+ import { l as resolveMatrixConfigPath, s as syncMatrixOwnProfile, u as updateMatrixAccountConfig } from "./setup-core-D6gyoyeg.js";
3
+ import { n as withResolvedActionClient } from "./client-BwX6rURh.js";
4
4
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
5
  //#region extensions/matrix/src/matrix/actions/profile.ts
6
6
  async function updateMatrixOwnProfile(opts = {}) {