@openclaw/matrix 2026.10.10-beta.5 → 2026.10.33

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 (120) hide show
  1. package/dist/.setup/{account-selection-Bs_jCAaG.mjs → account-selection-CWsL5zIU.mjs} +1 -1
  2. package/dist/.setup/{approval-handler.runtime-6u08WKWh.mjs → approval-handler.runtime-Co2elSYS.mjs} +4 -4
  3. package/dist/.setup/{channel-CqkLHNdp.mjs → channel-BBvOdxTc.mjs} +11 -10
  4. package/dist/.setup/{channel.runtime-BfZdvlho.mjs → channel.runtime-DyX4mM8d.mjs} +6 -6
  5. package/dist/.setup/{channel.setup-ClA7V_Ba.mjs → channel.setup-p6oll48W.mjs} +6 -2
  6. package/dist/.setup/{cli-BLgMlO3I.mjs → cli-C2XKMk1U.mjs} +12 -12
  7. package/dist/.setup/{cli-metadata-COWLWR3E.mjs → cli-metadata-C60BW1oa.mjs} +1 -1
  8. package/dist/.setup/{client-C4Gibhzl.mjs → client-BEl7PU1_.mjs} +8 -8
  9. package/dist/.setup/{client-C7pZ6gAl.mjs → client-Cxv-iMwp.mjs} +3 -3
  10. package/dist/.setup/{client-bootstrap-kOIDV4z_.mjs → client-bootstrap-D1vLveT2.mjs} +1 -1
  11. package/dist/.setup/{create-client-BS8UYx6N.mjs → create-client-CrY1E3hg.mjs} +5 -5
  12. package/dist/.setup/{credentials-read-D2ULV55A.mjs → credentials-read-Dj7Hj87M.mjs} +1 -1
  13. package/dist/.setup/{credentials-CPnJZaZB.mjs → credentials-udso1z0C.mjs} +2 -2
  14. package/dist/.setup/{crypto-runtime-D8yY7kjD.mjs → crypto-runtime-DqX7VD1W.mjs} +3 -3
  15. package/dist/.setup/{crypto-state-store-D4wrCvFs.mjs → crypto-state-store-DclM-fO5.mjs} +2 -1
  16. package/dist/.setup/{crypto-store-ownership-Z_Y5WRKr.mjs → crypto-store-ownership-Dr-T40Rp.mjs} +1 -1
  17. package/dist/.setup/{crypto-unsafe-state-doctor-C8szCYmf.mjs → crypto-unsafe-state-doctor-BG9qMu0B.mjs} +4 -4
  18. package/dist/.setup/{device-health-Be60VF1w.mjs → device-health-D6_ECUVe.mjs} +1 -1
  19. package/dist/.setup/{direct-management-B3wYhx_M.mjs → direct-management-ZcjZgYEl.mjs} +1 -1
  20. package/dist/.setup/{directory-live-BpSz-FQB.mjs → directory-live-_yaRaktv.mjs} +2 -2
  21. package/dist/.setup/doctor-contract-BANpMUbP.mjs +38 -0
  22. package/dist/.setup/{draft-stream-K6Lu-JEI.mjs → draft-stream-vO_qjwJb.mjs} +2 -2
  23. package/dist/.setup/{encryption-guidance-D5_IsDIy.mjs → encryption-guidance-BLUoN4aV.mjs} +1 -1
  24. package/dist/.setup/{exec-approvals-DtNw0e04.mjs → exec-approvals-BFT-ee9F.mjs} +2 -2
  25. package/dist/.setup/{file-sync-store-CUH8EAJq.mjs → file-sync-store-BxUPmUoJ.mjs} +3 -3
  26. package/dist/.setup/{idb-persistence-BHTYPRe_.mjs → idb-persistence-C2TsCHY2.mjs} +3 -3
  27. package/dist/.setup/{inbound-dedupe-C-EBGY0B.mjs → inbound-dedupe-sW_gaR44.mjs} +1 -1
  28. package/dist/.setup/{joined-room-encryption-BAD70N5n.mjs → joined-room-encryption-DBbLkdvv.mjs} +1 -1
  29. package/dist/.setup/{logger-CXQnpXCt.mjs → logger-CuAzdD8Q.mjs} +2 -2
  30. package/dist/.setup/{logging-BKV8TYQq.mjs → logging-CoaEyRtA.mjs} +20 -14
  31. package/dist/.setup/{messages-O6G0-_xr.mjs → messages-TuEa_BPZ.mjs} +2 -2
  32. package/dist/.setup/{monitor-BSEZMFyq.mjs → monitor-B86Ll4B8.mjs} +119 -39
  33. package/dist/.setup/{onboarding-DQLF7huY.mjs → onboarding-DOLEjkg2.mjs} +5 -5
  34. package/dist/.setup/{outbound-C0bqZr89.mjs → outbound-BWsyqwt1.mjs} +2 -2
  35. package/dist/.setup/{profile-update-BbfEg9Fx.mjs → profile-update-DiXSVBki.mjs} +2 -2
  36. package/dist/.setup/{reaction-events-51DOeO0I.mjs → reaction-events-CuUeYcBC.mjs} +4 -4
  37. package/dist/.setup/{resolve-targets-BJ5sIKeM.mjs → resolve-targets-Dd70hGcM.mjs} +2 -2
  38. package/dist/.setup/{retired-state-DOCruzWd.mjs → retired-state-C4UnLIg4.mjs} +1 -37
  39. package/dist/.setup/{room-info-DAJKw-I8.mjs → room-info-C13IUffQ.mjs} +3 -3
  40. package/dist/.setup/{doctor-contract-CsTNmbMa.mjs → runtime-doctor-migrations-hxP-CXX7.mjs} +12 -48
  41. package/dist/.setup/runtime-setter-api-DtxDAM-x.mjs +3 -0
  42. package/dist/.setup/{sdk-ByU8So5S.mjs → sdk-DNW03GqJ.mjs} +9 -9
  43. package/dist/.setup/secret-contract-api-CiuSYjUy.mjs +3 -0
  44. package/dist/.setup/{send-CFx1h7xE.mjs → send-BGgwE5pV.mjs} +3 -3
  45. package/dist/.setup/{setup-bootstrap-DANlsW-o.mjs → setup-bootstrap-BCbltIf_.mjs} +2 -2
  46. package/dist/.setup/{setup-core-EQceJMZZ.mjs → setup-core-Di6NtQ_J.mjs} +4 -4
  47. package/dist/.setup/setup-plugin-api-ORC_4yEA.mjs +3 -0
  48. package/dist/.setup/sqlite-state-LByPx4Yp.mjs +37 -0
  49. package/dist/.setup/{startup-verification-UU8DUvi4.mjs → startup-verification-8xvGpdtK.mjs} +3 -2
  50. package/dist/.setup/{storage-l8V0XsGM.mjs → storage-CN4dxdtV.mjs} +14 -6
  51. package/dist/.setup/{sync-cache-state-Cnm4TCEI.mjs → sync-cache-state-L1kwjhjj.mjs} +7 -4
  52. package/dist/.setup/{thread-bindings-C0gv7BEN.mjs → thread-bindings-pNgPVdof.mjs} +4 -3
  53. package/dist/.setup/{tool-actions-DGYRJDEV.mjs → tool-actions-CFC7ZpIt.mjs} +9 -9
  54. package/dist/.setup/{verification-DUxuApWC.mjs → verification-CuT5ZBDO.mjs} +3 -3
  55. package/dist/api.js +5 -5
  56. package/dist/channel-plugin-api.js +2 -1
  57. package/dist/cli-metadata.js +2 -1
  58. package/dist/contract-api.js +2 -2
  59. package/dist/doctor-contract-api.js +46 -14
  60. package/dist/helper-api.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/plugin-entry.handlers.runtime.js +2 -2
  63. package/dist/runtime-api.js +1 -1
  64. package/dist/runtime-setter-api.js +2 -1
  65. package/dist/secret-contract-api.js +2 -1
  66. package/dist/session-binding-contract-api.js +1 -1
  67. package/dist/setup-entry.js +3 -3
  68. package/dist/setup-plugin-api.js +2 -1
  69. package/dist/thread-binding-api.js +2 -1
  70. package/dist/thread-bindings-runtime.js +2 -1
  71. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +26 -0
  72. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +2 -2
  73. package/node_modules/@openclaw/fs-safe/dist/native-config.js +14 -3
  74. package/node_modules/@openclaw/fs-safe/dist/output.js +6 -0
  75. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +2 -1
  76. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +12 -5
  77. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +2 -2
  78. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +27 -13
  79. package/node_modules/@openclaw/fs-safe/dist/root-path.js +2 -2
  80. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +3 -0
  81. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +18 -3
  82. package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +8 -3
  83. package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
  84. package/node_modules/@openclaw/fs-safe/docs/config.md +7 -1
  85. package/node_modules/@openclaw/fs-safe/docs/copy.md +10 -0
  86. package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +6 -4
  87. package/node_modules/@openclaw/fs-safe/docs/native-helper.md +6 -4
  88. package/node_modules/@openclaw/fs-safe/docs/output.md +4 -2
  89. package/node_modules/@openclaw/fs-safe/docs/security-model.md +9 -0
  90. package/node_modules/@openclaw/fs-safe/docs/watch.md +7 -1
  91. package/node_modules/@openclaw/fs-safe/package.json +15 -14
  92. package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
  93. package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
  94. package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
  95. package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
  96. package/node_modules/@openclaw/fs-safe-freebsd-arm64/fs-safe-native.node +0 -0
  97. package/node_modules/@openclaw/fs-safe-freebsd-arm64/package.json +1 -1
  98. package/node_modules/@openclaw/fs-safe-freebsd-x64/fs-safe-native.node +0 -0
  99. package/node_modules/@openclaw/fs-safe-freebsd-x64/package.json +1 -1
  100. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
  101. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
  102. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
  103. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
  104. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  105. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
  106. package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
  107. package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
  108. package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/fs-safe-native.node +0 -0
  109. package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/package.json +1 -1
  110. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
  111. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
  112. package/node_modules/matrix-js-sdk/lib/http-api/utils.js +3 -1
  113. package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +7 -1
  114. package/node_modules/matrix-js-sdk/src/http-api/utils.ts +5 -1
  115. package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +7 -1
  116. package/package.json +5 -5
  117. package/dist/.setup/runtime-setter-api-i2MOXoT3.mjs +0 -2
  118. package/dist/.setup/secret-contract-api-Dukgvike.mjs +0 -2
  119. package/dist/.setup/setup-plugin-api-f8mWghxf.mjs +0 -2
  120. package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +0 -1
