@openclaw/matrix 2026.7.2-beta.2 → 2026.7.2-beta.4
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.
- package/dist/{account-selection-Bz00QTmQ.js → account-selection-kqquRzCf.js} +5 -5
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime-BQZdg_dJ.js → approval-handler.runtime-AsawryfP.js} +4 -4
- package/dist/{approval-ids-De4IhOSN.js → approval-ids-XAMP8vN9.js} +1 -1
- package/dist/{approval-reaction-auth-BLJKPLku.js → approval-reaction-auth-DButmM13.js} +2 -2
- package/dist/auth-presence.js +13 -21
- package/dist/{channel-B1woOUgk.js → channel-MBtrY36B.js} +19 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BvJm9z0w.js → channel.runtime-Bi4Dgy2P.js} +15 -16
- package/dist/{cli-CLWOkMvw.js → cli-CcPuMyCk.js} +15 -12
- package/dist/{cli-metadata-9Naf7in0.js → cli-metadata-DAhDhbYX.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-BUai6s29.js → client-BwX6rURh.js} +2 -2
- package/dist/{client-CPuYbNL8.js → client-Dg8dk8NW.js} +2 -2
- package/dist/{client-bootstrap-CNVF73sF.js → client-bootstrap-ZAaO9fZ-.js} +1 -1
- package/dist/{config-schema-BTSatSY3.js → config-schema-CggnuwnJ.js} +4 -5
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-85ttAWDP.js → create-client-Und1YmJ2.js} +4 -4
- package/dist/credentials-W2EmwRhu.js +65 -0
- package/dist/credentials-read-DVmFCm7X.js +77 -0
- package/dist/{credentials-write.runtime-BDtpqvj0.js → credentials-write.runtime-Be9zNSUw.js} +1 -1
- package/dist/{crypto-runtime-DoEB5RpM.js → crypto-runtime-_j7TpS7k.js} +3 -3
- package/dist/{directory-live-0TyS9xep.js → directory-live-B6fbX6jf.js} +3 -3
- package/dist/{doctor-BGTs609f.js → doctor-C0LPJGTz.js} +1 -1
- package/dist/doctor-contract-CWVdlRQR.js +183 -0
- package/dist/doctor-contract-api.js +220 -73
- package/dist/{draft-stream-GOdPZMBm.js → draft-stream-BfibauH1.js} +1 -1
- package/dist/{encryption-guidance-BFfgq7c7.js → encryption-guidance-CbEFe38F.js} +1 -1
- package/dist/{file-sync-store-CUE9WwD2.js → file-sync-store-DUEWCEjb.js} +21 -4
- package/dist/helper-api.js +2 -2
- package/dist/{http-client-Jw5_bwQo.js → http-client-DOyTG9l2.js} +2 -2
- package/dist/{idb-persistence-BiHEEzD7.js → idb-persistence-C6zQfW2w.js} +73 -64
- package/dist/index.js +1 -1
- package/dist/{media-text-DPCtdFjk.js → media-text-Cv1VIHXW.js} +1 -1
- package/dist/{messages-DCRbGLMh.js → messages-ClTgfFl6.js} +3 -3
- package/dist/{monitor-C5EOF9et.js → monitor-2BjKS9RV.js} +93 -92
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-BWkgfbiE.js +3 -0
- package/dist/{profile-update-DompcDyu.js → profile-update-C2My3TML.js} +2 -2
- package/dist/{reaction-events-QUgxkQKQ.js → reaction-events-Cj6thhmc.js} +2 -2
- package/dist/record-shared-CWWx6fvI.js +2 -0
- package/dist/{recovery-key-store-B2RglalK.js → recovery-key-store-0O8ARdT_.js} +1 -1
- package/dist/{resolve-targets-Cx1VVArA.js → resolve-targets-Dn11HT76.js} +1 -1
- package/dist/{resolver.runtime-PPrv3ZHu.js → resolver.runtime-Zguh0hH9.js} +1 -1
- package/dist/runtime-api.js +3 -3
- package/dist/{sdk-1TXuSiXZ.js → sdk-DiRXiRRf.js} +5 -5
- package/dist/{secret-contract-OZoQf0kI.js → secret-contract-M3hRmGO-.js} +21 -5
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-yre1krm8.js → send-CZCmDQu8.js} +4 -3
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-DXVRCd4G.js → setup-bootstrap-C9w01xQK.js} +2 -2
- package/dist/{setup-core-CYQRY2oG.js → setup-core-D6gyoyeg.js} +109 -21
- package/dist/setup-plugin-api.js +4 -3
- package/dist/{setup-surface-BjvRQzK6.js → setup-surface-DZIEWtQC.js} +8 -6
- package/dist/{shared-BfW4lxGu.js → shared-C7Vm9RxI.js} +6 -6
- package/dist/{startup-verification-DSiyDKM5.js → startup-verification-D1nscMh8.js} +2 -2
- package/dist/{storage-DD-EnNJE.js → storage-BrkTJZov.js} +11 -44
- package/dist/{thread-bindings-U5ZroBeZ.js → thread-bindings-BcYBELC7.js} +3 -3
- package/dist/{tool-actions.runtime-BlfTr9b0.js → tool-actions.runtime-Dbco_Vwn.js} +7 -7
- package/dist/{verification-CGnI9k1O.js → verification-DhMBWxOJ.js} +2 -2
- package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/Util.js +7 -1
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +23 -3
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +38 -13
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
- package/node_modules/music-metadata/package.json +6 -6
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/npm-shrinkwrap.json +11 -11
- package/openclaw.plugin.json +7 -20
- package/package.json +111 -28
- package/dist/async-lock-BcLS4KOc.js +0 -19
- package/dist/credentials-CncWUieb.js +0 -56
- package/dist/credentials-read-CwNJrmwu.js +0 -112
- package/dist/doctor-contract-D2qTLe-C.js +0 -312
- package/dist/probe.runtime-BBvciVfo.js +0 -3
- package/dist/record-shared-CvzjvHRn.js +0 -2
- package/dist/{deps-DDbghaZH.js → deps-CcVJfvRM.js} +1 -1
- package/dist/{storage-paths-B4_I9iqO.js → storage-paths-gUmSydsW.js} +1 -1
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import { t as isRecord } from "./record-shared-CvzjvHRn.js";
|
|
2
|
-
import { defineChannelAliasMigration } from "openclaw/plugin-sdk/runtime-doctor";
|
|
3
|
-
import { hasLegacyFlatAllowPrivateNetworkAlias, migrateLegacyFlatAllowPrivateNetworkAlias } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
-
//#region extensions/matrix/src/doctor-contract.ts
|
|
5
|
-
function parseMatrixStreamingMode(value) {
|
|
6
|
-
if (typeof value !== "string") return null;
|
|
7
|
-
const normalized = value.trim().toLowerCase();
|
|
8
|
-
return normalized === "partial" || normalized === "quiet" || normalized === "progress" || normalized === "off" ? normalized : null;
|
|
9
|
-
}
|
|
10
|
-
const streamingAliasMigration = defineChannelAliasMigration({
|
|
11
|
-
channelId: "matrix",
|
|
12
|
-
streaming: {
|
|
13
|
-
defaultMode: "off",
|
|
14
|
-
resolveMode: (entry) => {
|
|
15
|
-
const streaming = isRecord(entry.streaming) ? entry.streaming : null;
|
|
16
|
-
const parsed = parseMatrixStreamingMode(streaming ? streaming.mode : entry.streaming);
|
|
17
|
-
if (parsed) return parsed;
|
|
18
|
-
return entry.streaming === true ? "partial" : "off";
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
accountStreamingReplacesRoot: true
|
|
22
|
-
});
|
|
23
|
-
function stripMatrixJunkStreamMode(cfg, changes) {
|
|
24
|
-
const channels = isRecord(cfg.channels) ? cfg.channels : null;
|
|
25
|
-
const matrix = isRecord(channels?.matrix) ? channels.matrix : null;
|
|
26
|
-
if (!matrix) return cfg;
|
|
27
|
-
let updated = matrix;
|
|
28
|
-
let changed = false;
|
|
29
|
-
if (updated.streamMode !== void 0) {
|
|
30
|
-
const { streamMode: _streamMode, ...rest } = updated;
|
|
31
|
-
updated = rest;
|
|
32
|
-
changes.push("Removed channels.matrix.streamMode (never read by the Matrix runtime).");
|
|
33
|
-
changed = true;
|
|
34
|
-
}
|
|
35
|
-
const accounts = isRecord(updated.accounts) ? updated.accounts : null;
|
|
36
|
-
if (accounts) {
|
|
37
|
-
let accountsChanged = false;
|
|
38
|
-
const nextAccounts = { ...accounts };
|
|
39
|
-
for (const [accountId, accountValue] of Object.entries(accounts)) {
|
|
40
|
-
const account = isRecord(accountValue) ? accountValue : null;
|
|
41
|
-
if (!account || account.streamMode === void 0) continue;
|
|
42
|
-
const { streamMode: _streamMode, ...rest } = account;
|
|
43
|
-
nextAccounts[accountId] = rest;
|
|
44
|
-
changes.push(`Removed channels.matrix.accounts.${accountId}.streamMode (never read by the Matrix runtime).`);
|
|
45
|
-
accountsChanged = true;
|
|
46
|
-
}
|
|
47
|
-
if (accountsChanged) {
|
|
48
|
-
updated = {
|
|
49
|
-
...updated,
|
|
50
|
-
accounts: nextAccounts
|
|
51
|
-
};
|
|
52
|
-
changed = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (!changed) return cfg;
|
|
56
|
-
return {
|
|
57
|
-
...cfg,
|
|
58
|
-
channels: {
|
|
59
|
-
...channels,
|
|
60
|
-
matrix: updated
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function hasLegacyMatrixRoomAllowAlias(value) {
|
|
65
|
-
const room = isRecord(value) ? value : null;
|
|
66
|
-
return Boolean(room && typeof room.allow === "boolean");
|
|
67
|
-
}
|
|
68
|
-
function hasLegacyMatrixRoomMapAllowAliases(value) {
|
|
69
|
-
const rooms = isRecord(value) ? value : null;
|
|
70
|
-
return Boolean(rooms && Object.values(rooms).some((room) => hasLegacyMatrixRoomAllowAlias(room)));
|
|
71
|
-
}
|
|
72
|
-
function hasLegacyMatrixAccountRoomAllowAliases(value) {
|
|
73
|
-
const accounts = isRecord(value) ? value : null;
|
|
74
|
-
if (!accounts) return false;
|
|
75
|
-
return Object.values(accounts).some((account) => {
|
|
76
|
-
if (!isRecord(account)) return false;
|
|
77
|
-
return hasLegacyMatrixRoomMapAllowAliases(account.groups) || hasLegacyMatrixRoomMapAllowAliases(account.rooms);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function hasLegacyMatrixAccountPrivateNetworkAliases(value) {
|
|
81
|
-
const accounts = isRecord(value) ? value : null;
|
|
82
|
-
if (!accounts) return false;
|
|
83
|
-
return Object.values(accounts).some((account) => hasLegacyFlatAllowPrivateNetworkAlias(isRecord(account) ? account : {}));
|
|
84
|
-
}
|
|
85
|
-
function hasLegacyTrustedDmPolicy(value) {
|
|
86
|
-
const root = isRecord(value) ? value : null;
|
|
87
|
-
if (!root) return false;
|
|
88
|
-
return (isRecord(root.dm) ? root.dm : null)?.policy === "trusted";
|
|
89
|
-
}
|
|
90
|
-
function hasLegacyMatrixAccountTrustedDmPolicies(value) {
|
|
91
|
-
const accounts = isRecord(value) ? value : null;
|
|
92
|
-
if (!accounts) return false;
|
|
93
|
-
return Object.values(accounts).some((account) => hasLegacyTrustedDmPolicy(account));
|
|
94
|
-
}
|
|
95
|
-
function migrateLegacyTrustedDmPolicy(params) {
|
|
96
|
-
const dm = isRecord(params.entry.dm) ? params.entry.dm : null;
|
|
97
|
-
if (!dm || dm.policy !== "trusted") return {
|
|
98
|
-
entry: params.entry,
|
|
99
|
-
changed: false
|
|
100
|
-
};
|
|
101
|
-
const allowFromRaw = dm.allowFrom;
|
|
102
|
-
const allowFromEntries = Array.isArray(allowFromRaw) ? allowFromRaw.filter((entry) => typeof entry === "string" && entry.trim().length > 0).length : 0;
|
|
103
|
-
const nextPolicy = allowFromEntries > 0 ? "allowlist" : "pairing";
|
|
104
|
-
const nextDm = {
|
|
105
|
-
...dm,
|
|
106
|
-
policy: nextPolicy
|
|
107
|
-
};
|
|
108
|
-
params.changes.push(`Migrated ${params.pathPrefix}.dm.policy "trusted" → "${nextPolicy}" (legacy alias removed; ${allowFromEntries > 0 ? `preserved ${allowFromEntries} ${params.pathPrefix}.dm.allowFrom ${allowFromEntries === 1 ? "entry" : "entries"}` : "no allowFrom entries present, defaulting to pairing for safety"}).`);
|
|
109
|
-
return {
|
|
110
|
-
entry: {
|
|
111
|
-
...params.entry,
|
|
112
|
-
dm: nextDm
|
|
113
|
-
},
|
|
114
|
-
changed: true
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function normalizeMatrixRoomAllowAliases(params) {
|
|
118
|
-
let changed = false;
|
|
119
|
-
const nextRooms = { ...params.rooms };
|
|
120
|
-
for (const [roomId, roomValue] of Object.entries(params.rooms)) {
|
|
121
|
-
const room = isRecord(roomValue) ? roomValue : null;
|
|
122
|
-
if (!room || typeof room.allow !== "boolean") continue;
|
|
123
|
-
const nextRoom = { ...room };
|
|
124
|
-
if (typeof nextRoom.enabled !== "boolean") nextRoom.enabled = room.allow;
|
|
125
|
-
delete nextRoom.allow;
|
|
126
|
-
nextRooms[roomId] = nextRoom;
|
|
127
|
-
changed = true;
|
|
128
|
-
params.changes.push(`Moved ${params.pathPrefix}.${roomId}.allow → ${params.pathPrefix}.${roomId}.enabled (${String(nextRoom.enabled)}).`);
|
|
129
|
-
}
|
|
130
|
-
return {
|
|
131
|
-
rooms: nextRooms,
|
|
132
|
-
changed
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
const legacyConfigRules = [
|
|
136
|
-
...streamingAliasMigration.legacyConfigRules,
|
|
137
|
-
{
|
|
138
|
-
path: ["channels", "matrix"],
|
|
139
|
-
message: "channels.matrix.allowPrivateNetwork is legacy; use channels.matrix.network.dangerouslyAllowPrivateNetwork instead. Run \"openclaw doctor --fix\".",
|
|
140
|
-
match: (value) => hasLegacyFlatAllowPrivateNetworkAlias(isRecord(value) ? value : {})
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
path: [
|
|
144
|
-
"channels",
|
|
145
|
-
"matrix",
|
|
146
|
-
"accounts"
|
|
147
|
-
],
|
|
148
|
-
message: "channels.matrix.accounts.<id>.allowPrivateNetwork is legacy; use channels.matrix.accounts.<id>.network.dangerouslyAllowPrivateNetwork instead. Run \"openclaw doctor --fix\".",
|
|
149
|
-
match: hasLegacyMatrixAccountPrivateNetworkAliases
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
path: [
|
|
153
|
-
"channels",
|
|
154
|
-
"matrix",
|
|
155
|
-
"groups"
|
|
156
|
-
],
|
|
157
|
-
message: "channels.matrix.groups.<room>.allow is legacy; use channels.matrix.groups.<room>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
158
|
-
match: hasLegacyMatrixRoomMapAllowAliases
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
path: [
|
|
162
|
-
"channels",
|
|
163
|
-
"matrix",
|
|
164
|
-
"rooms"
|
|
165
|
-
],
|
|
166
|
-
message: "channels.matrix.rooms.<room>.allow is legacy; use channels.matrix.rooms.<room>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
167
|
-
match: hasLegacyMatrixRoomMapAllowAliases
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
path: [
|
|
171
|
-
"channels",
|
|
172
|
-
"matrix",
|
|
173
|
-
"accounts"
|
|
174
|
-
],
|
|
175
|
-
message: "channels.matrix.accounts.<id>.{groups,rooms}.<room>.allow is legacy; use channels.matrix.accounts.<id>.{groups,rooms}.<room>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
176
|
-
match: hasLegacyMatrixAccountRoomAllowAliases
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
path: ["channels", "matrix"],
|
|
180
|
-
message: "channels.matrix.dm.policy \"trusted\" is legacy; use \"allowlist\" (with allowFrom entries) or \"pairing\" instead. Run \"openclaw doctor --fix\".",
|
|
181
|
-
match: hasLegacyTrustedDmPolicy
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
path: [
|
|
185
|
-
"channels",
|
|
186
|
-
"matrix",
|
|
187
|
-
"accounts"
|
|
188
|
-
],
|
|
189
|
-
message: "channels.matrix.accounts.<id>.dm.policy \"trusted\" is legacy; use \"allowlist\" (with allowFrom entries) or \"pairing\" instead. Run \"openclaw doctor --fix\".",
|
|
190
|
-
match: hasLegacyMatrixAccountTrustedDmPolicies
|
|
191
|
-
}
|
|
192
|
-
];
|
|
193
|
-
function normalizeCompatibilityConfig({ cfg }) {
|
|
194
|
-
const changes = [];
|
|
195
|
-
const withoutJunkStreamMode = stripMatrixJunkStreamMode(cfg, changes);
|
|
196
|
-
const aliases = streamingAliasMigration.normalizeChannelConfig({
|
|
197
|
-
cfg: withoutJunkStreamMode,
|
|
198
|
-
changes
|
|
199
|
-
});
|
|
200
|
-
const channels = isRecord(aliases.config.channels) ? aliases.config.channels : null;
|
|
201
|
-
const matrix = isRecord(channels?.matrix) ? channels.matrix : null;
|
|
202
|
-
if (!matrix) return {
|
|
203
|
-
config: cfg,
|
|
204
|
-
changes: []
|
|
205
|
-
};
|
|
206
|
-
let updatedMatrix = matrix;
|
|
207
|
-
let changed = aliases.config !== cfg;
|
|
208
|
-
const topLevelPrivateNetwork = migrateLegacyFlatAllowPrivateNetworkAlias({
|
|
209
|
-
entry: updatedMatrix,
|
|
210
|
-
pathPrefix: "channels.matrix",
|
|
211
|
-
changes
|
|
212
|
-
});
|
|
213
|
-
updatedMatrix = topLevelPrivateNetwork.entry;
|
|
214
|
-
changed = changed || topLevelPrivateNetwork.changed;
|
|
215
|
-
const topLevelTrustedDmPolicy = migrateLegacyTrustedDmPolicy({
|
|
216
|
-
entry: updatedMatrix,
|
|
217
|
-
pathPrefix: "channels.matrix",
|
|
218
|
-
changes
|
|
219
|
-
});
|
|
220
|
-
updatedMatrix = topLevelTrustedDmPolicy.entry;
|
|
221
|
-
changed = changed || topLevelTrustedDmPolicy.changed;
|
|
222
|
-
const normalizeTopLevelRoomScope = (key) => {
|
|
223
|
-
const rooms = isRecord(updatedMatrix[key]) ? updatedMatrix[key] : null;
|
|
224
|
-
if (!rooms) return;
|
|
225
|
-
const normalized = normalizeMatrixRoomAllowAliases({
|
|
226
|
-
rooms,
|
|
227
|
-
pathPrefix: `channels.matrix.${key}`,
|
|
228
|
-
changes
|
|
229
|
-
});
|
|
230
|
-
if (normalized.changed) {
|
|
231
|
-
updatedMatrix = {
|
|
232
|
-
...updatedMatrix,
|
|
233
|
-
[key]: normalized.rooms
|
|
234
|
-
};
|
|
235
|
-
changed = true;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
normalizeTopLevelRoomScope("groups");
|
|
239
|
-
normalizeTopLevelRoomScope("rooms");
|
|
240
|
-
const accounts = isRecord(updatedMatrix.accounts) ? updatedMatrix.accounts : null;
|
|
241
|
-
if (accounts) {
|
|
242
|
-
let accountsChanged = false;
|
|
243
|
-
const nextAccounts = { ...accounts };
|
|
244
|
-
for (const [accountId, accountValue] of Object.entries(accounts)) {
|
|
245
|
-
const account = isRecord(accountValue) ? accountValue : null;
|
|
246
|
-
if (!account) continue;
|
|
247
|
-
let nextAccount = account;
|
|
248
|
-
let accountChanged = false;
|
|
249
|
-
const privateNetworkMigration = migrateLegacyFlatAllowPrivateNetworkAlias({
|
|
250
|
-
entry: nextAccount,
|
|
251
|
-
pathPrefix: `channels.matrix.accounts.${accountId}`,
|
|
252
|
-
changes
|
|
253
|
-
});
|
|
254
|
-
if (privateNetworkMigration.changed) {
|
|
255
|
-
nextAccount = privateNetworkMigration.entry;
|
|
256
|
-
accountChanged = true;
|
|
257
|
-
}
|
|
258
|
-
const accountTrustedDmPolicy = migrateLegacyTrustedDmPolicy({
|
|
259
|
-
entry: nextAccount,
|
|
260
|
-
pathPrefix: `channels.matrix.accounts.${accountId}`,
|
|
261
|
-
changes
|
|
262
|
-
});
|
|
263
|
-
if (accountTrustedDmPolicy.changed) {
|
|
264
|
-
nextAccount = accountTrustedDmPolicy.entry;
|
|
265
|
-
accountChanged = true;
|
|
266
|
-
}
|
|
267
|
-
for (const key of ["groups", "rooms"]) {
|
|
268
|
-
const rooms = isRecord(nextAccount[key]) ? nextAccount[key] : null;
|
|
269
|
-
if (!rooms) continue;
|
|
270
|
-
const normalized = normalizeMatrixRoomAllowAliases({
|
|
271
|
-
rooms,
|
|
272
|
-
pathPrefix: `channels.matrix.accounts.${accountId}.${key}`,
|
|
273
|
-
changes
|
|
274
|
-
});
|
|
275
|
-
if (normalized.changed) {
|
|
276
|
-
nextAccount = {
|
|
277
|
-
...nextAccount,
|
|
278
|
-
[key]: normalized.rooms
|
|
279
|
-
};
|
|
280
|
-
accountChanged = true;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
if (accountChanged) {
|
|
284
|
-
nextAccounts[accountId] = nextAccount;
|
|
285
|
-
accountsChanged = true;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
if (accountsChanged) {
|
|
289
|
-
updatedMatrix = {
|
|
290
|
-
...updatedMatrix,
|
|
291
|
-
accounts: nextAccounts
|
|
292
|
-
};
|
|
293
|
-
changed = true;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
if (!changed) return {
|
|
297
|
-
config: cfg,
|
|
298
|
-
changes: []
|
|
299
|
-
};
|
|
300
|
-
return {
|
|
301
|
-
config: {
|
|
302
|
-
...aliases.config,
|
|
303
|
-
channels: {
|
|
304
|
-
...aliases.config.channels,
|
|
305
|
-
matrix: updatedMatrix
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
changes
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
//#endregion
|
|
312
|
-
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
|
+
import fs from "node:fs";
|
|
5
5
|
import { runCommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
6
6
|
//#region extensions/matrix/src/matrix/deps.ts
|
|
7
7
|
const REQUIRED_MATRIX_PACKAGES = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import crypto from "node:crypto";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
//#region extensions/matrix/src/storage-paths.ts
|
|
6
6
|
function sanitizeMatrixPathSegment(value) {
|
|
7
7
|
return normalizeLowercaseStringOrEmpty(value).replace(/[^a-z0-9._-]+/g, "_").replace(/^_+|_+$/g, "") || "unknown";
|