@openclaw/matrix 2026.10.10-beta.5 → 2026.10.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/.setup/{account-selection-Bs_jCAaG.mjs → account-selection-CWsL5zIU.mjs} +1 -1
  2. package/dist/.setup/{approval-handler.runtime-6u08WKWh.mjs → approval-handler.runtime-Co2elSYS.mjs} +4 -4
  3. package/dist/.setup/{channel-CqkLHNdp.mjs → channel-BBvOdxTc.mjs} +11 -10
  4. package/dist/.setup/{channel.runtime-BfZdvlho.mjs → channel.runtime-DyX4mM8d.mjs} +6 -6
  5. package/dist/.setup/{channel.setup-ClA7V_Ba.mjs → channel.setup-p6oll48W.mjs} +6 -2
  6. package/dist/.setup/{cli-BLgMlO3I.mjs → cli-C2XKMk1U.mjs} +12 -12
  7. package/dist/.setup/{cli-metadata-COWLWR3E.mjs → cli-metadata-C60BW1oa.mjs} +1 -1
  8. package/dist/.setup/{client-C4Gibhzl.mjs → client-BEl7PU1_.mjs} +8 -8
  9. package/dist/.setup/{client-C7pZ6gAl.mjs → client-Cxv-iMwp.mjs} +3 -3
  10. package/dist/.setup/{client-bootstrap-kOIDV4z_.mjs → client-bootstrap-D1vLveT2.mjs} +1 -1
  11. package/dist/.setup/{create-client-BS8UYx6N.mjs → create-client-CrY1E3hg.mjs} +5 -5
  12. package/dist/.setup/{credentials-read-D2ULV55A.mjs → credentials-read-Dj7Hj87M.mjs} +1 -1
  13. package/dist/.setup/{credentials-CPnJZaZB.mjs → credentials-udso1z0C.mjs} +2 -2
  14. package/dist/.setup/{crypto-runtime-D8yY7kjD.mjs → crypto-runtime-DqX7VD1W.mjs} +3 -3
  15. package/dist/.setup/{crypto-state-store-D4wrCvFs.mjs → crypto-state-store-DclM-fO5.mjs} +2 -1
  16. package/dist/.setup/{crypto-store-ownership-Z_Y5WRKr.mjs → crypto-store-ownership-Dr-T40Rp.mjs} +1 -1
  17. package/dist/.setup/{crypto-unsafe-state-doctor-C8szCYmf.mjs → crypto-unsafe-state-doctor-BG9qMu0B.mjs} +4 -4
  18. package/dist/.setup/{device-health-Be60VF1w.mjs → device-health-D6_ECUVe.mjs} +1 -1
  19. package/dist/.setup/{direct-management-B3wYhx_M.mjs → direct-management-ZcjZgYEl.mjs} +1 -1
  20. package/dist/.setup/{directory-live-BpSz-FQB.mjs → directory-live-_yaRaktv.mjs} +2 -2
  21. package/dist/.setup/doctor-contract-BANpMUbP.mjs +38 -0
  22. package/dist/.setup/{draft-stream-K6Lu-JEI.mjs → draft-stream-vO_qjwJb.mjs} +2 -2
  23. package/dist/.setup/{encryption-guidance-D5_IsDIy.mjs → encryption-guidance-BLUoN4aV.mjs} +1 -1
  24. package/dist/.setup/{exec-approvals-DtNw0e04.mjs → exec-approvals-BFT-ee9F.mjs} +2 -2
  25. package/dist/.setup/{file-sync-store-CUH8EAJq.mjs → file-sync-store-BxUPmUoJ.mjs} +3 -3
  26. package/dist/.setup/{idb-persistence-BHTYPRe_.mjs → idb-persistence-C2TsCHY2.mjs} +3 -3
  27. package/dist/.setup/{inbound-dedupe-C-EBGY0B.mjs → inbound-dedupe-sW_gaR44.mjs} +1 -1
  28. package/dist/.setup/{joined-room-encryption-BAD70N5n.mjs → joined-room-encryption-DBbLkdvv.mjs} +1 -1
  29. package/dist/.setup/{logger-CXQnpXCt.mjs → logger-CuAzdD8Q.mjs} +2 -2
  30. package/dist/.setup/{logging-BKV8TYQq.mjs → logging-CoaEyRtA.mjs} +20 -14
  31. package/dist/.setup/{messages-O6G0-_xr.mjs → messages-TuEa_BPZ.mjs} +2 -2
  32. package/dist/.setup/{monitor-BSEZMFyq.mjs → monitor-B86Ll4B8.mjs} +119 -39
  33. package/dist/.setup/{onboarding-DQLF7huY.mjs → onboarding-DOLEjkg2.mjs} +5 -5
  34. package/dist/.setup/{outbound-C0bqZr89.mjs → outbound-BWsyqwt1.mjs} +2 -2
  35. package/dist/.setup/{profile-update-BbfEg9Fx.mjs → profile-update-DiXSVBki.mjs} +2 -2
  36. package/dist/.setup/{reaction-events-51DOeO0I.mjs → reaction-events-CuUeYcBC.mjs} +4 -4
  37. package/dist/.setup/{resolve-targets-BJ5sIKeM.mjs → resolve-targets-Dd70hGcM.mjs} +2 -2
  38. package/dist/.setup/{retired-state-DOCruzWd.mjs → retired-state-C4UnLIg4.mjs} +1 -37
  39. package/dist/.setup/{room-info-DAJKw-I8.mjs → room-info-C13IUffQ.mjs} +3 -3
  40. package/dist/.setup/{doctor-contract-CsTNmbMa.mjs → runtime-doctor-migrations-hxP-CXX7.mjs} +12 -48
  41. package/dist/.setup/runtime-setter-api-DtxDAM-x.mjs +3 -0
  42. package/dist/.setup/{sdk-ByU8So5S.mjs → sdk-DNW03GqJ.mjs} +9 -9
  43. package/dist/.setup/secret-contract-api-CiuSYjUy.mjs +3 -0
  44. package/dist/.setup/{send-CFx1h7xE.mjs → send-BGgwE5pV.mjs} +3 -3
  45. package/dist/.setup/{setup-bootstrap-DANlsW-o.mjs → setup-bootstrap-BCbltIf_.mjs} +2 -2
  46. package/dist/.setup/{setup-core-EQceJMZZ.mjs → setup-core-Di6NtQ_J.mjs} +4 -4
  47. package/dist/.setup/setup-plugin-api-ORC_4yEA.mjs +3 -0
  48. package/dist/.setup/sqlite-state-LByPx4Yp.mjs +37 -0
  49. package/dist/.setup/{startup-verification-UU8DUvi4.mjs → startup-verification-8xvGpdtK.mjs} +3 -2
  50. package/dist/.setup/{storage-l8V0XsGM.mjs → storage-CN4dxdtV.mjs} +14 -6
  51. package/dist/.setup/{sync-cache-state-Cnm4TCEI.mjs → sync-cache-state-L1kwjhjj.mjs} +7 -4
  52. package/dist/.setup/{thread-bindings-C0gv7BEN.mjs → thread-bindings-pNgPVdof.mjs} +4 -3
  53. package/dist/.setup/{tool-actions-DGYRJDEV.mjs → tool-actions-CFC7ZpIt.mjs} +9 -9
  54. package/dist/.setup/{verification-DUxuApWC.mjs → verification-CuT5ZBDO.mjs} +3 -3
  55. package/dist/api.js +5 -5
  56. package/dist/channel-plugin-api.js +2 -1
  57. package/dist/cli-metadata.js +2 -1
  58. package/dist/contract-api.js +2 -2
  59. package/dist/doctor-contract-api.js +46 -14
  60. package/dist/helper-api.js +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/plugin-entry.handlers.runtime.js +2 -2
  63. package/dist/runtime-api.js +1 -1
  64. package/dist/runtime-setter-api.js +2 -1
  65. package/dist/secret-contract-api.js +2 -1
  66. package/dist/session-binding-contract-api.js +1 -1
  67. package/dist/setup-entry.js +3 -3
  68. package/dist/setup-plugin-api.js +2 -1
  69. package/dist/thread-binding-api.js +2 -1
  70. package/dist/thread-bindings-runtime.js +2 -1
  71. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +26 -0
  72. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +2 -2
  73. package/node_modules/@openclaw/fs-safe/dist/native-config.js +14 -3
  74. package/node_modules/@openclaw/fs-safe/dist/output.js +6 -0
  75. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +2 -1
  76. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +12 -5
  77. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.d.ts +2 -2
  78. package/node_modules/@openclaw/fs-safe/dist/root-path-existing.js +27 -13
  79. package/node_modules/@openclaw/fs-safe/dist/root-path.js +2 -2
  80. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.d.ts +3 -0
  81. package/node_modules/@openclaw/fs-safe/dist/sibling-staged-file.js +18 -3
  82. package/node_modules/@openclaw/fs-safe/dist/watch-hints.js +8 -3
  83. package/node_modules/@openclaw/fs-safe/dist/windows-security-helper.exe +0 -0
  84. package/node_modules/@openclaw/fs-safe/docs/config.md +7 -1
  85. package/node_modules/@openclaw/fs-safe/docs/copy.md +10 -0
  86. package/node_modules/@openclaw/fs-safe/docs/migrating-to-0.5.md +6 -4
  87. package/node_modules/@openclaw/fs-safe/docs/native-helper.md +6 -4
  88. package/node_modules/@openclaw/fs-safe/docs/output.md +4 -2
  89. package/node_modules/@openclaw/fs-safe/docs/security-model.md +9 -0
  90. package/node_modules/@openclaw/fs-safe/docs/watch.md +7 -1
  91. package/node_modules/@openclaw/fs-safe/package.json +15 -14
  92. package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
  93. package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
  94. package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
  95. package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
  96. package/node_modules/@openclaw/fs-safe-freebsd-arm64/fs-safe-native.node +0 -0
  97. package/node_modules/@openclaw/fs-safe-freebsd-arm64/package.json +1 -1
  98. package/node_modules/@openclaw/fs-safe-freebsd-x64/fs-safe-native.node +0 -0
  99. package/node_modules/@openclaw/fs-safe-freebsd-x64/package.json +1 -1
  100. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
  101. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
  102. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
  103. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
  104. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  105. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
  106. package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
  107. package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
  108. package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/fs-safe-native.node +0 -0
  109. package/node_modules/@openclaw/fs-safe-win32-arm64-msvc/package.json +1 -1
  110. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
  111. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
  112. package/node_modules/matrix-js-sdk/lib/http-api/utils.js +3 -1
  113. package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +7 -1
  114. package/node_modules/matrix-js-sdk/src/http-api/utils.ts +5 -1
  115. package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +7 -1
  116. package/package.json +5 -5
  117. package/dist/.setup/runtime-setter-api-i2MOXoT3.mjs +0 -2
  118. package/dist/.setup/secret-contract-api-Dukgvike.mjs +0 -2
  119. package/dist/.setup/setup-plugin-api-f8mWghxf.mjs +0 -2
  120. package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +0 -1