@@ -1,22 +1,22 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
2
  import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.mjs";
3
- import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-EQceJMZZ.mjs";
4
- import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-CqkLHNdp.mjs";
5
- import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-ClA7V_Ba.mjs";
3
+ import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-Di6NtQ_J.mjs";
4
+ import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-BBvOdxTc.mjs";
5
+ import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-p6oll48W.mjs";
6
6
  import { n as isMatrixQualifiedUserId, r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-HhcaKX1n.mjs";
7
7
  import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-C2rMVVIQ.mjs";
8
- import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers, v as RelationType } from "./direct-management-B3wYhx_M.mjs";
9
- import { _ as isPollEventType, c as formatMatrixMessageText, d as resolveMatrixReplacementContent, h as formatPollAsText, l as isLikelyBareFilename, r as sendMessageMatrix, u as resolveMatrixMessageAttachment, v as isPollStartType, w as setBoundedMap, y as parsePollStart } from "./send-CFx1h7xE.mjs";
10
- import { t as createMatrixThreadBindingManager } from "./thread-bindings-C0gv7BEN.mjs";
11
- import { a as isMatrixStartupAbortError, c as getMatrixMonitorTaskSignal, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as createMatrixMonitorTaskRunner, u as resolveMatrixAuth } from "./client-C4Gibhzl.mjs";
12
- import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-O6G0-_xr.mjs";
8
+ import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers, v as RelationType } from "./direct-management-ZcjZgYEl.mjs";
9
+ import { _ as isPollEventType, c as formatMatrixMessageText, d as resolveMatrixReplacementContent, h as formatPollAsText, l as isLikelyBareFilename, r as sendMessageMatrix, u as resolveMatrixMessageAttachment, v as isPollStartType, w as setBoundedMap, y as parsePollStart } from "./send-BGgwE5pV.mjs";
10
+ import { t as createMatrixThreadBindingManager } from "./thread-bindings-pNgPVdof.mjs";
11
+ import { a as isMatrixStartupAbortError, c as getMatrixMonitorTaskSignal, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as createMatrixMonitorTaskRunner, u as resolveMatrixAuth } from "./client-BEl7PU1_.mjs";
12
+ import { i as readMatrixMessages, l as fetchMatrixPollSnapshot } from "./messages-TuEa_BPZ.mjs";
13
13
  import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-ByR4STVQ.mjs";
