@openclaw/matrix 2026.6.5-beta.2 → 2026.6.5-beta.5

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 (65) hide show
  1. package/dist/{account-selection-DEMtY2cn.js → account-selection-Bv_ZuOu4.js} +2 -3
  2. package/dist/api.js +5 -5
  3. package/dist/{approval-handler.runtime-DBUlR5vu.js → approval-handler.runtime-D88ERXxc.js} +4 -4
  4. package/dist/{approval-ids-BWuh0wZT.js → approval-ids-B2J320aL.js} +1 -1
  5. package/dist/{approval-reaction-auth-NgDjrK6V.js → approval-reaction-auth-ryklScll.js} +2 -2
  6. package/dist/{channel-6UUus7Ba.js → channel-DtT1oc4C.js} +13 -13
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{channel.runtime-CPXd3XKs.js → channel.runtime-CoCkSJV6.js} +6 -6
  9. package/dist/{cli-CM0h-B_j.js → cli-BX7_GgmS.js} +10 -10
  10. package/dist/{cli-metadata-CW6xSM2K.js → cli-metadata-C9_um_Yj.js} +1 -1
  11. package/dist/cli-metadata.js +1 -1
  12. package/dist/{client-CdP9vWOu.js → client-CPfb6TMG.js} +2 -2
  13. package/dist/{client-bootstrap-D5vrHEms.js → client-bootstrap-Dj2242_Y.js} +1 -1
  14. package/dist/{client-DRRL7Zv5.js → client-dLfa0qNk.js} +2 -2
  15. package/dist/{config-schema-CVJYP50t.js → config-schema-NrB2XGxM.js} +1 -1
  16. package/dist/contract-api.js +4 -4
  17. package/dist/{create-client-B90Sb7LG.js → create-client-MnSzqELZ.js} +4 -4
  18. package/dist/{credentials-Bi0pTJDK.js → credentials-G8lNmiME.js} +1 -1
  19. package/dist/{credentials-read-DpxFOhx0.js → credentials-read-TzTOQPOM.js} +1 -1
  20. package/dist/{credentials-write.runtime-BB5QuM4Z.js → credentials-write.runtime-cZhhyGAZ.js} +1 -1
  21. package/dist/{crypto-runtime-DWVNNqa3.js → crypto-runtime-B4WWNpMk.js} +4 -174
  22. package/dist/crypto-state-store-DK2tcEyP.js +352 -0
  23. package/dist/{directory-live-5uWtLQ41.js → directory-live-C7aYHtRU.js} +2 -2
  24. package/dist/{doctor-BKjr6uua.js → doctor-BwpkOBwr.js} +5 -5
  25. package/dist/{doctor-contract-D9oKDvsJ.js → doctor-contract-Dq8OZWHF.js} +1 -1
  26. package/dist/doctor-contract-api.js +265 -2
  27. package/dist/{draft-stream-DZ2X1RHP.js → draft-stream-PqFfvyV9.js} +1 -1
  28. package/dist/{encryption-guidance-aEUzD940.js → encryption-guidance-D_KhjprO.js} +1 -1
  29. package/dist/file-sync-store-Ni-pkFde.js +402 -0
  30. package/dist/helper-api.js +1 -1
  31. package/dist/idb-persistence-BGY1CJ7J.js +229 -0
  32. package/dist/idb-persistence-lock-DAJ49nZX.js +32 -0
  33. package/dist/index.js +1 -1
  34. package/dist/{legacy-crypto-restore-CbVSppMd.js → legacy-crypto-restore-Bm6HmeN5.js} +36 -28
  35. package/dist/logger-D0GCSDQq.js +78 -0
  36. package/dist/{logging-Cm8vxO3E.js → logging-QH-48Gr6.js} +1 -1
  37. package/dist/{matrix-migration.runtime-RzIEp7RP.js → matrix-migration.runtime-dvxE3e5l.js} +24 -25
  38. package/dist/{media-text-DVhXN81h.js → media-text-D0uvrHo1.js} +1 -1
  39. package/dist/{messages-sk1eTx7H.js → messages-C00n-MG_.js} +3 -3
  40. package/dist/{monitor-DXW0sFfU.js → monitor-BWHn9jy2.js} +21 -19
  41. package/dist/plugin-entry.handlers.runtime.js +1 -1
  42. package/dist/probe.runtime-DcSBLSet.js +3 -0
  43. package/dist/{profile-update-rzynJvpi.js → profile-update-CWvjc5i_.js} +2 -2
  44. package/dist/{reaction-events-DRKzlo8q.js → reaction-events-CdkYjlyo.js} +1 -1
  45. package/dist/{recovery-key-store-D6RbiZMM.js → recovery-key-store-TSlOpcEG.js} +22 -53
  46. package/dist/{resolve-targets-CAwsoBQK.js → resolve-targets-0dT0vJZJ.js} +1 -1
  47. package/dist/{resolver.runtime-phS2hwm9.js → resolver.runtime-BD2ZRhKw.js} +1 -1
  48. package/dist/runtime-api.js +1 -1
  49. package/dist/runtime-heavy-api.js +1 -1
  50. package/dist/{sdk-BdCZ5WwA.js → sdk-CdMhAFz3.js} +9 -202
  51. package/dist/{send-DEgWxp1p.js → send-Bus9xhUh.js} +1 -1
  52. package/dist/{setup-bootstrap-B4xc58Ww.js → setup-bootstrap-C9tUX9Ty.js} +2 -2
  53. package/dist/{setup-core-DJosJdWt.js → setup-core-CUyFBi5x.js} +3 -3
  54. package/dist/setup-plugin-api.js +3 -3
  55. package/dist/{setup-surface-CqxGV1WL.js → setup-surface-BRlTR6to.js} +5 -5
  56. package/dist/{shared-BbT5LdPp.js → shared-Bk7pOHMb.js} +8 -84
  57. package/dist/{startup-verification-D1p_LRmg.js → startup-verification-BoDITB_u.js} +2 -2
  58. package/dist/{storage-DSVcH_zM.js → storage-C10h2piS.js} +122 -26
  59. package/dist/{thread-bindings-gLQYbsB9.js → thread-bindings-CnviJ9Ff.js} +4 -23
  60. package/dist/{tool-actions.runtime-o06m9bgN.js → tool-actions.runtime-dStqVKMT.js} +6 -6
  61. package/dist/{verification-BiA5IWPK.js → verification-jZ1KWtb5.js} +2 -2
  62. package/npm-shrinkwrap.json +3 -3
  63. package/package.json +4 -4
  64. package/dist/probe.runtime-BO0mNIe8.js +0 -3
  65. package/dist/record-shared-CvzjvHRn.js +0 -2
