@openclaw/matrix 2026.7.2-beta.3 → 2026.7.2-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 (77) hide show
  1. package/README.md +1 -1
  2. package/dist/api.js +4 -4
  3. package/dist/{approval-handler.runtime-BEa98wwG.js → approval-handler.runtime-D1ibJgSk.js} +4 -4
  4. package/dist/{approval-ids-Dfn7oQAm.js → approval-ids-2OQj32-K.js} +1 -1
  5. package/dist/{approval-reaction-auth-kXkCJBGi.js → approval-reaction-auth-CCAWWkbu.js} +2 -2
  6. package/dist/{channel-j331Xd7b.js → channel-Cmi248PA.js} +34 -32
  7. package/dist/channel-plugin-api.js +1 -1
  8. package/dist/{channel.runtime-BIwlVfQw.js → channel.runtime-BaPXFRgT.js} +34 -40
  9. package/dist/{cli-0EcKfqFw.js → cli-0CNHkps5.js} +868 -852
  10. package/dist/{cli-metadata-Xq1Xb15R.js → cli-metadata-DnXxNCoj.js} +1 -1
  11. package/dist/cli-metadata.js +1 -1
  12. package/dist/{client-CA0PULls.js → client-BFRg0kd4.js} +2 -2
  13. package/dist/{client-BtG4quUl.js → client-CitERujx.js} +2 -2
  14. package/dist/{client-bootstrap-Dk5EAn3n.js → client-bootstrap-CkAnkzB6.js} +1 -1
  15. package/dist/{config-schema-B5GRV8wL.js → config-schema-BShrVROw.js} +19 -6
  16. package/dist/contract-api.js +2 -2
  17. package/dist/{create-client-WQExaby_.js → create-client-f-CkRllE.js} +3 -3
  18. package/dist/{crypto-runtime-CAff-n15.js → crypto-runtime-D9_6J5tZ.js} +2 -2
  19. package/dist/{device-health-D4LBxuPq.js → device-health-B4-YXtJR.js} +6 -1
  20. package/dist/{directory-live-DiC-0XBC.js → directory-live-YRgYDx2w.js} +3 -3
  21. package/dist/{doctor-DwUVm5Lw.js → doctor-CM8ijNpW.js} +1 -1
  22. package/dist/doctor-contract-BMSJkkAE.js +167 -0
  23. package/dist/doctor-contract-api.js +112 -71
  24. package/dist/{draft-stream-CTLKtJJ0.js → draft-stream-CIjafRr0.js} +1 -1
  25. package/dist/{file-sync-store-CPkgnSXp.js → file-sync-store-DiiFsayX.js} +1 -1
  26. package/dist/{http-client-BmrgOZTL.js → http-client-CycYxU9-.js} +2 -2
  27. package/dist/{idb-persistence-Dyy6ipgU.js → idb-persistence-B6x7dMsF.js} +75 -72
  28. package/dist/index.js +1 -1
  29. package/dist/{logging-QH-48Gr6.js → logging-DV-p52N0.js} +8 -1
  30. package/dist/{media-text-BMXEXb1j.js → media-text-DlQC_k_K.js} +1 -1
  31. package/dist/{messages-3UBHfZrN.js → messages-Bf_s--M9.js} +3 -3
  32. package/dist/{monitor-BtUIds8T.js → monitor-s--XqoxF.js} +2041 -1804
  33. package/dist/plugin-entry.handlers.runtime.js +1 -1
  34. package/dist/probe.runtime-BJOvCHnZ.js +3 -0
  35. package/dist/{profile-update-Bh2XtJwN.js → profile-update-z3aM46KS.js} +2 -2
  36. package/dist/{reaction-events-BwAKtUyQ.js → reaction-events-DrK9Zua7.js} +2 -2
  37. package/dist/{recovery-key-store-CW6eePfp.js → recovery-key-store-BNnHvXdk.js} +1 -1
  38. package/dist/{resolve-targets-DVoj-YxB.js → resolve-targets-nNMcrV3W.js} +1 -1
  39. package/dist/{resolver.runtime-CC0VVsAt.js → resolver.runtime-BvaFlVLg.js} +1 -1
  40. package/dist/{room-info-B6vKD5DF.js → room-info-CAFZ3Z9J.js} +13 -12
  41. package/dist/{sdk-CIDZXWpZ.js → sdk-UzPd8tst.js} +227 -181
  42. package/dist/{send-BJbrdmNm.js → send-C9Ssx-iV.js} +624 -109
  43. package/dist/session-binding-contract-api.js +1 -1
  44. package/dist/{setup-bootstrap-DGPOOdz-.js → setup-bootstrap-BBGpPKgy.js} +2 -2
  45. package/dist/{setup-core-XCdAx1nY.js → setup-core-a542Ernq.js} +135 -45
  46. package/dist/setup-plugin-api.js +4 -3
  47. package/dist/{setup-surface-CzUiTe_k.js → setup-surface-BJrCI6KT.js} +34 -30
  48. package/dist/{shared-DquM1oz6.js → shared-CUH5otj8.js} +5 -12
  49. package/dist/{startup-verification-CA00kebL.js → startup-verification-wm3_i88s.js} +1 -1
  50. package/dist/{storage-CzHxeF5E.js → storage-BvAkgzvT.js} +24 -57
  51. package/dist/{thread-bindings-Cw194yEn.js → thread-bindings-D3RfVgAF.js} +4 -3
  52. package/dist/{tool-actions.runtime-C0jgWYhX.js → tool-actions.runtime-Dh5ow2EK.js} +8 -8
  53. package/dist/{verification-DjxyWTNP.js → verification-ZdAXdmuh.js} +1 -1
  54. package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
  55. package/node_modules/music-metadata/lib/common/Util.js +7 -1
  56. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +23 -3
  57. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
  58. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
  59. package/node_modules/music-metadata/lib/mp4/AtomToken.js +38 -13
  60. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
  61. package/node_modules/music-metadata/package.json +6 -6
  62. package/node_modules/typebox/build/compile/validator.d.mts +1 -4
  63. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  64. package/node_modules/typebox/build/guard/guard.mjs +5 -2
  65. package/node_modules/typebox/build/guard/string.mjs +16 -4
  66. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  67. package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
  68. package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
  69. package/node_modules/typebox/build/typebox.d.mts +1 -1
  70. package/node_modules/typebox/build/typebox.mjs +1 -1
  71. package/node_modules/typebox/package.json +1 -1
  72. package/node_modules/typebox/readme.md +29 -32
  73. package/openclaw.plugin.json +7 -20
  74. package/package.json +111 -29
  75. package/dist/doctor-contract-BA2Y6Crx.js +0 -312
  76. package/dist/probe.runtime-sBV-Govx.js +0 -3
  77. package/npm-shrinkwrap.json +0 -557
