@openclaw/matrix 2026.6.11 → 2026.7.1-beta.2

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 (57) hide show
  1. package/dist/api.js +4 -4
  2. package/dist/{approval-handler.runtime-CK5HedmU.js → approval-handler.runtime-DzpLXVdc.js} +4 -4
  3. package/dist/{approval-ids-gM2AFaP-.js → approval-ids-R834n6m3.js} +1 -1
  4. package/dist/{approval-reaction-auth--lKUos8v.js → approval-reaction-auth-eAqCXUFG.js} +2 -2
  5. package/dist/{channel-Y_HGdzpZ.js → channel-KcNo9qtl.js} +18 -22
  6. package/dist/channel-plugin-api.js +1 -1
  7. package/dist/{channel.runtime-DkbZfBYE.js → channel.runtime-DtsGVgZj.js} +7 -10
  8. package/dist/{cli-ZiO7g1vT.js → cli-Clvpw_8I.js} +10 -17
  9. package/dist/{cli-metadata-Cn_UFU3u.js → cli-metadata-D3N0Avnt.js} +1 -1
  10. package/dist/cli-metadata.js +1 -1
  11. package/dist/{client-DnNqVfCX.js → client-BQz5GcYr.js} +2 -2
  12. package/dist/{client-COdtuzoa.js → client-D-5GVz_D.js} +2 -2
  13. package/dist/{client-bootstrap-DoOOMP52.js → client-bootstrap-CBJciU5u.js} +6 -9
  14. package/dist/{config-schema-o1UmRtMF.js → config-schema-Dn-fHID8.js} +1 -1
  15. package/dist/contract-api.js +2 -2
  16. package/dist/{create-client-DWe5jGGk.js → create-client-DhGid8FE.js} +7 -10
  17. package/dist/{credentials-write.runtime-cZhhyGAZ.js → credentials-write.runtime-5PDPPG9f.js} +2 -5
  18. package/dist/{crypto-runtime-DaHFPR8x.js → crypto-runtime-B7kyrTL0.js} +9 -7
  19. package/dist/{deps-BVWGd2XS.js → deps-D3bkh48_.js} +3 -3
  20. package/dist/{directory-live-D4ibL3X0.js → directory-live-Ctu4whZK.js} +3 -3
  21. package/dist/{doctor-BwpkOBwr.js → doctor-BRSDNU5C.js} +1 -1
  22. package/dist/doctor-contract-api.js +2 -2
  23. package/dist/{draft-stream-aZa1gWNI.js → draft-stream-j71tSUu-.js} +1 -1
  24. package/dist/{file-sync-store-1GY-yvy-.js → file-sync-store-BWLVB01Y.js} +1 -1
  25. package/dist/{http-client-BBfH0FfA.js → http-client-nSmFiVgk.js} +11 -6
  26. package/dist/index.js +3 -6
  27. package/dist/{legacy-crypto-inspector-tJOj25VL.js → legacy-crypto-inspector-D_8iylBq.js} +1 -1
  28. package/dist/{legacy-crypto-restore-DenIM7bT.js → legacy-crypto-restore-B0gcIEkE.js} +1 -1
  29. package/dist/{matrix-migration.runtime-dvxE3e5l.js → matrix-migration.runtime-Ctlb_rZl.js} +1 -1
  30. package/dist/{media-text-DS2lvlA2.js → media-text-XO4VaezT.js} +1 -1
  31. package/dist/{messages-CMTiMecS.js → messages-nQLGGa1r.js} +3 -3
  32. package/dist/{monitor-BpvP2_nj.js → monitor-k3Sko8qt.js} +50 -77
  33. package/dist/plugin-entry.handlers.runtime.js +2 -5
  34. package/dist/probe.runtime-BED7DXis.js +3 -0
  35. package/dist/{profile-update-DUh6sAqK.js → profile-update-DIOAhezh.js} +2 -2
  36. package/dist/{reaction-events-CABcpM-q.js → reaction-events-BDsbR82F.js} +3 -10
  37. package/dist/{resolve-targets-Byrcsv59.js → resolve-targets-BbrinjHd.js} +1 -1
  38. package/dist/{resolver.runtime-Blu9khLB.js → resolver.runtime-B3N7k_6-.js} +1 -1
  39. package/dist/runtime-api.js +1 -1
  40. package/dist/runtime-heavy-api.js +1 -1
  41. package/dist/{sdk-CpYofZkF.js → sdk-eyqOqjmn.js} +9 -12
  42. package/dist/{send-eoayPB_l.js → send-D0hpevF-.js} +2 -5
  43. package/dist/session-binding-contract-api.js +1 -1
  44. package/dist/{setup-bootstrap-DRzRwu9E.js → setup-bootstrap-Ihb_DM2a.js} +2 -2
  45. package/dist/{setup-core-Ub_idsu1.js → setup-core-D2BQs8w1.js} +1 -1
  46. package/dist/setup-plugin-api.js +3 -3
  47. package/dist/{setup-surface-CXenmuMm.js → setup-surface-1qf1LZIP.js} +5 -5
  48. package/dist/{shared-CSN0TWWD.js → shared-BGcaBMK3.js} +15 -31
  49. package/dist/{startup-verification-Bl_QJ2BQ.js → startup-verification-Bd31KqLv.js} +1 -1
  50. package/dist/{storage-BSLHjdgS.js → storage-t5S-5c_5.js} +27 -12
  51. package/dist/subagent-hooks-api.js +2 -5
  52. package/dist/{thread-bindings-DuoPRata.js → thread-bindings-BnuBS0VH.js} +2 -2
  53. package/dist/{tool-actions.runtime-BwP9E9M0.js → tool-actions.runtime-BeUveYxV.js} +6 -6
  54. package/dist/{verification-BN8M6A73.js → verification-CNw2K4uT.js} +1 -1
  55. package/npm-shrinkwrap.json +3 -3
  56. package/package.json +4 -4
  57. package/dist/probe.runtime-DKRqRegP.js +0 -3