@@ -1,6 +1,5 @@
1
1
  import { n as listMatrixEnvAccountIds, t as getMatrixScopedEnvVarNames } from "./env-vars-KzaYveuy.js";
2
- import { t as isRecord } from "./record-shared-CvzjvHRn.js";
3
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
3
  import { listCombinedAccountIds, listConfiguredAccountIds, resolveListedDefaultAccountId, resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-core";
5
4
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
6
5
  import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input-runtime";
@@ -155,4 +154,4 @@ function requiresExplicitMatrixDefaultAccount(cfg, env = process.env) {
155
154
  return !(configuredDefault && configuredAccountIds.includes(configuredDefault));
156
155
  }
157
156
  //#endregion
158
- export { resolveMatrixDefaultOrOnlyAccountId as a, resolveMatrixChannelConfig as i, requiresExplicitMatrixDefaultAccount as n, resolveMatrixAccountStringValues as o, resolveConfiguredMatrixAccountIds as r, findMatrixAccountEntry as t };
157
+ export { resolveMatrixDefaultOrOnlyAccountId as a, resolveMatrixChannelConfig as i, requiresExplicitMatrixDefaultAccount as n, isRecord as o, resolveConfiguredMatrixAccountIds as r, resolveMatrixAccountStringValues as s, findMatrixAccountEntry as t };
package/dist/api.js CHANGED
@@ -1,11 +1,11 @@
1
- import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-DEMtY2cn.js";
1
+ import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-Bv_ZuOu4.js";
2
2
  import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-KzaYveuy.js";
3
3
  import { a as resolveMatrixCredentialsPath, c as resolveMatrixLegacyFlatStoreRoot, i as resolveMatrixCredentialsFilename, l as sanitizeMatrixPathSegment, n as resolveMatrixAccountStorageRoot, o as resolveMatrixHomeserverKey, r as resolveMatrixCredentialsDir, s as resolveMatrixLegacyFlatStoragePaths, t as hashMatrixAccessToken } from "./storage-paths-BWo_ZEMC.js";
4
- import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-DJosJdWt.js";
5
- import { t as matrixPlugin } from "./channel-6UUus7Ba.js";
4
+ import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-CUyFBi5x.js";
5
+ import { t as matrixPlugin } from "./channel-DtT1oc4C.js";
6
6
  import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, n as getMatrixThreadBindingManager, p as setMatrixThreadBindingMaxAgeBySessionKey, s as resetMatrixThreadBindingsForTests } from "./thread-bindings-shared-CKnY4LSd.js";
7
- import { n as matrixOnboardingAdapter } from "./setup-surface-CqxGV1WL.js";
8
- import { t as createMatrixThreadBindingManager } from "./thread-bindings-gLQYbsB9.js";
7
+ import { n as matrixOnboardingAdapter } from "./setup-surface-BRlTR6to.js";
8
+ import { t as createMatrixThreadBindingManager } from "./thread-bindings-CnviJ9Ff.js";
9
9
  //#region extensions/matrix/api.ts
10
10
  const matrixSessionBindingAdapterChannels = ["matrix"];
11
11
  //#endregion
@@ -1,9 +1,9 @@
1
- import { g as resolveMatrixAccount } from "./setup-core-DJosJdWt.js";
2
- import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-6UUus7Ba.js";
1
+ import { g as resolveMatrixAccount } from "./setup-core-CUyFBi5x.js";
2
+ import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-DtT1oc4C.js";
3
3
  import { a as resolveMatrixTargetIdentity } from "./target-ids-B-5aQxwn.js";
4
- import { a as sendMessageMatrix, i as reactMatrixMessage, p as repairMatrixDirectRooms, s as sendSingleTextMessageMatrix } from "./send-DEgWxp1p.js";
4
+ import { a as sendMessageMatrix, i as reactMatrixMessage, p as repairMatrixDirectRooms, s as sendSingleTextMessageMatrix } from "./send-Bus9xhUh.js";
5
5
  import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-BRGQgOu2.js";
6
- import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-sk1eTx7H.js";
6
+ import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-C00n-MG_.js";
7
7
  import { listMessageReceiptPlatformIds, resolveMessageReceiptPrimaryId } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
