@openclaw/matrix 2026.8.1 → 2026.8.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-selection-C8nnBTxi.js → .setup/account-selection-DZMazUgX.mjs} +12 -10
- package/dist/{accounts-fC57n-Jo.js → .setup/accounts-BJ6ECCac.mjs} +3 -3
- package/dist/{approval-handler.runtime-BBjFZw1t.js → .setup/approval-handler.runtime-CdT1wQve.mjs} +6 -6
- package/dist/{approval-ids-DTIdXV-m.js → .setup/approval-ids-CU_nMQy9.mjs} +1 -1
- package/dist/{approval-reaction-auth-BDONXxnF.js → .setup/approval-reaction-auth-CpxhvOOT.mjs} +2 -2
- package/dist/{approval-reactions-tXh9KYrW.js → .setup/approval-reactions-D5eegob9.mjs} +2 -2
- package/dist/{channel-BkEcVUs_.js → .setup/channel-Q_N83Wwa.mjs} +57 -59
- package/dist/{channel.runtime-CTLSBFsP.js → .setup/channel.runtime-BFXlZFP1.mjs} +17 -13
- package/dist/{channel.setup-CSacbORr.js → .setup/channel.setup-2A6HBRbA.mjs} +22 -20
- package/dist/{cli-DRVtgrq5.js → .setup/cli-CyuDGiIr.mjs} +43 -34
- package/dist/{cli-metadata-Ddx_y4Os.js → .setup/cli-metadata-B_y2Z5Np.mjs} +1 -1
- package/dist/{client-CZ_JvrO0.js → .setup/client-CpHMD-C2.mjs} +3 -3
- package/dist/{client-kSi51NKp.js → .setup/client-DvcYcTSy.mjs} +76 -23
- package/dist/{client-bootstrap-D8irSL2i.js → .setup/client-bootstrap-Cb1tHsT4.mjs} +3 -3
- package/dist/{client-support-DLj4vDeu.js → .setup/client-support-Bn9Bk0-H.mjs} +1 -1
- package/dist/{config-update-DC0fWBxc.js → .setup/config-update-B_4qZ5bV.mjs} +49 -31
- package/dist/{credentials-BdAaWuiR.js → .setup/credentials-B2roKThT.mjs} +6 -10
- package/dist/{credentials-read-B37cQknZ.js → .setup/credentials-read-DaemdXHy.mjs} +11 -9
- package/dist/{credentials-write.runtime-nAV2-5uR.js → .setup/credentials-write.runtime-D83HEGcL.mjs} +1 -1
- package/dist/{crypto-runtime-C4WDYxlP.js → .setup/crypto-runtime-Ch4WOG1y.mjs} +8 -8
- package/dist/{deps-CcVJfvRM.js → .setup/deps-mtxF2mHI.mjs} +1 -1
- package/dist/{device-health-B4-YXtJR.js → .setup/device-health-CWOuIirq.mjs} +1 -1
- package/dist/{direct-room-RinHjtqX.js → .setup/direct-room-CKyU8upP.mjs} +1 -1
- package/dist/{directory-live-DKr0w35b.js → .setup/directory-live-DggLE-28.mjs} +10 -8
- package/dist/{doctor-EWf9CDso.js → .setup/doctor-BLCvdOFo.mjs} +1 -1
- package/dist/{doctor-contract-DEt4O4Zt.js → .setup/doctor-contract-HyWFZQVG.mjs} +5 -4
- package/dist/{draft-stream-0CEpNrBk.js → .setup/draft-stream-DfUFwKfN.mjs} +1 -1
- package/dist/{encryption-guidance-D4ZdAqzM.js → .setup/encryption-guidance-CvN_NQUJ.mjs} +4 -3
- package/dist/{http-client-D8o8b9u6.js → .setup/http-client-Bv6a2OfI.mjs} +11 -8
- package/dist/{idb-persistence-DfgW720p.js → .setup/idb-persistence-BiscLSq4.mjs} +3 -3
- package/dist/{idb-persistence-lock-DAJ49nZX.js → .setup/idb-persistence-lock-B3fZXyF_.mjs} +1 -1
- package/dist/{inbound-dedupe-RvSLqdsz.js → .setup/inbound-dedupe-BOsuMiaj.mjs} +2 -2
- package/dist/{logger-B_71hN6W.js → .setup/logger-B3tfcB-m.mjs} +1 -1
- package/dist/{logging-DRjvUOIh.js → .setup/logging-CkohOZwO.mjs} +2 -2
- package/dist/{messages-DaGRt-tu.js → .setup/messages-C3v-jkaN.mjs} +4 -4
- package/dist/{monitor-CLPbPcR9.js → .setup/monitor-CQ6pGvZh.mjs} +56 -81
- package/dist/.setup/probe.runtime-ni46ImsO.mjs +2 -0
- package/dist/{profile-D-Wubo0A.js → .setup/profile-ClrB3IgR.mjs} +2 -2
- package/dist/{profile-update-zXVCMg7y.js → .setup/profile-update-B9Q6Ox2O.mjs} +6 -5
- package/dist/{reaction-events-CjVUiqcY.js → .setup/reaction-events-Dtd3W-rj.mjs} +10 -8
- package/dist/{resolve-targets-qG6gceps.js → .setup/resolve-targets-Bke5jHKS.mjs} +3 -3
- package/dist/{resolver.runtime-zX3TR3TN.js → .setup/resolver.runtime-BtrbC025.mjs} +1 -1
- package/dist/{room-info-yheP1mod.js → .setup/room-info-B0VNxsF8.mjs} +4 -4
- package/dist/.setup/runtime-setter-api-DGMubGUq.mjs +3 -0
- package/dist/{sdk-TZYyo0XQ.js → .setup/sdk-DoObvds0.mjs} +528 -30
- package/dist/{secret-contract-CufozuyJ.js → .setup/secret-contract-JlB6VmI3.mjs} +1 -1
- package/dist/.setup/secret-contract-api-B-iJoQEv.mjs +3 -0
- package/dist/{send-BL_iH5Ox.js → .setup/send-SmBzUhD-.mjs} +19 -15
- package/dist/{setup-bootstrap-D8M7FmcO.js → .setup/setup-bootstrap-CUKhebeX.mjs} +3 -3
- package/dist/{setup-core-r6L0nno-.js → .setup/setup-core-BnqoLunq.mjs} +9 -8
- package/dist/.setup/setup-plugin-api-Dg95tydH.mjs +3 -0
- package/dist/{setup-surface-g174ElFO.js → .setup/setup-surface-sWwADrZ8.mjs} +87 -81
- package/dist/{startup-verification-Cs08ca8u.js → .setup/startup-verification-E46yu4fh.mjs} +3 -3
- package/dist/{storage-BsGuHngK.js → .setup/storage-B-nf2ReN.mjs} +7 -6
- package/dist/{subagent-hooks-CMoZaARG.js → .setup/subagent-hooks-jFgft_Mr.mjs} +6 -2
- package/dist/.setup/sync-cache-state-6Hjn1K-v.mjs +234 -0
- package/dist/{thread-binding-api-CzkeLZCU.js → .setup/thread-binding-api-DRMC62cs.mjs} +1 -1
- package/dist/{thread-bindings-ERWNousC.js → .setup/thread-bindings-_WJ8RYWJ.mjs} +4 -4
- package/dist/{tool-actions.runtime-DcBCSwY4.js → .setup/tool-actions.runtime-DLICojA3.mjs} +230 -168
- package/dist/{verification-4vsW_WSn.js → .setup/verification-DOT16noD.mjs} +4 -3
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +1 -1
- 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 +9 -9
- package/dist/helper-api.js +3 -3
- package/dist/index.js +1 -1
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/runtime-api.js +6 -6
- 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 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +525 -484
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -1
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +7 -7
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -1
- package/node_modules/markdown-it/dist/markdown-it.cjs.js +129 -121
- package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -1
- package/node_modules/markdown-it/dist/markdown-it.d.mts +42 -71
- package/node_modules/markdown-it/dist/markdown-it.mjs +129 -121
- package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -1
- package/node_modules/markdown-it/package.json +1 -2
- package/node_modules/matrix-js-sdk/lib/client.d.ts +2 -1
- package/node_modules/matrix-js-sdk/lib/client.js +6 -2
- package/node_modules/matrix-js-sdk/lib/sync.js +8 -8
- package/node_modules/matrix-js-sdk/src/client.ts +7 -3
- package/node_modules/matrix-js-sdk/src/sync.ts +8 -8
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/package.json +6 -6
- package/dist/file-sync-store-DjskBX2o.js +0 -436
- package/dist/probe.runtime-Bxpr1FFy.js +0 -2
- package/dist/recovery-key-store-CognuDys.js +0 -276
- /package/dist/{account-config-CRsKoMqJ.js → .setup/account-config-CRsKoMqJ.mjs} +0 -0
- /package/dist/{backup-health-Dm_YMVFT.js → .setup/backup-health-Dm_YMVFT.mjs} +0 -0
- /package/dist/{config-paths-CnREYb1Y.js → .setup/config-paths-CnREYb1Y.mjs} +0 -0
- /package/dist/{config-secret-input.runtime-CwsP3--c.js → .setup/config-secret-input.runtime-CwsP3--c.mjs} +0 -0
- /package/dist/{credentials-state-B3cuUFwZ.js → .setup/credentials-state-B3cuUFwZ.mjs} +0 -0
- /package/dist/{crypto-node.runtime-6Aj_ltHQ.js → .setup/crypto-node.runtime-6Aj_ltHQ.mjs} +0 -0
- /package/dist/{env-vars-dGqak9dN.js → .setup/env-vars-dGqak9dN.mjs} +0 -0
- /package/dist/{errors-DKVS3_DO.js → .setup/errors-DKVS3_DO.mjs} +0 -0
- /package/dist/{event-helpers-XRfAbOIh.js → .setup/event-helpers-XRfAbOIh.mjs} +0 -0
- /package/dist/{reaction-common-DkrQdBSZ.js → .setup/reaction-common-DkrQdBSZ.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{runtime-6S3DNFNv.js → .setup/runtime-6S3DNFNv.mjs} +0 -0
- /package/dist/{runtime-BefyhPWv.js → .setup/runtime-BefyhPWv.mjs} +0 -0
- /package/dist/{storage-paths-gUmSydsW.js → .setup/storage-paths-gUmSydsW.mjs} +0 -0
- /package/dist/{target-ids-Nwx7cMVE.js → .setup/target-ids-Nwx7cMVE.mjs} +0 -0
- /package/dist/{thread-bindings-shared-oNPiyMWY.js → .setup/thread-bindings-shared-oNPiyMWY.mjs} +0 -0
- /package/dist/{url-validation-GRHde6lq.js → .setup/url-validation-GRHde6lq.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/matrix/src/matrix/direct-room.ts
|
|
4
4
|
var direct_room_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.
|
|
3
|
-
import {
|
|
4
|
-
import { t as MatrixAuthedHttpClient } from "./http-client-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
|
|
3
|
+
import { l as resolveMatrixAuth } from "./client-DvcYcTSy.mjs";
|
|
4
|
+
import { t as MatrixAuthedHttpClient } from "./http-client-Bv6a2OfI.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
//#region extensions/matrix/src/directory-live.ts
|
|
7
7
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -85,20 +85,22 @@ async function listMatrixDirectoryPeersLive(params) {
|
|
|
85
85
|
}
|
|
86
86
|
async function resolveMatrixRoomAlias(client, alias) {
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
const res = await requestMatrixJson(client, {
|
|
89
89
|
method: "GET",
|
|
90
90
|
endpoint: `/_matrix/client/v3/directory/room/${encodeURIComponent(alias)}`
|
|
91
|
-
})
|
|
91
|
+
});
|
|
92
|
+
return normalizeOptionalString(res.room_id) ?? null;
|
|
92
93
|
} catch {
|
|
93
94
|
return null;
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
async function fetchMatrixRoomName(client, roomId) {
|
|
97
98
|
try {
|
|
98
|
-
|
|
99
|
+
const res = await requestMatrixJson(client, {
|
|
99
100
|
method: "GET",
|
|
100
101
|
endpoint: `/_matrix/client/v3/rooms/${encodeURIComponent(roomId)}/state/m.room.name`
|
|
101
|
-
})
|
|
102
|
+
});
|
|
103
|
+
return normalizeOptionalString(res.name) ?? null;
|
|
102
104
|
} catch {
|
|
103
105
|
return null;
|
|
104
106
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-HyWFZQVG.mjs";
|
|
2
2
|
import { detectPluginInstallPathIssue, formatPluginInstallPathIssue, removePluginFromConfig } from "openclaw/plugin-sdk/doctor-repair-runtime";
|
|
3
3
|
//#region extensions/matrix/src/doctor.ts
|
|
4
4
|
async function collectMatrixInstallPathWarnings(cfg) {
|
|
@@ -152,11 +152,12 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
152
152
|
scope: "root-and-accounts",
|
|
153
153
|
onRemove: ({ key, pathPrefix }) => changes.push(`Removed ${pathPrefix}.${key} (never read by the Matrix runtime).`)
|
|
154
154
|
}).config;
|
|
155
|
+
const aliases = streamingAliasMigration.normalizeChannelConfig({
|
|
156
|
+
cfg: withoutJunkStreamMode,
|
|
157
|
+
changes
|
|
158
|
+
});
|
|
155
159
|
return normalizeChannelConfigEntries({
|
|
156
|
-
cfg:
|
|
157
|
-
cfg: withoutJunkStreamMode,
|
|
158
|
-
changes
|
|
159
|
-
}).config,
|
|
160
|
+
cfg: aliases.config,
|
|
160
161
|
channelId: "matrix",
|
|
161
162
|
changes,
|
|
162
163
|
normalizeEntry: normalizeMatrixEntry
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as MsgType, a as sendSingleTextMessageMatrix, c as prepareMatrixSingleText, t as editMessageMatrix } from "./send-
|
|
1
|
+
import { T as MsgType, a as sendSingleTextMessageMatrix, c as prepareMatrixSingleText, t as editMessageMatrix } from "./send-SmBzUhD-.mjs";
|
|
2
2
|
import { createFinalizableDraftStreamControlsForState } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
3
|
//#region extensions/matrix/src/matrix/draft-stream.ts
|
|
4
4
|
const DEFAULT_THROTTLE_MS = 1e3;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { a as resolveMatrixDefaultOrOnlyAccountId } from "./account-selection-
|
|
2
|
-
import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.
|
|
1
|
+
import { a as resolveMatrixDefaultOrOnlyAccountId } from "./account-selection-DZMazUgX.mjs";
|
|
2
|
+
import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
|
|
3
3
|
import { normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
//#region extensions/matrix/src/matrix/encryption-guidance.ts
|
|
5
5
|
function resolveMatrixEncryptionConfigPath(cfg, accountId) {
|
|
6
|
-
|
|
6
|
+
const effectiveAccountId = normalizeOptionalAccountId(accountId) ?? resolveMatrixDefaultOrOnlyAccountId(cfg);
|
|
7
|
+
return resolveMatrixConfigFieldPath(cfg, effectiveAccountId, "encryption");
|
|
7
8
|
}
|
|
8
9
|
function formatMatrixEncryptionUnavailableError(cfg, accountId) {
|
|
9
10
|
return `Matrix encryption is not available (enable ${resolveMatrixEncryptionConfigPath(cfg, accountId)}=true)`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as buildHttpError } from "./event-helpers-XRfAbOIh.
|
|
1
|
+
import { t as buildHttpError } from "./event-helpers-XRfAbOIh.mjs";
|
|
2
2
|
import { parseMediaContentLength } from "openclaw/plugin-sdk/media-runtime";
|
|
3
3
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
4
4
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
@@ -28,8 +28,8 @@ async function readResponseWithLimit$1(res, maxBytes, opts) {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region extensions/matrix/src/matrix/sdk/transport.ts
|
|
31
|
-
const MATRIX_JSON_RESPONSE_MAX_BYTES =
|
|
32
|
-
const MATRIX_SDK_RESPONSE_MAX_BYTES =
|
|
31
|
+
const MATRIX_JSON_RESPONSE_MAX_BYTES = 8388608;
|
|
32
|
+
const MATRIX_SDK_RESPONSE_MAX_BYTES = 67108864;
|
|
33
33
|
function normalizeEndpoint(endpoint) {
|
|
34
34
|
if (!endpoint) return "/";
|
|
35
35
|
return endpoint.startsWith("/") ? endpoint : `/${endpoint}`;
|
|
@@ -116,7 +116,8 @@ async function fetchWithMatrixGuardedRedirects(params) {
|
|
|
116
116
|
for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount += 1) {
|
|
117
117
|
let dispatcher;
|
|
118
118
|
try {
|
|
119
|
-
|
|
119
|
+
const pinned = await resolvePinnedHostnameWithPolicy(currentUrl.hostname, { policy: params.ssrfPolicy });
|
|
120
|
+
dispatcher = createPinnedDispatcher(pinned, params.dispatcherPolicy, params.ssrfPolicy);
|
|
120
121
|
const response = await fetchWithMatrixDispatcher({
|
|
121
122
|
url: currentUrl.toString(),
|
|
122
123
|
init: {
|
|
@@ -216,10 +217,12 @@ async function performMatrixRequest(params) {
|
|
|
216
217
|
headers.set("Accept", params.raw ? "*/*" : "application/json");
|
|
217
218
|
if (params.accessToken) headers.set("Authorization", `Bearer ${params.accessToken}`);
|
|
218
219
|
let body;
|
|
219
|
-
if (params.body !== void 0)
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
220
|
+
if (params.body !== void 0) {
|
|
221
|
+
if (params.body instanceof Uint8Array || params.body instanceof ArrayBuffer || typeof params.body === "string") body = params.body;
|
|
222
|
+
else {
|
|
223
|
+
headers.set("Content-Type", "application/json");
|
|
224
|
+
body = JSON.stringify(params.body);
|
|
225
|
+
}
|
|
223
226
|
}
|
|
224
227
|
const { response, release } = await fetchWithMatrixGuardedRedirects({
|
|
225
228
|
url: baseUrl.toString(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as writeMatrixIdbSnapshotJson, f as MATRIX_IDB_SNAPSHOT_FILENAME, w as readMatrixIdbSnapshotJson } from "./storage-
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as
|
|
1
|
+
import { D as writeMatrixIdbSnapshotJson, f as MATRIX_IDB_SNAPSHOT_FILENAME, w as readMatrixIdbSnapshotJson } from "./storage-B-nf2ReN.mjs";
|
|
2
|
+
import { n as MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS } from "./idb-persistence-lock-B3fZXyF_.mjs";
|
|
3
|
+
import { n as LogService } from "./logger-B3tfcB-m.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region extensions/matrix/src/matrix/sdk/idb-persistence-lock.ts
|
|
2
2
|
const MATRIX_IDB_PERSIST_INTERVAL_MS = 6e4;
|
|
3
|
-
const IDB_SNAPSHOT_LOCK_STALE_MS =
|
|
3
|
+
const IDB_SNAPSHOT_LOCK_STALE_MS = 3e5;
|
|
4
4
|
const IDB_SNAPSHOT_LOCK_RETRY_BASE = {
|
|
5
5
|
factor: 2,
|
|
6
6
|
minTimeout: 50,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as LogService } from "./logger-
|
|
1
|
+
import { n as LogService } from "./logger-B3tfcB-m.mjs";
|
|
2
2
|
import { createChannelReplayGuard, resolvePersistentDedupePluginStateNamespace } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
3
3
|
//#region extensions/matrix/src/matrix/monitor/inbound-dedupe.ts
|
|
4
4
|
const MATRIX_INBOUND_DEDUPE_PLUGIN_ID = "matrix";
|
|
5
5
|
const MATRIX_INBOUND_DEDUPE_NAMESPACE_PREFIX = "matrix.inbound-dedupe";
|
|
6
6
|
const MATRIX_INBOUND_DEDUPE_NAMESPACE = "global";
|
|
7
|
-
const MATRIX_INBOUND_DEDUPE_TTL_MS =
|
|
7
|
+
const MATRIX_INBOUND_DEDUPE_TTL_MS = 2592e6;
|
|
8
8
|
const MATRIX_INBOUND_DEDUPE_MEMORY_MAX = 5e3;
|
|
9
9
|
const MATRIX_INBOUND_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
10
10
|
function resolveMatrixInboundDedupeAccountId(accountId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
|
|
2
2
|
import { format } from "node:util";
|
|
3
3
|
import { redactSensitiveText } from "openclaw/plugin-sdk/security-runtime";
|
|
4
4
|
//#region extensions/matrix/src/matrix/sdk/logger.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { i as setMatrixConsoleLogging, n as LogService, t as ConsoleLogger } from "./logger-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { i as setMatrixConsoleLogging, n as LogService, t as ConsoleLogger } from "./logger-B3tfcB-m.mjs";
|
|
3
3
|
import { logger } from "matrix-js-sdk/lib/logger.js";
|
|
4
4
|
//#region extensions/matrix/src/matrix/client/logging.ts
|
|
5
5
|
var logging_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as MATRIX_REACTION_EVENT_TYPE } from "./reaction-common-DkrQdBSZ.
|
|
2
|
-
import { _ as resolvePollReferenceEventId, d as formatPollAsText, f as formatPollResultsAsText, g as parsePollStartContent, m as isPollStartType, p as isPollEventType, r as sendMessageMatrix, t as editMessageMatrix, u as buildPollResultsSummary } from "./send-
|
|
3
|
-
import { r as withResolvedRoomAction } from "./client-
|
|
4
|
-
import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.
|
|
1
|
+
import { n as MATRIX_REACTION_EVENT_TYPE } from "./reaction-common-DkrQdBSZ.mjs";
|
|
2
|
+
import { _ as resolvePollReferenceEventId, d as formatPollAsText, f as formatPollResultsAsText, g as parsePollStartContent, m as isPollStartType, p as isPollEventType, r as sendMessageMatrix, t as editMessageMatrix, u as buildPollResultsSummary } from "./send-SmBzUhD-.mjs";
|
|
3
|
+
import { r as withResolvedRoomAction } from "./client-CpHMD-C2.mjs";
|
|
4
|
+
import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.mjs";
|
|
5
5
|
import { asNullableObjectRecord, asNullableRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
//#region extensions/matrix/src/matrix/poll-summary.ts
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.
|
|
2
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.
|
|
3
|
-
import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-
|
|
4
|
-
import { _ as logInboundDrop, a as resolveMatrixThreadRootId, b as summarizeMapping, c as RelationType, d as buildAllowlistResolutionSummary, f as canonicalizeAllowlistWithResolvedIds, g as getAgentScopedMediaLocalRoots, h as formatLocationText, i as resolveMatrixReplyToEventId, l as resolveMatrixRoomConfig, m as createTypingCallbacks, n as resolveMatrixStoredSessionMeta, o as resolveMatrixThreadRouting, p as createReplyPrefixOptions, r as resolveMatrixInboundRoute, s as EventType, u as addAllowlistUserEntriesFromConfigEntry, v as logTypingFailure, x as toLocationContext, y as patchAllowlistUsersInConfigEntries } from "./channel-
|
|
5
|
-
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-
|
|
6
|
-
import { n as isMatrixRoomId, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.
|
|
7
|
-
import { S as promoteMatrixDirectRoomCandidate, d as formatPollAsText, g as parsePollStartContent, m as isPollStartType, p as isPollEventType, r as sendMessageMatrix, w as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY } from "./send-
|
|
8
|
-
import { i as isStrictDirectMembership, n as hasDirectMatrixMemberFlag, o as readJoinedMatrixMembers } from "./direct-room-
|
|
9
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-
|
|
10
|
-
import { c as formatMatrixMediaTooLargeText, d as isLikelyBareFilename, f as resolveBundledMatrixReplacementContent, l as formatMatrixMediaUnavailableText, m as fetchMatrixPollSnapshot, r as readMatrixMessages, u as formatMatrixMessageText } from "./messages-
|
|
11
|
-
import { t as isBunRuntime } from "./runtime-BefyhPWv.
|
|
12
|
-
import { a as throwIfMatrixStartupAborted, c as
|
|
13
|
-
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-
|
|
14
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
15
|
-
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-
|
|
16
|
-
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-
|
|
17
|
-
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-
|
|
18
|
-
import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-
|
|
1
|
+
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
|
|
3
|
+
import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-BJ6ECCac.mjs";
|
|
4
|
+
import { _ as logInboundDrop, a as resolveMatrixThreadRootId, b as summarizeMapping, c as RelationType, d as buildAllowlistResolutionSummary, f as canonicalizeAllowlistWithResolvedIds, g as getAgentScopedMediaLocalRoots, h as formatLocationText, i as resolveMatrixReplyToEventId, l as resolveMatrixRoomConfig, m as createTypingCallbacks, n as resolveMatrixStoredSessionMeta, o as resolveMatrixThreadRouting, p as createReplyPrefixOptions, r as resolveMatrixInboundRoute, s as EventType, u as addAllowlistUserEntriesFromConfigEntry, v as logTypingFailure, x as toLocationContext, y as patchAllowlistUsersInConfigEntries } from "./channel-Q_N83Wwa.mjs";
|
|
5
|
+
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-2A6HBRbA.mjs";
|
|
6
|
+
import { n as isMatrixRoomId, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
|
|
7
|
+
import { S as promoteMatrixDirectRoomCandidate, d as formatPollAsText, g as parsePollStartContent, m as isPollStartType, p as isPollEventType, r as sendMessageMatrix, w as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY } from "./send-SmBzUhD-.mjs";
|
|
8
|
+
import { i as isStrictDirectMembership, n as hasDirectMatrixMemberFlag, o as readJoinedMatrixMembers } from "./direct-room-CKyU8upP.mjs";
|
|
9
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-_WJ8RYWJ.mjs";
|
|
10
|
+
import { c as formatMatrixMediaTooLargeText, d as isLikelyBareFilename, f as resolveBundledMatrixReplacementContent, l as formatMatrixMediaUnavailableText, m as fetchMatrixPollSnapshot, r as readMatrixMessages, u as formatMatrixMessageText } from "./messages-C3v-jkaN.mjs";
|
|
11
|
+
import { t as isBunRuntime } from "./runtime-BefyhPWv.mjs";
|
|
12
|
+
import { a as throwIfMatrixStartupAborted, c as backfillMatrixAuthDeviceIdAfterStartup, i as isMatrixStartupAbortError, l as resolveMatrixAuth, n as acquireSharedMatrixClient, o as createMatrixMonitorTaskRunner, u as resolveMatrixAuthContext } from "./client-DvcYcTSy.mjs";
|
|
13
|
+
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-Bv6a2OfI.mjs";
|
|
14
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-Bke5jHKS.mjs";
|
|
15
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-CvN_NQUJ.mjs";
|
|
16
|
+
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-BOsuMiaj.mjs";
|
|
17
|
+
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-Bn9Bk0-H.mjs";
|
|
18
|
+
import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-B0VNxsF8.mjs";
|
|
19
19
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
20
20
|
import { buildChannelProgressDraftLineForEntry, createChannelProgressDraftCompositor, createMessageReceiptFromOutboundResults, createPreviewMessageReceipt, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftLine, formatChannelProgressDraftText, listMessageReceiptPlatformIds, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
21
21
|
import { normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalString, normalizeStringifiedEntries, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -327,15 +327,16 @@ async function resolveMatrixMonitorLiveUserAllowlist(params) {
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
if (pending.length === 0) return effective;
|
|
330
|
+
const resolution = await resolveMatrixMonitorUserEntries({
|
|
331
|
+
cfg: params.cfg,
|
|
332
|
+
accountId: params.accountId,
|
|
333
|
+
entries: pending,
|
|
334
|
+
runtime: params.runtime,
|
|
335
|
+
resolveTargets: params.resolveTargets ?? resolveMatrixTargets
|
|
336
|
+
});
|
|
330
337
|
const canonicalized = canonicalizeAllowlistWithResolvedIds({
|
|
331
338
|
existing: pending,
|
|
332
|
-
resolvedMap:
|
|
333
|
-
cfg: params.cfg,
|
|
334
|
-
accountId: params.accountId,
|
|
335
|
-
entries: pending,
|
|
336
|
-
runtime: params.runtime,
|
|
337
|
-
resolveTargets: params.resolveTargets ?? resolveMatrixTargets
|
|
338
|
-
})).resolvedMap,
|
|
339
|
+
resolvedMap: resolution.resolvedMap,
|
|
339
340
|
entryKey: normalizeMatrixUserId
|
|
340
341
|
});
|
|
341
342
|
const resolvedEntries = params.failClosedOnUnresolved ? filterFailClosedMatrixAllowlistEntries(canonicalized) : filterResolvedMatrixAllowlistEntries(canonicalized);
|
|
@@ -821,7 +822,7 @@ const matrixVerificationConstants = {
|
|
|
821
822
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
822
823
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
823
824
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
824
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-
|
|
825
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-SmBzUhD-.mjs").then((n) => n.x), import("./direct-room-CKyU8upP.mjs").then((n) => n.t)]).then(([directManagementModule, directRoomModule]) => ({
|
|
825
826
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
826
827
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
827
828
|
})));
|
|
@@ -931,10 +932,11 @@ async function resolveVerificationSummaryForSignal(client, params) {
|
|
|
931
932
|
const byTransactionId = list.find((entry) => candidates.some((candidate) => entry.transactionId === candidate));
|
|
932
933
|
if (byTransactionId) return byTransactionId;
|
|
933
934
|
const { inspectMatrixDirectRooms, isStrictDirectRoom } = await loadMatrixDirectRoomDeps();
|
|
934
|
-
const
|
|
935
|
+
const inspection = await inspectMatrixDirectRooms({
|
|
935
936
|
client,
|
|
936
937
|
remoteUserId: params.senderId
|
|
937
|
-
}).catch(() => null)
|
|
938
|
+
}).catch(() => null);
|
|
939
|
+
const activeRoomId = normalizeNullableString(inspection?.activeRoomId);
|
|
938
940
|
if (activeRoomId) {
|
|
939
941
|
if (activeRoomId !== params.roomId) return null;
|
|
940
942
|
} else if (!await isStrictDirectRoom({
|
|
@@ -1014,10 +1016,11 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
1014
1016
|
const verificationUserRooms = /* @__PURE__ */ new Map();
|
|
1015
1017
|
async function resolveActiveDirectRoomId(remoteUserId) {
|
|
1016
1018
|
const { inspectMatrixDirectRooms } = await loadMatrixDirectRoomDeps();
|
|
1017
|
-
|
|
1019
|
+
const inspection = await inspectMatrixDirectRooms({
|
|
1018
1020
|
client: params.client,
|
|
1019
1021
|
remoteUserId
|
|
1020
|
-
}).catch(() => null)
|
|
1022
|
+
}).catch(() => null);
|
|
1023
|
+
return normalizeNullableString(inspection?.activeRoomId);
|
|
1021
1024
|
}
|
|
1022
1025
|
function shouldEmitVerificationEventNotice(event) {
|
|
1023
1026
|
const eventTs = typeof event.origin_server_ts === "number" && Number.isFinite(event.origin_server_ts) ? event.origin_server_ts : null;
|
|
@@ -1170,7 +1173,7 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
1170
1173
|
}
|
|
1171
1174
|
//#endregion
|
|
1172
1175
|
//#region extensions/matrix/src/matrix/monitor/events.ts
|
|
1173
|
-
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS =
|
|
1176
|
+
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS = 12e4;
|
|
1174
1177
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_THRESHOLD = 3;
|
|
1175
1178
|
const MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT = 3;
|
|
1176
1179
|
function formatMatrixPostHealthySyncDecryptionHint(accountId) {
|
|
@@ -1580,11 +1583,7 @@ function resolveMatrixSharedDmContextNotice(params) {
|
|
|
1580
1583
|
if (currentSession.accountId && currentSession.accountId !== params.accountId) return null;
|
|
1581
1584
|
if (!currentSession.directUserId) return null;
|
|
1582
1585
|
if (!currentSession.roomId || currentSession.roomId === params.roomId) return null;
|
|
1583
|
-
return [
|
|
1584
|
-
"This Matrix DM is sharing a session with another Matrix DM room.",
|
|
1585
|
-
"Use /focus here for a one-off isolated thread session when thread bindings are enabled, or set",
|
|
1586
|
-
"channels.matrix.dm.sessionScope to per-room to isolate each Matrix DM room."
|
|
1587
|
-
].join(" ");
|
|
1586
|
+
return ["This Matrix DM is sharing a session with another Matrix DM room.", "Set channels.matrix.dm.sessionScope to per-room to isolate each Matrix DM room."].join(" ");
|
|
1588
1587
|
} catch (err) {
|
|
1589
1588
|
params.logVerboseMessage(`matrix: failed checking shared DM session notice room=${params.roomId} (${String(err)})`);
|
|
1590
1589
|
return null;
|
|
@@ -1592,10 +1591,13 @@ function resolveMatrixSharedDmContextNotice(params) {
|
|
|
1592
1591
|
}
|
|
1593
1592
|
function resolveMatrixPendingHistoryText(params) {
|
|
1594
1593
|
if (!params.mediaUrl) return params.mentionPrecheckText;
|
|
1594
|
+
const body = typeof params.content.body === "string" ? params.content.body : void 0;
|
|
1595
|
+
const filename = typeof params.content.filename === "string" ? params.content.filename : void 0;
|
|
1596
|
+
const msgtype = typeof params.content.msgtype === "string" ? params.content.msgtype : void 0;
|
|
1595
1597
|
return formatMatrixMessageText({
|
|
1596
|
-
body
|
|
1597
|
-
filename
|
|
1598
|
-
msgtype
|
|
1598
|
+
body,
|
|
1599
|
+
filename,
|
|
1600
|
+
msgtype
|
|
1599
1601
|
}) ?? params.mentionPrecheckText;
|
|
1600
1602
|
}
|
|
1601
1603
|
function resolveMatrixInboundMediaContent(content) {
|
|
@@ -1628,7 +1630,7 @@ function resolveMatrixAllowBotsMode(value) {
|
|
|
1628
1630
|
return "off";
|
|
1629
1631
|
}
|
|
1630
1632
|
function formatMatrixToolProgressMarkdownCode(text) {
|
|
1631
|
-
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text,
|
|
1633
|
+
return `\`${(text.length <= MATRIX_TOOL_PROGRESS_MAX_CHARS ? text : `${truncateUtf16Safe(text, 299).trimEnd()}...`).replaceAll("`", "'")}\``;
|
|
1632
1634
|
}
|
|
1633
1635
|
//#endregion
|
|
1634
1636
|
//#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
|
|
@@ -1638,11 +1640,11 @@ async function redactMatrixDraftEvent(client, roomId, draftEventId) {
|
|
|
1638
1640
|
function buildMatrixFinalizedPreviewContent() {
|
|
1639
1641
|
return { [MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY]: true };
|
|
1640
1642
|
}
|
|
1641
|
-
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-
|
|
1643
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-SmBzUhD-.mjs").then((n) => n.s));
|
|
1642
1644
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1643
1645
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1644
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
1645
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
1646
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-Dtd3W-rj.mjs"));
|
|
1647
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-DfUFwKfN.mjs"));
|
|
1646
1648
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
1647
1649
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1648
1650
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -1671,7 +1673,7 @@ const MAX_CACHED_REPLY_CONTEXTS = 256;
|
|
|
1671
1673
|
const MAX_REPLY_BODY_LENGTH = 500;
|
|
1672
1674
|
function truncateReplyBody(value) {
|
|
1673
1675
|
if (value.length <= MAX_REPLY_BODY_LENGTH) return value;
|
|
1674
|
-
return `${sliceUtf16Safe(value, 0,
|
|
1676
|
+
return `${sliceUtf16Safe(value, 0, 497)}...`;
|
|
1675
1677
|
}
|
|
1676
1678
|
function summarizeMatrixReplyEvent(event) {
|
|
1677
1679
|
const body = summarizeMatrixMessageContextEvent(event);
|
|
@@ -1724,7 +1726,7 @@ const MAX_TRACKED_THREAD_STARTERS = 256;
|
|
|
1724
1726
|
const MAX_THREAD_STARTER_BODY_LENGTH = 500;
|
|
1725
1727
|
function truncateThreadStarterBody(value) {
|
|
1726
1728
|
if (value.length <= MAX_THREAD_STARTER_BODY_LENGTH) return value;
|
|
1727
|
-
return `${sliceUtf16Safe(value, 0,
|
|
1729
|
+
return `${sliceUtf16Safe(value, 0, 497)}...`;
|
|
1728
1730
|
}
|
|
1729
1731
|
function summarizeMatrixThreadStarterEvent(event) {
|
|
1730
1732
|
const body = summarizeMatrixMessageContextEvent(event);
|
|
@@ -2836,7 +2838,6 @@ async function resolveMatrixIngressContent(config) {
|
|
|
2836
2838
|
isDirectMessage,
|
|
2837
2839
|
dmSessionScope,
|
|
2838
2840
|
threadId: thread.threadId,
|
|
2839
|
-
eventTs: eventTs ?? void 0,
|
|
2840
2841
|
resolveAgentRoute: core.channel.routing.resolveAgentRoute
|
|
2841
2842
|
});
|
|
2842
2843
|
const hasExplicitSessionBinding = _configuredBinding !== null || _runtimeBindingId !== null;
|
|
@@ -3062,7 +3063,10 @@ async function resolveMatrixIngressContent(config) {
|
|
|
3062
3063
|
}
|
|
3063
3064
|
if (_runtimeBindingId) {
|
|
3064
3065
|
const { getSessionBindingService } = await loadSessionBindingRuntime();
|
|
3065
|
-
getSessionBindingService().touch(_runtimeBindingId, eventTs ?? void 0
|
|
3066
|
+
getSessionBindingService().touch(_runtimeBindingId, eventTs ?? void 0, {
|
|
3067
|
+
channel: "matrix",
|
|
3068
|
+
accountId
|
|
3069
|
+
});
|
|
3066
3070
|
}
|
|
3067
3071
|
const preparedTrigger = isRoom && historyLimit > 0 ? reservedHistorySlot ? roomHistoryTracker.prepareReservedTrigger(_route.agentId, roomId, historyLimit, reservedHistorySlot, {
|
|
3068
3072
|
sender: senderName,
|
|
@@ -3629,7 +3633,7 @@ function createMatrixReplyDispatcher(config) {
|
|
|
3629
3633
|
//#endregion
|
|
3630
3634
|
//#region extensions/matrix/src/matrix/monitor/handler-state.ts
|
|
3631
3635
|
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
3632
|
-
const PAIRING_REPLY_COOLDOWN_MS =
|
|
3636
|
+
const PAIRING_REPLY_COOLDOWN_MS = 3e5;
|
|
3633
3637
|
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
3634
3638
|
function createMatrixHandlerState(config) {
|
|
3635
3639
|
const { core, accountId, runtime, allowFromResolvedEntries, groupAllowFromResolvedEntries, resolveLiveUserAllowlist } = config;
|
|
@@ -4178,10 +4182,10 @@ function shouldPromoteRecentInviteRoom(params) {
|
|
|
4178
4182
|
//#endregion
|
|
4179
4183
|
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
4180
4184
|
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
4181
|
-
import("./config-update-
|
|
4182
|
-
import("./device-health-
|
|
4183
|
-
import("./profile-
|
|
4184
|
-
import("./startup-verification-
|
|
4185
|
+
import("./config-update-B_4qZ5bV.mjs").then((n) => n.t),
|
|
4186
|
+
import("./device-health-CWOuIirq.mjs").then((n) => n.t),
|
|
4187
|
+
import("./profile-ClrB3IgR.mjs").then((n) => n.n),
|
|
4188
|
+
import("./startup-verification-E46yu4fh.mjs")
|
|
4185
4189
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
4186
4190
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
4187
4191
|
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
@@ -4403,35 +4407,6 @@ function createMatrixMonitorSyncLifecycle(params) {
|
|
|
4403
4407
|
};
|
|
4404
4408
|
}
|
|
4405
4409
|
//#endregion
|
|
4406
|
-
//#region extensions/matrix/src/matrix/monitor/task-runner.ts
|
|
4407
|
-
function createMatrixMonitorTaskRunner(params) {
|
|
4408
|
-
const inFlight = /* @__PURE__ */ new Set();
|
|
4409
|
-
let closed = false;
|
|
4410
|
-
const runDetachedTask = (label, task) => {
|
|
4411
|
-
if (closed) return Promise.resolve();
|
|
4412
|
-
const trackedTask = Promise.resolve().then(task).catch((error) => {
|
|
4413
|
-
const message = String(error);
|
|
4414
|
-
params.logVerboseMessage(`matrix: ${label} failed (${message})`);
|
|
4415
|
-
params.logger.warn("matrix background task failed", {
|
|
4416
|
-
task: label,
|
|
4417
|
-
error: message
|
|
4418
|
-
});
|
|
4419
|
-
}).finally(() => {
|
|
4420
|
-
inFlight.delete(trackedTask);
|
|
4421
|
-
});
|
|
4422
|
-
inFlight.add(trackedTask);
|
|
4423
|
-
return trackedTask;
|
|
4424
|
-
};
|
|
4425
|
-
const waitForIdle = async () => {
|
|
4426
|
-
while (inFlight.size > 0) await Promise.allSettled(Array.from(inFlight));
|
|
4427
|
-
};
|
|
4428
|
-
return {
|
|
4429
|
-
close: () => closed = true,
|
|
4430
|
-
runDetachedTask,
|
|
4431
|
-
waitForIdle
|
|
4432
|
-
};
|
|
4433
|
-
}
|
|
4434
|
-
//#endregion
|
|
4435
4410
|
//#region extensions/matrix/src/matrix/monitor/index.ts
|
|
4436
4411
|
function resolveMatrixStreamingMode(streaming) {
|
|
4437
4412
|
const mode = streaming?.mode;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/matrix/src/matrix/profile.ts
|
|
4
4
|
var profile_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
isSupportedMatrixAvatarSource: () => isSupportedMatrixAvatarSource,
|
|
6
6
|
syncMatrixOwnProfile: () => syncMatrixOwnProfile
|
|
7
7
|
});
|
|
8
|
-
const MATRIX_PROFILE_AVATAR_MAX_BYTES =
|
|
8
|
+
const MATRIX_PROFILE_AVATAR_MAX_BYTES = 10485760;
|
|
9
9
|
function isMatrixMxcUri(value) {
|
|
10
10
|
return normalizeLowercaseStringOrEmpty(normalizeOptionalString(value)).startsWith("mxc://");
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.
|
|
2
|
-
import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-
|
|
3
|
-
import { r as syncMatrixOwnProfile } from "./profile-
|
|
4
|
-
import { n as withResolvedActionClient } from "./client-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
|
|
2
|
+
import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-B_4qZ5bV.mjs";
|
|
3
|
+
import { r as syncMatrixOwnProfile } from "./profile-ClrB3IgR.mjs";
|
|
4
|
+
import { n as withResolvedActionClient } from "./client-CpHMD-C2.mjs";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
//#region extensions/matrix/src/matrix/actions/profile.ts
|
|
7
7
|
async function updateMatrixOwnProfile(opts = {}) {
|
|
@@ -10,9 +10,10 @@ async function updateMatrixOwnProfile(opts = {}) {
|
|
|
10
10
|
const avatarPath = opts.avatarPath?.trim();
|
|
11
11
|
const runtime = getMatrixRuntime();
|
|
12
12
|
return await withResolvedActionClient(opts, async (client) => {
|
|
13
|
+
const userId = await client.getUserId();
|
|
13
14
|
return await syncMatrixOwnProfile({
|
|
14
15
|
client,
|
|
15
|
-
userId
|
|
16
|
+
userId,
|
|
16
17
|
displayName: displayName || void 0,
|
|
17
18
|
avatarUrl: avatarUrl || void 0,
|
|
18
19
|
avatarPath: avatarPath || void 0,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.
|
|
2
|
-
import { a as resolveMatrixThreadRootId, o as resolveMatrixThreadRouting, r as resolveMatrixInboundRoute } from "./channel-
|
|
3
|
-
import { a as extractMatrixReactionAnnotation } from "./reaction-common-DkrQdBSZ.
|
|
4
|
-
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-
|
|
1
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import { a as resolveMatrixThreadRootId, o as resolveMatrixThreadRouting, r as resolveMatrixInboundRoute } from "./channel-Q_N83Wwa.mjs";
|
|
3
|
+
import { a as extractMatrixReactionAnnotation } from "./reaction-common-DkrQdBSZ.mjs";
|
|
4
|
+
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-D5eegob9.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
8
8
|
import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
9
9
|
//#region extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
10
|
-
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-
|
|
10
|
+
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-CpxhvOOT.mjs"));
|
|
11
11
|
const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
|
|
12
|
-
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-
|
|
12
|
+
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-SmBzUhD-.mjs").then((n) => n.s));
|
|
13
13
|
function buildMatrixApprovalTerminalText(result) {
|
|
14
14
|
const approval = result.approval;
|
|
15
15
|
const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
|
|
@@ -152,10 +152,12 @@ async function handleInboundMatrixReaction(params) {
|
|
|
152
152
|
isDirectMessage: params.isDirectMessage,
|
|
153
153
|
dmSessionScope: accountConfig.dm?.sessionScope ?? "per-user",
|
|
154
154
|
threadId: thread.threadId,
|
|
155
|
-
eventTs: params.event.origin_server_ts,
|
|
156
155
|
resolveAgentRoute: params.core.channel.routing.resolveAgentRoute
|
|
157
156
|
});
|
|
158
|
-
if (runtimeBindingId) getSessionBindingService().touch(runtimeBindingId, params.event.origin_server_ts
|
|
157
|
+
if (runtimeBindingId) getSessionBindingService().touch(runtimeBindingId, params.event.origin_server_ts, {
|
|
158
|
+
channel: "matrix",
|
|
159
|
+
accountId: params.accountId
|
|
160
|
+
});
|
|
159
161
|
const text = `Matrix reaction added: ${reaction.key} by ${params.senderLabel} on msg ${reaction.eventId}`;
|
|
160
162
|
params.core.system.enqueueSystemEvent(text, {
|
|
161
163
|
sessionKey: route.sessionKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.
|
|
3
|
-
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
|
|
3
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DggLE-28.mjs";
|
|
4
4
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/matrix/src/resolve-targets.ts
|
|
6
6
|
var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
1
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-Bke5jHKS.mjs";
|
|
2
2
|
//#region extensions/matrix/src/resolver.runtime.ts
|
|
3
3
|
const matrixResolverRuntime = { resolveMatrixTargets };
|
|
4
4
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b as resolveMatrixRoomId } from "./send-
|
|
2
|
-
import { s as EventType } from "./messages-
|
|
3
|
-
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-
|
|
4
|
-
import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.
|
|
1
|
+
import { b as resolveMatrixRoomId } from "./send-SmBzUhD-.mjs";
|
|
2
|
+
import { s as EventType } from "./messages-C3v-jkaN.mjs";
|
|
3
|
+
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-CpHMD-C2.mjs";
|
|
4
|
+
import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.mjs";
|
|
5
5
|
//#region extensions/matrix/src/matrix/monitor/bounded-cache.ts
|
|
6
6
|
function setBoundedMap(map, key, value, maxEntries) {
|
|
7
7
|
map.set(key, value);
|