@openclaw/matrix 2026.10.10 → 2026.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-config-CVM2a28p.mjs → account-config-CRsKoMqJ.mjs} +2 -1
- package/dist/.setup/{account-selection-Co94mKNj.mjs → account-selection-CWsL5zIU.mjs} +8 -5
- package/dist/.setup/{approval-handler.runtime-DtNvJpfB.mjs → approval-handler.runtime-Co2elSYS.mjs} +9 -8
- package/dist/.setup/{approval-reactions-DMDBJos0.mjs → approval-reactions-D2pEUrFS.mjs} +3 -2
- package/dist/.setup/{backup-health-BxH69np2.mjs → backup-health-Dm_YMVFT.mjs} +2 -1
- package/dist/.setup/{channel-CNjJyBS_.mjs → channel-OgoZc4uR.mjs} +44 -29
- package/dist/.setup/{channel.runtime-DaGbm27q.mjs → channel.runtime-BbPbs1Hp.mjs} +10 -8
- package/dist/.setup/{channel.setup-IjRB0ymg.mjs → channel.setup-p6oll48W.mjs} +15 -7
- package/dist/.setup/{cli-CuEJNM3c.mjs → cli-C2XKMk1U.mjs} +39 -28
- package/dist/.setup/{cli-metadata-rWmD_rzx.mjs → cli-metadata-C60BW1oa.mjs} +5 -3
- package/dist/.setup/{client-7eyTX0cu.mjs → client-BEl7PU1_.mjs} +25 -19
- package/dist/.setup/{client-CV0MkCZG.mjs → client-Cxv-iMwp.mjs} +5 -4
- package/dist/.setup/{client-bootstrap-BjcmTmyR.mjs → client-bootstrap-D1vLveT2.mjs} +3 -2
- package/dist/.setup/{client-support-CFofPPPm.mjs → client-support-D-xHScuo.mjs} +5 -3
- package/dist/.setup/{config-paths-DBpHxDyc.mjs → config-paths-CnREYb1Y.mjs} +2 -1
- package/dist/.setup/{create-client-C4Lnqs2C.mjs → create-client-CrY1E3hg.mjs} +9 -8
- package/dist/.setup/{credentials-read-WCQSEvI8.mjs → credentials-read-Dj7Hj87M.mjs} +6 -5
- package/dist/.setup/{credentials-state-jxq29yQw.mjs → credentials-state-B3cuUFwZ.mjs} +2 -1
- package/dist/.setup/{credentials-B0vpXvcB.mjs → credentials-udso1z0C.mjs} +6 -5
- package/dist/.setup/{crypto-node.runtime-E_hqXGxm.mjs → crypto-node.runtime-6Aj_ltHQ.mjs} +2 -1
- package/dist/.setup/{crypto-runtime-Crp1is7m.mjs → crypto-runtime-DqX7VD1W.mjs} +19 -12
- package/dist/.setup/{crypto-state-store-CM57gchf.mjs → crypto-state-store-DclM-fO5.mjs} +5 -3
- package/dist/.setup/{crypto-store-ownership-Bratn-Np.mjs → crypto-store-ownership-Dr-T40Rp.mjs} +4 -3
- package/dist/.setup/{crypto-unsafe-state-doctor-Brv4bIyx.mjs → crypto-unsafe-state-doctor-BG9qMu0B.mjs} +8 -7
- package/dist/.setup/{deps-O7rEnklr.mjs → deps-L_1bUAGL.mjs} +2 -1
- package/dist/.setup/{device-health-DnKAXW1v.mjs → device-health-D6_ECUVe.mjs} +3 -2
- package/dist/.setup/{direct-management-DDaWVbQI.mjs → direct-management-ZcjZgYEl.mjs} +11 -7
- package/dist/.setup/{directory-live-B-csizuK.mjs → directory-live-_yaRaktv.mjs} +6 -5
- package/dist/.setup/doctor-contract-BANpMUbP.mjs +38 -0
- package/dist/.setup/{draft-stream-dmhBHufd.mjs → draft-stream-vO_qjwJb.mjs} +4 -3
- package/dist/.setup/{encryption-guidance-Cn6-Tlx0.mjs → encryption-guidance-BLUoN4aV.mjs} +4 -3
- package/dist/.setup/{env-vars-Bh1iOXJ1.mjs → env-vars-aEBngJPa.mjs} +2 -1
- package/dist/.setup/{errors-CL3YJV8U.mjs → errors-Bw4EHwKX.mjs} +2 -1
- package/dist/.setup/{event-helpers-DDUjVVf7.mjs → event-helpers-CxNgMQqH.mjs} +2 -1
- package/dist/.setup/{exec-approvals-D7vv3AZS.mjs → exec-approvals-BFT-ee9F.mjs} +9 -6
- package/dist/.setup/{file-sync-store-q5KCV2Lp.mjs → file-sync-store-BxUPmUoJ.mjs} +6 -5
- package/dist/.setup/{http-client-CxTmU1kT.mjs → http-client-ByR4STVQ.mjs} +7 -4
- package/dist/.setup/{idb-persistence-BF0MZglD.mjs → idb-persistence-C2TsCHY2.mjs} +7 -6
- package/dist/.setup/{idb-persistence-lock-CH2K6d_3.mjs → idb-persistence-lock-Bh3ZLIsE.mjs} +2 -1
- package/dist/.setup/{inbound-dedupe-CZnOq0ja.mjs → inbound-dedupe-sW_gaR44.mjs} +3 -2
- package/dist/.setup/{joined-room-encryption-Dl7Sb9FF.mjs → joined-room-encryption-DBbLkdvv.mjs} +3 -2
- package/dist/.setup/{logger-BX5kXvh1.mjs → logger-CuAzdD8Q.mjs} +5 -4
- package/dist/.setup/{logging-BLcaOSRD.mjs → logging-CoaEyRtA.mjs} +22 -15
- package/dist/.setup/{messages-BiHM0DM3.mjs → messages-TuEa_BPZ.mjs} +14 -9
- package/dist/.setup/{monitor-CPwDgRFY.mjs → monitor-B7aj9WSD.mjs} +93 -60
- package/dist/.setup/{onboarding-DiVtpjNu.mjs → onboarding-DOLEjkg2.mjs} +11 -10
- package/dist/.setup/{outbound-DwP97VpQ.mjs → outbound-SIW3NaJ2.mjs} +4 -3
- package/dist/.setup/{profile-update-DnNA9mEa.mjs → profile-update-DiXSVBki.mjs} +8 -6
- package/dist/.setup/{reaction-events-ClY9h_FC.mjs → reaction-events-C3DvaS9B.mjs} +9 -8
- package/dist/.setup/{resolve-targets-B8PAwHVS.mjs → resolve-targets-Dd70hGcM.mjs} +5 -4
- package/dist/.setup/{retired-state-vIr2IB90.mjs → retired-state-C4UnLIg4.mjs} +5 -38
- package/dist/.setup/{room-info-T_PR_liR.mjs → room-info-C13IUffQ.mjs} +8 -6
- package/dist/.setup/{runtime-Ck8TjD7L.mjs → runtime-1kn1P6io.mjs} +2 -1
- package/dist/.setup/{doctor-contract-DybEjJcd.mjs → runtime-doctor-migrations-hxP-CXX7.mjs} +22 -52
- package/dist/.setup/runtime-setter-api-DtxDAM-x.mjs +3 -0
- package/dist/.setup/{sdk-Cj3ggJHG.mjs → sdk-DNW03GqJ.mjs} +47 -32
- package/dist/.setup/{secret-contract-AKnr45nw.mjs → secret-contract-DxyzKSzf.mjs} +3 -2
- package/dist/.setup/secret-contract-api-CiuSYjUy.mjs +3 -0
- package/dist/.setup/{send-C1qeMQAy.mjs → send-BGgwE5pV.mjs} +40 -24
- package/dist/.setup/{send-currentness-CAUVR-f3.mjs → send-currentness-C2rMVVIQ.mjs} +4 -2
- package/dist/.setup/{setup-bootstrap-DDhwWvDs.mjs → setup-bootstrap-BCbltIf_.mjs} +5 -4
- package/dist/.setup/{setup-core-D2r4BivQ.mjs → setup-core-Di6NtQ_J.mjs} +20 -13
- package/dist/.setup/setup-plugin-api-ORC_4yEA.mjs +3 -0
- package/dist/.setup/sqlite-state-LByPx4Yp.mjs +37 -0
- package/dist/.setup/{startup-verification-B3LEbW33.mjs → startup-verification-8xvGpdtK.mjs} +6 -4
- package/dist/.setup/{state-layout-walk-BqCZTHpp.mjs → state-layout-walk-BQMgMykU.mjs} +3 -2
- package/dist/.setup/{storage-CxN4jqKI.mjs → storage-CN4dxdtV.mjs} +20 -10
- package/dist/.setup/{storage-paths-e_Vq6cvw.mjs → storage-paths-B51JM-pC.mjs} +2 -1
- package/dist/.setup/{subagent-hooks-CT-rdJmh.mjs → subagent-hooks-CSY4iwa_.mjs} +3 -2
- package/dist/.setup/{sync-cache-state-qYrd2EEh.mjs → sync-cache-state-L1kwjhjj.mjs} +9 -5
- package/dist/.setup/{target-ids-DltG_ZHJ.mjs → target-ids-HhcaKX1n.mjs} +2 -1
- package/dist/.setup/{thread-binding-api-OtSciHmZ.mjs → thread-binding-api-BvuaKpd0.mjs} +3 -2
- package/dist/.setup/{thread-bindings-D2ZR6mEZ.mjs → thread-bindings-pNgPVdof.mjs} +10 -7
- package/dist/.setup/{thread-bindings-shared-FMu_szTm.mjs → thread-bindings-shared-CPjUA0Ib.mjs} +2 -1
- package/dist/.setup/{tool-actions-CdKa0DC4.mjs → tool-actions-CFX8h2Vm.mjs} +23 -18
- package/dist/.setup/{url-validation-C77p4qT9.mjs → url-validation-CF6pG6eE.mjs} +2 -1
- package/dist/.setup/{verification-jP3tm-xD.mjs → verification-CuT5ZBDO.mjs} +5 -4
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +3 -2
- package/dist/channel-plugin-api.js +2 -1
- package/dist/cli-metadata.js +2 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +55 -20
- package/dist/helper-api.js +3 -3
- package/dist/index.js +4 -3
- package/dist/plugin-entry.handlers.runtime.js +4 -3
- package/dist/runtime-api.js +8 -7
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +2 -1
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +2 -1
- package/dist/thread-bindings-runtime.js +2 -1
- package/package.json +4 -4
- package/dist/.setup/runtime-setter-api-CpwhcBQK.mjs +0 -2
- package/dist/.setup/secret-contract-api-DMSwMIxd.mjs +0 -2
- package/dist/.setup/setup-plugin-api-SO1hdrsT.mjs +0 -2
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { w as setBoundedMap } from "./send-
|
|
2
|
-
import { s as EventType } from "./messages-
|
|
3
|
-
import { r as withResolvedRoomAction } from "./client-
|
|
4
|
-
import { n as isMatrixNotFoundError } from "./errors-
|
|
1
|
+
import { w as setBoundedMap } from "./send-BGgwE5pV.mjs";
|
|
2
|
+
import { s as EventType } from "./messages-TuEa_BPZ.mjs";
|
|
3
|
+
import { r as withResolvedRoomAction } from "./client-Cxv-iMwp.mjs";
|
|
4
|
+
import { n as isMatrixNotFoundError } from "./errors-Bw4EHwKX.mjs";
|
|
5
5
|
import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
-
|
|
6
|
+
//#region extensions/matrix/src/matrix/actions/room.ts
|
|
7
7
|
async function getMatrixMemberInfo(userId, opts) {
|
|
8
8
|
return await withResolvedRoomAction(opts.roomId, opts, async (client, roomId) => {
|
|
9
9
|
if (!(await client.getJoinedRoomMembers(roomId)).includes(userId)) throw new Error(`User ${userId} is not a member of room ${roomId}`);
|
|
@@ -42,7 +42,8 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region extensions/matrix/src/matrix/monitor/room-info.ts
|
|
46
47
|
const MAX_ROOM_INFO = 1024;
|
|
47
48
|
const MAX_MEMBER_DISPLAY_NAMES = 4096;
|
|
48
49
|
function createMatrixRoomInfoResolver(client) {
|
|
@@ -112,4 +113,5 @@ function createMatrixRoomInfoResolver(client) {
|
|
|
112
113
|
invalidateMemberDisplayName
|
|
113
114
|
};
|
|
114
115
|
}
|
|
116
|
+
//#endregion
|
|
115
117
|
export { getMatrixMemberInfo as n, getMatrixRoomInfo as r, createMatrixRoomInfoResolver as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
//#region extensions/matrix/src/runtime.ts
|
|
3
3
|
const { setRuntime: setMatrixRuntime, getRuntime: getMatrixRuntime, tryGetRuntime: getOptionalMatrixRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "matrix",
|
|
5
5
|
errorMessage: "Matrix runtime not initialized"
|
|
@@ -25,4 +25,5 @@ function getMatrixRuntimeLifecycle() {
|
|
|
25
25
|
const runtime = getOptionalMatrixRuntime();
|
|
26
26
|
return runtime ? runtimeLifecycles.tryGetRuntime()?.get(runtime) : void 0;
|
|
27
27
|
}
|
|
28
|
+
//#endregion
|
|
28
29
|
export { setMatrixRuntimeLifecycle as a, setMatrixRuntime as i, getMatrixRuntimeLifecycle as n, getOptionalMatrixRuntime as r, getMatrixRuntime as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
3
|
-
// \0rolldown/runtime.js
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -25,19 +24,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
25
24
|
return to;
|
|
26
25
|
};
|
|
27
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
28
|
-
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region packages/normalization-core/src/record-coerce.ts
|
|
29
29
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
30
|
-
function isRecord
|
|
30
|
+
function isRecord(value) {
|
|
31
31
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
32
32
|
}
|
|
33
33
|
/** Returns a non-array record or null. */
|
|
34
|
-
function asNullableRecord
|
|
35
|
-
return isRecord
|
|
34
|
+
function asNullableRecord(value) {
|
|
35
|
+
return isRecord(value) ? value : null;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/config/channel-config-normalization.ts
|
|
38
39
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
39
40
|
function normalizeChannelAccounts(params) {
|
|
40
|
-
const rawAccounts = asNullableRecord
|
|
41
|
+
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
41
42
|
if (!rawAccounts) return {
|
|
42
43
|
entry: params.entry,
|
|
43
44
|
changed: false
|
|
@@ -45,7 +46,7 @@ function normalizeChannelAccounts(params) {
|
|
|
45
46
|
let changed = false;
|
|
46
47
|
const accounts = { ...rawAccounts };
|
|
47
48
|
for (const [accountId, value] of Object.entries(rawAccounts)) {
|
|
48
|
-
const account = asNullableRecord
|
|
49
|
+
const account = asNullableRecord(value);
|
|
49
50
|
if (!account) continue;
|
|
50
51
|
const normalized = params.normalizeAccount({
|
|
51
52
|
account,
|
|
@@ -73,7 +74,7 @@ function normalizeChannelAccounts(params) {
|
|
|
73
74
|
function normalizeChannelConfigEntries(params) {
|
|
74
75
|
const changes = params.changes ?? [];
|
|
75
76
|
const channels = params.cfg.channels;
|
|
76
|
-
const entry = asNullableRecord
|
|
77
|
+
const entry = asNullableRecord(channels?.[params.channelId]);
|
|
77
78
|
if (!entry) return {
|
|
78
79
|
config: params.cfg,
|
|
79
80
|
changes
|
|
@@ -110,14 +111,15 @@ function normalizeChannelConfigEntries(params) {
|
|
|
110
111
|
changes
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
114
116
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
115
117
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
116
118
|
const portKey = params.portKey ?? "webhookPort";
|
|
117
119
|
const hostKey = params.hostKey === void 0 ? "webhookHost" : params.hostKey;
|
|
118
|
-
const source = (entry) => params.webhookKey ? asNullableRecord
|
|
120
|
+
const source = (entry) => params.webhookKey ? asNullableRecord(entry[params.webhookKey]) : entry;
|
|
119
121
|
const hasLegacy = (value) => {
|
|
120
|
-
const entry = asNullableRecord
|
|
122
|
+
const entry = asNullableRecord(value);
|
|
121
123
|
const listener = entry && source(entry);
|
|
122
124
|
return Boolean(listener && (Object.hasOwn(listener, portKey) || hostKey && Object.hasOwn(listener, hostKey)));
|
|
123
125
|
};
|
|
@@ -133,14 +135,14 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
133
135
|
path: ["channels", params.channelKey],
|
|
134
136
|
message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
|
|
135
137
|
match: (value) => {
|
|
136
|
-
const accounts = asNullableRecord
|
|
138
|
+
const accounts = asNullableRecord(asNullableRecord(value)?.accounts);
|
|
137
139
|
return hasLegacy(value) || Object.values(accounts ?? {}).some(hasLegacy);
|
|
138
140
|
}
|
|
139
141
|
}],
|
|
140
142
|
normalizeCompatibilityConfig: ({ cfg }) => {
|
|
141
|
-
const root = asNullableRecord
|
|
143
|
+
const root = asNullableRecord(asNullableRecord(cfg.channels)?.[params.channelKey]);
|
|
142
144
|
const inherited = root && source(root);
|
|
143
|
-
const canonicalRoot = asNullableRecord
|
|
145
|
+
const canonicalRoot = asNullableRecord(root?.legacyWebhook);
|
|
144
146
|
return normalizeChannelConfigEntries({
|
|
145
147
|
cfg,
|
|
146
148
|
channelId: params.channelKey,
|
|
@@ -180,42 +182,10 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
180
182
|
}
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
|
-
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
184
187
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
185
188
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
186
189
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (typeof value !== "string") return null;
|
|
190
|
-
const normalized = value.trim().toLowerCase();
|
|
191
|
-
return normalized === "partial" || normalized === "quiet" || normalized === "progress" || normalized === "off" ? normalized : null;
|
|
192
|
-
}
|
|
193
|
-
const streamingAliasMigration = (0, runtime_doctor_migrations_exports.defineChannelAliasMigration)({
|
|
194
|
-
channelId: "matrix",
|
|
195
|
-
streaming: {
|
|
196
|
-
defaultMode: "off",
|
|
197
|
-
resolveMode: (entry) => {
|
|
198
|
-
const streaming = isRecord(entry.streaming) ? entry.streaming : null;
|
|
199
|
-
const parsed = parseMatrixStreamingMode(streaming ? streaming.mode : entry.streaming);
|
|
200
|
-
if (parsed) return parsed;
|
|
201
|
-
return entry.streaming === true ? "partial" : "off";
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
accountStreamingReplacesRoot: true
|
|
205
|
-
});
|
|
206
|
-
const legacyConfigRules = streamingAliasMigration.legacyConfigRules;
|
|
207
|
-
function normalizeCompatibilityConfig({ cfg }) {
|
|
208
|
-
const changes = [];
|
|
209
|
-
const withoutJunkStreamMode = (0, runtime_doctor_migrations_exports.stripRetiredChannelKeys)({
|
|
210
|
-
cfg,
|
|
211
|
-
channelId: "matrix",
|
|
212
|
-
keys: /* @__PURE__ */ new Set(["streamMode"]),
|
|
213
|
-
scope: "root-and-accounts",
|
|
214
|
-
onRemove: ({ key, pathPrefix }) => changes.push(`Removed ${pathPrefix}.${key} (never read by the Matrix runtime).`)
|
|
215
|
-
}).config;
|
|
216
|
-
return streamingAliasMigration.normalizeChannelConfig({
|
|
217
|
-
cfg: withoutJunkStreamMode,
|
|
218
|
-
changes
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
export { __exportAll as i, normalizeCompatibilityConfig as n, runtime_doctor_migrations_exports as r, legacyConfigRules as t };
|
|
190
|
+
//#endregion
|
|
191
|
+
export { __exportAll as n, runtime_doctor_migrations_exports as t };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
3
|
-
import { r as assertMatrixSupportedStateFile } from "./retired-state-
|
|
4
|
-
import { a as readMatrixRecoveryKeyStateForPathAsync, l as writeMatrixRecoveryKeyStateForPathAsync } from "./crypto-state-store-
|
|
5
|
-
import { n as withMatrixSendCurrentness, r as withoutMatrixSendCurrentness, t as captureMatrixSendCurrentness } from "./send-currentness-
|
|
6
|
-
import { i as parseMxc, r as matrixEventToRaw } from "./event-helpers-
|
|
7
|
-
import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-
|
|
8
|
-
import { n as isMatrixNotFoundError, t as formatMatrixErrorReason } from "./errors-
|
|
9
|
-
import { n as createMatrixGuardedFetch, t as MatrixAuthedHttpClient } from "./http-client-
|
|
10
|
-
import { n as resolveMatrixRoomKeyBackupReadinessError } from "./backup-health-
|
|
11
|
-
import { r as noop, t as LogService } from "./logger-
|
|
12
|
-
import { t as createMatrixJsSdkClientLogger } from "./logging-
|
|
13
|
-
import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-
|
|
14
|
-
import { a as isMatrixAccessTokenInvalidatedError, c as resolveMatrixLocalTimeoutMs, f as isMatrixReadySyncState, i as createMatrixExplicitBootstrapOptions, l as unresolvedMatrixDeviceVerificationStatus, n as MATRIX_INITIAL_CRYPTO_BOOTSTRAP_OPTIONS, o as resolveMatrixDiagnostic, p as isMatrixTerminalSyncState, r as MATRIX_STATUS_DIAGNOSTIC_TIMEOUT_MS, s as resolveMatrixDiagnosticResult, t as MATRIX_AUTOMATIC_REPAIR_BOOTSTRAP_OPTIONS, u as unresolvedMatrixRoomKeyBackupStatus } from "./client-support-
|
|
15
|
-
import { t as MATRIX_IDB_PERSIST_INTERVAL_MS } from "./idb-persistence-lock-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
3
|
+
import { r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
|
|
4
|
+
import { a as readMatrixRecoveryKeyStateForPathAsync, l as writeMatrixRecoveryKeyStateForPathAsync } from "./crypto-state-store-DclM-fO5.mjs";
|
|
5
|
+
import { n as withMatrixSendCurrentness, r as withoutMatrixSendCurrentness, t as captureMatrixSendCurrentness } from "./send-currentness-C2rMVVIQ.mjs";
|
|
6
|
+
import { i as parseMxc, r as matrixEventToRaw } from "./event-helpers-CxNgMQqH.mjs";
|
|
7
|
+
import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-BEl7PU1_.mjs";
|
|
8
|
+
import { n as isMatrixNotFoundError, t as formatMatrixErrorReason } from "./errors-Bw4EHwKX.mjs";
|
|
9
|
+
import { n as createMatrixGuardedFetch, t as MatrixAuthedHttpClient } from "./http-client-ByR4STVQ.mjs";
|
|
10
|
+
import { n as resolveMatrixRoomKeyBackupReadinessError } from "./backup-health-Dm_YMVFT.mjs";
|
|
11
|
+
import { r as noop, t as LogService } from "./logger-CuAzdD8Q.mjs";
|
|
12
|
+
import { t as createMatrixJsSdkClientLogger } from "./logging-CoaEyRtA.mjs";
|
|
13
|
+
import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-Dr-T40Rp.mjs";
|
|
14
|
+
import { a as isMatrixAccessTokenInvalidatedError, c as resolveMatrixLocalTimeoutMs, f as isMatrixReadySyncState, i as createMatrixExplicitBootstrapOptions, l as unresolvedMatrixDeviceVerificationStatus, n as MATRIX_INITIAL_CRYPTO_BOOTSTRAP_OPTIONS, o as resolveMatrixDiagnostic, p as isMatrixTerminalSyncState, r as MATRIX_STATUS_DIAGNOSTIC_TIMEOUT_MS, s as resolveMatrixDiagnosticResult, t as MATRIX_AUTOMATIC_REPAIR_BOOTSTRAP_OPTIONS, u as unresolvedMatrixRoomKeyBackupStatus } from "./client-support-D-xHScuo.mjs";
|
|
15
|
+
import { t as MATRIX_IDB_PERSIST_INTERVAL_MS } from "./idb-persistence-lock-Bh3ZLIsE.mjs";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
17
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
18
18
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -33,7 +33,7 @@ import { createDeferred as createDeferred$1 } from "openclaw/plugin-sdk/concurre
|
|
|
33
33
|
import { decodeRecoveryKey } from "matrix-js-sdk/lib/crypto-api/recovery-key.js";
|
|
34
34
|
import { MatrixScheduler } from "matrix-js-sdk/lib/scheduler.js";
|
|
35
35
|
import { EventStatus } from "matrix-js-sdk/lib/models/event-status.js";
|
|
36
|
-
|
|
36
|
+
//#region extensions/matrix/src/matrix/sdk/client-device-info.ts
|
|
37
37
|
async function resolveMatrixCrossSigningPublicationStatus(params) {
|
|
38
38
|
let response;
|
|
39
39
|
if (params.userId) try {
|
|
@@ -62,7 +62,8 @@ async function listMatrixOwnDevices(client) {
|
|
|
62
62
|
current: currentDeviceId !== null && device.device_id === currentDeviceId
|
|
63
63
|
}));
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region extensions/matrix/src/matrix/sdk/client-event-bridge.ts
|
|
66
67
|
function registerMatrixClientBridge(params) {
|
|
67
68
|
let initialSyncComplete = false;
|
|
68
69
|
const joinTransitions = /* @__PURE__ */ new WeakSet();
|
|
@@ -132,7 +133,8 @@ function refreshMatrixDmRoomIds(direct, dmRoomIds) {
|
|
|
132
133
|
}
|
|
133
134
|
return true;
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region extensions/matrix/src/matrix/sdk/client-crypto-bootstrap.ts
|
|
136
138
|
async function bootstrapMatrixClientCrypto(params) {
|
|
137
139
|
const { crypto, bootstrapper, abortSignal } = params;
|
|
138
140
|
if (!crypto || !bootstrapper) return false;
|
|
@@ -150,7 +152,8 @@ async function bootstrapMatrixClientCrypto(params) {
|
|
|
150
152
|
}
|
|
151
153
|
return true;
|
|
152
154
|
}
|
|
153
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region extensions/matrix/src/matrix/sdk/client-sync-quiesce.ts
|
|
154
157
|
const MATRIX_SYNC_QUIESCE_TIMEOUT_MS = 5e3;
|
|
155
158
|
const MATRIX_JS_SDK_SYNC_VERSION = "42.4.0";
|
|
156
159
|
const matrixJsSdkPackage = createRequire(import.meta.url)("matrix-js-sdk/package.json");
|
|
@@ -218,7 +221,8 @@ async function quiesceMatrixClientSync(params) {
|
|
|
218
221
|
}
|
|
219
222
|
});
|
|
220
223
|
}
|
|
221
|
-
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region extensions/matrix/src/matrix/sdk/client-sync-ready.ts
|
|
222
226
|
async function waitForMatrixInitialSyncReady(params) {
|
|
223
227
|
const timeoutMs = params.timeoutMs ?? 3e4;
|
|
224
228
|
if (isMatrixReadySyncState(params.state)) return;
|
|
@@ -258,7 +262,8 @@ async function waitForMatrixInitialSyncReady(params) {
|
|
|
258
262
|
params.emitter.off("sync.unexpected_error", settle);
|
|
259
263
|
}
|
|
260
264
|
}
|
|
261
|
-
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region extensions/matrix/src/matrix/sdk/crypto-store-lifecycle.ts
|
|
262
267
|
async function closeMatrixCryptoStores(closeRecoveryKeys, releaseOwnership, teardownComplete) {
|
|
263
268
|
const recovery = await Promise.allSettled([closeRecoveryKeys()]);
|
|
264
269
|
const release = teardownComplete ? await Promise.allSettled([releaseOwnership()]) : [];
|
|
@@ -354,7 +359,8 @@ function createMatrixSdkStopGate() {
|
|
|
354
359
|
}
|
|
355
360
|
};
|
|
356
361
|
}
|
|
357
|
-
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region extensions/matrix/src/matrix/sdk/live-room-readiness.ts
|
|
358
364
|
async function withMatrixLiveEncryptedRoom(owner, run, params) {
|
|
359
365
|
const signal = AbortSignal.any([params.generationSignal, ...params.abortSignal ? [params.abortSignal] : []]);
|
|
360
366
|
const active = (async () => {
|
|
@@ -435,7 +441,8 @@ async function probeMatrixLiveEncryptedRoom(params) {
|
|
|
435
441
|
params.signal.removeEventListener("abort", onChange);
|
|
436
442
|
}
|
|
437
443
|
}
|
|
438
|
-
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region extensions/matrix/src/matrix/sdk/message-wire-dispatch.ts
|
|
439
446
|
function resolveMessageWireDispatch(resource, init) {
|
|
440
447
|
if ((init?.method ?? (resource instanceof Request ? resource.method : "GET")).toUpperCase() !== "PUT") return null;
|
|
441
448
|
const rawUrl = typeof resource === "string" ? resource : resource instanceof URL ? resource.href : resource.url;
|
|
@@ -490,7 +497,8 @@ var MatrixMessageWireDispatchGuards = class {
|
|
|
490
497
|
}
|
|
491
498
|
}
|
|
492
499
|
};
|
|
493
|
-
|
|
500
|
+
//#endregion
|
|
501
|
+
//#region extensions/matrix/src/matrix/sdk/recovery-key-store.ts
|
|
494
502
|
function isRepairableSecretStorageAccessError(err) {
|
|
495
503
|
const message = formatMatrixErrorReason(err);
|
|
496
504
|
if (!message) return false;
|
|
@@ -767,7 +775,8 @@ var MatrixRecoveryKeyStore = class {
|
|
|
767
775
|
}
|
|
768
776
|
}
|
|
769
777
|
};
|
|
770
|
-
|
|
778
|
+
//#endregion
|
|
779
|
+
//#region extensions/matrix/src/matrix/sdk/send-scheduler.ts
|
|
771
780
|
/** Keep SDK FIFO/backoff while settling a caller's pre-request rejection only for its event. */
|
|
772
781
|
var MatrixSendScheduler = class extends MatrixScheduler {
|
|
773
782
|
constructor(wasCurrentnessRejected) {
|
|
@@ -805,10 +814,11 @@ var MatrixSendScheduler = class extends MatrixScheduler {
|
|
|
805
814
|
return this.queue.removeEventFromQueue(event);
|
|
806
815
|
}
|
|
807
816
|
};
|
|
808
|
-
|
|
817
|
+
//#endregion
|
|
818
|
+
//#region extensions/matrix/src/matrix/sdk/client-base.ts
|
|
809
819
|
const MATRIX_ENCRYPTED_STARTUP_TIMEOUT_MS = 6e4;
|
|
810
820
|
let loadedMatrixCryptoRuntime = null;
|
|
811
|
-
const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-
|
|
821
|
+
const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-DqX7VD1W.mjs").then((runtime) => {
|
|
812
822
|
loadedMatrixCryptoRuntime = runtime;
|
|
813
823
|
return runtime;
|
|
814
824
|
}));
|
|
@@ -1038,7 +1048,7 @@ var MatrixClientBase = class {
|
|
|
1038
1048
|
checkActive();
|
|
1039
1049
|
throwIfMatrixStartupAborted(signal);
|
|
1040
1050
|
if (this.encryptionEnabled && this.cryptoInitialized) {
|
|
1041
|
-
const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-
|
|
1051
|
+
const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-DBbLkdvv.mjs");
|
|
1042
1052
|
checkActive();
|
|
1043
1053
|
await this.withClientCryptoWork(() => reconcileJoinedRoomEncryption(this.client, signal, checkActive), signal);
|
|
1044
1054
|
checkActive();
|
|
@@ -1250,7 +1260,8 @@ var MatrixClientBase = class {
|
|
|
1250
1260
|
}
|
|
1251
1261
|
}
|
|
1252
1262
|
};
|
|
1253
|
-
|
|
1263
|
+
//#endregion
|
|
1264
|
+
//#region extensions/matrix/src/matrix/sdk/client-core.ts
|
|
1254
1265
|
function isUnsupportedAuthenticatedMediaEndpointError(err) {
|
|
1255
1266
|
const statusCode = err?.statusCode;
|
|
1256
1267
|
if (statusCode === 404 || statusCode === 405 || statusCode === 501) return true;
|
|
@@ -1490,7 +1501,8 @@ var MatrixClientCore = class extends MatrixClientBase {
|
|
|
1490
1501
|
});
|
|
1491
1502
|
}
|
|
1492
1503
|
};
|
|
1493
|
-
|
|
1504
|
+
//#endregion
|
|
1505
|
+
//#region extensions/matrix/src/matrix/sdk/verification-status.ts
|
|
1494
1506
|
function isMatrixDeviceOwnerVerified(status) {
|
|
1495
1507
|
return status?.crossSigningVerified === true;
|
|
1496
1508
|
}
|
|
@@ -1507,7 +1519,8 @@ async function trustMatrixOwnIdentity(crypto) {
|
|
|
1507
1519
|
ownIdentity.free?.();
|
|
1508
1520
|
}
|
|
1509
1521
|
}
|
|
1510
|
-
|
|
1522
|
+
//#endregion
|
|
1523
|
+
//#region extensions/matrix/src/matrix/sdk/client-verification.ts
|
|
1511
1524
|
var MatrixClientVerification = class extends MatrixClientCore {
|
|
1512
1525
|
async refreshOwnDeviceKeys() {
|
|
1513
1526
|
await this.client.getCrypto()?.userHasCrossSigningKeys(await this.getUserId(), true);
|
|
@@ -1657,7 +1670,8 @@ var MatrixClientVerification = class extends MatrixClientCore {
|
|
|
1657
1670
|
LogService.info("MatrixClientLite", `Room key backup enabled (version ${createdVersion})`);
|
|
1658
1671
|
}
|
|
1659
1672
|
};
|
|
1660
|
-
|
|
1673
|
+
//#endregion
|
|
1674
|
+
//#region extensions/matrix/src/matrix/sdk.ts
|
|
1661
1675
|
var sdk_exports = /* @__PURE__ */ __exportAll({ MatrixClient: () => MatrixClient });
|
|
1662
1676
|
var MatrixClient = class extends MatrixClientVerification {
|
|
1663
1677
|
async verifyWithRecoveryKey(rawRecoveryKey) {
|
|
@@ -1956,4 +1970,5 @@ var MatrixClient = class extends MatrixClientVerification {
|
|
|
1956
1970
|
return refreshMatrixDmRoomIds(await this.getAccountData("m.direct"), this.dmRoomIds);
|
|
1957
1971
|
}
|
|
1958
1972
|
};
|
|
1973
|
+
//#endregion
|
|
1959
1974
|
export { MatrixClient, isRepairableSecretStorageAccessError as a, trustMatrixOwnIdentity as i, isMatrixDeviceOwnerVerified as n, isMatrixDeviceVerifiedInCurrentClient as r, sdk_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as getMatrixScopedEnvVarNames } from "./env-vars-
|
|
1
|
+
import { t as getMatrixScopedEnvVarNames } from "./env-vars-aEBngJPa.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { collectSecretInputAssignment, createChannelSecretContract, hasConfiguredSecretInputValue, hasOwnProperty, normalizeSecretStringValue } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/matrix/src/secret-contract.ts
|
|
5
5
|
function accountSecretOwner(accountId) {
|
|
6
6
|
return {
|
|
7
7
|
ownerKind: "account",
|
|
@@ -86,4 +86,5 @@ const channelSecrets = createChannelSecretContract({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
const { secretTargetRegistryEntries, collectRuntimeConfigAssignments } = channelSecrets;
|
|
89
|
+
//#endregion
|
|
89
90
|
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
3
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-
|
|
4
|
-
import { a as normalizeMatrixResolvableTarget, n as isMatrixQualifiedUserId } from "./target-ids-
|
|
5
|
-
import { n as withMatrixSendCurrentness, o as buildMatrixReactionContent, t as captureMatrixSendCurrentness } from "./send-currentness-
|
|
6
|
-
import { _ as MsgType, d as buildMatrixMessageRelation, f as resolveMatrixReplyToEventId, g as MSC4357_LIVE_KEY, l as isStrictDirectRoom, m as EventType, n as inspectMatrixDirectRooms, p as resolveMatrixThreadRootId, r as persistMatrixDirectRoomMapping, v as RelationType } from "./direct-management-
|
|
7
|
-
import { n as getMatrixEventProjection } from "./event-helpers-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
4
|
+
import { a as normalizeMatrixResolvableTarget, n as isMatrixQualifiedUserId } from "./target-ids-HhcaKX1n.mjs";
|
|
5
|
+
import { n as withMatrixSendCurrentness, o as buildMatrixReactionContent, t as captureMatrixSendCurrentness } from "./send-currentness-C2rMVVIQ.mjs";
|
|
6
|
+
import { _ as MsgType, d as buildMatrixMessageRelation, f as resolveMatrixReplyToEventId, g as MSC4357_LIVE_KEY, l as isStrictDirectRoom, m as EventType, n as inspectMatrixDirectRooms, p as resolveMatrixThreadRootId, r as persistMatrixDirectRoomMapping, v as RelationType } from "./direct-management-ZcjZgYEl.mjs";
|
|
7
|
+
import { n as getMatrixEventProjection } from "./event-helpers-CxNgMQqH.mjs";
|
|
8
8
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
10
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -22,8 +22,8 @@ import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
|
|
|
22
22
|
import MarkdownIt from "markdown-it";
|
|
23
23
|
import { isAutoLinkedFileRef } from "openclaw/plugin-sdk/text-autolink-runtime";
|
|
24
24
|
import { parseBuffer } from "music-metadata";
|
|
25
|
-
|
|
26
|
-
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-
|
|
25
|
+
//#region extensions/matrix/src/matrix/send/client.ts
|
|
26
|
+
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-D1vLveT2.mjs"));
|
|
27
27
|
function resolveMediaMaxBytes(accountId, cfg) {
|
|
28
28
|
if (!cfg) throw new Error("Matrix media limits requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
29
29
|
const mediaMaxMb = resolveMatrixAccountConfig({
|
|
@@ -56,7 +56,8 @@ async function withResolvedMatrixClient(opts, run, shutdownBehavior) {
|
|
|
56
56
|
const { withResolvedRuntimeMatrixClient } = await loadMatrixSendClientRuntime();
|
|
57
57
|
return await withResolvedRuntimeMatrixClient(opts, run, shutdownBehavior);
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region extensions/matrix/src/matrix/send/receipt.ts
|
|
60
61
|
function createMatrixSendReceipt(params) {
|
|
61
62
|
const firstEvent = params.events[0];
|
|
62
63
|
const receipt = createMessageReceiptFromOutboundResults({
|
|
@@ -81,14 +82,16 @@ function createMatrixSendReceipt(params) {
|
|
|
81
82
|
});
|
|
82
83
|
return receipt;
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region extensions/matrix/src/matrix/monitor/bounded-cache.ts
|
|
85
87
|
function setBoundedMap(map, key, value, maxEntries) {
|
|
86
88
|
map.set(key, value);
|
|
87
89
|
if (map.size <= maxEntries) return;
|
|
88
90
|
const oldest = map.keys().next();
|
|
89
91
|
if (!oldest.done) map.delete(oldest.value);
|
|
90
92
|
}
|
|
91
|
-
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region extensions/matrix/src/matrix/send/targets.ts
|
|
92
95
|
function normalizeTarget(raw) {
|
|
93
96
|
const trimmed = raw.trim();
|
|
94
97
|
if (!trimmed) throw new Error("Matrix target is required (room:<id> or #alias)");
|
|
@@ -148,7 +151,8 @@ async function resolveMatrixRoomId(client, raw, opts = {}) {
|
|
|
148
151
|
}
|
|
149
152
|
return target;
|
|
150
153
|
}
|
|
151
|
-
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region extensions/matrix/src/matrix/delivery-plan.ts
|
|
152
156
|
const DELIVERY_PLAN_VERSION = 1;
|
|
153
157
|
const DELIVERY_PLAN_NAMESPACE = "outbound-delivery-plans";
|
|
154
158
|
const DELIVERY_PLAN_TTL_MS = 864e5;
|
|
@@ -379,7 +383,8 @@ async function cleanupMatrixDeliveryPlans(ctx) {
|
|
|
379
383
|
const keys = entries.filter((entry) => entry.key.startsWith(prefix)).map((entry) => entry.key);
|
|
380
384
|
for (const key of keys) await store.delete(key);
|
|
381
385
|
}
|
|
382
|
-
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region extensions/matrix/src/matrix/poll-types.ts
|
|
383
388
|
const M_POLL_START = "m.poll.start";
|
|
384
389
|
const M_POLL_RESPONSE = "m.poll.response";
|
|
385
390
|
const M_POLL_END = "m.poll.end";
|
|
@@ -556,7 +561,8 @@ function buildPollResponseContent(pollEventId, answerIds) {
|
|
|
556
561
|
}
|
|
557
562
|
};
|
|
558
563
|
}
|
|
559
|
-
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region extensions/matrix/src/matrix/format-profile.ts
|
|
560
566
|
function createMatrixPrivateMarkers(markdown, exhaustedMessage) {
|
|
561
567
|
const used = new Set(Array.from(markdown, (character) => character.charCodeAt(0)));
|
|
562
568
|
for (const match of markdown.matchAll(/&#(?:x([0-9a-f]+)|(\d+));/giu)) {
|
|
@@ -599,7 +605,8 @@ function projectMatrixMarkdown(markdown) {
|
|
|
599
605
|
function renderMatrixMarkdownTables(markdown, mode) {
|
|
600
606
|
return MATRIX_FORMAT_PROFILE.constructs.table === "native" && (mode === "off" || mode === "block") ? markdown : convertMarkdownTables(markdown, mode);
|
|
601
607
|
}
|
|
602
|
-
|
|
608
|
+
//#endregion
|
|
609
|
+
//#region extensions/matrix/src/matrix/format-table-ranges.ts
|
|
603
610
|
const tableParser = new MarkdownIt({
|
|
604
611
|
html: false,
|
|
605
612
|
linkify: false,
|
|
@@ -620,7 +627,8 @@ function matrixTableSourceRangesFromTokens(tokens, lineStarts, sourceLength) {
|
|
|
620
627
|
}];
|
|
621
628
|
});
|
|
622
629
|
}
|
|
623
|
-
|
|
630
|
+
//#endregion
|
|
631
|
+
//#region extensions/matrix/src/matrix/format-spoiler-ranges.ts
|
|
624
632
|
const spoilerParser = new MarkdownIt({
|
|
625
633
|
html: false,
|
|
626
634
|
linkify: true,
|
|
@@ -799,7 +807,8 @@ function analyzeMatrixSpoilers(markdown) {
|
|
|
799
807
|
metadataCollision: hasMatrixSpoilerMetadataCollision(source, delimiterOffsets)
|
|
800
808
|
};
|
|
801
809
|
}
|
|
802
|
-
|
|
810
|
+
//#endregion
|
|
811
|
+
//#region extensions/matrix/src/matrix/format.ts
|
|
803
812
|
const MATRIX_STYLE_MARKERS = {
|
|
804
813
|
underline: {
|
|
805
814
|
open: "<u>",
|
|
@@ -1198,7 +1207,8 @@ async function renderMarkdownToMatrixHtmlWithMentions(params) {
|
|
|
1198
1207
|
mentions: state.mentions
|
|
1199
1208
|
};
|
|
1200
1209
|
}
|
|
1201
|
-
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region extensions/matrix/src/matrix/send/chunking.ts
|
|
1202
1212
|
function normalizeMatrixEventLimit(limit) {
|
|
1203
1213
|
if (!Number.isFinite(limit) || limit <= 0) return limit;
|
|
1204
1214
|
return Math.max(1, Math.floor(limit));
|
|
@@ -1361,7 +1371,8 @@ function chunkMatrixText(text, opts) {
|
|
|
1361
1371
|
chunks
|
|
1362
1372
|
};
|
|
1363
1373
|
}
|
|
1364
|
-
|
|
1374
|
+
//#endregion
|
|
1375
|
+
//#region extensions/matrix/src/matrix/media-text.ts
|
|
1365
1376
|
const MATRIX_MEDIA_KINDS = {
|
|
1366
1377
|
"m.audio": "audio",
|
|
1367
1378
|
"m.file": "file",
|
|
@@ -1429,7 +1440,8 @@ function formatMatrixMessageText(params) {
|
|
|
1429
1440
|
if (!body) return marker;
|
|
1430
1441
|
return `${body}\n\n${marker}`;
|
|
1431
1442
|
}
|
|
1432
|
-
|
|
1443
|
+
//#endregion
|
|
1444
|
+
//#region extensions/matrix/src/matrix/send/edit-content.ts
|
|
1433
1445
|
const MAX_EDIT_RELATION_PAGES = 100;
|
|
1434
1446
|
const EDIT_RELATION_PAGE_SIZE = 100;
|
|
1435
1447
|
const EDIT_DECRYPTION_ERROR = "Matrix edit history is not fully decrypted; restore encryption keys before editing.";
|
|
@@ -1467,7 +1479,8 @@ async function resolveMatrixEditContent(params) {
|
|
|
1467
1479
|
}
|
|
1468
1480
|
throw new Error("Matrix edit history could not be fully read; send a new message instead.");
|
|
1469
1481
|
}
|
|
1470
|
-
|
|
1482
|
+
//#endregion
|
|
1483
|
+
//#region extensions/matrix/src/matrix/send/formatting.ts
|
|
1471
1484
|
function buildTextContent(body, relation, opts = {}) {
|
|
1472
1485
|
return {
|
|
1473
1486
|
msgtype: opts.msgtype ?? MsgType.Text,
|
|
@@ -1530,7 +1543,8 @@ function resolveMatrixMsgType(contentType) {
|
|
|
1530
1543
|
default: return MsgType.File;
|
|
1531
1544
|
}
|
|
1532
1545
|
}
|
|
1533
|
-
|
|
1546
|
+
//#endregion
|
|
1547
|
+
//#region extensions/matrix/src/matrix/send/media.ts
|
|
1534
1548
|
function buildMediaContent(params) {
|
|
1535
1549
|
const base = {
|
|
1536
1550
|
msgtype: params.msgtype,
|
|
@@ -1646,7 +1660,8 @@ async function uploadMediaWithEncryption(client, roomId, buffer, params) {
|
|
|
1646
1660
|
}
|
|
1647
1661
|
return { url: await client.uploadContent(buffer, params.contentType, params.filename) };
|
|
1648
1662
|
}
|
|
1649
|
-
|
|
1663
|
+
//#endregion
|
|
1664
|
+
//#region extensions/matrix/src/matrix/send.ts
|
|
1650
1665
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
1651
1666
|
chunkMatrixText: () => chunkMatrixText,
|
|
1652
1667
|
editMessageMatrix: () => editMessageMatrix,
|
|
@@ -2005,4 +2020,5 @@ async function reactMatrixMessage(roomId, messageId, emoji, opts = {}) {
|
|
|
2005
2020
|
await resolved.sendEvent(resolvedRoom, EventType.Reaction, reaction);
|
|
2006
2021
|
});
|
|
2007
2022
|
}
|
|
2023
|
+
//#endregion
|
|
2008
2024
|
export { resolveMatrixRoomId as C, reconcileMatrixUnknownSend as S, isPollEventType as _, sendSingleTextMessageMatrix as a, resolvePollReferenceEventId as b, formatMatrixMessageText as c, resolveMatrixReplacementContent as d, prepareMatrixSingleText as f, formatPollResultsAsText as g, formatPollAsText as h, sendPollMatrix as i, isLikelyBareFilename as l, buildPollResultsSummary as m, reactMatrixMessage as n, sendTypingMatrix as o, buildPollResponseContent as p, sendMessageMatrix as r, send_exports as s, editMessageMatrix as t, resolveMatrixMessageAttachment as u, isPollStartType as v, setBoundedMap as w, cleanupMatrixDeliveryPlans as x, parsePollStart as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
|
|
3
|
+
//#region extensions/matrix/src/matrix/reaction-common.ts
|
|
4
4
|
const MATRIX_ANNOTATION_RELATION_TYPE = "m.annotation";
|
|
5
5
|
const MATRIX_REACTION_EVENT_TYPE = "m.reaction";
|
|
6
6
|
function normalizeMatrixReactionMessageId(messageId) {
|
|
@@ -65,7 +65,8 @@ function selectOwnMatrixReactionEventIds(events, userId, emoji) {
|
|
|
65
65
|
}
|
|
66
66
|
return ids;
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region extensions/matrix/src/matrix/sdk/send-currentness.ts
|
|
69
70
|
const sendCurrentness = new AsyncLocalStorage();
|
|
70
71
|
function withMatrixSendCurrentness(client, assertCurrent, run) {
|
|
71
72
|
assertCurrent();
|
|
@@ -82,4 +83,5 @@ function captureMatrixSendCurrentness(client) {
|
|
|
82
83
|
function withoutMatrixSendCurrentness(run) {
|
|
83
84
|
return sendCurrentness.exit(run);
|
|
84
85
|
}
|
|
86
|
+
//#endregion
|
|
85
87
|
export { MATRIX_REACTION_EVENT_TYPE as a, extractMatrixReactionAnnotation as c, MATRIX_ANNOTATION_RELATION_TYPE as i, selectOwnMatrixReactionEventIds as l, withMatrixSendCurrentness as n, buildMatrixReactionContent as o, withoutMatrixSendCurrentness as r, buildMatrixReactionRelationsPath as s, captureMatrixSendCurrentness as t, summarizeMatrixReactionEvents as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-
|
|
2
|
-
import "./setup-core-
|
|
3
|
-
import { n as bootstrapMatrixVerification } from "./verification-
|
|
1
|
+
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import "./setup-core-Di6NtQ_J.mjs";
|
|
3
|
+
import { n as bootstrapMatrixVerification } from "./verification-CuT5ZBDO.mjs";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/matrix/src/setup-bootstrap.ts
|
|
6
6
|
async function maybeBootstrapNewEncryptedMatrixAccount(params) {
|
|
7
7
|
const accountConfig = resolveMatrixAccountConfig({
|
|
8
8
|
cfg: params.cfg,
|
|
@@ -54,4 +54,5 @@ async function runMatrixSetupBootstrapAfterConfigWrite(params) {
|
|
|
54
54
|
}
|
|
55
55
|
params.runtime.error(`Matrix verification bootstrap warning for "${params.accountId}": ${bootstrap.error ?? "unknown bootstrap failure"}`);
|
|
56
56
|
}
|
|
57
|
+
//#endregion
|
|
57
58
|
export { maybeBootstrapNewEncryptedMatrixAccount, runMatrixSetupBootstrapAfterConfigWrite };
|