@openclaw/matrix 2026.8.1 → 2026.8.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 (117) hide show
  1. package/dist/{account-selection-C8nnBTxi.js → .setup/account-selection-DZMazUgX.mjs} +12 -10
  2. package/dist/{accounts-fC57n-Jo.js → .setup/accounts-BJ6ECCac.mjs} +3 -3
  3. package/dist/{approval-handler.runtime-BBjFZw1t.js → .setup/approval-handler.runtime-CdT1wQve.mjs} +6 -6
  4. package/dist/{approval-ids-DTIdXV-m.js → .setup/approval-ids-CU_nMQy9.mjs} +1 -1
  5. package/dist/{approval-reaction-auth-BDONXxnF.js → .setup/approval-reaction-auth-CpxhvOOT.mjs} +2 -2
  6. package/dist/{approval-reactions-tXh9KYrW.js → .setup/approval-reactions-D5eegob9.mjs} +2 -2
  7. package/dist/{channel-BkEcVUs_.js → .setup/channel-Q_N83Wwa.mjs} +57 -59
  8. package/dist/{channel.runtime-CTLSBFsP.js → .setup/channel.runtime-BFXlZFP1.mjs} +17 -13
  9. package/dist/{channel.setup-CSacbORr.js → .setup/channel.setup-2A6HBRbA.mjs} +22 -20
  10. package/dist/{cli-DRVtgrq5.js → .setup/cli-CyuDGiIr.mjs} +43 -34
  11. package/dist/{cli-metadata-Ddx_y4Os.js → .setup/cli-metadata-B_y2Z5Np.mjs} +1 -1
  12. package/dist/{client-CZ_JvrO0.js → .setup/client-CpHMD-C2.mjs} +3 -3
  13. package/dist/{client-kSi51NKp.js → .setup/client-DvcYcTSy.mjs} +76 -23
  14. package/dist/{client-bootstrap-D8irSL2i.js → .setup/client-bootstrap-Cb1tHsT4.mjs} +3 -3
  15. package/dist/{client-support-DLj4vDeu.js → .setup/client-support-Bn9Bk0-H.mjs} +1 -1
  16. package/dist/{config-update-DC0fWBxc.js → .setup/config-update-B_4qZ5bV.mjs} +49 -31
  17. package/dist/{credentials-BdAaWuiR.js → .setup/credentials-B2roKThT.mjs} +6 -10
  18. package/dist/{credentials-read-B37cQknZ.js → .setup/credentials-read-DaemdXHy.mjs} +11 -9
  19. package/dist/{credentials-write.runtime-nAV2-5uR.js → .setup/credentials-write.runtime-D83HEGcL.mjs} +1 -1
  20. package/dist/{crypto-runtime-C4WDYxlP.js → .setup/crypto-runtime-Ch4WOG1y.mjs} +8 -8
  21. package/dist/{deps-CcVJfvRM.js → .setup/deps-mtxF2mHI.mjs} +1 -1
  22. package/dist/{device-health-B4-YXtJR.js → .setup/device-health-CWOuIirq.mjs} +1 -1
  23. package/dist/{direct-room-RinHjtqX.js → .setup/direct-room-CKyU8upP.mjs} +1 -1
  24. package/dist/{directory-live-DKr0w35b.js → .setup/directory-live-DggLE-28.mjs} +10 -8
  25. package/dist/{doctor-EWf9CDso.js → .setup/doctor-BLCvdOFo.mjs} +1 -1
  26. package/dist/{doctor-contract-DEt4O4Zt.js → .setup/doctor-contract-HyWFZQVG.mjs} +5 -4
  27. package/dist/{draft-stream-0CEpNrBk.js → .setup/draft-stream-DfUFwKfN.mjs} +1 -1
  28. package/dist/{encryption-guidance-D4ZdAqzM.js → .setup/encryption-guidance-CvN_NQUJ.mjs} +4 -3
  29. package/dist/{http-client-D8o8b9u6.js → .setup/http-client-Bv6a2OfI.mjs} +11 -8
  30. package/dist/{idb-persistence-DfgW720p.js → .setup/idb-persistence-BiscLSq4.mjs} +3 -3
  31. package/dist/{idb-persistence-lock-DAJ49nZX.js → .setup/idb-persistence-lock-B3fZXyF_.mjs} +1 -1
  32. package/dist/{inbound-dedupe-RvSLqdsz.js → .setup/inbound-dedupe-BOsuMiaj.mjs} +2 -2
  33. package/dist/{logger-B_71hN6W.js → .setup/logger-B3tfcB-m.mjs} +1 -1
  34. package/dist/{logging-DRjvUOIh.js → .setup/logging-CkohOZwO.mjs} +2 -2
  35. package/dist/{messages-DaGRt-tu.js → .setup/messages-C3v-jkaN.mjs} +4 -4
  36. package/dist/{monitor-CLPbPcR9.js → .setup/monitor-CQ6pGvZh.mjs} +56 -81
  37. package/dist/.setup/probe.runtime-ni46ImsO.mjs +2 -0
  38. package/dist/{profile-D-Wubo0A.js → .setup/profile-ClrB3IgR.mjs} +2 -2
  39. package/dist/{profile-update-zXVCMg7y.js → .setup/profile-update-B9Q6Ox2O.mjs} +6 -5
  40. package/dist/{reaction-events-CjVUiqcY.js → .setup/reaction-events-Dtd3W-rj.mjs} +10 -8
  41. package/dist/{resolve-targets-qG6gceps.js → .setup/resolve-targets-Bke5jHKS.mjs} +3 -3
  42. package/dist/{resolver.runtime-zX3TR3TN.js → .setup/resolver.runtime-BtrbC025.mjs} +1 -1
  43. package/dist/{room-info-yheP1mod.js → .setup/room-info-B0VNxsF8.mjs} +4 -4
  44. package/dist/.setup/runtime-setter-api-DGMubGUq.mjs +3 -0
  45. package/dist/{sdk-TZYyo0XQ.js → .setup/sdk-DoObvds0.mjs} +528 -30
  46. package/dist/{secret-contract-CufozuyJ.js → .setup/secret-contract-JlB6VmI3.mjs} +1 -1
  47. package/dist/.setup/secret-contract-api-B-iJoQEv.mjs +3 -0
  48. package/dist/{send-BL_iH5Ox.js → .setup/send-SmBzUhD-.mjs} +19 -15
  49. package/dist/{setup-bootstrap-D8M7FmcO.js → .setup/setup-bootstrap-CUKhebeX.mjs} +3 -3
  50. package/dist/{setup-core-r6L0nno-.js → .setup/setup-core-BnqoLunq.mjs} +9 -8
  51. package/dist/.setup/setup-plugin-api-Dg95tydH.mjs +3 -0
  52. package/dist/{setup-surface-g174ElFO.js → .setup/setup-surface-sWwADrZ8.mjs} +87 -81
  53. package/dist/{startup-verification-Cs08ca8u.js → .setup/startup-verification-E46yu4fh.mjs} +3 -3
  54. package/dist/{storage-BsGuHngK.js → .setup/storage-B-nf2ReN.mjs} +7 -6
  55. package/dist/{subagent-hooks-CMoZaARG.js → .setup/subagent-hooks-jFgft_Mr.mjs} +6 -2
  56. package/dist/.setup/sync-cache-state-6Hjn1K-v.mjs +234 -0
  57. package/dist/{thread-binding-api-CzkeLZCU.js → .setup/thread-binding-api-DRMC62cs.mjs} +1 -1
  58. package/dist/{thread-bindings-ERWNousC.js → .setup/thread-bindings-_WJ8RYWJ.mjs} +4 -4
  59. package/dist/{tool-actions.runtime-DcBCSwY4.js → .setup/tool-actions.runtime-DLICojA3.mjs} +230 -168
  60. package/dist/{verification-4vsW_WSn.js → .setup/verification-DOT16noD.mjs} +4 -3
  61. package/dist/api.js +8 -8
  62. package/dist/auth-presence.js +1 -1
  63. package/dist/channel-plugin-api.js +1 -1
  64. package/dist/cli-metadata.js +1 -1
  65. package/dist/contract-api.js +2 -2
  66. package/dist/doctor-contract-api.js +9 -9
  67. package/dist/helper-api.js +3 -3
  68. package/dist/index.js +1 -1
  69. package/dist/plugin-entry.handlers.runtime.js +1 -1
  70. package/dist/runtime-api.js +6 -6
  71. package/dist/runtime-setter-api.js +1 -1
  72. package/dist/secret-contract-api.js +1 -1
  73. package/dist/session-binding-contract-api.js +2 -2
  74. package/dist/setup-entry.js +4 -3
  75. package/dist/setup-plugin-api.js +1 -1
  76. package/dist/subagent-hooks-api.js +1 -1
  77. package/dist/thread-binding-api.js +1 -1
  78. package/dist/thread-bindings-runtime.js +1 -1
  79. package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +525 -484
  80. package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -1
  81. package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +7 -7
  82. package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -1
  83. package/node_modules/markdown-it/dist/markdown-it.cjs.js +129 -121
  84. package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -1
  85. package/node_modules/markdown-it/dist/markdown-it.d.mts +42 -71
  86. package/node_modules/markdown-it/dist/markdown-it.mjs +129 -121
  87. package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -1
  88. package/node_modules/markdown-it/package.json +1 -2
  89. package/node_modules/matrix-js-sdk/lib/client.d.ts +2 -1
  90. package/node_modules/matrix-js-sdk/lib/client.js +6 -2
  91. package/node_modules/matrix-js-sdk/lib/sync.js +8 -8
  92. package/node_modules/matrix-js-sdk/src/client.ts +7 -3
  93. package/node_modules/matrix-js-sdk/src/sync.ts +8 -8
  94. package/node_modules/typebox/build/format/email.mjs +1 -1
  95. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
  96. package/node_modules/typebox/package.json +1 -1
  97. package/package.json +6 -6
  98. package/dist/file-sync-store-DjskBX2o.js +0 -436
  99. package/dist/probe.runtime-Bxpr1FFy.js +0 -2
  100. package/dist/recovery-key-store-CognuDys.js +0 -276
  101. /package/dist/{account-config-CRsKoMqJ.js → .setup/account-config-CRsKoMqJ.mjs} +0 -0
  102. /package/dist/{backup-health-Dm_YMVFT.js → .setup/backup-health-Dm_YMVFT.mjs} +0 -0
  103. /package/dist/{config-paths-CnREYb1Y.js → .setup/config-paths-CnREYb1Y.mjs} +0 -0
  104. /package/dist/{config-secret-input.runtime-CwsP3--c.js → .setup/config-secret-input.runtime-CwsP3--c.mjs} +0 -0
  105. /package/dist/{credentials-state-B3cuUFwZ.js → .setup/credentials-state-B3cuUFwZ.mjs} +0 -0
  106. /package/dist/{crypto-node.runtime-6Aj_ltHQ.js → .setup/crypto-node.runtime-6Aj_ltHQ.mjs} +0 -0
  107. /package/dist/{env-vars-dGqak9dN.js → .setup/env-vars-dGqak9dN.mjs} +0 -0
  108. /package/dist/{errors-DKVS3_DO.js → .setup/errors-DKVS3_DO.mjs} +0 -0
  109. /package/dist/{event-helpers-XRfAbOIh.js → .setup/event-helpers-XRfAbOIh.mjs} +0 -0
  110. /package/dist/{reaction-common-DkrQdBSZ.js → .setup/reaction-common-DkrQdBSZ.mjs} +0 -0
  111. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  112. /package/dist/{runtime-6S3DNFNv.js → .setup/runtime-6S3DNFNv.mjs} +0 -0
  113. /package/dist/{runtime-BefyhPWv.js → .setup/runtime-BefyhPWv.mjs} +0 -0
  114. /package/dist/{storage-paths-gUmSydsW.js → .setup/storage-paths-gUmSydsW.mjs} +0 -0
  115. /package/dist/{target-ids-Nwx7cMVE.js → .setup/target-ids-Nwx7cMVE.mjs} +0 -0
  116. /package/dist/{thread-bindings-shared-oNPiyMWY.js → .setup/thread-bindings-shared-oNPiyMWY.mjs} +0 -0
  117. /package/dist/{url-validation-GRHde6lq.js → .setup/url-validation-GRHde6lq.mjs} +0 -0