@@ -0,0 +1,37 @@
1
+ import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
+ import os from "node:os";
3
+ //#region extensions/matrix/src/matrix/sqlite-state.ts
4
+ function resolveStateDirOverride(options) {
5
+ if (!options) return;
6
+ return options.stateDir || options.stateRootDir || getMatrixRuntime().state.resolveStateDir(options.env ?? process.env, os.homedir);
7
+ }
8
+ function resolveMatrixSqliteStateKey(options) {
9
+ return resolveStateDirOverride(options) ?? "";
10
+ }
11
+ function resolveMatrixSqliteStateEnv(options) {
12
+ const stateDir = resolveStateDirOverride(options);
13
+ if (!stateDir) return options?.env;
14
+ return {
15
+ ...options?.env ?? process.env,
16
+ OPENCLAW_STATE_DIR: stateDir
17
+ };
18
+ }
19
+ async function updateMatrixKeyedState(store, key, update, onUndefined = "keep") {
20
+ let observation = await store.observe(key);
21
+ for (;;) {
22
+ const value = update(observation.value);
23
+ if (value === void 0 && onUndefined === "skip") return false;
24
+ const result = await store.compareAndApply(key, observation.comparison, value === void 0 ? {
25
+ operation: "update",
26
+ action: "keep"
27
+ } : {
28
+ operation: "update",
29
+ action: "set",
30
+ value
31
+ });
32
+ if (result.status !== "conflict") return true;
33
+ observation = result.current;
34
+ }
35
+ }
36
+ //#endregion
37
+ export { resolveMatrixSqliteStateKey as n, updateMatrixKeyedState as r, resolveMatrixSqliteStateEnv as t };
@@ -1,6 +1,7 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
- import { o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile } from "./retired-state-DOCruzWd.mjs";
3
- import { o as resolveMatrixStoragePaths, r as recordCurrentStorageMetaDeviceId } from "./storage-l8V0XsGM.mjs";
2
+ import { r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
3
+ import { t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
4
+ import { o as resolveMatrixStoragePaths, r as recordCurrentStorageMetaDeviceId } from "./storage-CN4dxdtV.mjs";
4
5
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
5
6
  import path from "node:path";
6
7
  //#region extensions/matrix/src/matrix/monitor/startup-verification.ts
@@ -1,7 +1,8 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
2
  import { n as isMatrixActiveTokenRootDirectory, r as resolveMatrixAccountStorageRoot } from "./storage-paths-B51JM-pC.mjs";
3
- import { c as updateMatrixKeyedState, i as assertMatrixSupportedStateRoot, o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile } from "./retired-state-DOCruzWd.mjs";
4
- import { n as MATRIX_RECOVERY_KEY_FILENAME, o as scoreMatrixCryptoStateInStore, t as MATRIX_IDB_SNAPSHOT_FILENAME } from "./crypto-state-store-D4wrCvFs.mjs";
3
+ import { i as assertMatrixSupportedStateRoot, r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
4
+ import { r as updateMatrixKeyedState, t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
5
+ import { n as MATRIX_RECOVERY_KEY_FILENAME, o as scoreMatrixCryptoStateInStore, t as MATRIX_IDB_SNAPSHOT_FILENAME } from "./crypto-state-store-DclM-fO5.mjs";
5
6
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
6
7
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
7
8
  import path from "node:path";
@@ -183,14 +184,21 @@ async function maybeMigrateLegacyStorage({ storagePaths }) {
183
184
  const { rootDir, storagePath } = storagePaths;
184
185
  await assertMatrixSupportedStateRoot(rootDir);
185
186
  if (!fs.existsSync(storagePath)) return;
186
- const syncCache = await import("./sync-cache-state-Cnm4TCEI.mjs").then((n) => n.o);
187
- if (!await syncCache.readLegacyMatrixSyncCacheState(rootDir)) return;
187
+ const syncCache = await import("./sync-cache-state-L1kwjhjj.mjs").then((n) => n.o);
188
+ const { Utf8InputError } = await import("./runtime-doctor-migrations-hxP-CXX7.mjs").then((n) => n.t);
188
189
  const logger = getMatrixRuntime().logging.getChildLogger({ module: "matrix-storage" });
190
+ let persisted;
191
+ try {
192
+ persisted = await syncCache.readLegacyMatrixSyncCacheState(rootDir);
193
+ } catch (error) {
194
+ if (!(error instanceof Utf8InputError)) throw error;
195
+ logger.warn?.(`${error.message} Legacy Matrix sync cache left in place: ${storagePath}`);
196
+ return;
197
+ }
198
+ if (!persisted) return;
189
199
  fs.mkdirSync(rootDir, { recursive: true });
190
200
  let migrated = false;
191
201
  try {
192
- const persisted = await syncCache.readLegacyMatrixSyncCacheState(rootDir);
193
- if (!persisted) return;
194
202
  const store = getMatrixRuntime().state.openKeyedStoreV2(syncCache.openMatrixSyncCacheStoreOptions(rootDir));
195
203
  if (!await syncCache.hasMatrixSyncCacheStateInStore({
196
204
  storageRootDir: rootDir,
@@ -1,5 +1,6 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
2
- import { d as writeMatrixStateChunks, l as chunkMatrixStateJson, o as resolveMatrixSqliteStateEnv, u as readMatrixStateChunks } from "./retired-state-DOCruzWd.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
+ import { c as writeMatrixStateChunks, o as chunkMatrixStateJson, s as readMatrixStateChunks } from "./retired-state-C4UnLIg4.mjs";
3
+ import { t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
3
4
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
4
5
  import { createHash, randomUUID } from "node:crypto";
5
6
  import path from "node:path";
@@ -129,12 +130,14 @@ function buildSyncCacheRows(payload) {
129
130
  };
130
131
  }
131
132
  async function readLegacyMatrixSyncCacheState(storageRootDir) {
133
+ const { decodeUtf8Input, Utf8InputError } = await import("./runtime-doctor-migrations-hxP-CXX7.mjs").then((n) => n.t);
132
134
  try {
133
- const raw = await fs.readFile(resolveLegacySyncCachePath(storageRootDir), "utf8");
135
+ const raw = decodeUtf8Input(await fs.readFile(resolveLegacySyncCachePath(storageRootDir)), "Legacy Matrix sync cache");
134
136
  const persisted = normalizeLegacyPersistedStore(JSON.parse(raw));
135
137
  if (!persisted?.savedSync && !persisted?.clientOptions) return null;
136
138
  return persisted;
137
- } catch {
139
+ } catch (error) {
140
+ if (error instanceof Utf8InputError) throw error;
138
141
  return null;
139
142
  }
140
143
  }
@@ -1,8 +1,9 @@
1
1
  import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
2
2
  import { a as listBindingsForAccount, c as setBindingRecord, d as setMatrixThreadBindingManagerEntry, m as toSessionBindingRecord, o as removeBindingRecord, r as getMatrixThreadBindingManagerEntry, s as resolveBindingKey, t as deleteMatrixThreadBindingManagerEntry } from "./thread-bindings-shared-CPjUA0Ib.mjs";
3
- import { o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile, s as resolveMatrixSqliteStateKey } from "./retired-state-DOCruzWd.mjs";
4
- import { a as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-l8V0XsGM.mjs";
5
- import { r as sendMessageMatrix } from "./send-CFx1h7xE.mjs";
3
+ import { r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
4
+ import { n as resolveMatrixSqliteStateKey, t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
5
+ import { a as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-CN4dxdtV.mjs";
6
+ import { r as sendMessageMatrix } from "./send-BGgwE5pV.mjs";
6
7
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
8
  import { createHash } from "node:crypto";
8
9
  import path from "node:path";
@@ -1,16 +1,16 @@
1
1
  import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig } from "./account-config-CRsKoMqJ.mjs";
2
- import { g as resolveDefaultMatrixAccountId } from "./setup-core-EQceJMZZ.mjs";
3
- import { o as resolveMatrixRoomConfig } from "./channel-CqkLHNdp.mjs";
2
+ import { g as resolveDefaultMatrixAccountId } from "./setup-core-Di6NtQ_J.mjs";
3
+ import { o as resolveMatrixRoomConfig } from "./channel-BBvOdxTc.mjs";
4
4
  import { a as normalizeMatrixResolvableTarget } from "./target-ids-HhcaKX1n.mjs";
5
5
  import { l as selectOwnMatrixReactionEventIds, s as buildMatrixReactionRelationsPath, u as summarizeMatrixReactionEvents } from "./send-currentness-C2rMVVIQ.mjs";
6
- import { c as isStrictDirectMembership, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-B3wYhx_M.mjs";
7
- import { C as resolveMatrixRoomId, n as reactMatrixMessage, p as buildPollResponseContent, r as sendMessageMatrix, v as isPollStartType, y as parsePollStart } from "./send-CFx1h7xE.mjs";
6
+ import { c as isStrictDirectMembership, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-ZcjZgYEl.mjs";
7
+ import { C as resolveMatrixRoomId, n as reactMatrixMessage, p as buildPollResponseContent, r as sendMessageMatrix, v as isPollStartType, y as parsePollStart } from "./send-BGgwE5pV.mjs";
8
8
  import { i as parseMxc } from "./event-helpers-CxNgMQqH.mjs";
9
- import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as readMatrixMessages, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessage, s as EventType, t as deleteMatrixMessage } from "./messages-O6G0-_xr.mjs";
10
- import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-C7pZ6gAl.mjs";
11
- import { t as applyMatrixProfileUpdate } from "./profile-update-BbfEg9Fx.mjs";
12
- 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-DUxuApWC.mjs";
13
- import { n as getMatrixMemberInfo, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-DAJKw-I8.mjs";
9
+ import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as readMatrixMessages, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessage, s as EventType, t as deleteMatrixMessage } from "./messages-TuEa_BPZ.mjs";
10
+ import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-Cxv-iMwp.mjs";
11
+ import { t as applyMatrixProfileUpdate } from "./profile-update-DiXSVBki.mjs";
12
+ 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-CuT5ZBDO.mjs";
13
+ import { n as getMatrixMemberInfo, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-C13IUffQ.mjs";
14
14
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
15
15
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeUniqueTrimmedStringList, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
16
16
  import { ToolAuthorizationError, createActionGate, jsonResult, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
@@ -1,6 +1,6 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
2
- import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-C7pZ6gAl.mjs";
3
- import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-D5_IsDIy.mjs";
1
+ import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
2
+ import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-Cxv-iMwp.mjs";
3
+ import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-BLUoN4aV.mjs";
4
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { setTimeout } from "node:timers/promises";
6
6
  //#region extensions/matrix/src/matrix/actions/verification.ts
package/dist/api.js CHANGED
@@ -1,9 +1,9 @@
1
- import { a as resolveConfiguredMatrixAccountIds, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-Bs_jCAaG.mjs";
1
+ import { a as resolveConfiguredMatrixAccountIds, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-CWsL5zIU.mjs";
2
2
  import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./.setup/env-vars-aEBngJPa.mjs";
3
3
  import { a as resolveMatrixCredentialsFilename, i as resolveMatrixCredentialsDir, l as sanitizeMatrixPathSegment, o as resolveMatrixCredentialsPath, r as resolveMatrixAccountStorageRoot, s as resolveMatrixHomeserverKey, t as hashMatrixAccessToken } from "./.setup/storage-paths-B51JM-pC.mjs";
4
- import { r as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./.setup/setup-core-EQceJMZZ.mjs";
5
- import { t as matrixPlugin } from "./.setup/channel-CqkLHNdp.mjs";
4
+ import { r as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./.setup/setup-core-Di6NtQ_J.mjs";
5
+ import { t as matrixPlugin } from "./.setup/channel-BBvOdxTc.mjs";
6
6
  import { f as setMatrixThreadBindingMaxAgeBySessionKey, l as setMatrixThreadBindingIdleTimeoutBySessionKey, n as getMatrixThreadBindingManager, p as setMatrixThreadBindingMaxAgeBySessionKeyAsync, u as setMatrixThreadBindingIdleTimeoutBySessionKeyAsync } from "./.setup/thread-bindings-shared-CPjUA0Ib.mjs";
7
- import { t as matrixOnboardingAdapter } from "./.setup/onboarding-DQLF7huY.mjs";
8
- import { t as createMatrixThreadBindingManager } from "./.setup/thread-bindings-C0gv7BEN.mjs";
7
+ import { t as matrixOnboardingAdapter } from "./.setup/onboarding-DOLEjkg2.mjs";
8
+ import { t as createMatrixThreadBindingManager } from "./.setup/thread-bindings-pNgPVdof.mjs";
9
9
  export { createMatrixSetupWizardProxy, createMatrixThreadBindingManager, findMatrixAccountEntry, getMatrixScopedEnvVarNames, getMatrixThreadBindingManager, hashMatrixAccessToken, listMatrixEnvAccountIds, matrixOnboardingAdapter, matrixOnboardingAdapter as matrixSetupWizard, matrixPlugin, matrixSetupAdapter, requiresExplicitMatrixDefaultAccount, resolveConfiguredMatrixAccountIds, resolveMatrixAccountStorageRoot, resolveMatrixChannelConfig, resolveMatrixCredentialsDir, resolveMatrixCredentialsFilename, resolveMatrixCredentialsPath, resolveMatrixDefaultOrOnlyAccountId, resolveMatrixEnvAccountToken, resolveMatrixHomeserverKey, sanitizeMatrixPathSegment, setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingIdleTimeoutBySessionKeyAsync, setMatrixThreadBindingMaxAgeBySessionKey, setMatrixThreadBindingMaxAgeBySessionKeyAsync };
@@ -1 +1,2 @@
1
- export { t as matrixPlugin } from "./.setup/channel-CqkLHNdp.mjs";
1
+ import { t as matrixPlugin } from "./.setup/channel-BBvOdxTc.mjs";
2
+ export { matrixPlugin };
@@ -1 +1,2 @@
1
- export { t as default, n as registerMatrixCliMetadata } from "./.setup/cli-metadata-COWLWR3E.mjs";
1
+ import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./.setup/cli-metadata-C60BW1oa.mjs";
2
+ export { cli_metadata_default as default, registerMatrixCliMetadata };
@@ -1,3 +1,3 @@
1
- import { c as resolveSingleAccountPromotionTarget, l as singleAccountKeysToMove, r as matrixSetupAdapter, s as namedAccountPromotionKeys } from "./.setup/setup-core-EQceJMZZ.mjs";
2
- import { t as matrixOnboardingAdapter } from "./.setup/onboarding-DQLF7huY.mjs";
1
+ import { c as resolveSingleAccountPromotionTarget, l as singleAccountKeysToMove, r as matrixSetupAdapter, s as namedAccountPromotionKeys } from "./.setup/setup-core-Di6NtQ_J.mjs";
2
+ import { t as matrixOnboardingAdapter } from "./.setup/onboarding-DOLEjkg2.mjs";
3
3
  export { matrixSetupAdapter, matrixOnboardingAdapter as matrixSetupWizard, namedAccountPromotionKeys, resolveSingleAccountPromotionTarget, singleAccountKeysToMove };
@@ -1,9 +1,11 @@
1
- import { n as normalizeCompatibilityConfig, r as runtime_doctor_migrations_exports, t as legacyConfigRules } from "./.setup/doctor-contract-CsTNmbMa.mjs";
1
+ import { t as runtime_doctor_migrations_exports } from "./.setup/runtime-doctor-migrations-hxP-CXX7.mjs";
2
2
  import { i as normalizeMatrixStoredCredentials, n as isMatrixCredentialRevocation, r as matrixCredentialsStoreKey, t as MATRIX_CREDENTIALS_NAMESPACE } from "./.setup/credentials-state-B3cuUFwZ.mjs";
3
3
  import { i as resolveMatrixCredentialsDir } from "./.setup/storage-paths-B51JM-pC.mjs";
4
- import { a as describeRetiredMatrixState, o as resolveMatrixSqliteStateEnv, t as RETIRED_MATRIX_STATE_FILENAMES } from "./.setup/retired-state-DOCruzWd.mjs";
4
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./.setup/doctor-contract-BANpMUbP.mjs";
5
+ import { a as describeRetiredMatrixState, t as RETIRED_MATRIX_STATE_FILENAMES } from "./.setup/retired-state-C4UnLIg4.mjs";
6
+ import { t as resolveMatrixSqliteStateEnv } from "./.setup/sqlite-state-LByPx4Yp.mjs";
5
7
  import { t as walkMatrixStateFiles } from "./.setup/state-layout-walk-BQMgMykU.mjs";
6
- import { i as readLegacyMatrixSyncCacheState, n as hasMatrixSyncCacheStateInStore, r as openMatrixSyncCacheStoreOptions, s as writeMatrixSyncCacheStateToStore } from "./.setup/sync-cache-state-Cnm4TCEI.mjs";
8
+ import { i as readLegacyMatrixSyncCacheState, n as hasMatrixSyncCacheStateInStore, r as openMatrixSyncCacheStoreOptions, s as writeMatrixSyncCacheStateToStore } from "./.setup/sync-cache-state-L1kwjhjj.mjs";
7
9
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
8
10
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
9
11
  import { createHash } from "node:crypto";
@@ -216,7 +218,7 @@ async function verifyMatrixInboundDedupeSourcesRetired(stateDir) {
216
218
  */
217
219
  async function importNewestInboundDedupeMarkers(params) {
218
220
  const { createPersistentDedupeImportEntry } = await import("openclaw/plugin-sdk/persistent-dedupe");
219
- const { buildMatrixInboundDedupeEventKey, MATRIX_INBOUND_DEDUPE_STATE_MAX_ENTRIES, MATRIX_INBOUND_DEDUPE_TTL_MS, resolveMatrixInboundDedupeStateNamespace } = await import("./.setup/inbound-dedupe-C-EBGY0B.mjs");
221
+ const { buildMatrixInboundDedupeEventKey, MATRIX_INBOUND_DEDUPE_STATE_MAX_ENTRIES, MATRIX_INBOUND_DEDUPE_TTL_MS, resolveMatrixInboundDedupeStateNamespace } = await import("./.setup/inbound-dedupe-sW_gaR44.mjs");
220
222
  const now = params.now ?? Date.now();
221
223
  const stateMaxEntries = MATRIX_INBOUND_DEDUPE_STATE_MAX_ENTRIES;
222
224
  const newestByKey = /* @__PURE__ */ new Map();
@@ -297,7 +299,7 @@ async function collectLegacyMatrixCredentialSources(params) {
297
299
  return left.name.localeCompare(right.name);
298
300
  });
299
301
  if (files.length === 0) return [];
300
- const { requiresExplicitMatrixDefaultAccount, resolveMatrixDefaultOrOnlyAccountId } = await import("./.setup/account-selection-Bs_jCAaG.mjs").then((n) => n.t);
302
+ const { requiresExplicitMatrixDefaultAccount, resolveMatrixDefaultOrOnlyAccountId } = await import("./.setup/account-selection-CWsL5zIU.mjs").then((n) => n.t);
301
303
  return files.map((entry) => {
302
304
  const namedAccount = /^credentials(?:-([a-z0-9._-]+))?\.json$/iu.exec(entry.name)?.[1];
303
305
  return {
@@ -309,23 +311,36 @@ async function collectLegacyMatrixCredentialSources(params) {
309
311
  async function readLegacyMatrixCredentials(source) {
310
312
  if (!source.accountId) return null;
311
313
  try {
312
- const raw = JSON.parse(await fs.readFile(source.filePath, "utf8"));
314
+ const raw = JSON.parse((0, runtime_doctor_migrations_exports.decodeUtf8Input)(await fs.readFile(source.filePath), "Legacy Matrix credentials"));
313
315
  const createdAt = isRecord(raw) && typeof raw.createdAt === "string" && raw.createdAt ? raw.createdAt : (await fs.stat(source.filePath)).mtime.toISOString();
314
316
  return normalizeMatrixStoredCredentials(isRecord(raw) ? {
315
317
  ...raw,
316
318
  createdAt
317
319
  } : raw, source.accountId);
318
- } catch {
320
+ } catch (error) {
321
+ if (error instanceof runtime_doctor_migrations_exports.Utf8InputError) throw error;
319
322
  return null;
320
323
  }
321
324
  }
322
325
  async function* readLegacyMatrixSyncCacheSources(stateDir) {
323
326
  const { entries } = await walkMatrixStateFiles(stateDir, (name, depth) => name === MATRIX_SYNC_CACHE_FILENAME && (depth === 2 || depth === 4));
324
327
  for (const storageRootDir of entries.map((entry) => path.dirname(entry.path)).toSorted()) {
325
- const payload = await readLegacyMatrixSyncCacheState(storageRootDir);
328
+ let payload;
329
+ try {
330
+ payload = await readLegacyMatrixSyncCacheState(storageRootDir);
331
+ } catch (error) {
332
+ if (!(error instanceof runtime_doctor_migrations_exports.Utf8InputError)) throw error;
333
+ yield {
334
+ storageRootDir,
335
+ payload: null,
336
+ error
337
+ };
338
+ continue;
339
+ }
326
340
  if (payload) yield {
327
341
  storageRootDir,
328
- payload
342
+ payload,
343
+ error: void 0
329
344
  };
330
345
  }
331
346
  }
@@ -334,12 +349,12 @@ const stateMigrations = [
334
349
  id: "matrix-crypto-unsafe-state",
335
350
  label: "Matrix crypto unsafe final state",
336
351
  async detectLegacyState(params) {
337
- const { listMatrixCryptoUnsafeState } = await import("./.setup/crypto-unsafe-state-doctor-C8szCYmf.mjs").then((n) => n.t);
352
+ const { listMatrixCryptoUnsafeState } = await import("./.setup/crypto-unsafe-state-doctor-BG9qMu0B.mjs").then((n) => n.t);
338
353
  const roots = await listMatrixCryptoUnsafeState(params.stateDir, { openKeyedStoreV2: params.context.openPluginStateKeyedStore });
339
354
  return roots.length > 0 ? { preview: roots.map((root) => `Matrix crypto store is blocked after unsafe final save: ${root}. Run openclaw matrix doctor inspect; recovery is never automatic.`) } : null;
340
355
  },
341
356
  async migrateLegacyState(params) {
342
- const { listMatrixCryptoUnsafeState } = await import("./.setup/crypto-unsafe-state-doctor-C8szCYmf.mjs").then((n) => n.t);
357
+ const { listMatrixCryptoUnsafeState } = await import("./.setup/crypto-unsafe-state-doctor-BG9qMu0B.mjs").then((n) => n.t);
343
358
  return {
344
359
  changes: [],
345
360
  warnings: (await listMatrixCryptoUnsafeState(params.stateDir, { openKeyedStoreV2: params.context.openPluginStateKeyedStore })).map((root) => `Matrix crypto store remains blocked: ${root}. Inspect with openclaw matrix doctor inspect; explicit recovery may roll back keys.`)
@@ -358,6 +373,7 @@ const stateMigrations = [
358
373
  const changes = [];
359
374
  const warnings = [];
360
375
  const sources = await collectLegacyMatrixCredentialSources(params);
376
+ let utf8Warnings = 0;
361
377
  const store = params.context.openPluginStateKeyedStore({
362
378
  namespace: MATRIX_CREDENTIALS_NAMESPACE,
363
379
  maxEntries: 256,
@@ -368,7 +384,15 @@ const stateMigrations = [
368
384
  warnings.push(`Left ambiguous Matrix credential legacy source in place because no default account is selected: ${source.filePath}`);
369
385
  continue;
370
386
  }
371
- const credentials = await readLegacyMatrixCredentials(source);
387
+ let credentials;
388
+ try {
389
+ credentials = await readLegacyMatrixCredentials(source);
390
+ } catch (error) {
391
+ if (!(error instanceof runtime_doctor_migrations_exports.Utf8InputError)) throw error;
392
+ warnings.push(`${error.message} Left legacy source in place: ${source.filePath}`);
393
+ utf8Warnings++;
394
+ continue;
395
+ }
372
396
  if (!credentials) {
373
397
  warnings.push(`Left invalid Matrix credential legacy source in place: ${source.filePath}`);
374
398
  continue;
@@ -408,7 +432,8 @@ const stateMigrations = [
408
432
  }
409
433
  return {
410
434
  changes,
411
- warnings
435
+ warnings,
436
+ ...utf8Warnings > 0 && utf8Warnings === warnings.length ? { warningDisposition: "recoverable" } : {}
412
437
  };
413
438
  }
414
439
  },
@@ -510,7 +535,13 @@ const stateMigrations = [
510
535
  const changes = [];
511
536
  const warnings = [];
512
537
  const notices = [];
538
+ let utf8Warnings = 0;
513
539
  for await (const source of readLegacyMatrixSyncCacheSources(params.stateDir)) {
540
+ if (source.error) {
541
+ warnings.push(`${source.error.message} Left legacy source in place: ${source.storageRootDir}`);
542
+ utf8Warnings++;
543
+ continue;
544
+ }
514
545
  const store = params.context.openPluginStateKeyedStore(openMatrixSyncCacheStoreOptions(source.storageRootDir));
515
546
  const existing = await hasMatrixSyncCacheStateInStore({
516
547
  ...source,
@@ -535,7 +566,8 @@ const stateMigrations = [
535
566
  return {
536
567
  changes,
537
568
  warnings,
538
- ...notices.length > 0 ? { notices } : {}
569
+ ...notices.length > 0 ? { notices } : {},
570
+ ...utf8Warnings > 0 && utf8Warnings === warnings.length ? { warningDisposition: "recoverable" } : {}
539
571
  };
540
572
  }
541
573
  }
@@ -1,4 +1,4 @@
1
- import { a as resolveConfiguredMatrixAccountIds, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, r as hasImplicitMatrixAccountConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-Bs_jCAaG.mjs";
1
+ import { a as resolveConfiguredMatrixAccountIds, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, r as hasImplicitMatrixAccountConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-CWsL5zIU.mjs";
2
2
  import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./.setup/env-vars-aEBngJPa.mjs";
3
3
  import { a as resolveMatrixCredentialsFilename, c as resolveMatrixStateLayoutChildDepth, i as resolveMatrixCredentialsDir, l as sanitizeMatrixPathSegment, n as isMatrixActiveTokenRootDirectory, o as resolveMatrixCredentialsPath, r as resolveMatrixAccountStorageRoot, s as resolveMatrixHomeserverKey, t as hashMatrixAccessToken } from "./.setup/storage-paths-B51JM-pC.mjs";
4
4
  export { findMatrixAccountEntry, getMatrixScopedEnvVarNames, hasImplicitMatrixAccountConfig, hashMatrixAccessToken, isMatrixActiveTokenRootDirectory, listMatrixEnvAccountIds, requiresExplicitMatrixDefaultAccount, resolveConfiguredMatrixAccountIds, resolveMatrixAccountStorageRoot, resolveMatrixChannelConfig, resolveMatrixCredentialsDir, resolveMatrixCredentialsFilename, resolveMatrixCredentialsPath, resolveMatrixDefaultOrOnlyAccountId, resolveMatrixEnvAccountToken, resolveMatrixHomeserverKey, resolveMatrixStateLayoutChildDepth, sanitizeMatrixPathSegment };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as registerMatrixCliMetadata } from "./.setup/cli-metadata-COWLWR3E.mjs";
1
+ import { n as registerMatrixCliMetadata } from "./.setup/cli-metadata-C60BW1oa.mjs";
2
2
  import { a as setMatrixRuntimeLifecycle } from "./.setup/runtime-1kn1P6io.mjs";
3
3
  import "./runtime-setter-api.js";
4
4
  import { registerMatrixSubagentHooks } from "./subagent-hooks-api.js";
@@ -1,9 +1,9 @@
1
- import { d as resolveMatrixAuthContext } from "./.setup/client-C4Gibhzl.mjs";
1
+ import { d as resolveMatrixAuthContext } from "./.setup/client-BEl7PU1_.mjs";
2
2
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
3
3
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
4
4
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/matrix/src/plugin-entry.runtime.ts
6
- const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./.setup/verification-DUxuApWC.mjs").then((n) => n.y));
6
+ const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./.setup/verification-CuT5ZBDO.mjs").then((n) => n.y));
7
7
  function sendError(respond, err) {
8
8
  respond(false, { error: formatErrorMessage(err) });
9
9
  }
@@ -1,5 +1,5 @@
1
1
  import { i as setMatrixRuntime } from "./.setup/runtime-1kn1P6io.mjs";
2
- import { a as resolveConfiguredMatrixAccountIds, f as resolveMatrixAccountStringValues, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-Bs_jCAaG.mjs";
2
+ import { a as resolveConfiguredMatrixAccountIds, f as resolveMatrixAccountStringValues, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-CWsL5zIU.mjs";
3
3
  import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./.setup/env-vars-aEBngJPa.mjs";
4
4
  import { a as resolveMatrixCredentialsFilename, i as resolveMatrixCredentialsDir, l as sanitizeMatrixPathSegment, o as resolveMatrixCredentialsPath, r as resolveMatrixAccountStorageRoot, s as resolveMatrixHomeserverKey, t as hashMatrixAccessToken } from "./.setup/storage-paths-B51JM-pC.mjs";
5
5
  import { f as setMatrixThreadBindingMaxAgeBySessionKey, l as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKeyAsync, u as setMatrixThreadBindingIdleTimeoutBySessionKeyAsync } from "./.setup/thread-bindings-shared-CPjUA0Ib.mjs";
@@ -1 +1,2 @@
1
- export { i as setMatrixRuntime, a as setMatrixRuntimeLifecycle } from "./.setup/runtime-1kn1P6io.mjs";
1
+ import { a as setMatrixRuntimeLifecycle, i as setMatrixRuntime } from "./.setup/runtime-1kn1P6io.mjs";
2
+ export { setMatrixRuntime, setMatrixRuntimeLifecycle };
@@ -1 +1,2 @@
1
- export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./.setup/secret-contract-DxyzKSzf.mjs";
1
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-DxyzKSzf.mjs";
2
+ export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,3 +1,3 @@
1
1
  import { i as setMatrixRuntime } from "./.setup/runtime-1kn1P6io.mjs";
2
- import { t as createMatrixThreadBindingManager } from "./.setup/thread-bindings-C0gv7BEN.mjs";
2
+ import { t as createMatrixThreadBindingManager } from "./.setup/thread-bindings-pNgPVdof.mjs";
3
3
  export { createMatrixThreadBindingManager, setMatrixRuntime };
@@ -4,15 +4,15 @@ import { fileURLToPath } from "node:url";
4
4
  var setup_entry_default = defineBundledChannelSetupEntry({
5
5
  importMetaUrl: import.meta.url,
6
6
  plugin: {
7
- specifier: fileURLToPath(new URL(".setup/setup-plugin-api-f8mWghxf.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/setup-plugin-api-ORC_4yEA.mjs", import.meta.url).href),
8
8
  exportName: "matrixSetupPlugin"
9
9
  },
10
10
  secrets: {
11
- specifier: fileURLToPath(new URL(".setup/secret-contract-api-Dukgvike.mjs", import.meta.url).href),
11
+ specifier: fileURLToPath(new URL(".setup/secret-contract-api-CiuSYjUy.mjs", import.meta.url).href),
12
12
  exportName: "channelSecrets"
13
13
  },
14
14
  runtime: {
15
- specifier: fileURLToPath(new URL(".setup/runtime-setter-api-i2MOXoT3.mjs", import.meta.url).href),
15
+ specifier: fileURLToPath(new URL(".setup/runtime-setter-api-DtxDAM-x.mjs", import.meta.url).href),
16
16
  exportName: "setMatrixRuntime"
17
17
  }
18
18
  });
@@ -1 +1,2 @@
1
- export { n as matrixSetupPlugin } from "./.setup/channel.setup-ClA7V_Ba.mjs";
1
+ import { n as matrixSetupPlugin } from "./.setup/channel.setup-p6oll48W.mjs";
2
+ export { matrixSetupPlugin };
@@ -1 +1,2 @@
1
- export { t as defaultTopLevelPlacement, n as resolveInboundConversation } from "./.setup/thread-binding-api-BvuaKpd0.mjs";
1
+ import { n as resolveMatrixInboundConversation, t as defaultTopLevelPlacement } from "./.setup/thread-binding-api-BvuaKpd0.mjs";
2
+ export { defaultTopLevelPlacement, resolveMatrixInboundConversation as resolveInboundConversation };
@@ -1 +1,2 @@
1
- export { l as setMatrixThreadBindingIdleTimeoutBySessionKey, u as setMatrixThreadBindingIdleTimeoutBySessionKeyAsync, f as setMatrixThreadBindingMaxAgeBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKeyAsync } from "./.setup/thread-bindings-shared-CPjUA0Ib.mjs";
1
+ import { f as setMatrixThreadBindingMaxAgeBySessionKey, l as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKeyAsync, u as setMatrixThreadBindingIdleTimeoutBySessionKeyAsync } from "./.setup/thread-bindings-shared-CPjUA0Ib.mjs";
2
+ export { setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingIdleTimeoutBySessionKeyAsync, setMatrixThreadBindingMaxAgeBySessionKey, setMatrixThreadBindingMaxAgeBySessionKeyAsync };
@@ -2,6 +2,32 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.26.7 - 2026-10-17
6
+
7
+ ### Highlights
8
+
9
+ - **Windows idle watch CPU:** share native identity and physical-path queries while retaining directory checks. ([#1000](https://github.com/openclaw/fs-safe/pull/1000))
10
+ - **Root containment:** preserve kernel parent semantics through nested and dangling symlink chains, and reject redirected sibling-output parents. ([#993](https://github.com/openclaw/fs-safe/pull/993))
11
+ - **Legacy native policy migration:** removed Python-mode settings now fail with an actionable migration error when no explicit native policy is selected. ([#995](https://github.com/openclaw/fs-safe/pull/995))
12
+
13
+ ### Fixes
14
+
15
+ - **Windows watch scan CPU:** share native identity and physical-path queries while retaining every listed entry's directory checks. Thanks @martinderm for reporting the idle Gateway CPU regression in [openclaw#174341](https://github.com/openclaw/openclaw/issues/174341). ([#1000](https://github.com/openclaw/fs-safe/pull/1000))
16
+ - **ZIP integrity:** update the native ZIP decoder while preserving format-error and byte-limit classifications for entries that exceed their declared size. ([#997](https://github.com/openclaw/fs-safe/pull/997))
17
+ - **Release dry runs:** keep generated unsigned package artifacts outside source-provenance checks so the final package smoke test can complete without signing or publishing. ([#996](https://github.com/openclaw/fs-safe/pull/996))
18
+ - **Root containment:** resolve nested and dangling symlink chains with kernel parent semantics, and reject redirected sibling-output parents before invoking external writers. Thanks @yetval for [#987](https://github.com/openclaw/fs-safe/issues/987) and [#986](https://github.com/openclaw/fs-safe/issues/986). ([#993](https://github.com/openclaw/fs-safe/pull/993))
19
+ - **Watch invalidations:** refresh the admitted parent after transient create/delete activity so consumer caches cannot retain a file absent from both watcher scans. ([#993](https://github.com/openclaw/fs-safe/pull/993))
20
+
21
+ ### Compatibility
22
+
23
+ - **Legacy native policy migration:** reject removed `FS_SAFE_PYTHON_MODE` and `OPENCLAW_FS_SAFE_PYTHON_MODE` settings with an actionable migration error when no explicit native policy is selected, instead of silently changing `require` or `off` to `auto`. Set the corresponding native-mode variable to the same value before upgrading. ([#995](https://github.com/openclaw/fs-safe/pull/995))
24
+
25
+ ## 0.26.6 - 2026-10-15
26
+
27
+ ### Fixes
28
+
29
+ - **Btrfs file cloning:** explicit `clone: "auto"` and `"always"` copies match NOCOW on their new empty destination so different source and destination-directory policies do not force a full byte copy. Sources and unrelated destination flags are preserved; automatic fallback recreates the destination with its ordinary inherited policy.
30
+
5
31
  ## 0.26.5 - 2026-10-14
6
32
 
7
33
  ### Highlights
@@ -10,7 +10,7 @@ function admitUncachedCopyPath(input, create = false, admittedRoot) {
10
10
  if (!path.isAbsolute(input.rootPath) || !path.isAbsolute(input.absolutePath)) {
11
11
  throw new FsSafeError("invalid-path", "copy roots and paths must be absolute");
12
12
  }
13
- const root = admittedRoot ?? captureDirectoryGuard(realpathSync(input.rootPath), "native", { bigint: true });
13
+ const root = admittedRoot ?? captureDirectoryGuard(realpathSync.native(input.rootPath), "native", { bigint: true });
14
14
  // Canonical POSIX callers already own a freshly checked root. Keep the
15
15
  // resolver's lexical/symlink walk, but do not rediscover that root each time.
16
16
  const rootCanonicalPath = admittedRoot?.realPath;
@@ -75,7 +75,7 @@ export function createCopyPathAdmissionCache() {
75
75
  }
76
76
  let root = roots.get(input.rootPath);
77
77
  if (!root) {
78
- const canonical = realpathSync(input.rootPath);
78
+ const canonical = realpathSync.native(input.rootPath);
79
79
  if (canonical !== input.rootPath)
80
80
  return admitUncachedCopyPath(input, create);
81
81
  root = captureDirectoryGuard(canonical, "native", { bigint: true });
@@ -18,12 +18,23 @@ function parseMode(value) {
18
18
  export function configureFsSafeNative(config) {
19
19
  overrideConfig = { ...overrideConfig, ...config };
20
20
  }
21
+ function rejectLegacyMode() {
22
+ for (const source of ["FS_SAFE_PYTHON_MODE", "OPENCLAW_FS_SAFE_PYTHON_MODE"]) {
23
+ if (process.env[source] === undefined)
24
+ continue;
25
+ const mode = parseMode(process.env[source]) ?? "auto";
26
+ throw new Error(`${source} has been removed. Set FS_SAFE_NATIVE_MODE=${mode} or ` +
27
+ `configureFsSafeNative({ mode: "${mode}" }) before using fs-safe, then remove ${source}. ` +
28
+ "Legacy mode settings no longer select native policy.");
29
+ }
30
+ return "auto";
31
+ }
21
32
  export function getFsSafeNativeConfig() {
22
33
  return {
23
34
  mode: overrideConfig.mode ??
24
35
  parseMode(process.env.FS_SAFE_NATIVE_MODE) ??
25
36
  parseMode(process.env.OPENCLAW_FS_SAFE_NATIVE_MODE) ??
26
- "auto",
37
+ rejectLegacyMode(),
27
38
  };
28
39
  }
29
40
  /** Internal provenance; keep the public configuration shape unchanged. */
@@ -35,13 +46,13 @@ export function getNativeModeSetting() {
35
46
  if (mode !== undefined)
36
47
  return { mode, source };
37
48
  }
38
- return { mode: "auto", source: "default" };
49
+ return { mode: rejectLegacyMode(), source: "default" };
39
50
  }
40
51
  export function isFsSafeNativeRequired() {
41
52
  return (overrideConfig.mode ??
42
53
  parseMode(process.env.FS_SAFE_NATIVE_MODE) ??
43
54
  parseMode(process.env.OPENCLAW_FS_SAFE_NATIVE_MODE) ??
44
- "auto") === "require";
55
+ rejectLegacyMode()) === "require";
45
56
  }
46
57
  export function __resetFsSafeNativeConfigForTest() {
47
58
  overrideConfig = {};
@@ -8,6 +8,7 @@ import { isPathInside } from "./path.js";
8
8
  import { root } from "./root.js";
9
9
  import { tempFile } from "./temp-target.js";
10
10
  import { assertNoWindowsPathAlias } from "./windows-path-alias.js";
11
+ import { createAsyncDirectoryGuard } from "./directory-guard.js";
11
12
  const NON_PORTABLE_FILE_NAME_CHARACTERS = /[\u0000-\u001f\u007f-\u009f<>:"/\\|?*]/u;
12
13
  function tempFileNameForTarget(targetPath, fallbackFileName) {
13
14
  const fallback = sanitizeUntrustedFileName(fallbackFileName ?? "output.bin", "output.bin");
@@ -62,6 +63,9 @@ export async function writeExternalFileWithinRoot(options) {
62
63
  const staging = options.staging;
63
64
  const fallbackFileName = options.fallbackFileName;
64
65
  const targetRoot = await root(rootDir);
66
+ const rootBoundary = staging === "sibling"
67
+ ? await createAsyncDirectoryGuard(targetRoot.rootReal, { bigint: true })
68
+ : undefined;
65
69
  if (requestedTargetPath.length === 0) {
66
70
  throw new FsSafeError("invalid-path", "target path is required");
67
71
  }
@@ -84,6 +88,7 @@ export async function writeExternalFileWithinRoot(options) {
84
88
  const siblingFinalPath = await targetRoot.resolve(targetPath);
85
89
  const result = await writeExternalFileViaSibling({
86
90
  finalPath: siblingFinalPath,
91
+ rootBoundary,
87
92
  write,
88
93
  producerIsolation,
89
94
  fallbackFileName,
@@ -126,6 +131,7 @@ async function writeExternalFileViaSibling(params) {
126
131
  assertNoWindowsPathAlias(finalPath, "filesystem", "output target uses a Windows filesystem namespace alias");
127
132
  const { result } = await writeCallbackSibling({
128
133
  tempDir: path.dirname(finalPath),
134
+ rootBoundary: params.rootBoundary,
129
135
  tempName: buildSiblingTempName(finalPath, params.fallbackFileName),
130
136
  write: params.write,
131
137
  producerIsolation: params.producerIsolation,
@@ -1,5 +1,6 @@
1
1
  import type { BigIntStats, Stats } from "node:fs";
2
2
  import { type AsyncDirectoryGuard } from "./directory-guard.js";
3
+ import { type NativeDirectoryObservationBackend } from "./native-directory-observation.js";
3
4
  import { type RootContext } from "./root-context.js";
4
5
  import type { RootPathDirectoryObservationGuard, RootPathObservationReceipt, RootPathParentObservationReceipt } from "./root-path.js";
5
6
  import type { DirEntry, PathStat } from "./types.js";
@@ -8,7 +9,7 @@ export declare function pathStatFromStats(stat: Stats | BigIntStats): PathStat;
8
9
  export declare function pathStatFromStats(stat: Stats | BigIntStats, name: string): DirEntry;
9
10
  export type RootDirectoryObservationGuard = AsyncDirectoryGuard<BigIntStats>;
10
11
  export declare function createRootDirectoryObservationGuard(root: RootContext, directory: string): Promise<RootDirectoryObservationGuard>;
11
- export declare function assertRootDirectoryObservationGuard(root: RootContext, guard: RootDirectoryObservationGuard | RootPathDirectoryObservationGuard): Promise<void>;
12
+ export declare function assertRootDirectoryObservationGuard(root: RootContext, guard: RootDirectoryObservationGuard | RootPathDirectoryObservationGuard, backend?: NativeDirectoryObservationBackend): Promise<void>;
12
13
  /**
13
14
  * Close an operation-local traversal receipt with fresh exact observations.
14
15
  * Descendant canonical paths are admitted while the receipt is created. The