14
- import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-C0bqZr89.mjs";
15
- import { t as resolveMatrixTargets } from "./resolve-targets-BJ5sIKeM.mjs";
16
- import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-D5_IsDIy.mjs";
17
- import { createMatrixInboundEventDeduper } from "./inbound-dedupe-C-EBGY0B.mjs";
14
+ import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-BWsyqwt1.mjs";
15
+ import { t as resolveMatrixTargets } from "./resolve-targets-Dd70hGcM.mjs";
16
+ import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-BLUoN4aV.mjs";
17
+ import { createMatrixInboundEventDeduper } from "./inbound-dedupe-sW_gaR44.mjs";
18
18
  import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-D-xHScuo.mjs";
19
- import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-DAJKw-I8.mjs";
19
+ import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-C13IUffQ.mjs";
20
20
  import { channelBlockedPatch, channelReadyPatch, channelStoppedPatch, createTransportActivityStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
21
21
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
22
22
  import { createChannelDeliveryAccumulator, createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, createReplyPrefixOptions, createTypingCallbacks, logTypingFailure, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
@@ -747,7 +747,7 @@ const matrixVerificationConstants = {
747
747
  const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
748
748
  const SAS_NOTICE_RETRY_DELAY_MS = 750;
749
749
  const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
750
- const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-B3wYhx_M.mjs").then((n) => n.t), import("./direct-management-B3wYhx_M.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
750
+ const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-ZcjZgYEl.mjs").then((n) => n.t), import("./direct-management-ZcjZgYEl.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
751
751
  inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
752
752
  isStrictDirectRoom: directRoomModule.isStrictDirectRoom
753
753
  })));
@@ -1574,11 +1574,11 @@ function formatMatrixToolProgressMarkdownCode(text) {
1574
1574
  }
1575
1575
  //#endregion
1576
1576
  //#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
1577
- const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-CFx1h7xE.mjs").then((n) => n.s));
1577
+ const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-BGgwE5pV.mjs").then((n) => n.s));
1578
1578
  const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
1579
1579
  const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
