@openclaw/matrix 2026.10.10-beta.5 → 2026.10.10
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-CRsKoMqJ.mjs → account-config-CVM2a28p.mjs} +1 -2
- package/dist/.setup/{account-selection-Bs_jCAaG.mjs → account-selection-Co94mKNj.mjs} +5 -8
- package/dist/.setup/{approval-handler.runtime-6u08WKWh.mjs → approval-handler.runtime-DtNvJpfB.mjs} +8 -9
- package/dist/.setup/{approval-reactions-D2pEUrFS.mjs → approval-reactions-DMDBJos0.mjs} +2 -3
- package/dist/.setup/{backup-health-Dm_YMVFT.mjs → backup-health-BxH69np2.mjs} +1 -2
- package/dist/.setup/{channel-CqkLHNdp.mjs → channel-CNjJyBS_.mjs} +29 -43
- package/dist/.setup/{channel.runtime-BfZdvlho.mjs → channel.runtime-DaGbm27q.mjs} +8 -10
- package/dist/.setup/{channel.setup-ClA7V_Ba.mjs → channel.setup-IjRB0ymg.mjs} +7 -11
- package/dist/.setup/{cli-BLgMlO3I.mjs → cli-CuEJNM3c.mjs} +28 -39
- package/dist/.setup/{cli-metadata-COWLWR3E.mjs → cli-metadata-rWmD_rzx.mjs} +3 -5
- package/dist/.setup/{client-C4Gibhzl.mjs → client-7eyTX0cu.mjs} +19 -25
- package/dist/.setup/{client-C7pZ6gAl.mjs → client-CV0MkCZG.mjs} +4 -5
- package/dist/.setup/{client-bootstrap-kOIDV4z_.mjs → client-bootstrap-BjcmTmyR.mjs} +2 -3
- package/dist/.setup/{client-support-D-xHScuo.mjs → client-support-CFofPPPm.mjs} +3 -5
- package/dist/.setup/{config-paths-CnREYb1Y.mjs → config-paths-DBpHxDyc.mjs} +1 -2
- package/dist/.setup/{create-client-BS8UYx6N.mjs → create-client-C4Lnqs2C.mjs} +8 -9
- package/dist/.setup/{credentials-CPnJZaZB.mjs → credentials-B0vpXvcB.mjs} +5 -6
- package/dist/.setup/{credentials-read-D2ULV55A.mjs → credentials-read-WCQSEvI8.mjs} +5 -6
- package/dist/.setup/{credentials-state-B3cuUFwZ.mjs → credentials-state-jxq29yQw.mjs} +1 -2
- package/dist/.setup/{crypto-node.runtime-6Aj_ltHQ.mjs → crypto-node.runtime-E_hqXGxm.mjs} +1 -2
- package/dist/.setup/{crypto-runtime-D8yY7kjD.mjs → crypto-runtime-Crp1is7m.mjs} +12 -19
- package/dist/.setup/{crypto-state-store-D4wrCvFs.mjs → crypto-state-store-CM57gchf.mjs} +3 -4
- package/dist/.setup/{crypto-store-ownership-Z_Y5WRKr.mjs → crypto-store-ownership-Bratn-Np.mjs} +3 -4
- package/dist/.setup/{crypto-unsafe-state-doctor-C8szCYmf.mjs → crypto-unsafe-state-doctor-Brv4bIyx.mjs} +7 -8
- package/dist/.setup/{deps-L_1bUAGL.mjs → deps-O7rEnklr.mjs} +1 -2
- package/dist/.setup/{device-health-Be60VF1w.mjs → device-health-DnKAXW1v.mjs} +2 -3
- package/dist/.setup/{direct-management-B3wYhx_M.mjs → direct-management-DDaWVbQI.mjs} +7 -11
- package/dist/.setup/{directory-live-BpSz-FQB.mjs → directory-live-B-csizuK.mjs} +5 -6
- package/dist/.setup/{doctor-contract-CsTNmbMa.mjs → doctor-contract-DybEjJcd.mjs} +6 -12
- package/dist/.setup/{draft-stream-K6Lu-JEI.mjs → draft-stream-dmhBHufd.mjs} +3 -4
- package/dist/.setup/{encryption-guidance-D5_IsDIy.mjs → encryption-guidance-Cn6-Tlx0.mjs} +3 -4
- package/dist/.setup/{env-vars-aEBngJPa.mjs → env-vars-Bh1iOXJ1.mjs} +1 -2
- package/dist/.setup/{errors-Bw4EHwKX.mjs → errors-CL3YJV8U.mjs} +1 -2
- package/dist/.setup/{event-helpers-CxNgMQqH.mjs → event-helpers-DDUjVVf7.mjs} +1 -2
- package/dist/.setup/{exec-approvals-DtNw0e04.mjs → exec-approvals-D7vv3AZS.mjs} +6 -9
- package/dist/.setup/{file-sync-store-CUH8EAJq.mjs → file-sync-store-q5KCV2Lp.mjs} +5 -6
- package/dist/.setup/{http-client-ByR4STVQ.mjs → http-client-CxTmU1kT.mjs} +4 -7
- package/dist/.setup/{idb-persistence-BHTYPRe_.mjs → idb-persistence-BF0MZglD.mjs} +6 -7
- package/dist/.setup/{idb-persistence-lock-Bh3ZLIsE.mjs → idb-persistence-lock-CH2K6d_3.mjs} +1 -2
- package/dist/.setup/{inbound-dedupe-C-EBGY0B.mjs → inbound-dedupe-CZnOq0ja.mjs} +2 -3
- package/dist/.setup/{joined-room-encryption-BAD70N5n.mjs → joined-room-encryption-Dl7Sb9FF.mjs} +2 -3
- package/dist/.setup/{logger-CXQnpXCt.mjs → logger-BX5kXvh1.mjs} +2 -3
- package/dist/.setup/{logging-BKV8TYQq.mjs → logging-BLcaOSRD.mjs} +3 -4
- package/dist/.setup/{messages-O6G0-_xr.mjs → messages-BiHM0DM3.mjs} +9 -14
- package/dist/.setup/{monitor-BSEZMFyq.mjs → monitor-CPwDgRFY.mjs} +85 -94
- package/dist/.setup/{onboarding-DQLF7huY.mjs → onboarding-DiVtpjNu.mjs} +10 -11
- package/dist/.setup/{outbound-C0bqZr89.mjs → outbound-DwP97VpQ.mjs} +3 -4
- package/dist/.setup/{profile-update-BbfEg9Fx.mjs → profile-update-DnNA9mEa.mjs} +6 -8
- package/dist/.setup/{reaction-events-51DOeO0I.mjs → reaction-events-ClY9h_FC.mjs} +8 -9
- package/dist/.setup/{resolve-targets-BJ5sIKeM.mjs → resolve-targets-B8PAwHVS.mjs} +4 -5
- package/dist/.setup/{retired-state-DOCruzWd.mjs → retired-state-vIr2IB90.mjs} +4 -7
- package/dist/.setup/{room-info-DAJKw-I8.mjs → room-info-T_PR_liR.mjs} +6 -8
- package/dist/.setup/{runtime-1kn1P6io.mjs → runtime-Ck8TjD7L.mjs} +1 -2
- package/dist/.setup/{runtime-setter-api-i2MOXoT3.mjs → runtime-setter-api-CpwhcBQK.mjs} +1 -1
- package/dist/.setup/{sdk-ByU8So5S.mjs → sdk-Cj3ggJHG.mjs} +32 -47
- package/dist/.setup/{secret-contract-DxyzKSzf.mjs → secret-contract-AKnr45nw.mjs} +2 -3
- package/dist/.setup/{secret-contract-api-Dukgvike.mjs → secret-contract-api-DMSwMIxd.mjs} +1 -1
- package/dist/.setup/{send-CFx1h7xE.mjs → send-C1qeMQAy.mjs} +24 -40
- package/dist/.setup/{send-currentness-C2rMVVIQ.mjs → send-currentness-CAUVR-f3.mjs} +2 -4
- package/dist/.setup/{setup-bootstrap-DANlsW-o.mjs → setup-bootstrap-DDhwWvDs.mjs} +4 -5
- package/dist/.setup/{setup-core-EQceJMZZ.mjs → setup-core-D2r4BivQ.mjs} +13 -20
- package/dist/.setup/setup-plugin-api-SO1hdrsT.mjs +2 -0
- package/dist/.setup/{startup-verification-UU8DUvi4.mjs → startup-verification-B3LEbW33.mjs} +4 -5
- package/dist/.setup/{state-layout-walk-BQMgMykU.mjs → state-layout-walk-BqCZTHpp.mjs} +2 -3
- package/dist/.setup/{storage-l8V0XsGM.mjs → storage-CxN4jqKI.mjs} +7 -9
- package/dist/.setup/{storage-paths-B51JM-pC.mjs → storage-paths-e_Vq6cvw.mjs} +1 -2
- package/dist/.setup/{subagent-hooks-CSY4iwa_.mjs → subagent-hooks-CT-rdJmh.mjs} +2 -3
- package/dist/.setup/{sync-cache-state-Cnm4TCEI.mjs → sync-cache-state-qYrd2EEh.mjs} +3 -4
- package/dist/.setup/{target-ids-HhcaKX1n.mjs → target-ids-DltG_ZHJ.mjs} +1 -2
- package/dist/.setup/{thread-binding-api-BvuaKpd0.mjs → thread-binding-api-OtSciHmZ.mjs} +2 -3
- package/dist/.setup/{thread-bindings-C0gv7BEN.mjs → thread-bindings-D2ZR6mEZ.mjs} +7 -9
- package/dist/.setup/{thread-bindings-shared-CPjUA0Ib.mjs → thread-bindings-shared-FMu_szTm.mjs} +1 -2
- package/dist/.setup/{tool-actions-DGYRJDEV.mjs → tool-actions-CdKa0DC4.mjs} +18 -23
- package/dist/.setup/{url-validation-CF6pG6eE.mjs → url-validation-C77p4qT9.mjs} +1 -2
- package/dist/.setup/{verification-DUxuApWC.mjs → verification-jP3tm-xD.mjs} +4 -5
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +2 -3
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +13 -16
- package/dist/helper-api.js +3 -3
- package/dist/index.js +3 -4
- package/dist/plugin-entry.handlers.runtime.js +3 -4
- package/dist/runtime-api.js +7 -8
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +4 -5
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/matrix-js-sdk/lib/http-api/utils.js +3 -1
- package/node_modules/matrix-js-sdk/lib/rust-crypto/rust-crypto.js +7 -1
- package/node_modules/matrix-js-sdk/src/http-api/utils.ts +5 -1
- package/node_modules/matrix-js-sdk/src/rust-crypto/rust-crypto.ts +7 -1
- package/package.json +4 -4
- package/dist/.setup/setup-plugin-api-f8mWghxf.mjs +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-Ck8TjD7L.mjs";
|
|
2
2
|
import { extractErrorCode } from "openclaw/plugin-sdk/error-runtime";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
|
-
|
|
7
|
+
// extensions/matrix/src/matrix/chunked-state.ts
|
|
8
8
|
function chunkMatrixStateJson(value, maxBytes, maxChunks, limitMessage) {
|
|
9
9
|
const chunks = [];
|
|
10
10
|
const pushChunk = (chunk) => {
|
|
@@ -45,8 +45,7 @@ async function writeMatrixStateChunks(store, rows, chunkKeyPrefix) {
|
|
|
45
45
|
await store.register(rows.meta.key, rows.meta.value);
|
|
46
46
|
for (const row of await store.entries()) if (row.key.startsWith(chunkKeyPrefix) && !nextChunkKeys.has(row.key)) await store.delete(row.key);
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
//#region extensions/matrix/src/matrix/sqlite-state.ts
|
|
48
|
+
// extensions/matrix/src/matrix/sqlite-state.ts
|
|
50
49
|
function resolveStateDirOverride(options) {
|
|
51
50
|
if (!options) return;
|
|
52
51
|
return options.stateDir || options.stateRootDir || getMatrixRuntime().state.resolveStateDir(options.env ?? process.env, os.homedir);
|
|
@@ -79,8 +78,7 @@ async function updateMatrixKeyedState(store, key, update, onUndefined = "keep")
|
|
|
79
78
|
observation = result.current;
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
|
-
|
|
83
|
-
//#region extensions/matrix/src/matrix/retired-state.ts
|
|
81
|
+
// extensions/matrix/src/matrix/retired-state.ts
|
|
84
82
|
const RETIRED_MATRIX_STATE_FILENAMES = /* @__PURE__ */ new Set([
|
|
85
83
|
"thread-bindings.json",
|
|
86
84
|
"startup-verification.json",
|
|
@@ -106,5 +104,4 @@ async function assertMatrixSupportedStateFile(filePath) {
|
|
|
106
104
|
}
|
|
107
105
|
throw new Error(describeRetiredMatrixState(filePath));
|
|
108
106
|
}
|
|
109
|
-
//#endregion
|
|
110
107
|
export { describeRetiredMatrixState as a, updateMatrixKeyedState as c, writeMatrixStateChunks as d, assertMatrixSupportedStateRoot as i, chunkMatrixStateJson as l, RETIRED_MATRIX_STATE_REMEDIATION as n, resolveMatrixSqliteStateEnv as o, assertMatrixSupportedStateFile as r, resolveMatrixSqliteStateKey as s, RETIRED_MATRIX_STATE_FILENAMES as t, readMatrixStateChunks as u };
|
|
@@ -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-C1qeMQAy.mjs";
|
|
2
|
+
import { s as EventType } from "./messages-BiHM0DM3.mjs";
|
|
3
|
+
import { r as withResolvedRoomAction } from "./client-CV0MkCZG.mjs";
|
|
4
|
+
import { n as isMatrixNotFoundError } from "./errors-CL3YJV8U.mjs";
|
|
5
5
|
import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
-
|
|
6
|
+
// 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,8 +42,7 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
//#region extensions/matrix/src/matrix/monitor/room-info.ts
|
|
45
|
+
// extensions/matrix/src/matrix/monitor/room-info.ts
|
|
47
46
|
const MAX_ROOM_INFO = 1024;
|
|
48
47
|
const MAX_MEMBER_DISPLAY_NAMES = 4096;
|
|
49
48
|
function createMatrixRoomInfoResolver(client) {
|
|
@@ -113,5 +112,4 @@ function createMatrixRoomInfoResolver(client) {
|
|
|
113
112
|
invalidateMemberDisplayName
|
|
114
113
|
};
|
|
115
114
|
}
|
|
116
|
-
//#endregion
|
|
117
115
|
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
|
+
// 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,5 +25,4 @@ function getMatrixRuntimeLifecycle() {
|
|
|
25
25
|
const runtime = getOptionalMatrixRuntime();
|
|
26
26
|
return runtime ? runtimeLifecycles.tryGetRuntime()?.get(runtime) : void 0;
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { setMatrixRuntimeLifecycle as a, setMatrixRuntime as i, getMatrixRuntimeLifecycle as n, getOptionalMatrixRuntime as r, getMatrixRuntime as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { i as setMatrixRuntime, a as setMatrixRuntimeLifecycle } from "./runtime-
|
|
1
|
+
export { i as setMatrixRuntime, a as setMatrixRuntimeLifecycle } from "./runtime-Ck8TjD7L.mjs";
|
|
2
2
|
import "../runtime-setter-api.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { i as __exportAll } from "./doctor-contract-
|
|
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 { i as __exportAll } from "./doctor-contract-DybEjJcd.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-Ck8TjD7L.mjs";
|
|
3
|
+
import { r as assertMatrixSupportedStateFile } from "./retired-state-vIr2IB90.mjs";
|
|
4
|
+
import { a as readMatrixRecoveryKeyStateForPathAsync, l as writeMatrixRecoveryKeyStateForPathAsync } from "./crypto-state-store-CM57gchf.mjs";
|
|
5
|
+
import { n as withMatrixSendCurrentness, r as withoutMatrixSendCurrentness, t as captureMatrixSendCurrentness } from "./send-currentness-CAUVR-f3.mjs";
|
|
6
|
+
import { i as parseMxc, r as matrixEventToRaw } from "./event-helpers-DDUjVVf7.mjs";
|
|
7
|
+
import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-7eyTX0cu.mjs";
|
|
8
|
+
import { n as isMatrixNotFoundError, t as formatMatrixErrorReason } from "./errors-CL3YJV8U.mjs";
|
|
9
|
+
import { n as createMatrixGuardedFetch, t as MatrixAuthedHttpClient } from "./http-client-CxTmU1kT.mjs";
|
|
10
|
+
import { n as resolveMatrixRoomKeyBackupReadinessError } from "./backup-health-BxH69np2.mjs";
|
|
11
|
+
import { r as noop, t as LogService } from "./logger-BX5kXvh1.mjs";
|
|
12
|
+
import { t as createMatrixJsSdkClientLogger } from "./logging-BLcaOSRD.mjs";
|
|
13
|
+
import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-Bratn-Np.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-CFofPPPm.mjs";
|
|
15
|
+
import { t as MATRIX_IDB_PERSIST_INTERVAL_MS } from "./idb-persistence-lock-CH2K6d_3.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
|
+
// 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,8 +62,7 @@ async function listMatrixOwnDevices(client) {
|
|
|
62
62
|
current: currentDeviceId !== null && device.device_id === currentDeviceId
|
|
63
63
|
}));
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
//#region extensions/matrix/src/matrix/sdk/client-event-bridge.ts
|
|
65
|
+
// extensions/matrix/src/matrix/sdk/client-event-bridge.ts
|
|
67
66
|
function registerMatrixClientBridge(params) {
|
|
68
67
|
let initialSyncComplete = false;
|
|
69
68
|
const joinTransitions = /* @__PURE__ */ new WeakSet();
|
|
@@ -133,8 +132,7 @@ function refreshMatrixDmRoomIds(direct, dmRoomIds) {
|
|
|
133
132
|
}
|
|
134
133
|
return true;
|
|
135
134
|
}
|
|
136
|
-
|
|
137
|
-
//#region extensions/matrix/src/matrix/sdk/client-crypto-bootstrap.ts
|
|
135
|
+
// extensions/matrix/src/matrix/sdk/client-crypto-bootstrap.ts
|
|
138
136
|
async function bootstrapMatrixClientCrypto(params) {
|
|
139
137
|
const { crypto, bootstrapper, abortSignal } = params;
|
|
140
138
|
if (!crypto || !bootstrapper) return false;
|
|
@@ -152,8 +150,7 @@ async function bootstrapMatrixClientCrypto(params) {
|
|
|
152
150
|
}
|
|
153
151
|
return true;
|
|
154
152
|
}
|
|
155
|
-
|
|
156
|
-
//#region extensions/matrix/src/matrix/sdk/client-sync-quiesce.ts
|
|
153
|
+
// extensions/matrix/src/matrix/sdk/client-sync-quiesce.ts
|
|
157
154
|
const MATRIX_SYNC_QUIESCE_TIMEOUT_MS = 5e3;
|
|
158
155
|
const MATRIX_JS_SDK_SYNC_VERSION = "42.4.0";
|
|
159
156
|
const matrixJsSdkPackage = createRequire(import.meta.url)("matrix-js-sdk/package.json");
|
|
@@ -221,8 +218,7 @@ async function quiesceMatrixClientSync(params) {
|
|
|
221
218
|
}
|
|
222
219
|
});
|
|
223
220
|
}
|
|
224
|
-
|
|
225
|
-
//#region extensions/matrix/src/matrix/sdk/client-sync-ready.ts
|
|
221
|
+
// extensions/matrix/src/matrix/sdk/client-sync-ready.ts
|
|
226
222
|
async function waitForMatrixInitialSyncReady(params) {
|
|
227
223
|
const timeoutMs = params.timeoutMs ?? 3e4;
|
|
228
224
|
if (isMatrixReadySyncState(params.state)) return;
|
|
@@ -262,8 +258,7 @@ async function waitForMatrixInitialSyncReady(params) {
|
|
|
262
258
|
params.emitter.off("sync.unexpected_error", settle);
|
|
263
259
|
}
|
|
264
260
|
}
|
|
265
|
-
|
|
266
|
-
//#region extensions/matrix/src/matrix/sdk/crypto-store-lifecycle.ts
|
|
261
|
+
// extensions/matrix/src/matrix/sdk/crypto-store-lifecycle.ts
|
|
267
262
|
async function closeMatrixCryptoStores(closeRecoveryKeys, releaseOwnership, teardownComplete) {
|
|
268
263
|
const recovery = await Promise.allSettled([closeRecoveryKeys()]);
|
|
269
264
|
const release = teardownComplete ? await Promise.allSettled([releaseOwnership()]) : [];
|
|
@@ -359,8 +354,7 @@ function createMatrixSdkStopGate() {
|
|
|
359
354
|
}
|
|
360
355
|
};
|
|
361
356
|
}
|
|
362
|
-
|
|
363
|
-
//#region extensions/matrix/src/matrix/sdk/live-room-readiness.ts
|
|
357
|
+
// extensions/matrix/src/matrix/sdk/live-room-readiness.ts
|
|
364
358
|
async function withMatrixLiveEncryptedRoom(owner, run, params) {
|
|
365
359
|
const signal = AbortSignal.any([params.generationSignal, ...params.abortSignal ? [params.abortSignal] : []]);
|
|
366
360
|
const active = (async () => {
|
|
@@ -441,8 +435,7 @@ async function probeMatrixLiveEncryptedRoom(params) {
|
|
|
441
435
|
params.signal.removeEventListener("abort", onChange);
|
|
442
436
|
}
|
|
443
437
|
}
|
|
444
|
-
|
|
445
|
-
//#region extensions/matrix/src/matrix/sdk/message-wire-dispatch.ts
|
|
438
|
+
// extensions/matrix/src/matrix/sdk/message-wire-dispatch.ts
|
|
446
439
|
function resolveMessageWireDispatch(resource, init) {
|
|
447
440
|
if ((init?.method ?? (resource instanceof Request ? resource.method : "GET")).toUpperCase() !== "PUT") return null;
|
|
448
441
|
const rawUrl = typeof resource === "string" ? resource : resource instanceof URL ? resource.href : resource.url;
|
|
@@ -497,8 +490,7 @@ var MatrixMessageWireDispatchGuards = class {
|
|
|
497
490
|
}
|
|
498
491
|
}
|
|
499
492
|
};
|
|
500
|
-
|
|
501
|
-
//#region extensions/matrix/src/matrix/sdk/recovery-key-store.ts
|
|
493
|
+
// extensions/matrix/src/matrix/sdk/recovery-key-store.ts
|
|
502
494
|
function isRepairableSecretStorageAccessError(err) {
|
|
503
495
|
const message = formatMatrixErrorReason(err);
|
|
504
496
|
if (!message) return false;
|
|
@@ -775,8 +767,7 @@ var MatrixRecoveryKeyStore = class {
|
|
|
775
767
|
}
|
|
776
768
|
}
|
|
777
769
|
};
|
|
778
|
-
|
|
779
|
-
//#region extensions/matrix/src/matrix/sdk/send-scheduler.ts
|
|
770
|
+
// extensions/matrix/src/matrix/sdk/send-scheduler.ts
|
|
780
771
|
/** Keep SDK FIFO/backoff while settling a caller's pre-request rejection only for its event. */
|
|
781
772
|
var MatrixSendScheduler = class extends MatrixScheduler {
|
|
782
773
|
constructor(wasCurrentnessRejected) {
|
|
@@ -814,11 +805,10 @@ var MatrixSendScheduler = class extends MatrixScheduler {
|
|
|
814
805
|
return this.queue.removeEventFromQueue(event);
|
|
815
806
|
}
|
|
816
807
|
};
|
|
817
|
-
|
|
818
|
-
//#region extensions/matrix/src/matrix/sdk/client-base.ts
|
|
808
|
+
// extensions/matrix/src/matrix/sdk/client-base.ts
|
|
819
809
|
const MATRIX_ENCRYPTED_STARTUP_TIMEOUT_MS = 6e4;
|
|
820
810
|
let loadedMatrixCryptoRuntime = null;
|
|
821
|
-
const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-
|
|
811
|
+
const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-Crp1is7m.mjs").then((runtime) => {
|
|
822
812
|
loadedMatrixCryptoRuntime = runtime;
|
|
823
813
|
return runtime;
|
|
824
814
|
}));
|
|
@@ -1048,7 +1038,7 @@ var MatrixClientBase = class {
|
|
|
1048
1038
|
checkActive();
|
|
1049
1039
|
throwIfMatrixStartupAborted(signal);
|
|
1050
1040
|
if (this.encryptionEnabled && this.cryptoInitialized) {
|
|
1051
|
-
const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-
|
|
1041
|
+
const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-Dl7Sb9FF.mjs");
|
|
1052
1042
|
checkActive();
|
|
1053
1043
|
await this.withClientCryptoWork(() => reconcileJoinedRoomEncryption(this.client, signal, checkActive), signal);
|
|
1054
1044
|
checkActive();
|
|
@@ -1260,8 +1250,7 @@ var MatrixClientBase = class {
|
|
|
1260
1250
|
}
|
|
1261
1251
|
}
|
|
1262
1252
|
};
|
|
1263
|
-
|
|
1264
|
-
//#region extensions/matrix/src/matrix/sdk/client-core.ts
|
|
1253
|
+
// extensions/matrix/src/matrix/sdk/client-core.ts
|
|
1265
1254
|
function isUnsupportedAuthenticatedMediaEndpointError(err) {
|
|
1266
1255
|
const statusCode = err?.statusCode;
|
|
1267
1256
|
if (statusCode === 404 || statusCode === 405 || statusCode === 501) return true;
|
|
@@ -1501,8 +1490,7 @@ var MatrixClientCore = class extends MatrixClientBase {
|
|
|
1501
1490
|
});
|
|
1502
1491
|
}
|
|
1503
1492
|
};
|
|
1504
|
-
|
|
1505
|
-
//#region extensions/matrix/src/matrix/sdk/verification-status.ts
|
|
1493
|
+
// extensions/matrix/src/matrix/sdk/verification-status.ts
|
|
1506
1494
|
function isMatrixDeviceOwnerVerified(status) {
|
|
1507
1495
|
return status?.crossSigningVerified === true;
|
|
1508
1496
|
}
|
|
@@ -1519,8 +1507,7 @@ async function trustMatrixOwnIdentity(crypto) {
|
|
|
1519
1507
|
ownIdentity.free?.();
|
|
1520
1508
|
}
|
|
1521
1509
|
}
|
|
1522
|
-
|
|
1523
|
-
//#region extensions/matrix/src/matrix/sdk/client-verification.ts
|
|
1510
|
+
// extensions/matrix/src/matrix/sdk/client-verification.ts
|
|
1524
1511
|
var MatrixClientVerification = class extends MatrixClientCore {
|
|
1525
1512
|
async refreshOwnDeviceKeys() {
|
|
1526
1513
|
await this.client.getCrypto()?.userHasCrossSigningKeys(await this.getUserId(), true);
|
|
@@ -1670,8 +1657,7 @@ var MatrixClientVerification = class extends MatrixClientCore {
|
|
|
1670
1657
|
LogService.info("MatrixClientLite", `Room key backup enabled (version ${createdVersion})`);
|
|
1671
1658
|
}
|
|
1672
1659
|
};
|
|
1673
|
-
|
|
1674
|
-
//#region extensions/matrix/src/matrix/sdk.ts
|
|
1660
|
+
// extensions/matrix/src/matrix/sdk.ts
|
|
1675
1661
|
var sdk_exports = /* @__PURE__ */ __exportAll({ MatrixClient: () => MatrixClient });
|
|
1676
1662
|
var MatrixClient = class extends MatrixClientVerification {
|
|
1677
1663
|
async verifyWithRecoveryKey(rawRecoveryKey) {
|
|
@@ -1970,5 +1956,4 @@ var MatrixClient = class extends MatrixClientVerification {
|
|
|
1970
1956
|
return refreshMatrixDmRoomIds(await this.getAccountData("m.direct"), this.dmRoomIds);
|
|
1971
1957
|
}
|
|
1972
1958
|
};
|
|
1973
|
-
//#endregion
|
|
1974
1959
|
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-Bh1iOXJ1.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
|
+
// extensions/matrix/src/secret-contract.ts
|
|
5
5
|
function accountSecretOwner(accountId) {
|
|
6
6
|
return {
|
|
7
7
|
ownerKind: "account",
|
|
@@ -86,5 +86,4 @@ const channelSecrets = createChannelSecretContract({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
const { secretTargetRegistryEntries, collectRuntimeConfigAssignments } = channelSecrets;
|
|
89
|
-
//#endregion
|
|
90
89
|
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
1
|
+
export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-AKnr45nw.mjs";
|
|
2
2
|
import "../secret-contract-api.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as __exportAll } from "./doctor-contract-
|
|
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 { i as __exportAll } from "./doctor-contract-DybEjJcd.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-Ck8TjD7L.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CVM2a28p.mjs";
|
|
4
|
+
import { a as normalizeMatrixResolvableTarget, n as isMatrixQualifiedUserId } from "./target-ids-DltG_ZHJ.mjs";
|
|
5
|
+
import { n as withMatrixSendCurrentness, o as buildMatrixReactionContent, t as captureMatrixSendCurrentness } from "./send-currentness-CAUVR-f3.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-DDaWVbQI.mjs";
|
|
7
|
+
import { n as getMatrixEventProjection } from "./event-helpers-DDUjVVf7.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
|
+
// extensions/matrix/src/matrix/send/client.ts
|
|
26
|
+
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-BjcmTmyR.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,8 +56,7 @@ async function withResolvedMatrixClient(opts, run, shutdownBehavior) {
|
|
|
56
56
|
const { withResolvedRuntimeMatrixClient } = await loadMatrixSendClientRuntime();
|
|
57
57
|
return await withResolvedRuntimeMatrixClient(opts, run, shutdownBehavior);
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
//#region extensions/matrix/src/matrix/send/receipt.ts
|
|
59
|
+
// extensions/matrix/src/matrix/send/receipt.ts
|
|
61
60
|
function createMatrixSendReceipt(params) {
|
|
62
61
|
const firstEvent = params.events[0];
|
|
63
62
|
const receipt = createMessageReceiptFromOutboundResults({
|
|
@@ -82,16 +81,14 @@ function createMatrixSendReceipt(params) {
|
|
|
82
81
|
});
|
|
83
82
|
return receipt;
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
//#region extensions/matrix/src/matrix/monitor/bounded-cache.ts
|
|
84
|
+
// extensions/matrix/src/matrix/monitor/bounded-cache.ts
|
|
87
85
|
function setBoundedMap(map, key, value, maxEntries) {
|
|
88
86
|
map.set(key, value);
|
|
89
87
|
if (map.size <= maxEntries) return;
|
|
90
88
|
const oldest = map.keys().next();
|
|
91
89
|
if (!oldest.done) map.delete(oldest.value);
|
|
92
90
|
}
|
|
93
|
-
|
|
94
|
-
//#region extensions/matrix/src/matrix/send/targets.ts
|
|
91
|
+
// extensions/matrix/src/matrix/send/targets.ts
|
|
95
92
|
function normalizeTarget(raw) {
|
|
96
93
|
const trimmed = raw.trim();
|
|
97
94
|
if (!trimmed) throw new Error("Matrix target is required (room:<id> or #alias)");
|
|
@@ -151,8 +148,7 @@ async function resolveMatrixRoomId(client, raw, opts = {}) {
|
|
|
151
148
|
}
|
|
152
149
|
return target;
|
|
153
150
|
}
|
|
154
|
-
|
|
155
|
-
//#region extensions/matrix/src/matrix/delivery-plan.ts
|
|
151
|
+
// extensions/matrix/src/matrix/delivery-plan.ts
|
|
156
152
|
const DELIVERY_PLAN_VERSION = 1;
|
|
157
153
|
const DELIVERY_PLAN_NAMESPACE = "outbound-delivery-plans";
|
|
158
154
|
const DELIVERY_PLAN_TTL_MS = 864e5;
|
|
@@ -383,8 +379,7 @@ async function cleanupMatrixDeliveryPlans(ctx) {
|
|
|
383
379
|
const keys = entries.filter((entry) => entry.key.startsWith(prefix)).map((entry) => entry.key);
|
|
384
380
|
for (const key of keys) await store.delete(key);
|
|
385
381
|
}
|
|
386
|
-
|
|
387
|
-
//#region extensions/matrix/src/matrix/poll-types.ts
|
|
382
|
+
// extensions/matrix/src/matrix/poll-types.ts
|
|
388
383
|
const M_POLL_START = "m.poll.start";
|
|
389
384
|
const M_POLL_RESPONSE = "m.poll.response";
|
|
390
385
|
const M_POLL_END = "m.poll.end";
|
|
@@ -561,8 +556,7 @@ function buildPollResponseContent(pollEventId, answerIds) {
|
|
|
561
556
|
}
|
|
562
557
|
};
|
|
563
558
|
}
|
|
564
|
-
|
|
565
|
-
//#region extensions/matrix/src/matrix/format-profile.ts
|
|
559
|
+
// extensions/matrix/src/matrix/format-profile.ts
|
|
566
560
|
function createMatrixPrivateMarkers(markdown, exhaustedMessage) {
|
|
567
561
|
const used = new Set(Array.from(markdown, (character) => character.charCodeAt(0)));
|
|
568
562
|
for (const match of markdown.matchAll(/&#(?:x([0-9a-f]+)|(\d+));/giu)) {
|
|
@@ -605,8 +599,7 @@ function projectMatrixMarkdown(markdown) {
|
|
|
605
599
|
function renderMatrixMarkdownTables(markdown, mode) {
|
|
606
600
|
return MATRIX_FORMAT_PROFILE.constructs.table === "native" && (mode === "off" || mode === "block") ? markdown : convertMarkdownTables(markdown, mode);
|
|
607
601
|
}
|
|
608
|
-
|
|
609
|
-
//#region extensions/matrix/src/matrix/format-table-ranges.ts
|
|
602
|
+
// extensions/matrix/src/matrix/format-table-ranges.ts
|
|
610
603
|
const tableParser = new MarkdownIt({
|
|
611
604
|
html: false,
|
|
612
605
|
linkify: false,
|
|
@@ -627,8 +620,7 @@ function matrixTableSourceRangesFromTokens(tokens, lineStarts, sourceLength) {
|
|
|
627
620
|
}];
|
|
628
621
|
});
|
|
629
622
|
}
|
|
630
|
-
|
|
631
|
-
//#region extensions/matrix/src/matrix/format-spoiler-ranges.ts
|
|
623
|
+
// extensions/matrix/src/matrix/format-spoiler-ranges.ts
|
|
632
624
|
const spoilerParser = new MarkdownIt({
|
|
633
625
|
html: false,
|
|
634
626
|
linkify: true,
|
|
@@ -807,8 +799,7 @@ function analyzeMatrixSpoilers(markdown) {
|
|
|
807
799
|
metadataCollision: hasMatrixSpoilerMetadataCollision(source, delimiterOffsets)
|
|
808
800
|
};
|
|
809
801
|
}
|
|
810
|
-
|
|
811
|
-
//#region extensions/matrix/src/matrix/format.ts
|
|
802
|
+
// extensions/matrix/src/matrix/format.ts
|
|
812
803
|
const MATRIX_STYLE_MARKERS = {
|
|
813
804
|
underline: {
|
|
814
805
|
open: "<u>",
|
|
@@ -1207,8 +1198,7 @@ async function renderMarkdownToMatrixHtmlWithMentions(params) {
|
|
|
1207
1198
|
mentions: state.mentions
|
|
1208
1199
|
};
|
|
1209
1200
|
}
|
|
1210
|
-
|
|
1211
|
-
//#region extensions/matrix/src/matrix/send/chunking.ts
|
|
1201
|
+
// extensions/matrix/src/matrix/send/chunking.ts
|
|
1212
1202
|
function normalizeMatrixEventLimit(limit) {
|
|
1213
1203
|
if (!Number.isFinite(limit) || limit <= 0) return limit;
|
|
1214
1204
|
return Math.max(1, Math.floor(limit));
|
|
@@ -1371,8 +1361,7 @@ function chunkMatrixText(text, opts) {
|
|
|
1371
1361
|
chunks
|
|
1372
1362
|
};
|
|
1373
1363
|
}
|
|
1374
|
-
|
|
1375
|
-
//#region extensions/matrix/src/matrix/media-text.ts
|
|
1364
|
+
// extensions/matrix/src/matrix/media-text.ts
|
|
1376
1365
|
const MATRIX_MEDIA_KINDS = {
|
|
1377
1366
|
"m.audio": "audio",
|
|
1378
1367
|
"m.file": "file",
|
|
@@ -1440,8 +1429,7 @@ function formatMatrixMessageText(params) {
|
|
|
1440
1429
|
if (!body) return marker;
|
|
1441
1430
|
return `${body}\n\n${marker}`;
|
|
1442
1431
|
}
|
|
1443
|
-
|
|
1444
|
-
//#region extensions/matrix/src/matrix/send/edit-content.ts
|
|
1432
|
+
// extensions/matrix/src/matrix/send/edit-content.ts
|
|
1445
1433
|
const MAX_EDIT_RELATION_PAGES = 100;
|
|
1446
1434
|
const EDIT_RELATION_PAGE_SIZE = 100;
|
|
1447
1435
|
const EDIT_DECRYPTION_ERROR = "Matrix edit history is not fully decrypted; restore encryption keys before editing.";
|
|
@@ -1479,8 +1467,7 @@ async function resolveMatrixEditContent(params) {
|
|
|
1479
1467
|
}
|
|
1480
1468
|
throw new Error("Matrix edit history could not be fully read; send a new message instead.");
|
|
1481
1469
|
}
|
|
1482
|
-
|
|
1483
|
-
//#region extensions/matrix/src/matrix/send/formatting.ts
|
|
1470
|
+
// extensions/matrix/src/matrix/send/formatting.ts
|
|
1484
1471
|
function buildTextContent(body, relation, opts = {}) {
|
|
1485
1472
|
return {
|
|
1486
1473
|
msgtype: opts.msgtype ?? MsgType.Text,
|
|
@@ -1543,8 +1530,7 @@ function resolveMatrixMsgType(contentType) {
|
|
|
1543
1530
|
default: return MsgType.File;
|
|
1544
1531
|
}
|
|
1545
1532
|
}
|
|
1546
|
-
|
|
1547
|
-
//#region extensions/matrix/src/matrix/send/media.ts
|
|
1533
|
+
// extensions/matrix/src/matrix/send/media.ts
|
|
1548
1534
|
function buildMediaContent(params) {
|
|
1549
1535
|
const base = {
|
|
1550
1536
|
msgtype: params.msgtype,
|
|
@@ -1660,8 +1646,7 @@ async function uploadMediaWithEncryption(client, roomId, buffer, params) {
|
|
|
1660
1646
|
}
|
|
1661
1647
|
return { url: await client.uploadContent(buffer, params.contentType, params.filename) };
|
|
1662
1648
|
}
|
|
1663
|
-
|
|
1664
|
-
//#region extensions/matrix/src/matrix/send.ts
|
|
1649
|
+
// extensions/matrix/src/matrix/send.ts
|
|
1665
1650
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
1666
1651
|
chunkMatrixText: () => chunkMatrixText,
|
|
1667
1652
|
editMessageMatrix: () => editMessageMatrix,
|
|
@@ -2020,5 +2005,4 @@ async function reactMatrixMessage(roomId, messageId, emoji, opts = {}) {
|
|
|
2020
2005
|
await resolved.sendEvent(resolvedRoom, EventType.Reaction, reaction);
|
|
2021
2006
|
});
|
|
2022
2007
|
}
|
|
2023
|
-
//#endregion
|
|
2024
2008
|
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
|
+
// 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,8 +65,7 @@ function selectOwnMatrixReactionEventIds(events, userId, emoji) {
|
|
|
65
65
|
}
|
|
66
66
|
return ids;
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
//#region extensions/matrix/src/matrix/sdk/send-currentness.ts
|
|
68
|
+
// extensions/matrix/src/matrix/sdk/send-currentness.ts
|
|
70
69
|
const sendCurrentness = new AsyncLocalStorage();
|
|
71
70
|
function withMatrixSendCurrentness(client, assertCurrent, run) {
|
|
72
71
|
assertCurrent();
|
|
@@ -83,5 +82,4 @@ function captureMatrixSendCurrentness(client) {
|
|
|
83
82
|
function withoutMatrixSendCurrentness(run) {
|
|
84
83
|
return sendCurrentness.exit(run);
|
|
85
84
|
}
|
|
86
|
-
//#endregion
|
|
87
85
|
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-CVM2a28p.mjs";
|
|
2
|
+
import "./setup-core-D2r4BivQ.mjs";
|
|
3
|
+
import { n as bootstrapMatrixVerification } from "./verification-jP3tm-xD.mjs";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/matrix/src/setup-bootstrap.ts
|
|
6
6
|
async function maybeBootstrapNewEncryptedMatrixAccount(params) {
|
|
7
7
|
const accountConfig = resolveMatrixAccountConfig({
|
|
8
8
|
cfg: params.cfg,
|
|
@@ -54,5 +54,4 @@ 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
|
|
58
57
|
export { maybeBootstrapNewEncryptedMatrixAccount, runMatrixSetupBootstrapAfterConfigWrite };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as __exportAll } from "./doctor-contract-
|
|
2
|
-
import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
3
|
-
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-
|
|
4
|
-
import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-
|
|
5
|
-
import { n as resolveMatrixConfigPath, r as shouldStoreMatrixAccountAtTopLevel, t as resolveMatrixConfigFieldPath } from "./config-paths-
|
|
1
|
+
import { i as __exportAll } from "./doctor-contract-DybEjJcd.mjs";
|
|
2
|
+
import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-Co94mKNj.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-CVM2a28p.mjs";
|
|
4
|
+
import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-WCQSEvI8.mjs";
|
|
5
|
+
import { n as resolveMatrixConfigPath, r as shouldStoreMatrixAccountAtTopLevel, t as resolveMatrixConfigFieldPath } from "./config-paths-DBpHxDyc.mjs";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { coerceSecretRef, hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
@@ -11,7 +11,7 @@ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, addWildcardAllowFrom, apply
|
|
|
11
11
|
import { resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
12
12
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId as normalizeAccountId$2 } from "openclaw/plugin-sdk/routing";
|
|
13
13
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
14
|
-
|
|
14
|
+
// extensions/matrix/src/matrix/accounts.ts
|
|
15
15
|
function clean(value) {
|
|
16
16
|
return normalizeOptionalString(value) ?? "";
|
|
17
17
|
}
|
|
@@ -142,8 +142,7 @@ async function resolveMatrixAccountAsync(params) {
|
|
|
142
142
|
configured: isMatrixAccountConfigured(prepared, stored)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
//#region extensions/matrix/src/matrix/config-update.ts
|
|
145
|
+
// extensions/matrix/src/matrix/config-update.ts
|
|
147
146
|
var config_update_exports = /* @__PURE__ */ __exportAll({
|
|
148
147
|
resolveMatrixConfigFieldPath: () => resolveMatrixConfigFieldPath,
|
|
149
148
|
resolveMatrixConfigPath: () => resolveMatrixConfigPath,
|
|
@@ -237,8 +236,7 @@ function updateMatrixAccountConfig(cfg, accountId, patch) {
|
|
|
237
236
|
}
|
|
238
237
|
};
|
|
239
238
|
}
|
|
240
|
-
|
|
241
|
-
//#region extensions/matrix/src/matrix/profile.ts
|
|
239
|
+
// extensions/matrix/src/matrix/profile.ts
|
|
242
240
|
var profile_exports = /* @__PURE__ */ __exportAll({
|
|
243
241
|
isSupportedMatrixAvatarSource: () => isSupportedMatrixAvatarSource,
|
|
244
242
|
syncMatrixOwnProfile: () => syncMatrixOwnProfile
|
|
@@ -304,8 +302,7 @@ async function syncMatrixOwnProfile(params) {
|
|
|
304
302
|
...avatar
|
|
305
303
|
};
|
|
306
304
|
}
|
|
307
|
-
|
|
308
|
-
//#region extensions/matrix/src/setup-contract.ts
|
|
305
|
+
// extensions/matrix/src/setup-contract.ts
|
|
309
306
|
const matrixSingleAccountKeysToMove = [
|
|
310
307
|
"homeserver",
|
|
311
308
|
"userId",
|
|
@@ -365,8 +362,7 @@ function resolveSingleAccountPromotionTarget(params) {
|
|
|
365
362
|
}
|
|
366
363
|
return DEFAULT_ACCOUNT_ID$2;
|
|
367
364
|
}
|
|
368
|
-
|
|
369
|
-
//#region extensions/matrix/src/setup-config.ts
|
|
365
|
+
// extensions/matrix/src/setup-config.ts
|
|
370
366
|
const channel$1 = "matrix";
|
|
371
367
|
const COMMON_SINGLE_ACCOUNT_KEYS_TO_MOVE = /* @__PURE__ */ new Set([
|
|
372
368
|
"name",
|
|
@@ -477,8 +473,7 @@ function applyMatrixSetupAccountConfig(params) {
|
|
|
477
473
|
initialSyncLimit: input.initialSyncLimit
|
|
478
474
|
});
|
|
479
475
|
}
|
|
480
|
-
|
|
481
|
-
//#region extensions/matrix/src/setup-dm-policy.ts
|
|
476
|
+
// extensions/matrix/src/setup-dm-policy.ts
|
|
482
477
|
function resolveMatrixSetupDmAllowFrom(policy, allowFrom) {
|
|
483
478
|
if (policy === "open") return addWildcardAllowFrom(allowFrom);
|
|
484
479
|
return normalizeAllowFromEntries(allowFrom ?? []).filter((entry) => entry !== "*");
|
|
@@ -519,8 +514,7 @@ function createMatrixSetupDmPolicy(promptAllowFrom) {
|
|
|
519
514
|
promptAllowFrom
|
|
520
515
|
});
|
|
521
516
|
}
|
|
522
|
-
|
|
523
|
-
//#region extensions/matrix/src/setup-core.ts
|
|
517
|
+
// extensions/matrix/src/setup-core.ts
|
|
524
518
|
const channel = "matrix";
|
|
525
519
|
function resolveMatrixSetupAccountId(params) {
|
|
526
520
|
return normalizeAccountId$1(params.accountId?.trim() || params.name?.trim() || DEFAULT_ACCOUNT_ID$1);
|
|
@@ -552,7 +546,7 @@ function createMatrixSetupWizardProxy(loadWizardModule) {
|
|
|
552
546
|
};
|
|
553
547
|
}
|
|
554
548
|
const finishMatrixSetupAfterConfigWrite = async ({ previousCfg, cfg, accountId, runtime }) => {
|
|
555
|
-
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-
|
|
549
|
+
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-DDhwWvDs.mjs");
|
|
556
550
|
await runMatrixSetupBootstrapAfterConfigWrite({
|
|
557
551
|
previousCfg,
|
|
558
552
|
cfg,
|
|
@@ -666,5 +660,4 @@ const matrixSetupContract = defineChannelSetupContract({
|
|
|
666
660
|
},
|
|
667
661
|
legacyAdapter: matrixSetupAdapter
|
|
668
662
|
});
|
|
669
|
-
//#endregion
|
|
670
663
|
export { resolveMatrixAccount as _, createMatrixSetupDmPolicy as a, resolveSingleAccountPromotionTarget as c, syncMatrixOwnProfile as d, config_update_exports as f, resolveDefaultMatrixAccountId as g, resolveConfiguredMatrixBotUserIds as h, matrixSetupContract as i, singleAccountKeysToMove as l, listMatrixAccountIds as m, finishMatrixSetupAfterConfigWrite as n, moveSingleMatrixAccountConfigToNamedAccount as o, updateMatrixAccountConfig as p, matrixSetupAdapter as r, namedAccountPromotionKeys as s, createMatrixSetupWizardProxy as t, profile_exports as u, resolveMatrixAccountAsync as v };
|