@@ -17,20 +17,6 @@
17
17
  "channels": [
18
18
  "matrix"
19
19
  ],
20
- "channelEnvVars": {
21
- "matrix": [
22
- "MATRIX_HOMESERVER",
23
- "MATRIX_USER_ID",
24
- "MATRIX_ACCESS_TOKEN",
25
- "MATRIX_PASSWORD",
26
- "MATRIX_DEVICE_ID",
27
- "MATRIX_DEVICE_NAME",
28
- "MATRIX_OPS_HOMESERVER",
29
- "MATRIX_OPS_ACCESS_TOKEN",
30
- "MATRIX_OPS_DEVICE_ID",
31
- "MATRIX_OPS_DEVICE_NAME"
32
- ]
33
- },
34
20
  "configSchema": {
35
21
  "type": "object",
36
22
  "additionalProperties": false,
@@ -430,6 +416,13 @@
430
416
  },
431
417
  "toolProgress": {
432
418
  "type": "boolean"
419
+ },
420
+ "commandText": {
421
+ "type": "string",
422
+ "enum": [
423
+ "raw",
424
+ "status"
425
+ ]
433
426
  }
434
427
  },
435
428
  "additionalProperties": false
@@ -513,12 +506,6 @@
513
506
  "isolated",
514
507
  "fork"
515
508
  ]
516
- },
517
- "spawnSubagentSessions": {
518
- "type": "boolean"
519
- },
520
- "spawnAcpSessions": {
521
- "type": "boolean"
522
509
  }
523
510
  },
524
511
  "additionalProperties": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.7.2-beta.3",
3
+ "version": "2026.7.2-beta.5",
4
4
  "description": "OpenClaw Matrix channel plugin for rooms and direct messages.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,12 +13,12 @@
13
13
  "fake-indexeddb": "6.2.5",
14
14
  "markdown-it": "14.3.0",
15
15
  "matrix-js-sdk": "41.9.0-rc.0",
16
- "music-metadata": "11.13.0",
17
- "typebox": "1.3.3",
16
+ "music-metadata": "11.14.0",
17
+ "typebox": "1.3.6",
18
18
  "zod": "4.4.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "openclaw": ">=2026.7.2-beta.3"
21
+ "openclaw": ">=2026.7.2-beta.5"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "openclaw": {
@@ -35,6 +35,25 @@
35
35
  },
36
36
  "channel": {
37
37
  "id": "matrix",
38
+ "configuredState": {
39
+ "env": {
40
+ "anyOf": [
41
+ "MATRIX_HOMESERVER",
42
+ "MATRIX_USER_ID",
43
+ "MATRIX_ACCESS_TOKEN",
44
+ "MATRIX_PASSWORD",
45
+ "MATRIX_DEVICE_ID",
46
+ "MATRIX_DEVICE_NAME",
47
+ "MATRIX_OPS_HOMESERVER",
48
+ "MATRIX_OPS_ACCESS_TOKEN",
49
+ "MATRIX_OPS_DEVICE_ID",
50
+ "MATRIX_OPS_DEVICE_NAME"
51
+ ]
52
+ }
53
+ },
54
+ "approvalFlags": [
55
+ "native"
56
+ ],
38
57
  "label": "Matrix",
39
58
  "selectionLabel": "Matrix (plugin)",
40
59
  "docsPath": "/channels/matrix",
@@ -49,28 +68,92 @@
49
68
  "groupAllowFromFallbackToAllowFrom": false,
50
69
  "warnOnEmptyGroupSenderAllowlist": true
51
70
  },