@@ -1,4 +1,4 @@
1
- import { a as normalizeMatrixUserId } from "./config-schema-CVJYP50t.js";
1
+ import { a as normalizeMatrixUserId } from "./config-schema-NrB2XGxM.js";
2
2
  //#region extensions/matrix/src/approval-ids.ts
3
3
  function normalizeMatrixApproverId(value) {
4
4
  return normalizeMatrixUserId(String(value)) || void 0;
@@ -1,5 +1,5 @@
1
- import { g as resolveMatrixAccount } from "./setup-core-DJosJdWt.js";
2
- import { t as normalizeMatrixApproverId } from "./approval-ids-BWuh0wZT.js";
1
+ import { g as resolveMatrixAccount } from "./setup-core-CUyFBi5x.js";
2
+ import { t as normalizeMatrixApproverId } from "./approval-ids-B2J320aL.js";
3
3
  import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
4
4
  //#region extensions/matrix/src/approval-reaction-auth.ts
5
5
  function normalizeMatrixExecApproverId(value) {
@@ -1,14 +1,14 @@
1
- import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-DEMtY2cn.js";
1
+ import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-Bv_ZuOu4.js";
2
2
  import { c as resolveMatrixAccountConfig } from "./config-paths-ZBCMwSos.js";
3
- import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, n as matrixSetupAdapter, p as listMatrixAccountIds, t as createMatrixSetupWizardProxy, u as namedAccountPromotionKeys } from "./setup-core-DJosJdWt.js";
4
- import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-CVJYP50t.js";
5
- import { t as normalizeMatrixApproverId } from "./approval-ids-BWuh0wZT.js";
3
+ import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, n as matrixSetupAdapter, p as listMatrixAccountIds, t as createMatrixSetupWizardProxy, u as namedAccountPromotionKeys } from "./setup-core-CUyFBi5x.js";
4
+ import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-NrB2XGxM.js";
5
+ import { t as normalizeMatrixApproverId } from "./approval-ids-B2J320aL.js";
6
6
  import { a as resolveMatrixTargetIdentity, i as resolveMatrixDirectUserId, n as normalizeMatrixMessagingTarget, r as normalizeMatrixResolvableTarget } from "./target-ids-B-5aQxwn.js";
7
7
  import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
8
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-D9oKDvsJ.js";
8
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-Dq8OZWHF.js";
9
9
  import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKey } from "./thread-bindings-shared-CKnY4LSd.js";
10
10
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DTgQyQxc.js";
11
- import { i as autoPrepareLegacyMatrixCrypto, o as autoMigrateLegacyMatrixState, r as resolveMatrixMigrationStatus } from "./matrix-migration.runtime-RzIEp7RP.js";
11
+ import { i as autoPrepareLegacyMatrixCrypto, o as autoMigrateLegacyMatrixState, r as resolveMatrixMigrationStatus } from "./matrix-migration.runtime-dvxE3e5l.js";
12
12
  import { t as maybeCreateMatrixMigrationSnapshot } from "./migration-snapshot-backup-YcCrSjbE.js";
13
13
  import { n as resolveMatrixInboundConversation } from "./thread-binding-api-DRbBZlhS.js";
14
14
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
@@ -129,7 +129,7 @@ const matrixMessageActions = {
129
129
  return extractToolSend(args, "sendMessage");
130
130
  },
131
131
  handleAction: async (ctx) => {
132
- const { handleMatrixAction } = await import("./tool-actions.runtime-o06m9bgN.js");
132
+ const { handleMatrixAction } = await import("./tool-actions.runtime-dStqVKMT.js");
133
133
  const { action, params, cfg, accountId, mediaLocalRoots } = ctx;
134
134
  const dispatch = async (actionParams) => await handleMatrixAction({
135
135
  ...actionParams,
@@ -594,7 +594,7 @@ const matrixNativeApprovalCapability = createApproverRestrictedNativeApprovalCap
594
594
  accountId,
595
595
  request
596
596
  }),
597
- load: async () => (await import("./approval-handler.runtime-DBUlR5vu.js")).matrixApprovalNativeRuntime
597
+ load: async () => (await import("./approval-handler.runtime-D88ERXxc.js")).matrixApprovalNativeRuntime
598
598
  })
599
599
  });
600
600
  const splitMatrixApprovalCapability = splitChannelApprovalCapability(matrixNativeApprovalCapability);
@@ -756,7 +756,7 @@ function resolveMatrixGroupToolPolicy(params) {
756
756
  }
757
757
  //#endregion
758
758
  //#region extensions/matrix/src/resolver.ts