1580
- const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-51DOeO0I.mjs"));
1581
- const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-K6Lu-JEI.mjs"));
1580
+ const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-CuUeYcBC.mjs"));
1581
+ const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-vO_qjwJb.mjs"));
1582
1582
  async function matrixTextWouldActivateMentions(client, text) {
1583
1583
  const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
1584
1584
  const mentions = await resolveMatrixMentionsForBody({
@@ -2374,8 +2374,69 @@ function decodeVisibleHtmlEntities(value) {
2374
2374
  return decoded === "\xA0" ? " " : decoded;
2375
2375
  });
2376
2376
  }
2377
+ /**
2378
+ * Replaces each `<[^>]+>` with a space. No tag can end after the last `>`, so the
2379
+ * regex only runs on that prefix and an unterminated `<` run stays linear.
2380
+ */
2381
+ function stripHtmlTags(value) {
2382
+ const end = value.lastIndexOf(">") + 1;
2383
+ return value.slice(0, end).replace(/<[^>]+>/g, " ") + value.slice(end);
2384
+ }
2385
+ /**
2386
+ * `href` and label of each anchor, matching the captures of
2387
+ * `/<a\b[^>]*href=(["'])(https:\/\/matrix\.to\/#[^"']+)\1[^>]*>(.*?)<\/a>/gis`: the last
2388
+ * usable `href=` inside the opening tag wins, the quoted value may contain `>`, and the
2389
+ * label ends at the first `</a>`. Each `<a` start is resolved from precomputed next-`>`,
2390
+ * next-quote and next-`</a>` positions plus a forward-only candidate cursor, so the scan
2391
+ * is linear in the length of sender-controlled HTML.
2392
+ */
2393
+ function* matrixToAnchors(html) {
2394
+ const length = html.length;
2395
+ const nextGt = new Int32Array(length + 1).fill(length);
2396
+ const nextQuote = new Int32Array(length + 1).fill(length);
2397
+ for (let index = length - 1; index >= 0; index -= 1) {
2398
+ const char = html[index];
2399
+ nextGt[index] = char === ">" ? index : nextGt[index + 1];
2400
+ nextQuote[index] = char === "\"" || char === "'" ? index : nextQuote[index + 1];
2401
+ }
2402
+ const closes = Array.from(html.matchAll(/<\/a>/gi), (match) => match.index);
2403
+ let nextClose = 0;
2404
+ const candidates = [];
2405
+ for (const match of html.matchAll(/href=(["'])https:\/\/matrix\.to\/#/gi)) {
2406
+ const valueStart = match.index + 5 + 1;
2407
+ const restStart = match.index + match[0].length;
2408
+ const valueEnd = nextQuote[restStart];
2409
+ if (valueEnd === restStart || valueEnd === length || html[valueEnd] !== match[1]) continue;
2410
+ const tagEnd = nextGt[valueEnd + 1];
2411
+ if (tagEnd === length) continue;
2412
+ while (nextClose < closes.length && closes[nextClose] <= tagEnd) nextClose += 1;
2413
+ if (nextClose === closes.length) break;
2414
+ candidates.push({
2415
+ start: match.index,
2416
+ href: html.slice(valueStart, valueEnd),
2417
+ labelStart: tagEnd + 1,
2418
+ labelEnd: closes[nextClose]
2419
+ });
2420
+ }
2421
+ let resumeAt = 0;
2422
+ let candidatesBefore = 0;
2423
+ for (const open of html.matchAll(/<a\b/gi)) {
2424
+ if (open.index < resumeAt) continue;
2425
+ const firstStart = open.index + open[0].length;
2426
+ const lastStart = nextGt[firstStart] - 1;
2427
+ while (candidatesBefore < candidates.length && candidates[candidatesBefore].start <= lastStart) candidatesBefore += 1;
2428
+ const candidate = candidates[candidatesBefore - 1];
2429
+ if (candidate && candidate.start >= firstStart) {
2430
+ yield {
2431
+ href: candidate.href,
2432
+ label: html.slice(candidate.labelStart, candidate.labelEnd)
2433
+ };
2434
+ resumeAt = candidate.labelEnd + 4;
2435
+ }
2436
+ }
2437
+ }
2377
2438
  function extractVisibleMentionText(value) {
2378
- return normalizeLowercaseStringOrEmpty(decodeVisibleHtmlEntities((value ?? "").replace(/<[^>]+>/g, " ").replace(/[\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g, "")).replace(/\s+/g, " "));
2439
+ return normalizeLowercaseStringOrEmpty(decodeVisibleHtmlEntities(stripHtmlTags(value ?? "").replace(/[\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g, "")).replace(/\s+/g, " "));
2379
2440
  }
2380
2441
  function resolveMatrixUserLocalpart(userId) {
2381
2442
  const trimmed = userId.trim();
@@ -2453,22 +2514,17 @@ function hasVisibleRoomMention(value) {
2453
2514
  */
2454
2515
  function checkFormattedBodyMention(params) {
2455
2516
  if (!params.formattedBody || !params.userId) return false;
2456
- for (const match of params.formattedBody.matchAll(/<a\b[^>]*href=(["'])(https:\/\/matrix\.to\/#[^"']+)\1[^>]*>(.*?)<\/a>/gis)) {
2457
- const href = match[2];
2458
- const visibleLabel = match[3] ?? "";
2459
- if (!href) continue;
2460
- try {
2461
- const parsed = new URL(href);
2462
- if (decodeURIComponent(parsed.hash.replace(/^#\/?/, "").trim()) !== params.userId.trim()) continue;
2463
- if (isVisibleMentionLabel({
2464
- text: visibleLabel,
2465
- userId: params.userId,
2466
- mentionRegexes: params.mentionRegexes,
2467
- displayName: params.displayName
2468
- })) return true;
2469
- } catch {
2470
- continue;
2471
- }
2517
+ for (const { href, label: visibleLabel } of matrixToAnchors(params.formattedBody)) try {
2518
+ const parsed = new URL(href);
2519
+ if (decodeURIComponent(parsed.hash.replace(/^#\/?/, "").trim()) !== params.userId.trim()) continue;
2520
+ if (isVisibleMentionLabel({
2521
+ text: visibleLabel,
2522
+ userId: params.userId,
2523
+ mentionRegexes: params.mentionRegexes,
2524
+ displayName: params.displayName
2525
+ })) return true;
2526
+ } catch {
2527
+ continue;
2472
2528
  }
2473
2529
  return false;
2474
2530
  }
@@ -3597,10 +3653,10 @@ function shouldPromoteRecentInviteRoom(params) {
3597
3653
  //#endregion
3598
3654
  //#region extensions/matrix/src/matrix/monitor/startup.ts
3599
3655
  const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
3600
- import("./setup-core-EQceJMZZ.mjs").then((n) => n.f),
3601
- import("./device-health-Be60VF1w.mjs").then((n) => n.t),
3602
- import("./setup-core-EQceJMZZ.mjs").then((n) => n.u),
3603
- import("./startup-verification-UU8DUvi4.mjs")
3656
+ import("./setup-core-Di6NtQ_J.mjs").then((n) => n.f),
3657
+ import("./device-health-D6_ECUVe.mjs").then((n) => n.t),
3658
+ import("./setup-core-Di6NtQ_J.mjs").then((n) => n.u),
3659
+ import("./startup-verification-8xvGpdtK.mjs")
3604
3660
  ]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
3605
3661
  updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
3606
3662
  summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
@@ -3690,7 +3746,17 @@ function createMatrixMonitorStatusController(params) {
3690
3746
  lastDisconnect: cloneLastDisconnect(status.lastDisconnect)
3691
3747
  });
3692
3748
  };
3749
+ let startupComplete = params.deferReadyUntilStartupComplete !== true;
3750
+ let pendingReadyAt = null;
3751
+ let pendingTransportActivity = false;
3693
3752
  const noteConnected = (at = Date.now(), options) => {
3753
+ if (!startupComplete) {
3754
+ pendingReadyAt = at;
3755
+ pendingTransportActivity ||= options?.transportActivity === true;
3756
+ status.lastEventAt = at;
3757
+ emit();
3758
+ return;
3759
+ }
3694
3760
  const lastConnectedAt = status.connected === true ? status.lastConnectedAt ?? at : at;
3695
3761
  Object.assign(status, channelReadyPatch({
3696
3762
  lastConnectedAt,
@@ -3703,6 +3769,8 @@ function createMatrixMonitorStatusController(params) {
3703
3769
  };
3704
3770
  const noteDisconnected = (paramsLocal) => {
3705
3771
  const at = paramsLocal.at ?? Date.now();
3772
+ pendingReadyAt = null;
3773
+ pendingTransportActivity = false;
3706
3774
  const tokenInvalidated = isMatrixAccessTokenInvalidatedError(paramsLocal.error);
3707
3775
  if (status.lifecycle === "blocked" && status.terminalDisconnect === true && !tokenInvalidated) {
3708
3776
  status.connected = false;
@@ -3728,6 +3796,16 @@ function createMatrixMonitorStatusController(params) {
3728
3796
  };
3729
3797
  emit();
3730
3798
  return {
3799
+ markStartupComplete(at = Date.now()) {
3800
+ startupComplete = true;
3801
+ if (pendingReadyAt !== null) {
3802
+ const readyAt = Math.max(pendingReadyAt, at);
3803
+ const transportActivity = pendingTransportActivity;
3804
+ pendingReadyAt = null;
3805
+ pendingTransportActivity = false;
3806
+ noteConnected(readyAt, { transportActivity });
3807
+ }
3808
+ },
3731
3809
  noteSyncState(state, error, at = Date.now()) {
3732
3810
  if (isMatrixReadySyncState(state)) {
3733
3811
  noteConnected(at, { transportActivity: state === "SYNCING" });
@@ -3912,7 +3990,8 @@ async function monitorMatrixProvider(opts = {}) {
3912
3990
  const statusController = createMatrixMonitorStatusController({
3913
3991
  accountId: auth.accountId,
3914
3992
  baseUrl: auth.homeserver,
3915
- statusSink: opts.setStatus
3993
+ statusSink: opts.setStatus,
3994
+ deferReadyUntilStartupComplete: true
3916
3995
  });
3917
3996
  let cleanedUp = false;
3918
3997
  let cleanupPromise = null;
@@ -4195,6 +4274,7 @@ async function monitorMatrixProvider(opts = {}) {
4195
4274
  await cleanup("stop");
4196
4275
  return;
4197
4276
  }
4277
+ statusController.markStartupComplete();
4198
4278
  await Promise.race([waitUntilAbort(monitorLifecycleSignal, async () => {
4199
4279
  try {
4200
4280
  logVerboseMessage("matrix: stopping client");
@@ -1,7 +1,7 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
2
- import { i as requiresExplicitMatrixDefaultAccount, u as resolveMatrixEnvAuthReadiness } from "./account-selection-Bs_jCAaG.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
+ import { i as requiresExplicitMatrixDefaultAccount, u as resolveMatrixEnvAuthReadiness } from "./account-selection-CWsL5zIU.mjs";
3
3
  import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
4
- import { a as createMatrixSetupDmPolicy, g as resolveDefaultMatrixAccountId, m as listMatrixAccountIds, n as finishMatrixSetupAfterConfigWrite, o as moveSingleMatrixAccountConfigToNamedAccount, p as updateMatrixAccountConfig, v as resolveMatrixAccountAsync } from "./setup-core-EQceJMZZ.mjs";
4
+ import { a as createMatrixSetupDmPolicy, g as resolveDefaultMatrixAccountId, m as listMatrixAccountIds, n as finishMatrixSetupAfterConfigWrite, o as moveSingleMatrixAccountConfigToNamedAccount, p as updateMatrixAccountConfig, v as resolveMatrixAccountAsync } from "./setup-core-Di6NtQ_J.mjs";
5
5
  import { r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-HhcaKX1n.mjs";
6
6
  import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-CF6pG6eE.mjs";
7
7
  import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-L_1bUAGL.mjs";
@@ -87,7 +87,7 @@ async function promptMatrixAllowFrom(params) {
87
87
  pending.push(part);
88
88
  }
89
89
  if (pending.length > 0) {
90
- const { resolveMatrixTargets } = await import("./resolve-targets-BJ5sIKeM.mjs").then((n) => n.n);
90
+ const { resolveMatrixTargets } = await import("./resolve-targets-Dd70hGcM.mjs").then((n) => n.n);
91
91
  const results = await resolveMatrixTargets({
92
92
  cfg,
93
93
  accountId,
@@ -204,7 +204,7 @@ async function configureMatrixAccessPrompts(params) {
204
204
  resolvedIds.push(cleaned);
205
205
  continue;
206
206
  }
207
- const { listMatrixDirectoryGroupsLive } = await import("./directory-live-BpSz-FQB.mjs").then((n) => n.t);
207
+ const { listMatrixDirectoryGroupsLive } = await import("./directory-live-_yaRaktv.mjs").then((n) => n.t);
208
208
  const matches = await listMatrixDirectoryGroupsLive({
209
209
  cfg: next,
210
210
  accountId: params.accountId,
@@ -1,5 +1,5 @@
1
- import { r as matrixPresentationCapabilities } from "./channel-CqkLHNdp.mjs";
2
- import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-CFx1h7xE.mjs";
1
+ import { r as matrixPresentationCapabilities } from "./channel-BBvOdxTc.mjs";
2
+ import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-BGgwE5pV.mjs";
3
3
  import { createMessageReceiptFromOutboundResults, createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
4
4
  import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
@@ -1,7 +1,7 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
- import { d as syncMatrixOwnProfile, p as updateMatrixAccountConfig } from "./setup-core-EQceJMZZ.mjs";
2
+ import { d as syncMatrixOwnProfile, p as updateMatrixAccountConfig } from "./setup-core-Di6NtQ_J.mjs";
3
3
  import { n as resolveMatrixConfigPath } from "./config-paths-CnREYb1Y.mjs";
4
- import { n as withResolvedActionClient } from "./client-C7pZ6gAl.mjs";
4
+ import { n as withResolvedActionClient } from "./client-Cxv-iMwp.mjs";
5
5
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
6
6
  //#region extensions/matrix/src/matrix/actions/profile.ts
7
7
  async function updateMatrixOwnProfile(opts = {}) {
@@ -1,16 +1,16 @@
1
1
  import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
2
- import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync } from "./channel-CqkLHNdp.mjs";
2
+ import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRouteAsync } from "./channel-BBvOdxTc.mjs";
3
3
  import { c as extractMatrixReactionAnnotation } from "./send-currentness-C2rMVVIQ.mjs";
4
- import { p as resolveMatrixThreadRootId } from "./direct-management-B3wYhx_M.mjs";
4
+ import { p as resolveMatrixThreadRootId } from "./direct-management-ZcjZgYEl.mjs";
5
5
  import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-D2pEUrFS.mjs";
6
6
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
7
7
  import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
8
8
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
9
9
  import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
10
10
  //#region extensions/matrix/src/matrix/monitor/reaction-events.ts
11
- const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-CqkLHNdp.mjs").then((n) => n.s));
11
+ const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-BBvOdxTc.mjs").then((n) => n.s));
12
12
  const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
13
- const loadMatrixSend = createLazyRuntimeModule(() => import("./send-CFx1h7xE.mjs").then((n) => n.s));
13
+ const loadMatrixSend = createLazyRuntimeModule(() => import("./send-BGgwE5pV.mjs").then((n) => n.s));
14
14
  function buildMatrixApprovalTerminalText(result) {
15
15
  const approval = result.approval;
16
16
  const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
@@ -1,6 +1,6 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
2
  import { i as normalizeMatrixMessagingTarget, n as isMatrixQualifiedUserId } from "./target-ids-HhcaKX1n.mjs";
3
- import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-BpSz-FQB.mjs";
3
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-_yaRaktv.mjs";
4
4
  import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/matrix/src/resolve-targets.ts
6
6
  var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
@@ -1,8 +1,6 @@
1
- import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
1
  import { extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
3
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
3
  import path from "node:path";
5
- import os from "node:os";
6
4
  import fs from "node:fs/promises";
7
5
  //#region extensions/matrix/src/matrix/chunked-state.ts
8
6
  function chunkMatrixStateJson(value, maxBytes, maxChunks, limitMessage) {
@@ -46,40 +44,6 @@ async function writeMatrixStateChunks(store, rows, chunkKeyPrefix) {
46
44
  for (const row of await store.entries()) if (row.key.startsWith(chunkKeyPrefix) && !nextChunkKeys.has(row.key)) await store.delete(row.key);
47
45
  }
48
46
  //#endregion
49
- //#region extensions/matrix/src/matrix/sqlite-state.ts
50
- function resolveStateDirOverride(options) {
51
- if (!options) return;
52
- return options.stateDir || options.stateRootDir || getMatrixRuntime().state.resolveStateDir(options.env ?? process.env, os.homedir);
53
- }
54
- function resolveMatrixSqliteStateKey(options) {
55
- return resolveStateDirOverride(options) ?? "";
56
- }
57
- function resolveMatrixSqliteStateEnv(options) {
58
- const stateDir = resolveStateDirOverride(options);
59
- if (!stateDir) return options?.env;
60
- return {
61
- ...options?.env ?? process.env,
62
- OPENCLAW_STATE_DIR: stateDir
63
- };
64
- }
65
- async function updateMatrixKeyedState(store, key, update, onUndefined = "keep") {
66
- let observation = await store.observe(key);
67
- for (;;) {
68
- const value = update(observation.value);
69
- if (value === void 0 && onUndefined === "skip") return false;
70
- const result = await store.compareAndApply(key, observation.comparison, value === void 0 ? {
71
- operation: "update",
72
- action: "keep"
73
- } : {
74
- operation: "update",
75
- action: "set",
76
- value
77
- });
78
- if (result.status !== "conflict") return true;
79
- observation = result.current;
80
- }
81
- }
82
- //#endregion
83
47
  //#region extensions/matrix/src/matrix/retired-state.ts
84
48
  const RETIRED_MATRIX_STATE_FILENAMES = /* @__PURE__ */ new Set([
85
49
  "thread-bindings.json",
@@ -107,4 +71,4 @@ async function assertMatrixSupportedStateFile(filePath) {
107
71
  throw new Error(describeRetiredMatrixState(filePath));
108
72
  }
109
73
  //#endregion
110
- export { describeRetiredMatrixState as a, updateMatrixKeyedState as c, writeMatrixStateChunks as d, assertMatrixSupportedStateRoot as i, chunkMatrixStateJson as l, RETIRED_MATRIX_STATE_REMEDIATION as n, resolveMatrixSqliteStateEnv as o, assertMatrixSupportedStateFile as r, resolveMatrixSqliteStateKey as s, RETIRED_MATRIX_STATE_FILENAMES as t, readMatrixStateChunks as u };
74
+ export { describeRetiredMatrixState as a, writeMatrixStateChunks as c, assertMatrixSupportedStateRoot as i, RETIRED_MATRIX_STATE_REMEDIATION as n, chunkMatrixStateJson as o, assertMatrixSupportedStateFile as r, readMatrixStateChunks as s, RETIRED_MATRIX_STATE_FILENAMES as t };
@@ -1,6 +1,6 @@
1
- import { w as setBoundedMap } from "./send-CFx1h7xE.mjs";
2
- import { s as EventType } from "./messages-O6G0-_xr.mjs";
3
- import { r as withResolvedRoomAction } from "./client-C7pZ6gAl.mjs";
1
+ import { w as setBoundedMap } from "./send-BGgwE5pV.mjs";
2
+ import { s as EventType } from "./messages-TuEa_BPZ.mjs";
3
+ import { r as withResolvedRoomAction } from "./client-Cxv-iMwp.mjs";
4
4
  import { n as isMatrixNotFoundError } from "./errors-Bw4EHwKX.mjs";
5
5
  import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  //#region extensions/matrix/src/matrix/actions/room.ts
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
2
  //#region \0rolldown/runtime.js
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -28,18 +27,18 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
28
27
  //#endregion
29
28
  //#region packages/normalization-core/src/record-coerce.ts
30
29
  /** Type guard for non-array object records at browser-safe boundaries. */
31
- function isRecord$1(value) {
30
+ function isRecord(value) {
32
31
  return value !== null && typeof value === "object" && !Array.isArray(value);
33
32
  }
34
33
  /** Returns a non-array record or null. */
35
- function asNullableRecord$1(value) {
36
- return isRecord$1(value) ? value : null;
34
+ function asNullableRecord(value) {
35
+ return isRecord(value) ? value : null;
37
36
  }
38
37
  //#endregion
39
38
  //#region src/config/channel-config-normalization.ts
40
39
  /** Applies one channel-specific doctor migration to every object-shaped account. */
41
40
  function normalizeChannelAccounts(params) {
42
- const rawAccounts = asNullableRecord$1(params.entry.accounts);
41
+ const rawAccounts = asNullableRecord(params.entry.accounts);
43
42
  if (!rawAccounts) return {
44
43
  entry: params.entry,
45
44
  changed: false
@@ -47,7 +46,7 @@ function normalizeChannelAccounts(params) {
47
46
  let changed = false;
48
47
  const accounts = { ...rawAccounts };
49
48
  for (const [accountId, value] of Object.entries(rawAccounts)) {
50
- const account = asNullableRecord$1(value);
49
+ const account = asNullableRecord(value);
51
50
  if (!account) continue;
52
51
  const normalized = params.normalizeAccount({
53
52
  account,
@@ -75,7 +74,7 @@ function normalizeChannelAccounts(params) {
75
74
  function normalizeChannelConfigEntries(params) {
76
75
  const changes = params.changes ?? [];
77
76
  const channels = params.cfg.channels;
78
- const entry = asNullableRecord$1(channels?.[params.channelId]);
77
+ const entry = asNullableRecord(channels?.[params.channelId]);
79
78
  if (!entry) return {
80
79
  config: params.cfg,
81
80
  changes
@@ -118,9 +117,9 @@ function normalizeChannelConfigEntries(params) {
118
117
  function createLegacyWebhookListenerDoctorContract(params) {
119
118
  const portKey = params.portKey ?? "webhookPort";
120
119
  const hostKey = params.hostKey === void 0 ? "webhookHost" : params.hostKey;
121
- const source = (entry) => params.webhookKey ? asNullableRecord$1(entry[params.webhookKey]) : entry;
120
+ const source = (entry) => params.webhookKey ? asNullableRecord(entry[params.webhookKey]) : entry;
122
121
  const hasLegacy = (value) => {
123
- const entry = asNullableRecord$1(value);
122
+ const entry = asNullableRecord(value);
124
123
  const listener = entry && source(entry);
125
124
  return Boolean(listener && (Object.hasOwn(listener, portKey) || hostKey && Object.hasOwn(listener, hostKey)));
126
125
  };
@@ -136,14 +135,14 @@ function createLegacyWebhookListenerDoctorContract(params) {
136
135
  path: ["channels", params.channelKey],
137
136
  message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
138
137
  match: (value) => {
139
- const accounts = asNullableRecord$1(asNullableRecord$1(value)?.accounts);
138
+ const accounts = asNullableRecord(asNullableRecord(value)?.accounts);
140
139
  return hasLegacy(value) || Object.values(accounts ?? {}).some(hasLegacy);
141
140
  }
142
141
  }],
143
142
  normalizeCompatibilityConfig: ({ cfg }) => {
144
- const root = asNullableRecord$1(asNullableRecord$1(cfg.channels)?.[params.channelKey]);
143
+ const root = asNullableRecord(asNullableRecord(cfg.channels)?.[params.channelKey]);
145
144
  const inherited = root && source(root);
146
- const canonicalRoot = asNullableRecord$1(root?.legacyWebhook);
145
+ const canonicalRoot = asNullableRecord(root?.legacyWebhook);
147
146
  return normalizeChannelConfigEntries({
148
147
  cfg,
149
148
  channelId: params.channelKey,
@@ -189,39 +188,4 @@ var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLega
189
188
  import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
190
189
  __reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
191
190
  //#endregion
192
- //#region extensions/matrix/src/doctor-contract.ts
193
- function parseMatrixStreamingMode(value) {
194
- if (typeof value !== "string") return null;
195
- const normalized = value.trim().toLowerCase();
196
- return normalized === "partial" || normalized === "quiet" || normalized === "progress" || normalized === "off" ? normalized : null;
197
- }
198
- const streamingAliasMigration = (0, runtime_doctor_migrations_exports.defineChannelAliasMigration)({
199
- channelId: "matrix",
200
- streaming: {
201
- defaultMode: "off",
202
- resolveMode: (entry) => {
203
- const streaming = isRecord(entry.streaming) ? entry.streaming : null;
204
- const parsed = parseMatrixStreamingMode(streaming ? streaming.mode : entry.streaming);
205
- if (parsed) return parsed;
206
- return entry.streaming === true ? "partial" : "off";
207
- }
208
- },
209
- accountStreamingReplacesRoot: true
210
- });
211
- const legacyConfigRules = streamingAliasMigration.legacyConfigRules;
212
- function normalizeCompatibilityConfig({ cfg }) {
213
- const changes = [];
214
- const withoutJunkStreamMode = (0, runtime_doctor_migrations_exports.stripRetiredChannelKeys)({
215
- cfg,
216
- channelId: "matrix",
217
- keys: /* @__PURE__ */ new Set(["streamMode"]),
218
- scope: "root-and-accounts",
219
- onRemove: ({ key, pathPrefix }) => changes.push(`Removed ${pathPrefix}.${key} (never read by the Matrix runtime).`)
220
- }).config;
221
- return streamingAliasMigration.normalizeChannelConfig({
222
- cfg: withoutJunkStreamMode,
223
- changes
224
- });
225
- }
226
- //#endregion
227
- export { __exportAll as i, normalizeCompatibilityConfig as n, runtime_doctor_migrations_exports as r, legacyConfigRules as t };
191
+ export { __exportAll as n, runtime_doctor_migrations_exports as t };
@@ -0,0 +1,3 @@
1
+ import { a as setMatrixRuntimeLifecycle, i as setMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
+ import "../runtime-setter-api.js";
3
+ export { setMatrixRuntime, setMatrixRuntimeLifecycle };
@@ -1,16 +1,16 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
2
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
3
- import { r as assertMatrixSupportedStateFile } from "./retired-state-DOCruzWd.mjs";
4
- import { a as readMatrixRecoveryKeyStateForPathAsync, l as writeMatrixRecoveryKeyStateForPathAsync } from "./crypto-state-store-D4wrCvFs.mjs";
3
+ import { r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
4
+ import { a as readMatrixRecoveryKeyStateForPathAsync, l as writeMatrixRecoveryKeyStateForPathAsync } from "./crypto-state-store-DclM-fO5.mjs";
5
5
  import { n as withMatrixSendCurrentness, r as withoutMatrixSendCurrentness, t as captureMatrixSendCurrentness } from "./send-currentness-C2rMVVIQ.mjs";
6
6
  import { i as parseMxc, r as matrixEventToRaw } from "./event-helpers-CxNgMQqH.mjs";
7
- import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-C4Gibhzl.mjs";
7
+ import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-BEl7PU1_.mjs";
8
8
  import { n as isMatrixNotFoundError, t as formatMatrixErrorReason } from "./errors-Bw4EHwKX.mjs";
9
9
  import { n as createMatrixGuardedFetch, t as MatrixAuthedHttpClient } from "./http-client-ByR4STVQ.mjs";
10
10
  import { n as resolveMatrixRoomKeyBackupReadinessError } from "./backup-health-Dm_YMVFT.mjs";
11
- import { r as noop, t as LogService } from "./logger-CXQnpXCt.mjs";
12
- import { t as createMatrixJsSdkClientLogger } from "./logging-BKV8TYQq.mjs";
13
- import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-Z_Y5WRKr.mjs";
11
+ import { r as noop, t as LogService } from "./logger-CuAzdD8Q.mjs";
12
+ import { t as createMatrixJsSdkClientLogger } from "./logging-CoaEyRtA.mjs";
13
+ import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-Dr-T40Rp.mjs";
14
14
  import { a as isMatrixAccessTokenInvalidatedError, c as resolveMatrixLocalTimeoutMs, f as isMatrixReadySyncState, i as createMatrixExplicitBootstrapOptions, l as unresolvedMatrixDeviceVerificationStatus, n as MATRIX_INITIAL_CRYPTO_BOOTSTRAP_OPTIONS, o as resolveMatrixDiagnostic, p as isMatrixTerminalSyncState, r as MATRIX_STATUS_DIAGNOSTIC_TIMEOUT_MS, s as resolveMatrixDiagnosticResult, t as MATRIX_AUTOMATIC_REPAIR_BOOTSTRAP_OPTIONS, u as unresolvedMatrixRoomKeyBackupStatus } from "./client-support-D-xHScuo.mjs";
15
15
  import { t as MATRIX_IDB_PERSIST_INTERVAL_MS } from "./idb-persistence-lock-Bh3ZLIsE.mjs";
16
16
  import { createRequire } from "node:module";
@@ -818,7 +818,7 @@ var MatrixSendScheduler = class extends MatrixScheduler {
818
818
  //#region extensions/matrix/src/matrix/sdk/client-base.ts
819
819
  const MATRIX_ENCRYPTED_STARTUP_TIMEOUT_MS = 6e4;
820
820
  let loadedMatrixCryptoRuntime = null;
821
- const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-D8yY7kjD.mjs").then((runtime) => {
821
+ const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-DqX7VD1W.mjs").then((runtime) => {
822
822
  loadedMatrixCryptoRuntime = runtime;
823
823
  return runtime;
824
824
  }));
@@ -1048,7 +1048,7 @@ var MatrixClientBase = class {
1048
1048
  checkActive();
1049
1049
  throwIfMatrixStartupAborted(signal);
1050
1050
  if (this.encryptionEnabled && this.cryptoInitialized) {
1051
- const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-BAD70N5n.mjs");
1051
+ const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-DBbLkdvv.mjs");
1052
1052
  checkActive();
1053
1053
  await this.withClientCryptoWork(() => reconcileJoinedRoomEncryption(this.client, signal, checkActive), signal);
1054
1054
  checkActive();
@@ -0,0 +1,3 @@
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-DxyzKSzf.mjs";
2
+ import "../secret-contract-api.js";
3
+ export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,9 +1,9 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
2
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
3
3
  import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
4
4
  import { a as normalizeMatrixResolvableTarget, n as isMatrixQualifiedUserId } from "./target-ids-HhcaKX1n.mjs";
5
5
  import { n as withMatrixSendCurrentness, o as buildMatrixReactionContent, t as captureMatrixSendCurrentness } from "./send-currentness-C2rMVVIQ.mjs";
6
- import { _ as MsgType, d as buildMatrixMessageRelation, f as resolveMatrixReplyToEventId, g as MSC4357_LIVE_KEY, l as isStrictDirectRoom, m as EventType, n as inspectMatrixDirectRooms, p as resolveMatrixThreadRootId, r as persistMatrixDirectRoomMapping, v as RelationType } from "./direct-management-B3wYhx_M.mjs";
6
+ import { _ as MsgType, d as buildMatrixMessageRelation, f as resolveMatrixReplyToEventId, g as MSC4357_LIVE_KEY, l as isStrictDirectRoom, m as EventType, n as inspectMatrixDirectRooms, p as resolveMatrixThreadRootId, r as persistMatrixDirectRoomMapping, v as RelationType } from "./direct-management-ZcjZgYEl.mjs";
7
7
  import { n as getMatrixEventProjection } from "./event-helpers-CxNgMQqH.mjs";
8
8
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
9
9
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
@@ -23,7 +23,7 @@ import MarkdownIt from "markdown-it";
23
23
  import { isAutoLinkedFileRef } from "openclaw/plugin-sdk/text-autolink-runtime";
24
24
  import { parseBuffer } from "music-metadata";
25
25
  //#region extensions/matrix/src/matrix/send/client.ts
26
- const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-kOIDV4z_.mjs"));
26
+ const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-D1vLveT2.mjs"));
27
27
  function resolveMediaMaxBytes(accountId, cfg) {
28
28
  if (!cfg) throw new Error("Matrix media limits requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
29
29
  const mediaMaxMb = resolveMatrixAccountConfig({
@@ -1,6 +1,6 @@
1
1
  import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
2
- import "./setup-core-EQceJMZZ.mjs";
3
- import { n as bootstrapMatrixVerification } from "./verification-DUxuApWC.mjs";
2
+ import "./setup-core-Di6NtQ_J.mjs";
3
+ import { n as bootstrapMatrixVerification } from "./verification-CuT5ZBDO.mjs";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
5
  //#region extensions/matrix/src/setup-bootstrap.ts
6
6
  async function maybeBootstrapNewEncryptedMatrixAccount(params) {
@@ -1,7 +1,7 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
2
- import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-Bs_jCAaG.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
+ import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-CWsL5zIU.mjs";
3
3
  import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
4
- import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-D2ULV55A.mjs";
4
+ import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-Dj7Hj87M.mjs";
5
5
  import { n as resolveMatrixConfigPath, r as shouldStoreMatrixAccountAtTopLevel, t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
6
6
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
7
7
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -552,7 +552,7 @@ function createMatrixSetupWizardProxy(loadWizardModule) {
552
552
  };
553
553
  }
554
554
  const finishMatrixSetupAfterConfigWrite = async ({ previousCfg, cfg, accountId, runtime }) => {
555
- const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-DANlsW-o.mjs");
555
+ const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-BCbltIf_.mjs");
556
556
  await runMatrixSetupBootstrapAfterConfigWrite({
557
557
  previousCfg,
558
558
  cfg,
@@ -0,0 +1,3 @@
1
+ import { n as matrixSetupPlugin } from "./channel.setup-p6oll48W.mjs";
2
+ import "../setup-plugin-api.js";
3
+ export { matrixSetupPlugin };