52
- "cliAddOptions": [
53
- {
54
- "flags": "--homeserver <url>",
55
- "description": "Matrix homeserver URL"
56
- },
57
- {
58
- "flags": "--user-id <id>",
59
- "description": "Matrix user ID"
60
- },
61
- {
62
- "flags": "--access-token <token>",
63
- "description": "Matrix access token"
64
- },
65
- {
66
- "flags": "--device-name <name>",
67
- "description": "Matrix device name"
68
- },
69
- {
70
- "flags": "--initial-sync-limit <n>",
71
- "description": "Matrix initial sync limit"
72
- }
73
- ],
71
+ "setup": {
72
+ "fields": [
73
+ {
74
+ "key": "homeserver",
75
+ "kind": "string",
76
+ "cli": {
77
+ "flags": "--homeserver <url>",
78
+ "description": "Matrix homeserver URL"
79
+ }
80
+ },
81
+ {
82
+ "key": "userId",
83
+ "kind": "string",
84
+ "cli": {
85
+ "flags": "--user-id <id>",
86
+ "description": "Matrix user id"
87
+ }
88
+ },
89
+ {
90
+ "key": "accessToken",
91
+ "kind": "string",
92
+ "sensitive": true,
93
+ "cli": {
94
+ "flags": "--access-token <token>",
95
+ "description": "Matrix access token"
96
+ }
97
+ },
98
+ {
99
+ "key": "password",
100
+ "kind": "string",
101
+ "sensitive": true,
102
+ "cli": {
103
+ "flags": "--password <password>",
104
+ "description": "Matrix password"
105
+ }
106
+ },
107
+ {
108
+ "key": "deviceName",
109
+ "kind": "string",
110
+ "cli": {
111
+ "flags": "--device-name <name>",
112
+ "description": "Matrix device name"
113
+ }
114
+ },
115
+ {
116
+ "key": "avatarUrl",
117
+ "kind": "string",
118
+ "cli": {
119
+ "flags": "--avatar-url <url>",
120
+ "description": "Matrix avatar URL"
121
+ }
122
+ },
123
+ {
124
+ "key": "initialSyncLimit",
125
+ "kind": "integer",
126
+ "cli": {
127
+ "flags": "--initial-sync-limit <n>",
128
+ "description": "Matrix initial sync room limit"
129
+ }
130
+ },
131
+ {
132
+ "key": "proxy",
133
+ "kind": "string",
134
+ "cli": {
135
+ "flags": "--proxy <url>",
136
+ "description": "Matrix proxy URL"
137
+ }
138
+ },
139
+ {
140
+ "key": "dangerouslyAllowPrivateNetwork",
141
+ "kind": "boolean",
142
+ "cli": {
143
+ "flags": "--dangerously-allow-private-network",
144
+ "description": "Allow private-network Matrix homeservers"
145
+ }
146
+ },
147
+ {
148
+ "key": "useEnv",
149
+ "kind": "boolean",
150
+ "cli": {
151
+ "flags": "--use-env",
152
+ "description": "Use Matrix environment credentials"
153
+ }
154
+ }
155
+ ]
156
+ },
74
157
  "persistedAuthState": {
75
158
  "specifier": "./auth-presence",
76
159
  "exportName": "hasAnyMatrixAuth"
@@ -84,10 +167,10 @@
84
167
  "allowInvalidConfigRecovery": true
85
168
  },
86
169
  "compat": {
87
- "pluginApi": ">=2026.7.2-beta.3"
170
+ "pluginApi": ">=2026.7.2-beta.5"
88
171
  },
89
172
  "build": {
90
- "openclawVersion": "2026.7.2-beta.3"
173
+ "openclawVersion": "2026.7.2-beta.5"
91
174
  },
92
175
  "release": {
93
176
  "publishToClawHub": true,
@@ -101,7 +184,6 @@
101
184
  "files": [
102
185
  "dist/**",
103
186
  "openclaw.plugin.json",
104
- "npm-shrinkwrap.json",
105
187
  "README.md"
106
188
  ],
107
189
  "bundledDependencies": [
@@ -1,312 +0,0 @@
1
- import { t as isRecord } from "./record-shared-CWWx6fvI.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,3 +0,0 @@
1
- import { t as createMatrixClient } from "./create-client-WQExaby_.js";
2
- import "./client-CA0PULls.js";
3
- export { createMatrixClient };