@openclaw/matrix 2026.11.5-beta.1 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-config-CVM2a28p.mjs → account-config-CRsKoMqJ.mjs} +2 -1
- package/dist/.setup/{account-selection-Cow3TMFO.mjs → account-selection-UUPhMBmu.mjs} +8 -5
- package/dist/.setup/{approval-handler.runtime-_0gqiVgR.mjs → approval-handler.runtime-Ca12_7Qa.mjs} +9 -8
- package/dist/.setup/{approval-reactions-Bz_8XB01.mjs → approval-reactions-BazmsDbe.mjs} +3 -2
- package/dist/.setup/{backup-health-BxH69np2.mjs → backup-health-Dm_YMVFT.mjs} +2 -1
- package/dist/.setup/{channel-ByHcZU28.mjs → channel-CX7k81dL.mjs} +38 -27
- package/dist/.setup/{channel.runtime-sNicWjmD.mjs → channel.runtime-K_hHX-9W.mjs} +12 -10
- package/dist/.setup/{channel.setup-Bmba21y9.mjs → channel.setup-B00zzOOL.mjs} +7 -5
- package/dist/.setup/{cli-B26pps0Q.mjs → cli-dz9hd2dR.mjs} +34 -25
- package/dist/.setup/{cli-metadata-CKGwVfmT.mjs → cli-metadata-CwUhA9CY.mjs} +5 -3
- package/dist/.setup/{client-N8TEwtmk.mjs → client-CFPYqaYK.mjs} +5 -4
- package/dist/.setup/{client-Bqu801rH.mjs → client-D1bsidwU.mjs} +26 -21
- package/dist/.setup/{client-bootstrap-k6Zm1M8Y.mjs → client-bootstrap-CTT0VF6v.mjs} +3 -2
- package/dist/.setup/{client-support-CqXAOZp3.mjs → client-support-B_Mp4Qk9.mjs} +3 -2
- package/dist/.setup/{config-paths-DBpHxDyc.mjs → config-paths-CnREYb1Y.mjs} +2 -1
- package/dist/.setup/{create-client-DaGljdrk.mjs → create-client-Ccf5wyS3.mjs} +9 -8
- package/dist/.setup/{credentials-DVmY0miU.mjs → credentials-kT20jk_u.mjs} +6 -5
- package/dist/.setup/{credentials-read-rPqEpuxv.mjs → credentials-read-CM6wXUjL.mjs} +6 -5
- package/dist/.setup/{credentials-state-jxq29yQw.mjs → credentials-state-B3cuUFwZ.mjs} +2 -1
- package/dist/.setup/{crypto-node.runtime-E_hqXGxm.mjs → crypto-node.runtime-6Aj_ltHQ.mjs} +2 -1
- package/dist/.setup/{crypto-runtime-KQupbxSM.mjs → crypto-runtime-DZNytKX5.mjs} +15 -10
- package/dist/.setup/{crypto-state-store-p1mdYTWH.mjs → crypto-state-store-BZLlwkv_.mjs} +4 -3
- package/dist/.setup/{crypto-store-ownership-7lVHeXWL.mjs → crypto-store-ownership-CiQ1l_O7.mjs} +4 -3
- package/dist/.setup/{crypto-unsafe-state-doctor-CG2nJk8P.mjs → crypto-unsafe-state-doctor-Dh1dtuSz.mjs} +8 -7
- package/dist/.setup/{deps-CVPT2Ros.mjs → deps-D-W_QQjz.mjs} +2 -1
- package/dist/.setup/{device-health-D7n-lPeb.mjs → device-health-Ck2YpEVN.mjs} +3 -2
- package/dist/.setup/{direct-management-D59C1WO-.mjs → direct-management-Dp1giZ34.mjs} +11 -7
- package/dist/.setup/{directory-live-YixmpyLW.mjs → directory-live-ufzRheWx.mjs} +6 -5
- package/dist/.setup/{doctor-contract-GiXgCj7k.mjs → doctor-contract-BANpMUbP.mjs} +3 -2
- package/dist/.setup/{draft-stream-C09OtoJZ.mjs → draft-stream-BPjjKSoI.mjs} +4 -3
- package/dist/.setup/{encryption-guidance-DfbEaKct.mjs → encryption-guidance-Br3Lv9Hm.mjs} +4 -3
- package/dist/.setup/{env-vars-Bh1iOXJ1.mjs → env-vars-aEBngJPa.mjs} +2 -1
- package/dist/.setup/{errors-CL3YJV8U.mjs → errors-Bw4EHwKX.mjs} +2 -1
- package/dist/.setup/{event-helpers-DDUjVVf7.mjs → event-helpers-CxNgMQqH.mjs} +2 -1
- package/dist/.setup/{exec-approvals-C3rCm0Sn.mjs → exec-approvals-BwEOyI1-.mjs} +9 -6
- package/dist/.setup/{file-sync-store-NW6eDuai.mjs → file-sync-store-BpS12yaK.mjs} +36 -6
- package/dist/.setup/{http-client-CqnKFKUH.mjs → http-client-B_ohXrBm.mjs} +8 -5
- package/dist/.setup/{idb-persistence-CmoPtwDD.mjs → idb-persistence-BTOsltD9.mjs} +7 -6
- package/dist/.setup/{idb-persistence-lock-CH2K6d_3.mjs → idb-persistence-lock-Bh3ZLIsE.mjs} +2 -1
- package/dist/.setup/{joined-room-encryption-9sJK1kM-.mjs → joined-room-encryption-C0gHa2DG.mjs} +3 -2
- package/dist/.setup/{logger-B9TwnY6C.mjs → logger-CuAzdD8Q.mjs} +3 -2
- package/dist/.setup/{logging-Bnsn7s4r.mjs → logging-CoaEyRtA.mjs} +4 -3
- package/dist/.setup/{messages-BjzsVgS6.mjs → messages-DpJ9naJa.mjs} +14 -9
- package/dist/.setup/{monitor-D4vhbNUM.mjs → monitor-Rzl3naSn.mjs} +157 -63
- package/dist/.setup/{onboarding-DKmt3jpW.mjs → onboarding-BK-V2ZLT.mjs} +11 -10
- package/dist/.setup/{outbound-wsXTF0z_.mjs → outbound-DMMVmZjV.mjs} +4 -3
- package/dist/.setup/{profile-update-DX060MnL.mjs → profile-update-RLsY-gu6.mjs} +9 -7
- package/dist/.setup/{reaction-events-BMsatzs4.mjs → reaction-events-UA_g6jEX.mjs} +9 -8
- package/dist/.setup/{resolve-targets-Yz_3aN_2.mjs → resolve-targets-DYW8ULZS.mjs} +5 -4
- package/dist/.setup/{retired-state-Bs3Gqkge.mjs → retired-state-JGUEBE72.mjs} +7 -4
- package/dist/.setup/{room-info-OGKjk422.mjs → room-info-Dhc4efkA.mjs} +8 -6
- package/dist/.setup/{runtime-Ck8TjD7L.mjs → runtime-1kn1P6io.mjs} +2 -1
- package/dist/.setup/{runtime-doctor-migrations-CSvRANPN.mjs → runtime-doctor-migrations-hxP-CXX7.mjs} +10 -5
- package/dist/.setup/{runtime-setter-api-CpwhcBQK.mjs → runtime-setter-api-i2MOXoT3.mjs} +1 -1
- package/dist/.setup/{sdk-BXcIyN-I.mjs → sdk-DPXiQ3jr.mjs} +46 -32
- package/dist/.setup/{secret-contract-AKnr45nw.mjs → secret-contract-DxyzKSzf.mjs} +3 -2
- package/dist/.setup/{secret-contract-api-DMSwMIxd.mjs → secret-contract-api-Dukgvike.mjs} +1 -1
- package/dist/.setup/{send-CWjH-l-T.mjs → send-HHAbKARg.mjs} +41 -25
- package/dist/.setup/{send-currentness-D1x6YP9O.mjs → send-currentness-DGxiiBn9.mjs} +4 -2
- package/dist/.setup/{setup-bootstrap-yKeGh4Iy.mjs → setup-bootstrap-DaT2j28V.mjs} +5 -4
- package/dist/.setup/{setup-core-BaKffgBi.mjs → setup-core-DcqQbLZv.mjs} +20 -13
- package/dist/.setup/setup-plugin-api-Cg4TelGZ.mjs +2 -0
- package/dist/.setup/{startup-verification-C-lhD0gk.mjs → startup-verification-UkaoSldm.mjs} +5 -4
- package/dist/.setup/{state-layout-walk-BqCZTHpp.mjs → state-layout-walk-BQMgMykU.mjs} +3 -2
- package/dist/.setup/{storage-BLLN9jYG.mjs → storage-C3N6YZIn.mjs} +10 -8
- package/dist/.setup/{storage-paths-e_Vq6cvw.mjs → storage-paths-B51JM-pC.mjs} +2 -1
- package/dist/.setup/{subagent-hooks-D-lCcLGQ.mjs → subagent-hooks-CfGAysJi.mjs} +3 -2
- package/dist/.setup/{sync-cache-state-B4hJFIPw.mjs → sync-cache-state-BKVaKRzQ.mjs} +5 -4
- package/dist/.setup/{sync-state-Cu1nagBV.mjs → sync-state-CWbp0QSY.mjs} +2 -1
- package/dist/.setup/{target-ids-DltG_ZHJ.mjs → target-ids-HhcaKX1n.mjs} +2 -1
- package/dist/.setup/{task-runner-CYyGHdNW.mjs → task-runner-DY3aKiQa.mjs} +2 -1
- package/dist/.setup/{thread-binding-api-OtSciHmZ.mjs → thread-binding-api-BvuaKpd0.mjs} +3 -2
- package/dist/.setup/{thread-bindings-BA2xESjV.mjs → thread-bindings-891JsKXF.mjs} +9 -7
- package/dist/.setup/{thread-bindings-shared-CBlJu3Wz.mjs → thread-bindings-shared-QmZOfX9Q.mjs} +2 -1
- package/dist/.setup/{tool-actions-CRuiVbqj.mjs → tool-actions-yFZH_7mC.mjs} +24 -19
- package/dist/.setup/{url-validation-DesoKUns.mjs → url-validation-By_2hsXr.mjs} +2 -1
- package/dist/.setup/{verification-C5x4Hy5Y.mjs → verification-CcZIVL8P.mjs} +5 -4
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +3 -2
- 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 +16 -13
- package/dist/helper-api.js +3 -3
- package/dist/index.js +4 -3
- package/dist/plugin-entry.handlers.runtime.js +4 -3
- package/dist/runtime-api.js +8 -7
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +3 -2
- 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-B_t4waBw.mjs +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-
|
|
2
|
-
import { a as resolveMatrixInboundRouteAsync, o as resolveMatrixThreadRouting } from "./channel-
|
|
3
|
-
import { c as extractMatrixReactionAnnotation } from "./send-currentness-
|
|
4
|
-
import { p as resolveMatrixThreadRootId } from "./direct-management-
|
|
5
|
-
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-
|
|
1
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import { a as resolveMatrixInboundRouteAsync, o as resolveMatrixThreadRouting } from "./channel-CX7k81dL.mjs";
|
|
3
|
+
import { c as extractMatrixReactionAnnotation } from "./send-currentness-DGxiiBn9.mjs";
|
|
4
|
+
import { p as resolveMatrixThreadRootId } from "./direct-management-Dp1giZ34.mjs";
|
|
5
|
+
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-BazmsDbe.mjs";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
9
9
|
import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
10
|
-
|
|
11
|
-
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-
|
|
10
|
+
//#region extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
11
|
+
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./channel-CX7k81dL.mjs").then((n) => n.s));
|
|
12
12
|
const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
|
|
13
|
-
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-
|
|
13
|
+
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-HHAbKARg.mjs").then((n) => n.s));
|
|
14
14
|
function buildMatrixApprovalTerminalText(result) {
|
|
15
15
|
const approval = result.approval;
|
|
16
16
|
const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
|
|
@@ -139,4 +139,5 @@ async function handleInboundMatrixReaction(params) {
|
|
|
139
139
|
});
|
|
140
140
|
params.logVerboseMessage(`matrix: reaction event enqueued room=${params.roomId} target=${reaction.eventId} sender=${params.senderId} emoji=${reaction.key}`);
|
|
141
141
|
}
|
|
142
|
+
//#endregion
|
|
142
143
|
export { handleInboundMatrixReaction };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
2
|
-
import { i as normalizeMatrixMessagingTarget, n as isMatrixQualifiedUserId } from "./target-ids-
|
|
3
|
-
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { i as normalizeMatrixMessagingTarget, n as isMatrixQualifiedUserId } from "./target-ids-HhcaKX1n.mjs";
|
|
3
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-ufzRheWx.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 });
|
|
7
7
|
function findExactDirectoryMatches(matches, query) {
|
|
8
8
|
const normalized = normalizeOptionalLowercaseString(query);
|
|
@@ -77,4 +77,5 @@ async function resolveMatrixTargets(params) {
|
|
|
77
77
|
}
|
|
78
78
|
return results;
|
|
79
79
|
}
|
|
80
|
+
//#endregion
|
|
80
81
|
export { resolve_targets_exports as n, resolveMatrixTargets as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.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
|
+
//#region extensions/matrix/src/matrix/chunked-state.ts
|
|
8
8
|
function chunkMatrixStateJson(value, maxBytes, maxChunks, limitMessage) {
|
|
9
9
|
const chunks = [];
|
|
10
10
|
const pushChunk = (chunk) => {
|
|
@@ -48,7 +48,8 @@ async function pruneMatrixStateChunks(store, retainedKeys, chunkKeyPrefix) {
|
|
|
48
48
|
const nextChunkKeys = new Set(retainedKeys);
|
|
49
49
|
for (const row of await store.entries()) if (row.key.startsWith(chunkKeyPrefix) && !nextChunkKeys.has(row.key)) await store.delete(row.key);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region extensions/matrix/src/matrix/sqlite-state.ts
|
|
52
53
|
function resolveStateDirOverride(options) {
|
|
53
54
|
if (!options) return;
|
|
54
55
|
return options.stateDir || getMatrixRuntime().state.resolveStateDir(options.env ?? process.env, os.homedir);
|
|
@@ -81,7 +82,8 @@ async function updateMatrixKeyedState(store, key, update, onUndefined = "keep")
|
|
|
81
82
|
observation = result.current;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region extensions/matrix/src/matrix/retired-state.ts
|
|
85
87
|
const RETIRED_MATRIX_STATE_FILENAMES = /* @__PURE__ */ new Set([
|
|
86
88
|
"thread-bindings.json",
|
|
87
89
|
"startup-verification.json",
|
|
@@ -107,4 +109,5 @@ async function assertMatrixSupportedStateFile(filePath) {
|
|
|
107
109
|
}
|
|
108
110
|
throw new Error(describeRetiredMatrixState(filePath));
|
|
109
111
|
}
|
|
112
|
+
//#endregion
|
|
110
113
|
export { describeRetiredMatrixState as a, updateMatrixKeyedState as c, readMatrixStateChunks as d, writeMatrixStateChunks as f, 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, pruneMatrixStateChunks as u };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { w as setBoundedMap } from "./send-
|
|
2
|
-
import { n as isMatrixNotFoundError } from "./errors-
|
|
3
|
-
import { s as EventType } from "./messages-
|
|
4
|
-
import { r as withResolvedRoomAction } from "./client-
|
|
1
|
+
import { w as setBoundedMap } from "./send-HHAbKARg.mjs";
|
|
2
|
+
import { n as isMatrixNotFoundError } from "./errors-Bw4EHwKX.mjs";
|
|
3
|
+
import { s as EventType } from "./messages-DpJ9naJa.mjs";
|
|
4
|
+
import { r as withResolvedRoomAction } from "./client-CFPYqaYK.mjs";
|
|
5
5
|
import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
-
|
|
6
|
+
//#region extensions/matrix/src/matrix/actions/room.ts
|
|
7
7
|
async function getMatrixMemberInfo(userId, opts) {
|
|
8
8
|
return await withResolvedRoomAction(opts.roomId, opts, async (client, roomId) => {
|
|
9
9
|
if (!(await client.getJoinedRoomMembers(roomId)).includes(userId)) throw new Error(`User ${userId} is not a member of room ${roomId}`);
|
|
@@ -42,7 +42,8 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region extensions/matrix/src/matrix/monitor/room-info.ts
|
|
46
47
|
const MAX_ROOM_INFO = 1024;
|
|
47
48
|
const MAX_MEMBER_DISPLAY_NAMES = 4096;
|
|
48
49
|
function createMatrixRoomInfoResolver(client) {
|
|
@@ -125,4 +126,5 @@ function createMatrixRoomInfoResolver(client) {
|
|
|
125
126
|
invalidateRoomName
|
|
126
127
|
};
|
|
127
128
|
}
|
|
129
|
+
//#endregion
|
|
128
130
|
export { getMatrixMemberInfo as n, getMatrixRoomInfo as r, createMatrixRoomInfoResolver as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
//#region extensions/matrix/src/runtime.ts
|
|
3
3
|
const { setRuntime: setMatrixRuntime, getRuntime: getMatrixRuntime, tryGetRuntime: getOptionalMatrixRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "matrix",
|
|
5
5
|
errorMessage: "Matrix runtime not initialized"
|
|
@@ -25,4 +25,5 @@ function getMatrixRuntimeLifecycle() {
|
|
|
25
25
|
const runtime = getOptionalMatrixRuntime();
|
|
26
26
|
return runtime ? runtimeLifecycles.tryGetRuntime()?.get(runtime) : void 0;
|
|
27
27
|
}
|
|
28
|
+
//#endregion
|
|
28
29
|
export { setMatrixRuntimeLifecycle as a, setMatrixRuntime as i, getMatrixRuntimeLifecycle as n, getOptionalMatrixRuntime as r, getMatrixRuntime as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,7 +24,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
return to;
|
|
25
25
|
};
|
|
26
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region packages/normalization-core/src/record-coerce.ts
|
|
28
29
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
29
30
|
function isRecord(value) {
|
|
30
31
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -33,7 +34,8 @@ function isRecord(value) {
|
|
|
33
34
|
function asNullableRecord(value) {
|
|
34
35
|
return isRecord(value) ? value : null;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/config/channel-config-normalization.ts
|
|
37
39
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
38
40
|
function normalizeChannelAccounts(params) {
|
|
39
41
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -109,7 +111,8 @@ function normalizeChannelConfigEntries(params) {
|
|
|
109
111
|
changes
|
|
110
112
|
};
|
|
111
113
|
}
|
|
112
|
-
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
113
116
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
114
117
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
115
118
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -179,8 +182,10 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
179
182
|
}
|
|
180
183
|
};
|
|
181
184
|
}
|
|
182
|
-
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
183
187
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
184
188
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
185
189
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
190
|
+
//#endregion
|
|
186
191
|
export { __exportAll as n, runtime_doctor_migrations_exports 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-1kn1P6io.mjs";
|
|
2
2
|
import "../runtime-setter-api.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
2
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
3
|
-
import { r as assertMatrixSupportedStateFile } from "./retired-state-
|
|
4
|
-
import { o as readMatrixRecoveryKeyStateForPathAsync, u 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 { n as isMatrixNotFoundError, t as formatMatrixErrorReason } from "./errors-
|
|
8
|
-
import { a as isMatrixAccessTokenInvalidatedError, c as resolveMatrixLocalTimeoutMs, i as createMatrixExplicitBootstrapOptions, l as unresolvedMatrixDeviceVerificationStatus, n as MATRIX_INITIAL_CRYPTO_BOOTSTRAP_OPTIONS, o as resolveMatrixDiagnostic, r as MATRIX_STATUS_DIAGNOSTIC_TIMEOUT_MS, s as resolveMatrixDiagnosticResult, t as MATRIX_AUTOMATIC_REPAIR_BOOTSTRAP_OPTIONS, u as unresolvedMatrixRoomKeyBackupStatus } from "./client-support-
|
|
9
|
-
import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-
|
|
10
|
-
import { r as createMatrixGuardedFetch, t as MatrixAuthedHttpClient } from "./http-client-
|
|
11
|
-
import { n as resolveMatrixRoomKeyBackupReadinessError } from "./backup-health-
|
|
12
|
-
import { r as noop, t as LogService } from "./logger-
|
|
13
|
-
import { t as createMatrixJsSdkClientLogger } from "./logging-
|
|
14
|
-
import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-
|
|
15
|
-
import { n as isMatrixReadySyncState, r as isMatrixTerminalSyncState } from "./sync-state-
|
|
16
|
-
import { t as MATRIX_IDB_PERSIST_INTERVAL_MS } from "./idb-persistence-lock-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
3
|
+
import { r as assertMatrixSupportedStateFile } from "./retired-state-JGUEBE72.mjs";
|
|
4
|
+
import { o as readMatrixRecoveryKeyStateForPathAsync, u as writeMatrixRecoveryKeyStateForPathAsync } from "./crypto-state-store-BZLlwkv_.mjs";
|
|
5
|
+
import { n as withMatrixSendCurrentness, r as withoutMatrixSendCurrentness, t as captureMatrixSendCurrentness } from "./send-currentness-DGxiiBn9.mjs";
|
|
6
|
+
import { i as parseMxc, r as matrixEventToRaw } from "./event-helpers-CxNgMQqH.mjs";
|
|
7
|
+
import { n as isMatrixNotFoundError, t as formatMatrixErrorReason } from "./errors-Bw4EHwKX.mjs";
|
|
8
|
+
import { a as isMatrixAccessTokenInvalidatedError, c as resolveMatrixLocalTimeoutMs, i as createMatrixExplicitBootstrapOptions, l as unresolvedMatrixDeviceVerificationStatus, n as MATRIX_INITIAL_CRYPTO_BOOTSTRAP_OPTIONS, o as resolveMatrixDiagnostic, r as MATRIX_STATUS_DIAGNOSTIC_TIMEOUT_MS, s as resolveMatrixDiagnosticResult, t as MATRIX_AUTOMATIC_REPAIR_BOOTSTRAP_OPTIONS, u as unresolvedMatrixRoomKeyBackupStatus } from "./client-support-B_Mp4Qk9.mjs";
|
|
9
|
+
import { i as createMatrixStartupAbortError, o as throwIfMatrixStartupAborted, r as awaitMatrixStartupWithAbort } from "./client-D1bsidwU.mjs";
|
|
10
|
+
import { r as createMatrixGuardedFetch, t as MatrixAuthedHttpClient } from "./http-client-B_ohXrBm.mjs";
|
|
11
|
+
import { n as resolveMatrixRoomKeyBackupReadinessError } from "./backup-health-Dm_YMVFT.mjs";
|
|
12
|
+
import { r as noop, t as LogService } from "./logger-CuAzdD8Q.mjs";
|
|
13
|
+
import { t as createMatrixJsSdkClientLogger } from "./logging-CoaEyRtA.mjs";
|
|
14
|
+
import { t as acquireMatrixCryptoStoreOwnership } from "./crypto-store-ownership-CiQ1l_O7.mjs";
|
|
15
|
+
import { n as isMatrixReadySyncState, r as isMatrixTerminalSyncState } from "./sync-state-CWbp0QSY.mjs";
|
|
16
|
+
import { t as MATRIX_IDB_PERSIST_INTERVAL_MS } from "./idb-persistence-lock-Bh3ZLIsE.mjs";
|
|
17
17
|
import { createRequire } from "node:module";
|
|
18
18
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
19
19
|
import { formatErrorMessage, materializeErrorStack } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -35,7 +35,7 @@ import { createDeferred as createDeferred$1 } from "openclaw/plugin-sdk/concurre
|
|
|
35
35
|
import { decodeRecoveryKey } from "matrix-js-sdk/lib/crypto-api/recovery-key.js";
|
|
36
36
|
import { MatrixScheduler } from "matrix-js-sdk/lib/scheduler.js";
|
|
37
37
|
import { EventStatus } from "matrix-js-sdk/lib/models/event-status.js";
|
|
38
|
-
|
|
38
|
+
//#region extensions/matrix/src/matrix/sdk/client-event-bridge.ts
|
|
39
39
|
function registerMatrixClientBridge(params) {
|
|
40
40
|
let initialSyncComplete = false;
|
|
41
41
|
const joinTransitions = /* @__PURE__ */ new WeakSet();
|
|
@@ -105,7 +105,8 @@ function refreshMatrixDmRoomIds(direct, dmRoomIds) {
|
|
|
105
105
|
}
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
108
|
-
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region extensions/matrix/src/matrix/sdk/client-crypto-bootstrap.ts
|
|
109
110
|
async function bootstrapMatrixClientCrypto(params) {
|
|
110
111
|
const { crypto, bootstrapper, abortSignal } = params;
|
|
111
112
|
if (!crypto || !bootstrapper) return false;
|
|
@@ -123,7 +124,8 @@ async function bootstrapMatrixClientCrypto(params) {
|
|
|
123
124
|
}
|
|
124
125
|
return true;
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region extensions/matrix/src/matrix/sdk/client-sync-quiesce.ts
|
|
127
129
|
const MATRIX_SYNC_QUIESCE_TIMEOUT_MS = 5e3;
|
|
128
130
|
const MATRIX_JS_SDK_SYNC_VERSION = "43.0.0";
|
|
129
131
|
const matrixJsSdkPackage = createRequire(import.meta.url)("matrix-js-sdk/package.json");
|
|
@@ -191,7 +193,8 @@ async function quiesceMatrixClientSync(params) {
|
|
|
191
193
|
}
|
|
192
194
|
});
|
|
193
195
|
}
|
|
194
|
-
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region extensions/matrix/src/matrix/sdk/client-sync-ready.ts
|
|
195
198
|
async function waitForMatrixInitialSyncReady(params) {
|
|
196
199
|
const timeoutMs = params.timeoutMs ?? 3e4;
|
|
197
200
|
if (isMatrixReadySyncState(params.state)) return;
|
|
@@ -231,7 +234,8 @@ async function waitForMatrixInitialSyncReady(params) {
|
|
|
231
234
|
params.emitter.off("sync.unexpected_error", settle);
|
|
232
235
|
}
|
|
233
236
|
}
|
|
234
|
-
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region extensions/matrix/src/matrix/sdk/crypto-store-lifecycle.ts
|
|
235
239
|
async function closeMatrixCryptoStores(closeRecoveryKeys, releaseOwnership, teardownComplete) {
|
|
236
240
|
const recovery = await Promise.allSettled([closeRecoveryKeys()]);
|
|
237
241
|
const release = teardownComplete ? await Promise.allSettled([releaseOwnership()]) : [];
|
|
@@ -329,7 +333,8 @@ function createMatrixSdkStopGate() {
|
|
|
329
333
|
}
|
|
330
334
|
};
|
|
331
335
|
}
|
|
332
|
-
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region extensions/matrix/src/matrix/sdk/live-room-readiness.ts
|
|
333
338
|
async function withMatrixLiveEncryptedRoom(owner, run, params) {
|
|
334
339
|
const signal = AbortSignal.any([params.generationSignal, ...params.abortSignal ? [params.abortSignal] : []]);
|
|
335
340
|
const active = (async () => {
|
|
@@ -410,7 +415,8 @@ async function probeMatrixLiveEncryptedRoom(params) {
|
|
|
410
415
|
params.signal.removeEventListener("abort", onChange);
|
|
411
416
|
}
|
|
412
417
|
}
|
|
413
|
-
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region extensions/matrix/src/matrix/sdk/message-wire-dispatch.ts
|
|
414
420
|
function resolveMessageWireDispatch(resource, init) {
|
|
415
421
|
if ((init?.method ?? (resource instanceof Request ? resource.method : "GET")).toUpperCase() !== "PUT") return null;
|
|
416
422
|
const rawUrl = typeof resource === "string" ? resource : resource instanceof URL ? resource.href : resource.url;
|
|
@@ -465,7 +471,8 @@ var MatrixMessageWireDispatchGuards = class {
|
|
|
465
471
|
}
|
|
466
472
|
}
|
|
467
473
|
};
|
|
468
|
-
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region extensions/matrix/src/matrix/sdk/recovery-key-store.ts
|
|
469
476
|
function isRepairableSecretStorageAccessError(err) {
|
|
470
477
|
const message = formatMatrixErrorReason(err);
|
|
471
478
|
if (!message) return false;
|
|
@@ -732,7 +739,8 @@ var MatrixRecoveryKeyStore = class {
|
|
|
732
739
|
}
|
|
733
740
|
}
|
|
734
741
|
};
|
|
735
|
-
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region extensions/matrix/src/matrix/sdk/send-scheduler.ts
|
|
736
744
|
/** Keep SDK FIFO/backoff while settling a caller's pre-request rejection only for its event. */
|
|
737
745
|
var MatrixSendScheduler = class extends MatrixScheduler {
|
|
738
746
|
constructor(wasCurrentnessRejected) {
|
|
@@ -770,10 +778,11 @@ var MatrixSendScheduler = class extends MatrixScheduler {
|
|
|
770
778
|
return this.queue.removeEventFromQueue(event);
|
|
771
779
|
}
|
|
772
780
|
};
|
|
773
|
-
|
|
781
|
+
//#endregion
|
|
782
|
+
//#region extensions/matrix/src/matrix/sdk/client-base.ts
|
|
774
783
|
const MATRIX_ENCRYPTED_STARTUP_TIMEOUT_MS = 6e4;
|
|
775
784
|
let loadedMatrixCryptoRuntime = null;
|
|
776
|
-
const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-
|
|
785
|
+
const loadMatrixCryptoRuntime = createLazyRuntimeModule(() => import("./crypto-runtime-DZNytKX5.mjs").then((runtime) => {
|
|
777
786
|
loadedMatrixCryptoRuntime = runtime;
|
|
778
787
|
return runtime;
|
|
779
788
|
}));
|
|
@@ -999,7 +1008,7 @@ var MatrixClientBase = class {
|
|
|
999
1008
|
});
|
|
1000
1009
|
checkActive();
|
|
1001
1010
|
if (this.encryptionEnabled && this.cryptoInitialized) {
|
|
1002
|
-
const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-
|
|
1011
|
+
const { reconcileJoinedRoomEncryption } = await import("./joined-room-encryption-C0gHa2DG.mjs");
|
|
1003
1012
|
checkActive();
|
|
1004
1013
|
await this.withClientCryptoWork(() => reconcileJoinedRoomEncryption(this.client, signal, checkActive), signal);
|
|
1005
1014
|
checkActive();
|
|
@@ -1208,7 +1217,8 @@ var MatrixClientBase = class {
|
|
|
1208
1217
|
}
|
|
1209
1218
|
}
|
|
1210
1219
|
};
|
|
1211
|
-
|
|
1220
|
+
//#endregion
|
|
1221
|
+
//#region extensions/matrix/src/matrix/sdk/client-core.ts
|
|
1212
1222
|
function isUnsupportedAuthenticatedMediaEndpointError(err) {
|
|
1213
1223
|
const statusCode = err?.statusCode;
|
|
1214
1224
|
if (statusCode === 404 || statusCode === 405 || statusCode === 501) return true;
|
|
@@ -1460,7 +1470,8 @@ var MatrixClientCore = class extends MatrixClientBase {
|
|
|
1460
1470
|
});
|
|
1461
1471
|
}
|
|
1462
1472
|
};
|
|
1463
|
-
|
|
1473
|
+
//#endregion
|
|
1474
|
+
//#region extensions/matrix/src/matrix/sdk/verification-status.ts
|
|
1464
1475
|
function isMatrixDeviceOwnerVerified(status) {
|
|
1465
1476
|
return status?.crossSigningVerified === true;
|
|
1466
1477
|
}
|
|
@@ -1477,7 +1488,8 @@ async function trustMatrixOwnIdentity(crypto) {
|
|
|
1477
1488
|
ownIdentity.free();
|
|
1478
1489
|
}
|
|
1479
1490
|
}
|
|
1480
|
-
|
|
1491
|
+
//#endregion
|
|
1492
|
+
//#region extensions/matrix/src/matrix/sdk/client-verification.ts
|
|
1481
1493
|
var MatrixClientVerification = class extends MatrixClientCore {
|
|
1482
1494
|
async refreshOwnDeviceKeys() {
|
|
1483
1495
|
await this.client.getCrypto()?.userHasCrossSigningKeys(await this.getUserId(), true);
|
|
@@ -1626,7 +1638,8 @@ var MatrixClientVerification = class extends MatrixClientCore {
|
|
|
1626
1638
|
LogService.info("MatrixClientLite", `Room key backup enabled (version ${createdVersion})`);
|
|
1627
1639
|
}
|
|
1628
1640
|
};
|
|
1629
|
-
|
|
1641
|
+
//#endregion
|
|
1642
|
+
//#region extensions/matrix/src/matrix/sdk.ts
|
|
1630
1643
|
var sdk_exports = /* @__PURE__ */ __exportAll({ MatrixClient: () => MatrixClient });
|
|
1631
1644
|
var MatrixClient = class extends MatrixClientVerification {
|
|
1632
1645
|
async resolveCryptoControlPlane() {
|
|
@@ -1944,4 +1957,5 @@ var MatrixClient = class extends MatrixClientVerification {
|
|
|
1944
1957
|
return refreshMatrixDmRoomIds(await this.getAccountData("m.direct"), this.dmRoomIds);
|
|
1945
1958
|
}
|
|
1946
1959
|
};
|
|
1960
|
+
//#endregion
|
|
1947
1961
|
export { MatrixClient, isRepairableSecretStorageAccessError as a, trustMatrixOwnIdentity as i, isMatrixDeviceOwnerVerified as n, isMatrixDeviceVerifiedInCurrentClient as r, sdk_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as getMatrixScopedEnvVarNames } from "./env-vars-
|
|
1
|
+
import { t as getMatrixScopedEnvVarNames } from "./env-vars-aEBngJPa.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { collectSecretInputAssignment, createChannelSecretContract, hasConfiguredSecretInputValue, hasOwnProperty, normalizeSecretStringValue } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/matrix/src/secret-contract.ts
|
|
5
5
|
function accountSecretOwner(accountId) {
|
|
6
6
|
return {
|
|
7
7
|
ownerKind: "account",
|
|
@@ -86,4 +86,5 @@ const channelSecrets = createChannelSecretContract({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
const { secretTargetRegistryEntries, collectRuntimeConfigAssignments } = channelSecrets;
|
|
89
|
+
//#endregion
|
|
89
90
|
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -1,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-DxyzKSzf.mjs";
|
|
2
2
|
import "../secret-contract-api.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
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 getMatrixMonitorTaskSignal } from "./task-runner-
|
|
8
|
-
import { n as getMatrixEventProjection } from "./event-helpers-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
4
|
+
import { a as normalizeMatrixResolvableTarget, n as isMatrixQualifiedUserId } from "./target-ids-HhcaKX1n.mjs";
|
|
5
|
+
import { n as withMatrixSendCurrentness, o as buildMatrixReactionContent, t as captureMatrixSendCurrentness } from "./send-currentness-DGxiiBn9.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-Dp1giZ34.mjs";
|
|
7
|
+
import { n as getMatrixMonitorTaskSignal } from "./task-runner-DY3aKiQa.mjs";
|
|
8
|
+
import { n as getMatrixEventProjection } from "./event-helpers-CxNgMQqH.mjs";
|
|
9
9
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
10
10
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
11
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -24,8 +24,8 @@ import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-run
|
|
|
24
24
|
import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
|
|
25
25
|
import MarkdownIt from "markdown-it";
|
|
26
26
|
import { isAutoLinkedFileRef } from "openclaw/plugin-sdk/text-autolink-runtime";
|
|
27
|
-
|
|
28
|
-
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-
|
|
27
|
+
//#region extensions/matrix/src/matrix/send/client.ts
|
|
28
|
+
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-CTT0VF6v.mjs"));
|
|
29
29
|
function resolveMediaMaxBytes(accountId, cfg) {
|
|
30
30
|
const mediaMaxMb = resolveMatrixAccountConfig({
|
|
31
31
|
cfg,
|
|
@@ -59,7 +59,8 @@ async function withResolvedMatrixClient(opts, run) {
|
|
|
59
59
|
const { withResolvedRuntimeMatrixClient } = await loadMatrixSendClientRuntime();
|
|
60
60
|
return await withResolvedRuntimeMatrixClient(opts, run);
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region extensions/matrix/src/matrix/send/receipt.ts
|
|
63
64
|
function createMatrixSendReceipt(params) {
|
|
64
65
|
const firstEvent = params.events[0];
|
|
65
66
|
const receipt = createMessageReceiptFromOutboundResults({
|
|
@@ -84,12 +85,14 @@ function createMatrixSendReceipt(params) {
|
|
|
84
85
|
});
|
|
85
86
|
return receipt;
|
|
86
87
|
}
|
|
87
|
-
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region extensions/matrix/src/matrix/monitor/bounded-cache.ts
|
|
88
90
|
function setBoundedMap(map, key, value, maxEntries) {
|
|
89
91
|
map.set(key, value);
|
|
90
92
|
pruneMapToMaxSize(map, maxEntries);
|
|
91
93
|
}
|
|
92
|
-
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region extensions/matrix/src/matrix/send/targets.ts
|
|
93
96
|
function normalizeTarget(raw) {
|
|
94
97
|
const trimmed = raw.trim();
|
|
95
98
|
if (!trimmed) throw new Error("Matrix target is required (room:<id> or #alias)");
|
|
@@ -149,7 +152,8 @@ async function resolveMatrixRoomId(client, raw, opts = {}) {
|
|
|
149
152
|
}
|
|
150
153
|
return target;
|
|
151
154
|
}
|
|
152
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region extensions/matrix/src/matrix/delivery-plan.ts
|
|
153
157
|
const DELIVERY_PLAN_VERSION = 1;
|
|
154
158
|
const DELIVERY_PLAN_NAMESPACE = "outbound-delivery-plans";
|
|
155
159
|
const DELIVERY_PLAN_TTL_MS = 864e5;
|
|
@@ -375,7 +379,8 @@ async function cleanupMatrixDeliveryPlans(ctx) {
|
|
|
375
379
|
const keys = entries.filter((entry) => entry.key.startsWith(prefix)).map((entry) => entry.key);
|
|
376
380
|
for (const key of keys) await store.delete(key);
|
|
377
381
|
}
|
|
378
|
-
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region extensions/matrix/src/matrix/poll-types.ts
|
|
379
384
|
const M_POLL_START = "m.poll.start";
|
|
380
385
|
const M_POLL_RESPONSE = "m.poll.response";
|
|
381
386
|
const M_POLL_END = "m.poll.end";
|
|
@@ -552,7 +557,8 @@ function buildPollResponseContent(pollEventId, answerIds) {
|
|
|
552
557
|
}
|
|
553
558
|
};
|
|
554
559
|
}
|
|
555
|
-
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region extensions/matrix/src/matrix/format-profile.ts
|
|
556
562
|
function createMatrixPrivateMarkers(markdown, exhaustedMessage) {
|
|
557
563
|
const used = new Set(Array.from(markdown, (character) => character.charCodeAt(0)));
|
|
558
564
|
for (const match of markdown.matchAll(/&#(?:x([0-9a-f]+)|(\d+));/giu)) {
|
|
@@ -595,7 +601,8 @@ function projectMatrixMarkdown(markdown) {
|
|
|
595
601
|
function renderMatrixMarkdownTables(markdown, mode) {
|
|
596
602
|
return MATRIX_FORMAT_PROFILE.constructs.table === "native" && (mode === "off" || mode === "block") ? markdown : convertMarkdownTables(markdown, mode);
|
|
597
603
|
}
|
|
598
|
-
|
|
604
|
+
//#endregion
|
|
605
|
+
//#region extensions/matrix/src/matrix/format-table-ranges.ts
|
|
599
606
|
const tableParser = new MarkdownIt({
|
|
600
607
|
html: false,
|
|
601
608
|
linkify: false,
|
|
@@ -616,7 +623,8 @@ function matrixTableSourceRangesFromTokens(tokens, lineStarts, sourceLength) {
|
|
|
616
623
|
}];
|
|
617
624
|
});
|
|
618
625
|
}
|
|
619
|
-
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region extensions/matrix/src/matrix/format-spoiler-ranges.ts
|
|
620
628
|
const spoilerParser = new MarkdownIt({
|
|
621
629
|
html: false,
|
|
622
630
|
linkify: true,
|
|
@@ -795,7 +803,8 @@ function analyzeMatrixSpoilers(markdown) {
|
|
|
795
803
|
metadataCollision: hasMatrixSpoilerMetadataCollision(source, delimiterOffsets)
|
|
796
804
|
};
|
|
797
805
|
}
|
|
798
|
-
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region extensions/matrix/src/matrix/format.ts
|
|
799
808
|
const MATRIX_STYLE_MARKERS = {
|
|
800
809
|
underline: {
|
|
801
810
|
open: "<u>",
|
|
@@ -1147,7 +1156,8 @@ async function renderMarkdownToMatrixHtmlWithMentions(params) {
|
|
|
1147
1156
|
mentions: state.mentions
|
|
1148
1157
|
};
|
|
1149
1158
|
}
|
|
1150
|
-
|
|
1159
|
+
//#endregion
|
|
1160
|
+
//#region extensions/matrix/src/matrix/send/chunking.ts
|
|
1151
1161
|
function normalizeMatrixEventLimit(limit) {
|
|
1152
1162
|
if (!Number.isFinite(limit) || limit <= 0) return limit;
|
|
1153
1163
|
return Math.max(1, Math.floor(limit));
|
|
@@ -1309,7 +1319,8 @@ function chunkMatrixText(text, opts) {
|
|
|
1309
1319
|
chunks
|
|
1310
1320
|
};
|
|
1311
1321
|
}
|
|
1312
|
-
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region extensions/matrix/src/matrix/media-text.ts
|
|
1313
1324
|
const MATRIX_MEDIA_KINDS = {
|
|
1314
1325
|
"m.audio": "audio",
|
|
1315
1326
|
"m.file": "file",
|
|
@@ -1377,7 +1388,8 @@ function formatMatrixMessageText(params) {
|
|
|
1377
1388
|
if (!body) return marker;
|
|
1378
1389
|
return `${body}\n\n${marker}`;
|
|
1379
1390
|
}
|
|
1380
|
-
|
|
1391
|
+
//#endregion
|
|
1392
|
+
//#region extensions/matrix/src/matrix/send/edit-content.ts
|
|
1381
1393
|
const MAX_EDIT_RELATION_PAGES = 100;
|
|
1382
1394
|
const EDIT_RELATION_PAGE_SIZE = 100;
|
|
1383
1395
|
const EDIT_DECRYPTION_ERROR = "Matrix edit history is not fully decrypted; restore encryption keys before editing.";
|
|
@@ -1415,7 +1427,8 @@ async function resolveMatrixEditContent(params) {
|
|
|
1415
1427
|
}
|
|
1416
1428
|
throw new Error("Matrix edit history could not be fully read; send a new message instead.");
|
|
1417
1429
|
}
|
|
1418
|
-
|
|
1430
|
+
//#endregion
|
|
1431
|
+
//#region extensions/matrix/src/matrix/send/formatting.ts
|
|
1419
1432
|
function buildTextContent(body, relation, opts = {}) {
|
|
1420
1433
|
return {
|
|
1421
1434
|
msgtype: opts.msgtype ?? MsgType.Text,
|
|
@@ -1478,7 +1491,8 @@ function resolveMatrixMsgType(contentType) {
|
|
|
1478
1491
|
default: return MsgType.File;
|
|
1479
1492
|
}
|
|
1480
1493
|
}
|
|
1481
|
-
|
|
1494
|
+
//#endregion
|
|
1495
|
+
//#region extensions/matrix/src/matrix/send/media.ts
|
|
1482
1496
|
const THUMBNAIL_MAX_SIDE = 800;
|
|
1483
1497
|
const THUMBNAIL_QUALITY = 80;
|
|
1484
1498
|
async function prepareImageInfo(params) {
|
|
@@ -1526,7 +1540,8 @@ async function uploadMediaWithEncryption(client, roomId, buffer, params) {
|
|
|
1526
1540
|
}
|
|
1527
1541
|
return { url: await client.uploadContent(buffer, params.contentType, params.filename) };
|
|
1528
1542
|
}
|
|
1529
|
-
|
|
1543
|
+
//#endregion
|
|
1544
|
+
//#region extensions/matrix/src/matrix/send.ts
|
|
1530
1545
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
1531
1546
|
chunkMatrixText: () => chunkMatrixText,
|
|
1532
1547
|
editMessageMatrix: () => editMessageMatrix,
|
|
@@ -1923,4 +1938,5 @@ async function reactMatrixMessage(roomId, messageId, emoji, opts = {}) {
|
|
|
1923
1938
|
await resolved.sendEvent(resolvedRoom, EventType.Reaction, reaction);
|
|
1924
1939
|
});
|
|
1925
1940
|
}
|
|
1941
|
+
//#endregion
|
|
1926
1942
|
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 { asOptionalObjectRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
|
|
3
|
+
//#region extensions/matrix/src/matrix/reaction-common.ts
|
|
4
4
|
const MATRIX_ANNOTATION_RELATION_TYPE = "m.annotation";
|
|
5
5
|
const MATRIX_REACTION_EVENT_TYPE = "m.reaction";
|
|
6
6
|
function normalizeMatrixReactionValue(value, field) {
|
|
@@ -59,7 +59,8 @@ function selectOwnMatrixReactionEventIds(events, userId, emoji) {
|
|
|
59
59
|
}
|
|
60
60
|
return ids;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region extensions/matrix/src/matrix/sdk/send-currentness.ts
|
|
63
64
|
const sendCurrentness = new AsyncLocalStorage();
|
|
64
65
|
function withMatrixSendCurrentness(client, assertCurrent, run) {
|
|
65
66
|
assertCurrent();
|
|
@@ -76,4 +77,5 @@ function captureMatrixSendCurrentness(client) {
|
|
|
76
77
|
function withoutMatrixSendCurrentness(run) {
|
|
77
78
|
return sendCurrentness.exit(run);
|
|
78
79
|
}
|
|
80
|
+
//#endregion
|
|
79
81
|
export { MATRIX_REACTION_EVENT_TYPE as a, extractMatrixReactionAnnotation as c, MATRIX_ANNOTATION_RELATION_TYPE as i, selectOwnMatrixReactionEventIds as l, withMatrixSendCurrentness as n, buildMatrixReactionContent as o, withoutMatrixSendCurrentness as r, buildMatrixReactionRelationsPath as s, captureMatrixSendCurrentness as t, summarizeMatrixReactionEvents as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-
|
|
2
|
-
import "./setup-core-
|
|
3
|
-
import { n as bootstrapMatrixVerification } from "./verification-
|
|
1
|
+
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import "./setup-core-DcqQbLZv.mjs";
|
|
3
|
+
import { n as bootstrapMatrixVerification } from "./verification-CcZIVL8P.mjs";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/matrix/src/setup-bootstrap.ts
|
|
6
6
|
async function maybeBootstrapNewEncryptedMatrixAccount(params) {
|
|
7
7
|
const accountConfig = resolveMatrixAccountConfig({
|
|
8
8
|
cfg: params.cfg,
|
|
@@ -54,4 +54,5 @@ async function runMatrixSetupBootstrapAfterConfigWrite(params) {
|
|
|
54
54
|
}
|
|
55
55
|
params.runtime.error(`Matrix verification bootstrap warning for "${params.accountId}": ${bootstrap.error ?? "unknown bootstrap failure"}`);
|
|
56
56
|
}
|
|
57
|
+
//#endregion
|
|
57
58
|
export { maybeBootstrapNewEncryptedMatrixAccount, runMatrixSetupBootstrapAfterConfigWrite };
|