@@ -92,21 +92,17 @@ function isCompatibleStorageRoot(params) {
92
92
  function resolvePreferredMatrixStorageRoot(params) {
93
93
  const parentDir = path.dirname(params.canonicalRootDir);
94
94
  const bestCurrentScore = scoreStorageRoot(params.canonicalRootDir);
95
+ const bestCurrentMtimeMs = resolveStorageRootMtimeMs(params.canonicalRootDir);
95
96
  let best = {
96
97
  rootDir: params.canonicalRootDir,
97
98
  tokenHash: params.canonicalTokenHash,
98
99
  score: bestCurrentScore,
99
- mtimeMs: resolveStorageRootMtimeMs(params.canonicalRootDir)
100
+ mtimeMs: bestCurrentMtimeMs
100
101
  };
101
102
  if (!params.deviceId?.trim()) return {
102
103
  rootDir: best.rootDir,
103
104
  tokenHash: best.tokenHash
104
105
  };
105
- const canonicalMetadata = readStoredRootMetadata(params.canonicalRootDir);
106
- if (canonicalMetadata.accessTokenHash === params.canonicalTokenHash && canonicalMetadata.deviceId?.trim() === params.deviceId.trim() && canonicalMetadata.currentTokenStateClaimed === true) return {
107
- rootDir: best.rootDir,
108
- tokenHash: best.tokenHash
109
- };
110
106
  let siblingEntries;
111
107
  try {
112
108
  siblingEntries = fs.readdirSync(parentDir, { withFileTypes: true });
@@ -116,7 +112,9 @@ function resolvePreferredMatrixStorageRoot(params) {
116
112
  tokenHash: best.tokenHash
117
113
  };
118
114
  }
119
- for (const entry of siblingEntries) {
115
+ const compatiblePopulatedSiblings = [];
116
+ const populatedTokenHashes = bestCurrentScore > 0 ? [params.canonicalTokenHash] : [];
117
+ for (const entry of siblingEntries.toSorted((a, b) => a.name.localeCompare(b.name))) {
120
118
  if (!entry.isDirectory()) continue;
121
119
  if (entry.name === params.canonicalTokenHash) continue;
122
120
  const candidateRootDir = path.join(parentDir, entry.name);
@@ -130,14 +128,31 @@ function resolvePreferredMatrixStorageRoot(params) {
130
128
  })) continue;
131
129
  const candidateScore = scoreStorageRoot(candidateRootDir);
132
130
  if (candidateScore <= 0) continue;
133
- const candidateMtimeMs = resolveStorageRootMtimeMs(candidateRootDir);
134
- if (candidateScore > best.score || best.rootDir !== params.canonicalRootDir && candidateScore === best.score && candidateMtimeMs > best.mtimeMs) best = {
131
+ populatedTokenHashes.push(entry.name);
132
+ compatiblePopulatedSiblings.push({
135
133
  rootDir: candidateRootDir,
136
134
  tokenHash: entry.name,
137
135
  score: candidateScore,
138
- mtimeMs: candidateMtimeMs
136
+ mtimeMs: resolveStorageRootMtimeMs(candidateRootDir)
137
+ });
138
+ }
139
+ const canonicalMetadata = readStoredRootMetadata(params.canonicalRootDir);
140
+ if (!(canonicalMetadata.accessTokenHash === params.canonicalTokenHash && canonicalMetadata.deviceId?.trim() === params.deviceId.trim() && canonicalMetadata.currentTokenStateClaimed === true)) {
141
+ for (const candidate of compatiblePopulatedSiblings) if (candidate.score > best.score || best.rootDir !== params.canonicalRootDir && candidate.score === best.score && candidate.mtimeMs > best.mtimeMs) best = {
142
+ rootDir: candidate.rootDir,
143
+ tokenHash: candidate.tokenHash,
144
+ score: candidate.score,
145
+ mtimeMs: candidate.mtimeMs
139
146
  };
140
147
  }
148
+ if (populatedTokenHashes.length > 1) getMatrixRuntime().logging.getChildLogger({ module: "matrix-storage" }).warn("matrix: multiple populated token-hash storage roots detected", {
149
+ parentDir,
150
+ canonicalTokenHash: params.canonicalTokenHash,
151
+ selectedTokenHash: best.tokenHash,
152
+ populatedTokenHashes,
153
+ populatedSiblingTokenHashes: compatiblePopulatedSiblings.map((root) => root.tokenHash),
154
+ populatedRootCount: populatedTokenHashes.length
155
+ });
141
156
  return {
142
157
  rootDir: best.rootDir,
143
158
  tokenHash: best.tokenHash
@@ -186,7 +201,7 @@ async function maybeMigrateLegacyStorage(params) {
186
201
  const legacy = resolveLegacyStoragePaths(params.env);
187
202
  const hasFlatLegacyStorageFile = fs.existsSync(legacy.storagePath);
188
203
  const hasAccountScopedLegacyStorageFile = fs.existsSync(params.storagePaths.storagePath);
189
- const syncCache = hasFlatLegacyStorageFile || hasAccountScopedLegacyStorageFile ? await import("./file-sync-store-1GY-yvy-.js").then((n) => n.n) : null;
204
+ const syncCache = hasFlatLegacyStorageFile || hasAccountScopedLegacyStorageFile ? await import("./file-sync-store-BWLVB01Y.js").then((n) => n.n) : null;
190
205
  const hasFlatLegacyStorage = hasFlatLegacyStorageFile && await syncCache?.readLegacyMatrixSyncCacheState(legacy.rootDir) !== null;
191
206
  const hasAccountScopedLegacyStorage = hasAccountScopedLegacyStorageFile && await syncCache?.readLegacyMatrixSyncCacheState(params.storagePaths.rootDir) !== null;
192
207
  const hasLegacyCrypto = fs.existsSync(legacy.cryptoPath);
@@ -293,7 +308,7 @@ async function migrateLegacyIdbSnapshotToSqlite(params) {
293
308
  });
294
309
  }
295
310
  async function migrateLegacySyncCacheToSqlite(params) {
296
- const syncCache = await import("./file-sync-store-1GY-yvy-.js").then((n) => n.n);
311
+ const syncCache = await import("./file-sync-store-BWLVB01Y.js").then((n) => n.n);
297
312
  const persisted = await syncCache.readLegacyMatrixSyncCacheState(params.sourceRootDir);
298
313
  if (!persisted) return;
299
314
  const store = getMatrixRuntime().state.openKeyedStore(syncCache.openMatrixSyncCacheStoreOptions(params.targetRootDir));
@@ -1,9 +1,6 @@
1
+ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
1
2
  //#region extensions/matrix/subagent-hooks-api.ts
2
- let matrixSubagentHooksPromise = null;
3
- function loadMatrixSubagentHooksModule() {
4
- matrixSubagentHooksPromise ??= import("./subagent-hooks-dkPAF6Et.js");
5
- return matrixSubagentHooksPromise;
6
- }
3
+ const loadMatrixSubagentHooksModule = createLazyRuntimeModule(() => import("./subagent-hooks-dkPAF6Et.js"));
7
4
  function registerMatrixSubagentHooks(api) {
8
5
  api.on("subagent_ended", async (event) => {
9
6
  const { handleMatrixSubagentEnded } = await loadMatrixSubagentHooksModule();
@@ -1,8 +1,8 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
2
2
  import { a as listBindingsForAccount, c as resolveBindingKey, f as setMatrixThreadBindingManagerEntry, h as toSessionBindingRecord, l as resolveEffectiveBindingExpiry, m as toMatrixBindingTargetKind, o as removeBindingRecord, r as getMatrixThreadBindingManagerEntry, t as deleteMatrixThreadBindingManagerEntry, u as setBindingRecord } from "./thread-bindings-shared-CKnY4LSd.js";
3
3
  import { O as resolveMatrixSqliteStateEnv, k as resolveMatrixSqliteStateKey } from "./crypto-state-store-DK2tcEyP.js";
4
- import { c as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-BSLHjdgS.js";
5
- import { a as sendMessageMatrix } from "./send-eoayPB_l.js";
4
+ import { c as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-t5S-5c_5.js";
5
+ import { a as sendMessageMatrix } from "./send-D0hpevF-.js";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import path from "node:path";
8
8
  import { createHash } from "node:crypto";
@@ -1,12 +1,12 @@
1
1
  import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
2
- import "./setup-core-Ub_idsu1.js";
3
- import { E as parsePollStart, T as isPollStartType, b as buildPollResponseContent, i as reactMatrixMessage, u as resolveMatrixRoomId } from "./send-eoayPB_l.js";
2
+ import "./setup-core-D2BQs8w1.js";
3
+ import { E as parsePollStart, T as isPollStartType, b as buildPollResponseContent, i as reactMatrixMessage, u as resolveMatrixRoomId } from "./send-D0hpevF-.js";
4
4
  import { i as buildMatrixReactionRelationsPath, o as selectOwnMatrixReactionEventIds, s as summarizeMatrixReactionEvents } from "./reaction-common-DkrQdBSZ.js";
5
- import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-DnNqVfCX.js";
6
- import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as sendMatrixMessage, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessages, s as EventType, t as deleteMatrixMessage } from "./messages-CMTiMecS.js";
5
+ import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-BQz5GcYr.js";
6
+ import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as sendMatrixMessage, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessages, s as EventType, t as deleteMatrixMessage } from "./messages-nQLGGa1r.js";
7
7
  import { a as jsonResult, c as readStringArrayParam, l as readStringParam, o as readPositiveIntegerParam, r as createActionGate, s as readReactionParams } from "./runtime-api-CsBoesCU.js";
8
- import { t as applyMatrixProfileUpdate } from "./profile-update-DUh6sAqK.js";
9
- import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-BN8M6A73.js";
8
+ import { t as applyMatrixProfileUpdate } from "./profile-update-DIOAhezh.js";
9
+ import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-CNw2K4uT.js";
10
10
  import { normalizeOptionalLowercaseString, uniqueStrings, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
11
11
  //#region extensions/matrix/src/matrix/actions/polls.ts
12
12
  function normalizeOptionIndexes(indexes) {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-DnNqVfCX.js";
2
+ import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-BQz5GcYr.js";
3
3
  import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-Bg3IRYoX.js";
4
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.6.11",
3
+ "version": "2026.7.1-beta.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/matrix",
9
- "version": "2026.6.11",
9
+ "version": "2026.7.1-beta.2",
10
10
  "dependencies": {
11
11
  "@matrix-org/matrix-sdk-crypto-nodejs": "0.6.0",
12
12
  "@matrix-org/matrix-sdk-crypto-wasm": "18.3.0",
@@ -18,7 +18,7 @@
18
18
  "zod": "4.4.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.6.11"
21
+ "openclaw": ">=2026.7.1-beta.2"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "openclaw": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.6.11",
3
+ "version": "2026.7.1-beta.2",
4
4
  "description": "OpenClaw Matrix channel plugin for rooms and direct messages.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@
18
18
  "zod": "4.4.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.6.11"
21
+ "openclaw": ">=2026.7.1-beta.2"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "openclaw": {
@@ -84,10 +84,10 @@
84
84
  "allowInvalidConfigRecovery": true
85
85
  },
86
86
  "compat": {
87
- "pluginApi": ">=2026.6.11"
87
+ "pluginApi": ">=2026.7.1-beta.2"
88
88
  },
89
89
  "build": {
90
- "openclawVersion": "2026.6.11"
90
+ "openclawVersion": "2026.7.1-beta.2"
91
91
  },
92
92
  "release": {
93
93
  "publishToClawHub": true,
@@ -1,3 +0,0 @@
1
- import { t as createMatrixClient } from "./create-client-DWe5jGGk.js";
2
- import "./client-COdtuzoa.js";
3
- export { createMatrixClient };