759
- const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-phS2hwm9.js"), "matrixResolverRuntime");
759
+ const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-BD2ZRhKw.js"), "matrixResolverRuntime");
760
760
  const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs, kind, runtime }) => (await loadMatrixChannelRuntime$1()).resolveMatrixTargets({
761
761
  cfg,
762
762
  accountId,
@@ -945,11 +945,11 @@ async function runMatrixStartupMaintenance(params) {
945
945
  //#endregion
946
946
  //#region extensions/matrix/src/channel.ts
947
947
  let matrixStartupLock = Promise.resolve();
948
- const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-CqxGV1WL.js").then((n) => n.t), "matrixSetupWizard");
949
- const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CPXd3XKs.js"), "matrixChannelRuntime");
948
+ const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-BRlTR6to.js").then((n) => n.t), "matrixSetupWizard");
949
+ const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CoCkSJV6.js"), "matrixChannelRuntime");
950
950
  let matrixDoctorModulePromise = null;
951
951
  const loadMatrixDoctorModule = async () => {
952
- matrixDoctorModulePromise ??= import("./doctor-BKjr6uua.js");
952
+ matrixDoctorModulePromise ??= import("./doctor-BwpkOBwr.js");
953
953
  return await matrixDoctorModulePromise;
954
954
  };
955
955
  const meta = {
@@ -1322,7 +1322,7 @@ const matrixPlugin = createChatChannelPlugin({
1322
1322
  await previousLock;
1323
1323
  let monitorMatrixProvider;
1324
1324
  try {
1325
- monitorMatrixProvider = (await import("./monitor-DXW0sFfU.js")).monitorMatrixProvider;
1325
+ monitorMatrixProvider = (await import("./monitor-BWHn9jy2.js")).monitorMatrixProvider;
1326
1326
  } finally {
1327
1327
  releaseLock();
1328
1328
  }
@@ -1,2 +1,2 @@
1
- import { t as matrixPlugin } from "./channel-6UUus7Ba.js";
1
+ import { t as matrixPlugin } from "./channel-DtT1oc4C.js";
2
2
  export { matrixPlugin };
@@ -1,10 +1,10 @@
1
- import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-DEgWxp1p.js";
1
+ import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-Bus9xhUh.js";
2
2
  import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
3
- import { g as resolveMatrixAuth } from "./shared-BbT5LdPp.js";
4
- import "./client-DRRL7Zv5.js";
5
- import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-5uWtLQ41.js";
3
+ import { f as resolveMatrixAuth } from "./shared-Bk7pOHMb.js";
4
+ import "./client-dLfa0qNk.js";
5
+ import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-C7aYHtRU.js";
6
6
  import { f as resolveOutboundSendDep, n as chunkTextForOutbound } from "./runtime-api-CsBoesCU.js";
7
- import { t as resolveMatrixTargets } from "./resolve-targets-CAwsoBQK.js";
7
+ import { t as resolveMatrixTargets } from "./resolve-targets-0dT0vJZJ.js";
8
8
  import { createReplyToFanout } from "openclaw/plugin-sdk/channel-outbound";
9
9
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
10
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -13,7 +13,7 @@ import { resolvePayloadMediaUrls } from "openclaw/plugin-sdk/reply-payload";
13
13
  //#region extensions/matrix/src/matrix/probe.ts
14
14
  let matrixProbeRuntimeDepsPromise;
15
15
  async function loadMatrixProbeRuntimeDeps() {
16
- matrixProbeRuntimeDepsPromise ??= import("./probe.runtime-BO0mNIe8.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient }));
16
+ matrixProbeRuntimeDepsPromise ??= import("./probe.runtime-DcSBLSet.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient }));
17
17
  return await matrixProbeRuntimeDepsPromise;
18
18
  }
19
19
  async function probeMatrix(params) {
@@ -1,16 +1,16 @@
1
1
  import { c as resolveMatrixAccountConfig } from "./config-paths-ZBCMwSos.js";
2
2
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
3
- import { c as resolveMatrixConfigPath, g as resolveMatrixAccount, l as updateMatrixAccountConfig, n as matrixSetupAdapter } from "./setup-core-DJosJdWt.js";
3
+ import { c as resolveMatrixConfigPath, g as resolveMatrixAccount, l as updateMatrixAccountConfig, n as matrixSetupAdapter } from "./setup-core-CUyFBi5x.js";
4
4
  import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
5
- import { n as withResolvedActionClient } from "./client-CdP9vWOu.js";
6
- import { _ as resolveMatrixAuthContext } from "./shared-BbT5LdPp.js";
7
- import "./client-DRRL7Zv5.js";
5
+ import { n as withResolvedActionClient } from "./client-CPfb6TMG.js";
6
+ import { p as resolveMatrixAuthContext } from "./shared-Bk7pOHMb.js";
7
+ import "./client-dLfa0qNk.js";
8
8
  import { i as formatZonedTimestamp } from "./runtime-api-CsBoesCU.js";
9
9
  import { isOpenClawManagedMatrixDevice, summarizeMatrixDeviceHealth } from "./device-health-D4LBxuPq.js";
10
- import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-rzynJvpi.js";
11
- import { a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, g as runMatrixSelfVerification, h as restoreMatrixRoomKeyBackup, l as getMatrixVerificationSas, m as resetMatrixRoomKeyBackup, n as bootstrapMatrixVerification, p as requestMatrixVerification, r as cancelMatrixVerification, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-BiA5IWPK.js";
10
+ import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-CWvjc5i_.js";
11
+ import { a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, g as runMatrixSelfVerification, h as restoreMatrixRoomKeyBackup, l as getMatrixVerificationSas, m as resetMatrixRoomKeyBackup, n as bootstrapMatrixVerification, p as requestMatrixVerification, r as cancelMatrixVerification, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-jZ1KWtb5.js";
12
12
  import { t as resolveMatrixRoomKeyBackupIssue } from "./backup-health-Dm_YMVFT.js";
13
- import { setMatrixSdkConsoleLogging, setMatrixSdkLogMode } from "./logging-Cm8vxO3E.js";
13
+ import { setMatrixSdkConsoleLogging, setMatrixSdkLogMode } from "./logging-QH-48Gr6.js";
14
14
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
15
15
  import { parseStrictInteger, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
16
16
  //#region extensions/matrix/src/matrix/actions/devices.ts
@@ -38,11 +38,11 @@ let matrixCliExitScheduled = false;
38
38
  let matrixActionClientModulePromise;
39
39
  let matrixDirectManagementModulePromise;
40
40
  function loadMatrixActionClientModule() {
41
- matrixActionClientModulePromise ??= import("./client-CdP9vWOu.js").then((n) => n.t);
41
+ matrixActionClientModulePromise ??= import("./client-CPfb6TMG.js").then((n) => n.t);
42
42
  return matrixActionClientModulePromise;
43
43
  }
44
44
  function loadMatrixDirectManagementModule() {
45
- matrixDirectManagementModulePromise ??= import("./send-DEgWxp1p.js").then((n) => n.d);
45
+ matrixDirectManagementModulePromise ??= import("./send-Bus9xhUh.js").then((n) => n.d);
46
46
  return matrixDirectManagementModulePromise;
47
47
  }
48
48
  function scheduleMatrixCliExit() {
@@ -210,7 +210,7 @@ async function addMatrixAccount(params) {
210
210
  backupVersion: null
211
211
  };
212
212
  if (accountConfig.encryption === true) {
213
- const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-B4xc58Ww.js");
213
+ const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-C9tUX9Ty.js");
214
214
  verificationBootstrap = await maybeBootstrapNewEncryptedMatrixAccount({
215
215
  previousCfg: cfg,
216
216
  cfg: updated,
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
2
2
  //#region extensions/matrix/src/cli-metadata.ts
3
3
  function registerMatrixCliMetadata(api) {
4
4
  api.registerCli(async ({ program }) => {
5
- const { registerMatrixCli } = await import("./cli-CM0h-B_j.js");
5
+ const { registerMatrixCli } = await import("./cli-BX7_GgmS.js");
6
6
  registerMatrixCli({ program });
7
7
  }, { descriptors: [{
8
8
  name: "matrix",
@@ -1,2 +1,2 @@
1
- import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-CW6xSM2K.js";
1
+ import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-C9_um_Yj.js";
2
2
  export { cli_metadata_default as default, registerMatrixCliMetadata };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { u as resolveMatrixRoomId } from "./send-DEgWxp1p.js";
3
- import { n as withResolvedRuntimeMatrixClient } from "./client-bootstrap-D5vrHEms.js";
2
+ import { u as resolveMatrixRoomId } from "./send-Bus9xhUh.js";
3
+ import { n as withResolvedRuntimeMatrixClient } from "./client-bootstrap-Dj2242_Y.js";
4
4
  //#region extensions/matrix/src/matrix/actions/client.ts
5
5
  var client_exports = /* @__PURE__ */ __exportAll({
6
6
  withResolvedActionClient: () => withResolvedActionClient,
@@ -10,7 +10,7 @@ var client_bootstrap_exports = /* @__PURE__ */ __exportAll({
10
10
  });
11
11
  let matrixSharedClientRuntimeDepsPromise;
12
12
  async function loadMatrixSharedClientRuntimeDeps() {
13
- matrixSharedClientRuntimeDepsPromise ??= Promise.all([import("./client-DRRL7Zv5.js").then((n) => n.t), import("./shared-BbT5LdPp.js").then((n) => n.a)]).then(([clientModule, sharedModule]) => ({
13
+ matrixSharedClientRuntimeDepsPromise ??= Promise.all([import("./client-dLfa0qNk.js").then((n) => n.t), import("./shared-Bk7pOHMb.js").then((n) => n.a)]).then(([clientModule, sharedModule]) => ({
14
14
  acquireSharedMatrixClient: clientModule.acquireSharedMatrixClient,
15
15
  resolveMatrixAuthContext: clientModule.resolveMatrixAuthContext,
16
16
  releaseSharedClientInstance: sharedModule.releaseSharedClientInstance
@@ -3,8 +3,8 @@ import { t as getMatrixScopedEnvVarNames } from "./env-vars-KzaYveuy.js";
3
3
  import { i as resolveScopedMatrixEnvConfig, r as resolveMatrixEnvAuthReadiness, t as hasReadyMatrixEnvAuth } from "./env-auth-DIzOApj0.js";
4
4
  import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
5
5
  import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
6
- import { _ as resolveMatrixAuthContext, g as resolveMatrixAuth, h as backfillMatrixAuthDeviceIdAfterStartup, i as resolveSharedMatrixClient, n as releaseSharedClientInstance, o as stopSharedClientForAccount, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient, v as resolveMatrixConfigForAccount } from "./shared-BbT5LdPp.js";
7
- import { t as createMatrixClient } from "./create-client-B90Sb7LG.js";
6
+ import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, m as resolveMatrixConfigForAccount, n as releaseSharedClientInstance, o as stopSharedClientForAccount, p as resolveMatrixAuthContext, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient } from "./shared-Bk7pOHMb.js";
7
+ import { t as createMatrixClient } from "./create-client-MnSzqELZ.js";
8
8
  //#region extensions/matrix/src/matrix/client.ts
9
9
  var client_exports = /* @__PURE__ */ __exportAll({
10
10
  acquireSharedMatrixClient: () => acquireSharedMatrixClient,
@@ -1,5 +1,5 @@
1
1
  import { c as resolveMatrixAccountConfig } from "./config-paths-ZBCMwSos.js";
2
- import { g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, p as listMatrixAccountIds } from "./setup-core-DJosJdWt.js";
2
+ import { g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, p as listMatrixAccountIds } from "./setup-core-CUyFBi5x.js";
3
3
  import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
4
4
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
@@ -1,8 +1,8 @@
1
1
  import { r as setMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
- import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, n as matrixSetupAdapter, u as namedAccountPromotionKeys } from "./setup-core-DJosJdWt.js";
3
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-D9oKDvsJ.js";
2
+ import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, n as matrixSetupAdapter, u as namedAccountPromotionKeys } from "./setup-core-CUyFBi5x.js";
3
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-Dq8OZWHF.js";
4
4
  import { s as resetMatrixThreadBindingsForTests } from "./thread-bindings-shared-CKnY4LSd.js";
5
5
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DTgQyQxc.js";
6
- import { n as matrixOnboardingAdapter } from "./setup-surface-CqxGV1WL.js";
7
- import { t as createMatrixThreadBindingManager } from "./thread-bindings-gLQYbsB9.js";
6
+ import { n as matrixOnboardingAdapter } from "./setup-surface-BRlTR6to.js";
7
+ import { t as createMatrixThreadBindingManager } from "./thread-bindings-CnviJ9Ff.js";
8
8
  export { collectRuntimeConfigAssignments, createMatrixThreadBindingManager, legacyConfigRules, matrixSetupAdapter, matrixOnboardingAdapter as matrixSetupWizard, namedAccountPromotionKeys, normalizeCompatibilityConfig, resetMatrixThreadBindingsForTests, resolveSingleAccountPromotionTarget, secretTargetRegistryEntries, setMatrixRuntime, singleAccountKeysToMove };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
2
  import { t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
3
- import { n as maybeMigrateLegacyStorage, o as resolveMatrixStoragePaths, s as writeStorageMeta } from "./storage-DSVcH_zM.js";
4
- import "./shared-BbT5LdPp.js";
3
+ import { n as maybeMigrateLegacyStorage, o as resolveMatrixStoragePaths, s as writeStorageMeta } from "./storage-C10h2piS.js";
4
+ import "./shared-Bk7pOHMb.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import fs from "node:fs";
7
7
  import { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
@@ -9,7 +9,7 @@ import { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sd
9
9
  var create_client_exports = /* @__PURE__ */ __exportAll({ createMatrixClient: () => createMatrixClient });
10
10
  let matrixCreateClientRuntimeDepsPromise;
11
11
  async function loadMatrixCreateClientRuntimeDeps() {
12
- matrixCreateClientRuntimeDepsPromise ??= Promise.all([import("./sdk-BdCZ5WwA.js"), import("./logging-Cm8vxO3E.js")]).then(([sdkModule, loggingModule]) => ({
12
+ matrixCreateClientRuntimeDepsPromise ??= Promise.all([import("./sdk-CdMhAFz3.js"), import("./logging-QH-48Gr6.js")]).then(([sdkModule, loggingModule]) => ({
13
13
  MatrixClient: sdkModule.MatrixClient,
14
14
  ensureMatrixSdkLoggingConfigured: loggingModule.ensureMatrixSdkLoggingConfigured
15
15
  }));
@@ -51,7 +51,7 @@ async function createMatrixClient(params) {
51
51
  encryption: params.encryption,
52
52
  localTimeoutMs: params.localTimeoutMs,
53
53
  initialSyncLimit: params.initialSyncLimit,
54
- storagePath: storagePaths?.storagePath,
54
+ storageRootDir: storagePaths?.rootDir,
55
55
  recoveryKeyPath: storagePaths?.recoveryKeyPath,
56
56
  idbSnapshotPath: storagePaths?.idbSnapshotPath,
57
57
  cryptoDatabasePrefix,
@@ -1,4 +1,4 @@
1
- import { a as resolveMatrixCredentialsDir, i as loadMatrixCredentials, n as credentialsMatchConfig, o as resolveMatrixCredentialsPath, t as clearMatrixCredentials } from "./credentials-read-DpxFOhx0.js";
1
+ import { a as resolveMatrixCredentialsDir, i as loadMatrixCredentials, n as credentialsMatchConfig, o as resolveMatrixCredentialsPath, t as clearMatrixCredentials } from "./credentials-read-TzTOQPOM.js";
2
2
  import { t as createAsyncLock } from "./async-lock-BcLS4KOc.js";
3
3
  import { writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store";
4
4
  //#region extensions/matrix/src/matrix/credentials.ts
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { a as resolveMatrixDefaultOrOnlyAccountId, n as requiresExplicitMatrixDefaultAccount } from "./account-selection-DEMtY2cn.js";
2
+ import { a as resolveMatrixDefaultOrOnlyAccountId, n as requiresExplicitMatrixDefaultAccount } from "./account-selection-Bv_ZuOu4.js";
3
3
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
4
4
  import { a as resolveMatrixCredentialsPath$1, r as resolveMatrixCredentialsDir$1 } from "./storage-paths-BWo_ZEMC.js";
5
5
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
@@ -1,7 +1,7 @@
1
1
  //#region extensions/matrix/src/matrix/credentials-write.runtime.ts
2
2
  let matrixCredentialsRuntimePromise;
3
3
  function loadMatrixCredentialsRuntime() {
4
- matrixCredentialsRuntimePromise ??= import("./credentials-Bi0pTJDK.js");
4
+ matrixCredentialsRuntimePromise ??= import("./credentials-G8lNmiME.js");
5
5
  return matrixCredentialsRuntimePromise;
6
6
  }
7
7
  async function saveMatrixCredentials(...args) {
@@ -1,18 +1,15 @@
1
1
  import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
2
2
  import { t as ensureMatrixCryptoRuntime } from "./deps-BVWGd2XS.js";
3
- import { f as LogService, p as noop } from "./shared-BbT5LdPp.js";
4
- import { i as MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, n as isRepairableSecretStorageAccessError } from "./recovery-key-store-D6RbiZMM.js";
5
- import fs from "node:fs";
6
- import path from "node:path";
3
+ import { n as LogService, r as noop } from "./logger-D0GCSDQq.js";
4
+ import { i as restoreIdbFromDisk, n as persistIdbToDisk } from "./idb-persistence-BGY1CJ7J.js";
5
+ import { n as isRepairableSecretStorageAccessError } from "./recovery-key-store-TSlOpcEG.js";
7
6
  import { resolveDateTimestampMs, resolveTimestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
8
- import { setTimeout as setTimeout$1 } from "node:timers/promises";
9
7
  import { MatrixEventEvent } from "matrix-js-sdk/lib/matrix.js";
8
+ import { setTimeout as setTimeout$1 } from "node:timers/promises";
10
9
  import { VerificationMethod } from "matrix-js-sdk/lib/types.js";
11
10
  import "fake-indexeddb/auto";
12
11
  import { CryptoEvent } from "matrix-js-sdk/lib/crypto-api/CryptoEvent.js";
13
12
  import { DecryptionFailureCode } from "matrix-js-sdk/lib/crypto-api/index.js";
14
- import { indexedDB } from "fake-indexeddb";
15
- import { withFileLock } from "openclaw/plugin-sdk/file-lock";
16
13
  import { VerificationPhase, VerificationRequestEvent, VerifierEvent } from "matrix-js-sdk/lib/crypto-api/verification.js";
17
14
  //#region extensions/matrix/src/matrix/sdk/verification-status.ts
18
15
  function isMatrixDeviceLocallyVerified(status) {
@@ -653,173 +650,6 @@ var MatrixDecryptBridge = class {
653
650
  }
654
651
  };
655
652
  //#endregion
656
- //#region extensions/matrix/src/matrix/sdk/idb-persistence.ts
657
- function isValidIdbIndexSnapshot(value) {
658
- if (!value || typeof value !== "object") return false;
659
- const candidate = value;
660
- return typeof candidate.name === "string" && (typeof candidate.keyPath === "string" || Array.isArray(candidate.keyPath) && candidate.keyPath.every((entry) => typeof entry === "string")) && typeof candidate.multiEntry === "boolean" && typeof candidate.unique === "boolean";
661
- }
662
- function isValidIdbRecordSnapshot(value) {
663
- if (!value || typeof value !== "object") return false;
664
- return "key" in value && "value" in value;
665
- }
666
- function isValidIdbStoreSnapshot(value) {
667
- if (!value || typeof value !== "object") return false;
668
- const candidate = value;
669
- const validKeyPath = candidate.keyPath === null || typeof candidate.keyPath === "string" || Array.isArray(candidate.keyPath) && candidate.keyPath.every((entry) => typeof entry === "string");
670
- return typeof candidate.name === "string" && validKeyPath && typeof candidate.autoIncrement === "boolean" && Array.isArray(candidate.indexes) && candidate.indexes.every((entry) => isValidIdbIndexSnapshot(entry)) && Array.isArray(candidate.records) && candidate.records.every((entry) => isValidIdbRecordSnapshot(entry));
671
- }
672
- function isValidIdbDatabaseSnapshot(value) {
673
- if (!value || typeof value !== "object") return false;
674
- const candidate = value;
675
- return typeof candidate.name === "string" && typeof candidate.version === "number" && Number.isFinite(candidate.version) && candidate.version > 0 && Array.isArray(candidate.stores) && candidate.stores.every((entry) => isValidIdbStoreSnapshot(entry));
676
- }
677
- function parseSnapshotPayload(data) {
678
- const parsed = JSON.parse(data);
679
- if (!Array.isArray(parsed) || parsed.length === 0) return null;
680
- if (!parsed.every((entry) => isValidIdbDatabaseSnapshot(entry))) throw new Error("Malformed IndexedDB snapshot payload");
681
- return parsed;
682
- }
683
- function idbReq(req) {
684
- return new Promise((resolve, reject) => {
685
- req.addEventListener("success", () => resolve(req.result), { once: true });
686
- req.addEventListener("error", () => reject(toLintErrorObject(req.error, "Non-Error rejection")), { once: true });
687
- });
688
- }
689
- async function dumpIndexedDatabases(databasePrefix) {
690
- const idb = indexedDB;
691
- const dbList = await idb.databases();
692
- const snapshot = [];
693
- const expectedPrefix = databasePrefix ? `${databasePrefix}::` : null;
694
- for (const { name, version } of dbList) {
695
- if (!name || !version) continue;
696
- if (expectedPrefix && !name.startsWith(expectedPrefix)) continue;
697
- const db = await new Promise((resolve, reject) => {
698
- const r = idb.open(name, version);
699
- r.addEventListener("success", () => resolve(r.result), { once: true });
700
- r.addEventListener("error", () => reject(toLintErrorObject(r.error, "Non-Error rejection")), { once: true });
701
- });
702
- const stores = [];
703
- for (const storeName of db.objectStoreNames) {
704
- const store = db.transaction(storeName, "readonly").objectStore(storeName);
705
- const storeInfo = {
706
- name: storeName,
707
- keyPath: store.keyPath,
708
- autoIncrement: store.autoIncrement,
709
- indexes: [],
710
- records: []
711
- };
712
- for (const idxName of store.indexNames) {
713
- const idx = store.index(idxName);
714
- storeInfo.indexes.push({
715
- name: idxName,
716
- keyPath: idx.keyPath,
717
- multiEntry: idx.multiEntry,
718
- unique: idx.unique
719
- });
720
- }
721
- const keys = await idbReq(store.getAllKeys());
722
- const values = await idbReq(store.getAll());
723
- storeInfo.records = keys.map((k, i) => ({
724
- key: k,
725
- value: values[i]
726
- }));
727
- stores.push(storeInfo);
728
- }
729
- snapshot.push({
730
- name,
731
- version,
732
- stores
733
- });
734
- db.close();
735
- }
736
- return snapshot;
737
- }
738
- async function restoreIndexedDatabases(snapshot) {
739
- const idb = indexedDB;
740
- for (const dbSnap of snapshot) await new Promise((resolve, reject) => {
741
- const r = idb.open(dbSnap.name, dbSnap.version);
742
- r.addEventListener("upgradeneeded", () => {
743
- const db = r.result;
744
- for (const storeSnap of dbSnap.stores) {
745
- const opts = {};
746
- if (storeSnap.keyPath !== null) opts.keyPath = storeSnap.keyPath;
747
- if (storeSnap.autoIncrement) opts.autoIncrement = true;
748
- const store = db.createObjectStore(storeSnap.name, opts);
749
- for (const idx of storeSnap.indexes) store.createIndex(idx.name, idx.keyPath, {
750
- unique: idx.unique,
751
- multiEntry: idx.multiEntry
752
- });
753
- }
754
- });
755
- r.addEventListener("success", () => {
756
- (async () => {
757
- const db = r.result;
758
- for (const storeSnap of dbSnap.stores) {
759
- if (storeSnap.records.length === 0) continue;
760
- const tx = db.transaction(storeSnap.name, "readwrite");
761
- const store = tx.objectStore(storeSnap.name);
762
- for (const rec of storeSnap.records) if (storeSnap.keyPath !== null) store.put(rec.value);
763
- else store.put(rec.value, rec.key);
764
- await new Promise((res) => {
765
- tx.addEventListener("complete", () => res(), { once: true });
766
- });
767
- }
768
- db.close();
769
- resolve();
770
- })().catch(reject);
771
- }, { once: true });
772
- r.addEventListener("error", () => reject(toLintErrorObject(r.error, "Non-Error rejection")), { once: true });
773
- });
774
- }
775
- function resolveDefaultIdbSnapshotPath() {
776
- const stateDir = process.env.OPENCLAW_STATE_DIR || path.join(process.env.HOME || "/tmp", ".openclaw");
777
- return path.join(stateDir, "matrix", "crypto-idb-snapshot.json");
778
- }
779
- async function restoreIdbFromDisk(snapshotPath) {
780
- const candidatePaths = snapshotPath ? [snapshotPath] : [resolveDefaultIdbSnapshotPath()];
781
- for (const resolvedPath of candidatePaths) {
782
- if (!fs.existsSync(resolvedPath)) continue;
783
- try {
784
- if (await withFileLock(resolvedPath, MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, async () => {
785
- const snapshot = parseSnapshotPayload(fs.readFileSync(resolvedPath, "utf8"));
786
- if (!snapshot) return false;
787
- await restoreIndexedDatabases(snapshot);
788
- LogService.info("IdbPersistence", `Restored ${snapshot.length} IndexedDB database(s) from ${resolvedPath}`);
789
- return true;
790
- })) return true;
791
- } catch (err) {
792
- LogService.warn("IdbPersistence", `Failed to restore IndexedDB snapshot from ${resolvedPath}:`, err);
793
- continue;
794
- }
795
- }
796
- return false;
797
- }
798
- async function persistIdbToDisk(params) {
799
- const snapshotPath = params?.snapshotPath ?? resolveDefaultIdbSnapshotPath();
800
- try {
801
- fs.mkdirSync(path.dirname(snapshotPath), { recursive: true });
802
- const persistedCount = await withFileLock(snapshotPath, MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, async () => {
803
- const snapshot = await dumpIndexedDatabases(params?.databasePrefix);
804
- if (snapshot.length === 0) return 0;
805
- fs.writeFileSync(snapshotPath, JSON.stringify(snapshot));
806
- fs.chmodSync(snapshotPath, 384);
807
- return snapshot.length;
808
- });
809
- if (persistedCount === 0) return;
810
- LogService.debug("IdbPersistence", `Persisted ${persistedCount} IndexedDB database(s) to ${snapshotPath}`);
811
- } catch (err) {
812
- LogService.warn("IdbPersistence", "Failed to persist IndexedDB snapshot:", err);
813
- }
814
- }
815
- function toLintErrorObject(value, fallbackMessage) {
816
- if (value instanceof Error) return value;
817
- if (typeof value === "string") return new Error(value);
818
- const error = new Error(fallbackMessage, { cause: value });
819
- if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
820
- return error;
821
- }
822
- //#endregion
823
653
  //#region extensions/matrix/src/matrix/sdk/verification-manager.ts
824
654
  const MATRIX_VERIFICATION_PHASES = new Set([
825
655
  -1,