@@ -1,9 +1,9 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
3
- import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
4
- import { i as normalizeMatrixResolvableTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.js";
5
- import { n as MATRIX_REACTION_EVENT_TYPE, r as buildMatrixReactionContent, t as MATRIX_ANNOTATION_RELATION_TYPE } from "./reaction-common-DkrQdBSZ.js";
6
- import { a as isStrictDirectRoom, r as inspectMatrixDirectRoomEvidence } from "./direct-room-RinHjtqX.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
+ import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
3
+ import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
4
+ import { i as normalizeMatrixResolvableTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
5
+ import { n as MATRIX_REACTION_EVENT_TYPE, r as buildMatrixReactionContent, t as MATRIX_ANNOTATION_RELATION_TYPE } from "./reaction-common-DkrQdBSZ.mjs";
6
+ import { a as isStrictDirectRoom, r as inspectMatrixDirectRoomEvidence } from "./direct-room-CKyU8upP.mjs";
7
7
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
8
8
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
9
9
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -19,11 +19,12 @@ import { isAutoLinkedFileRef } from "openclaw/plugin-sdk/text-autolink-runtime";
19
19
  import { isVoiceMessageCompatibleAudio } from "openclaw/plugin-sdk/media-runtime";
20
20
  import { parseBuffer } from "music-metadata";
21
21
  //#region extensions/matrix/src/matrix/send/client.ts
22
- const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-D8irSL2i.js").then((n) => n.t));
22
+ const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-Cb1tHsT4.mjs").then((n) => n.t));
23
23
  function resolveMediaMaxBytes(accountId, cfg) {
24
24
  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.");
25
+ const resolvedCfg = requireRuntimeConfig(cfg, "Matrix media limits");
25
26
  const mediaMaxMb = resolveMatrixAccountConfig({
26
- cfg: requireRuntimeConfig(cfg, "Matrix media limits"),
27
+ cfg: resolvedCfg,
27
28
  accountId
28
29
  }).mediaMaxMb;
29
30
  return typeof mediaMaxMb === "number" && mediaMaxMb > 0 ? mediaMaxMb * 1024 * 1024 : void 0;
@@ -359,7 +360,7 @@ async function resolveMatrixRoomId(client, raw) {
359
360
  //#region extensions/matrix/src/matrix/delivery-plan.ts
360
361
  const DELIVERY_PLAN_VERSION = 1;
361
362
  const DELIVERY_PLAN_NAMESPACE = "outbound-delivery-plans";
362
- const DELIVERY_PLAN_TTL_MS = 1440 * 60 * 1e3;
363
+ const DELIVERY_PLAN_TTL_MS = 864e5;
363
364
  var MatrixDeliveryPlanInvariantError = class extends Error {
364
365
  constructor(message) {
365
366
  super(message);
@@ -370,8 +371,8 @@ function createDeliveryPlanStore() {
370
371
  return getMatrixRuntime().state.openBlobStore({
371
372
  namespace: DELIVERY_PLAN_NAMESPACE,
372
373
  maxEntries: 1e4,
373
- maxBytesPerEntry: 8 * 1024 * 1024,
374
- maxBytesPerNamespace: 256 * 1024 * 1024,
374
+ maxBytesPerEntry: 8388608,
375
+ maxBytesPerNamespace: 268435456,
375
376
  overflowPolicy: "reject-new",
376
377
  defaultTtlMs: DELIVERY_PLAN_TTL_MS
377
378
  });
@@ -639,7 +640,8 @@ function isPollEventType(eventType) {
639
640
  }
640
641
  function getTextContent(text) {
641
642
  if (!isRecord(text)) return "";
642
- return normalizeOptionalString(text["m.text"] ?? text["org.matrix.msc1767.text"] ?? text.body) ?? "";
643
+ const value = text["m.text"] ?? text["org.matrix.msc1767.text"] ?? text.body;
644
+ return normalizeOptionalString(value) ?? "";
643
645
  }
644
646
  function parsePollStart(content) {
645
647
  const poll = content["m.poll.start"] ?? content[ORG_POLL_START] ?? content["m.poll"];
@@ -852,8 +854,9 @@ function isMarkdownEscaped(markdown, index) {
852
854
  return slashCount % 2 === 1;
853
855
  }
854
856
  function projectMatrixMarkdown(markdown) {
857
+ const normalized = (markdown ?? "").replace(/\r\n?/gu, "\n");
855
858
  return renderMarkdownWithMarkers({
856
- text: (markdown ?? "").replace(/\r\n?/gu, "\n"),
859
+ text: normalized,
857
860
  styles: [],
858
861
  links: []
859
862
  }, {
@@ -1427,11 +1430,12 @@ function markdownToMatrixBody(markdown) {
1427
1430
  const close = offsets[index + 1];
1428
1431
  if (open !== void 0 && close !== void 0) body = `${body.slice(0, open)}[Spoiler]${body.slice(close + 2)}`;
1429
1432
  }
1430
- return renderMarkdownWithMarkers(markdownToIR(body, {
1433
+ const ir = markdownToIR(body, {
1431
1434
  enableHtmlUnderline: true,
1432
1435
  headingStyle: "rich",
1433
1436
  linkify: true
1434
- }), {
1437
+ });
1438
+ return renderMarkdownWithMarkers(ir, {
1435
1439
  styleMarkers: {},
1436
1440
  escapeText: (text) => text
1437
1441
  }, MATRIX_FORMAT_PROFILE);
@@ -1,6 +1,6 @@
1
- import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
2
- import "./accounts-fC57n-Jo.js";
3
- import { n as bootstrapMatrixVerification } from "./verification-4vsW_WSn.js";
1
+ import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
2
+ import "./accounts-BJ6ECCac.mjs";
3
+ import { n as bootstrapMatrixVerification } from "./verification-DOT16noD.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,9 +1,9 @@
1
- import { s as resolveMatrixEnvAuthReadiness } from "./account-selection-C8nnBTxi.js";
2
- import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
3
- import { r as resolveDefaultMatrixAccountId } from "./accounts-fC57n-Jo.js";
4
- import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.js";
5
- import { r as updateMatrixAccountConfig } from "./config-update-DC0fWBxc.js";
6
- import { t as isSupportedMatrixAvatarSource } from "./profile-D-Wubo0A.js";
1
+ import { s as resolveMatrixEnvAuthReadiness } from "./account-selection-DZMazUgX.mjs";
2
+ import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
3
+ import { r as resolveDefaultMatrixAccountId } from "./accounts-BJ6ECCac.mjs";
4
+ import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
5
+ import { r as updateMatrixAccountConfig } from "./config-update-B_4qZ5bV.mjs";
6
+ import { t as isSupportedMatrixAvatarSource } from "./profile-ClrB3IgR.mjs";
7
7
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
9
9
  import { DEFAULT_ACCOUNT_ID, addWildcardAllowFrom, applyAccountNameToChannelSection, normalizeAccountId, normalizeAllowFromEntries, normalizeSecretInputString, prepareScopedSetupConfig } from "openclaw/plugin-sdk/setup";
@@ -164,8 +164,9 @@ function validateMatrixSetupInput(params) {
164
164
  function applyMatrixSetupAccountConfig(params) {
165
165
  const input = params.input;
166
166
  const normalizedAccountId = normalizeAccountId(params.accountId);
167
+ const migratedCfg = normalizedAccountId !== DEFAULT_ACCOUNT_ID ? moveSingleMatrixAccountConfigToNamedAccount(params.cfg) : params.cfg;
167
168
  const next = applyAccountNameToChannelSection({
168
- cfg: normalizedAccountId !== DEFAULT_ACCOUNT_ID ? moveSingleMatrixAccountConfigToNamedAccount(params.cfg) : params.cfg,
169
+ cfg: migratedCfg,
169
170
  channelKey: channel$1,
170
171
  accountId: normalizedAccountId,
171
172
  name: input.name
@@ -310,7 +311,7 @@ const matrixSetupAdapter = {
310
311
  input
311
312
  }),
312
313
  afterAccountConfigWritten: async ({ previousCfg, cfg, accountId, runtime }) => {
313
- const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-D8M7FmcO.js");
314
+ const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-CUKhebeX.mjs");
314
315
  await runMatrixSetupBootstrapAfterConfigWrite({
315
316
  previousCfg,
316
317
  cfg,
@@ -0,0 +1,3 @@
1
+ import { n as matrixSetupPlugin } from "./channel.setup-2A6HBRbA.mjs";
2
+ import "../setup-plugin-api.js";
3
+ export { matrixSetupPlugin };
@@ -1,12 +1,12 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { n as requiresExplicitMatrixDefaultAccount, s as resolveMatrixEnvAuthReadiness } from "./account-selection-C8nnBTxi.js";
3
- import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
4
- import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-fC57n-Jo.js";
5
- import { n as isMatrixRoomId } from "./target-ids-Nwx7cMVE.js";
6
- import { r as updateMatrixAccountConfig } from "./config-update-DC0fWBxc.js";
7
- import { a as moveSingleMatrixAccountConfigToNamedAccount, i as createMatrixSetupDmPolicy } from "./setup-core-r6L0nno-.js";
8
- import { n as validateMatrixHomeserverUrl, r as isPrivateOrLoopbackHost, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
9
- import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-CcVJfvRM.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
+ import { n as requiresExplicitMatrixDefaultAccount, s as resolveMatrixEnvAuthReadiness } from "./account-selection-DZMazUgX.mjs";
3
+ import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
4
+ import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-BJ6ECCac.mjs";
5
+ import { n as isMatrixRoomId } from "./target-ids-Nwx7cMVE.mjs";
6
+ import { r as updateMatrixAccountConfig } from "./config-update-B_4qZ5bV.mjs";
7
+ import { a as moveSingleMatrixAccountConfigToNamedAccount, i as createMatrixSetupDmPolicy } from "./setup-core-BnqoLunq.mjs";
8
+ import { n as validateMatrixHomeserverUrl, r as isPrivateOrLoopbackHost, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.mjs";
9
+ import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-mtxF2mHI.mjs";
10
10
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
11
11
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
12
12
  import { formatDocsLink, hasConfiguredSecretInput, mergeAllowFromEntries, normalizeAccountId as normalizeAccountId$1, promptAccountId, promptChannelAccessConfig, splitSetupEntries } from "openclaw/plugin-sdk/setup";
@@ -68,12 +68,13 @@ async function promptMatrixAllowFrom(params) {
68
68
  }).configured;
69
69
  const isFullUserId = (value) => value.startsWith("@") && value.includes(":");
70
70
  while (true) {
71
- const parts = splitSetupEntries(await prompter.text({
71
+ const entry = await prompter.text({
72
72
  message: "Matrix allowFrom (full @user:server; display name only if unique)",
73
73
  placeholder: "@user:server",
74
74
  initialValue: existingAllowFrom[0] ? String(existingAllowFrom[0]) : void 0,
75
75
  validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
76
- }));
76
+ });
77
+ const parts = splitSetupEntries(entry);
77
78
  const resolvedIds = [];
78
79
  const pending = [];
79
80
  const unresolved = [];
@@ -90,7 +91,7 @@ async function promptMatrixAllowFrom(params) {
90
91
  pending.push(part);
91
92
  }
92
93
  if (pending.length > 0) {
93
- const { resolveMatrixTargets } = await import("./resolve-targets-qG6gceps.js").then((n) => n.n);
94
+ const { resolveMatrixTargets } = await import("./resolve-targets-Bke5jHKS.mjs").then((n) => n.n);
94
95
  const results = await resolveMatrixTargets({
95
96
  cfg,
96
97
  accountId,
@@ -158,14 +159,15 @@ async function configureMatrixInviteAutoJoin(params) {
158
159
  }
159
160
  if (policy === "always") return setMatrixAutoJoin(params.cfg, policy, [], accountId);
160
161
  while (true) {
161
- const allowlist = normalizeUniqueStringEntries(splitSetupEntries(await params.prompter.text({
162
+ const rawAllowlist = await params.prompter.text({
162
163
  message: "Matrix invite auto-join allowlist (comma-separated)",
163
164
  placeholder: "!roomId:server, !roomId, #alias:server, *",
164
165
  initialValue: currentAllowlist[0] ? currentAllowlist.join(", ") : void 0,
165
166
  validate: (value) => {
166
167
  return splitSetupEntries(value).length > 0 ? void 0 : "Required";
167
168
  }
168
- })));
169
+ });
170
+ const allowlist = normalizeUniqueStringEntries(splitSetupEntries(rawAllowlist));
169
171
  const invalidEntries = allowlist.filter((entry) => !isMatrixInviteAutoJoinTarget(entry));
170
172
  if (allowlist.length === 0 || invalidEntries.length > 0) {
171
173
  await params.prompter.note(["Use only stable Matrix invite targets for auto-join: !roomId:server (or the suffixless !roomId form on room version 12+), #alias:server, or *.", invalidEntries.length > 0 ? `Invalid: ${invalidEntries.join(", ")}` : void 0].filter(Boolean).join("\n"), "Matrix invite auto-join");
@@ -194,41 +196,43 @@ async function configureMatrixAccessPrompts(params) {
194
196
  placeholder: "!roomId:server, !roomId, #alias:server, Project Room",
195
197
  updatePrompt: Boolean(existingGroups)
196
198
  });
197
- if (accessConfig) if (accessConfig.policy !== "allowlist") next = updateMatrixAccountConfig(next, params.accountId, { groupPolicy: accessConfig.policy });
198
- else {
199
- let roomKeys = accessConfig.entries;
200
- if (accessConfig.entries.length > 0) try {
201
- const resolvedIds = [];
202
- const unresolved = [];
203
- for (const entry of accessConfig.entries) {
204
- const trimmed = normalizeOptionalString(entry) ?? "";
205
- if (!trimmed) continue;
206
- const cleaned = trimmed.replace(/^(room|channel):/i, "").trim();
207
- if (isMatrixRoomId(cleaned)) {
208
- resolvedIds.push(cleaned);
209
- continue;
199
+ if (accessConfig) {
200
+ if (accessConfig.policy !== "allowlist") next = updateMatrixAccountConfig(next, params.accountId, { groupPolicy: accessConfig.policy });
201
+ else {
202
+ let roomKeys = accessConfig.entries;
203
+ if (accessConfig.entries.length > 0) try {
204
+ const resolvedIds = [];
205
+ const unresolved = [];
206
+ for (const entry of accessConfig.entries) {
207
+ const trimmed = normalizeOptionalString(entry) ?? "";
208
+ if (!trimmed) continue;
209
+ const cleaned = trimmed.replace(/^(room|channel):/i, "").trim();
210
+ if (isMatrixRoomId(cleaned)) {
211
+ resolvedIds.push(cleaned);
212
+ continue;
213
+ }
214
+ const { listMatrixDirectoryGroupsLive } = await import("./directory-live-DggLE-28.mjs").then((n) => n.t);
215
+ const matches = await listMatrixDirectoryGroupsLive({
216
+ cfg: next,
217
+ accountId: params.accountId,
218
+ query: trimmed,
219
+ limit: 10
220
+ });
221
+ const best = matches.find((match) => normalizeLowercaseStringOrEmpty(match.name) === normalizeLowercaseStringOrEmpty(trimmed)) ?? matches[0];
222
+ if (best?.id) resolvedIds.push(best.id);
223
+ else unresolved.push(entry);
210
224
  }
211
- const { listMatrixDirectoryGroupsLive } = await import("./directory-live-DKr0w35b.js").then((n) => n.t);
212
- const matches = await listMatrixDirectoryGroupsLive({
213
- cfg: next,
214
- accountId: params.accountId,
215
- query: trimmed,
216
- limit: 10
217
- });
218
- const best = matches.find((match) => normalizeLowercaseStringOrEmpty(match.name) === normalizeLowercaseStringOrEmpty(trimmed)) ?? matches[0];
219
- if (best?.id) resolvedIds.push(best.id);
220
- else unresolved.push(entry);
225
+ roomKeys = [...resolvedIds, ...unresolved.map((entry) => normalizeOptionalString(entry)).filter((entry) => Boolean(entry))];
226
+ if (resolvedIds.length > 0 || unresolved.length > 0) await params.prompter.note([resolvedIds.length > 0 ? `Resolved: ${resolvedIds.join(", ")}` : void 0, unresolved.length > 0 ? `Unresolved (kept as typed): ${unresolved.join(", ")}` : void 0].filter(Boolean).join("\n"), "Matrix rooms");
227
+ } catch (err) {
228
+ await params.prompter.note(`Room lookup failed; keeping entries as typed. ${String(err)}`, "Matrix rooms");
221
229
  }
222
- roomKeys = [...resolvedIds, ...unresolved.map((entry) => normalizeOptionalString(entry)).filter((entry) => Boolean(entry))];
223
- if (resolvedIds.length > 0 || unresolved.length > 0) await params.prompter.note([resolvedIds.length > 0 ? `Resolved: ${resolvedIds.join(", ")}` : void 0, unresolved.length > 0 ? `Unresolved (kept as typed): ${unresolved.join(", ")}` : void 0].filter(Boolean).join("\n"), "Matrix rooms");
224
- } catch (err) {
225
- await params.prompter.note(`Room lookup failed; keeping entries as typed. ${String(err)}`, "Matrix rooms");
230
+ next = updateMatrixAccountConfig(next, params.accountId, {
231
+ groupPolicy: "allowlist",
232
+ groups: Object.fromEntries(roomKeys.map((key) => [key, { enabled: true }])),
233
+ rooms: null
234
+ });
226
235
  }
227
- next = updateMatrixAccountConfig(next, params.accountId, {
228
- groupPolicy: "allowlist",
229
- groups: Object.fromEntries(roomKeys.map((key) => [key, { enabled: true }])),
230
- rooms: null
231
- });
232
236
  }
233
237
  return await configureMatrixInviteAutoJoin({
234
238
  cfg: next,
@@ -335,40 +339,42 @@ async function runMatrixConfigure(params) {
335
339
  userId = "";
336
340
  }
337
341
  }
338
- if (!hasConfiguredSecretInput(accessToken) && !hasConfiguredSecretInput(password)) if (await params.prompter.select({
339
- message: "Matrix auth method",
340
- options: [{
341
- value: "token",
342
- label: "Access token (user ID fetched automatically)"
343
- }, {
344
- value: "password",
345
- label: "Password (requires user ID)"
346
- }]
347
- }) === "token") {
348
- accessToken = normalizeStringifiedOptionalString(await params.prompter.text({
349
- message: "Matrix access token",
350
- sensitive: true,
351
- validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
352
- })) ?? "";
353
- password = void 0;
354
- userId = "";
355
- } else {
356
- userId = normalizeStringifiedOptionalString(await params.prompter.text({
357
- message: "Matrix user ID",
358
- initialValue: existing.userId ?? envUserId,
359
- validate: (value) => {
360
- const raw = normalizeOptionalString(value) ?? "";
361
- if (!raw) return "Required";
362
- if (!raw.startsWith("@")) return "Matrix user IDs should start with @";
363
- if (!raw.includes(":")) return "Matrix user IDs should include a server (:server)";
364
- }
365
- })) ?? "";
366
- password = normalizeStringifiedOptionalString(await params.prompter.text({
367
- message: "Matrix password",
368
- sensitive: true,
369
- validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
370
- })) ?? "";
371
- accessToken = void 0;
342
+ if (!hasConfiguredSecretInput(accessToken) && !hasConfiguredSecretInput(password)) {
343
+ if (await params.prompter.select({
344
+ message: "Matrix auth method",
345
+ options: [{
346
+ value: "token",
347
+ label: "Access token (user ID fetched automatically)"
348
+ }, {
349
+ value: "password",
350
+ label: "Password (requires user ID)"
351
+ }]
352
+ }) === "token") {
353
+ accessToken = normalizeStringifiedOptionalString(await params.prompter.text({
354
+ message: "Matrix access token",
355
+ sensitive: true,
356
+ validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
357
+ })) ?? "";
358
+ password = void 0;
359
+ userId = "";
360
+ } else {
361
+ userId = normalizeStringifiedOptionalString(await params.prompter.text({
362
+ message: "Matrix user ID",
363
+ initialValue: existing.userId ?? envUserId,
364
+ validate: (value) => {
365
+ const raw = normalizeOptionalString(value) ?? "";
366
+ if (!raw) return "Required";
367
+ if (!raw.startsWith("@")) return "Matrix user IDs should start with @";
368
+ if (!raw.includes(":")) return "Matrix user IDs should include a server (:server)";
369
+ }
370
+ })) ?? "";
371
+ password = normalizeStringifiedOptionalString(await params.prompter.text({
372
+ message: "Matrix password",
373
+ sensitive: true,
374
+ validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
375
+ })) ?? "";
376
+ accessToken = void 0;
377
+ }
372
378
  }
373
379
  const deviceName = normalizeStringifiedOptionalString(await params.prompter.text({
374
380
  message: "Matrix device name (optional)",
@@ -458,7 +464,7 @@ const matrixOnboardingAdapter = {
458
464
  });
459
465
  },
460
466
  afterConfigWritten: async ({ previousCfg, cfg, accountId, runtime }) => {
461
- const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-D8M7FmcO.js");
467
+ const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-CUKhebeX.mjs");
462
468
  await runMatrixSetupBootstrapAfterConfigWrite({
463
469
  previousCfg,
464
470
  cfg,
@@ -1,5 +1,5 @@
1
- import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
- import { M as resolveMatrixSqliteStateEnv, l as resolveMatrixStoragePaths, o as recordCurrentStorageMetaDeviceId } from "./storage-BsGuHngK.js";
1
+ import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
2
+ import { M as resolveMatrixSqliteStateEnv, l as resolveMatrixStoragePaths, o as recordCurrentStorageMetaDeviceId } from "./storage-B-nf2ReN.mjs";
3
3
  import { createHash } from "node:crypto";
4
4
  import path from "node:path";
5
5
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -13,7 +13,7 @@ const STARTUP_VERIFICATION_MIGRATIONS_NAMESPACE = "startup-verification-migratio
13
13
  const STARTUP_VERIFICATION_MAX_ENTRIES = 1e3;
14
14
  const DEFAULT_STARTUP_VERIFICATION_MODE = "if-unverified";
15
15
  const DEFAULT_STARTUP_VERIFICATION_COOLDOWN_HOURS = 24;
16
- const DEFAULT_STARTUP_VERIFICATION_FAILURE_COOLDOWN_MS = 3600 * 1e3;
16
+ const DEFAULT_STARTUP_VERIFICATION_FAILURE_COOLDOWN_MS = 36e5;
17
17
  function normalizeCooldownHours(value) {
18
18
  if (typeof value !== "number" || !Number.isFinite(value)) return DEFAULT_STARTUP_VERIFICATION_COOLDOWN_HOURS;
19
19
  return Math.max(0, value);
@@ -1,5 +1,5 @@
1
- import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
- import { n as resolveMatrixAccountStorageRoot } from "./storage-paths-gUmSydsW.js";
1
+ import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
2
+ import { n as resolveMatrixAccountStorageRoot } from "./storage-paths-gUmSydsW.mjs";
3
3
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
5
  import { createHash, randomUUID } from "node:crypto";
@@ -33,7 +33,7 @@ const LEGACY_CRYPTO_MIGRATION_NAMESPACE = "legacy-crypto-migration";
33
33
  const IDB_SNAPSHOT_NAMESPACE = "idb-snapshot";
34
34
  const SMALL_STATE_MAX_ENTRIES = 10;
35
35
  const IDB_SNAPSHOT_MAX_ENTRIES = 2e4;
36
- const IDB_SNAPSHOT_MAX_CHUNKS = Math.floor((IDB_SNAPSHOT_MAX_ENTRIES - 1) / 2);
36
+ const IDB_SNAPSHOT_MAX_CHUNKS = Math.floor(19999 / 2);
37
37
  const IDB_SNAPSHOT_CHUNK_BYTES = 24e3;
38
38
  const MATRIX_RECOVERY_KEY_FILENAME = "recovery-key.json";
39
39
  const MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME = "legacy-crypto-migration.json";
@@ -487,8 +487,9 @@ function resolvePreferredMatrixStorageRoot(params) {
487
487
  }
488
488
  function resolveMatrixStoragePaths(params) {
489
489
  const env = params.env ?? process.env;
490
+ const stateDir = params.stateDir ?? getMatrixRuntime().state.resolveStateDir(env, os.homedir);
490
491
  const canonical = resolveMatrixAccountStorageRoot({
491
- stateDir: params.stateDir ?? getMatrixRuntime().state.resolveStateDir(env, os.homedir),
492
+ stateDir,
492
493
  homeserver: params.homeserver,
493
494
  userId: params.userId,
494
495
  accessToken: params.accessToken,
@@ -526,7 +527,7 @@ function resolveMatrixStateFilePath(params) {
526
527
  }
527
528
  async function maybeMigrateLegacyStorage(params) {
528
529
  const hasAccountScopedLegacyStorageFile = fs.existsSync(params.storagePaths.storagePath);
529
- const syncCache = hasAccountScopedLegacyStorageFile ? await import("./file-sync-store-DjskBX2o.js").then((n) => n.n) : null;
530
+ const syncCache = hasAccountScopedLegacyStorageFile ? await import("./sync-cache-state-6Hjn1K-v.mjs").then((n) => n.s) : null;
530
531
  const hasAccountScopedLegacyStorage = hasAccountScopedLegacyStorageFile && await syncCache?.readLegacyMatrixSyncCacheState(params.storagePaths.rootDir) !== null;
531
532
  const hasAccountScopedRecoveryKey = fs.existsSync(params.storagePaths.recoveryKeyPath);
532
533
  const hasAccountScopedLegacyCryptoMigration = fs.existsSync(path.join(params.storagePaths.rootDir, MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME));
@@ -573,7 +574,7 @@ async function maybeMigrateLegacyStorage(params) {
573
574
  if (skippedExistingTargets.length > 0) logger.warn?.(`matrix: legacy client storage files were left in place because their migrated targets already existed.\n${skippedExistingTargets.join("\n")}`);
574
575
  }
575
576
  async function migrateLegacySyncCacheToSqlite(params) {
576
- const syncCache = await import("./file-sync-store-DjskBX2o.js").then((n) => n.n);
577
+ const syncCache = await import("./sync-cache-state-6Hjn1K-v.mjs").then((n) => n.s);
577
578
  const persisted = await syncCache.readLegacyMatrixSyncCacheState(params.sourceRootDir);
578
579
  if (!persisted) return;
579
580
  const store = getMatrixRuntime().state.openKeyedStore(syncCache.openMatrixSyncCacheStoreOptions(params.targetRootDir));
@@ -1,4 +1,4 @@
1
- import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, o as removeBindingRecord, s as resolveBindingKey } from "./thread-bindings-shared-oNPiyMWY.js";
1
+ import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, o as removeBindingRecord, s as resolveBindingKey } from "./thread-bindings-shared-oNPiyMWY.mjs";
2
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-binding-runtime";
4
4
  //#region extensions/matrix/src/matrix/subagent-hooks.ts
@@ -13,7 +13,11 @@ async function handleMatrixSubagentEnded(event) {
13
13
  const bindingId = resolveBindingKey(binding);
14
14
  if ((await bindingService.unbind({
15
15
  bindingId,
16
- reason
16
+ reason,
17
+ scope: {
18
+ channel: "matrix",
19
+ accountId: binding.accountId
20
+ }
17
21
  })).some((entry) => entry.bindingId === bindingId)) removedBindingKeys.add(bindingId);
18
22
  }
19
23
  }