@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,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.
|
|
3
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.
|
|
4
|
-
import { i as normalizeMatrixResolvableTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.
|
|
5
|
-
import { n as MATRIX_REACTION_EVENT_TYPE, r as buildMatrixReactionContent, t as MATRIX_ANNOTATION_RELATION_TYPE } from "./reaction-common-DkrQdBSZ.
|
|
6
|
-
import { a as isStrictDirectRoom, r as inspectMatrixDirectRoomEvidence } from "./direct-room-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
3
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
|
|
4
|
+
import { i as normalizeMatrixResolvableTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.mjs";
|
|
5
|
+
import { n as MATRIX_REACTION_EVENT_TYPE, r as buildMatrixReactionContent, t as MATRIX_ANNOTATION_RELATION_TYPE } from "./reaction-common-DkrQdBSZ.mjs";
|
|
6
|
+
import { a as isStrictDirectRoom, r as inspectMatrixDirectRoomEvidence } from "./direct-room-CKyU8upP.mjs";
|
|
7
7
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
8
8
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
9
9
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -19,11 +19,12 @@ import { isAutoLinkedFileRef } from "openclaw/plugin-sdk/text-autolink-runtime";
|
|
|
19
19
|
import { isVoiceMessageCompatibleAudio } from "openclaw/plugin-sdk/media-runtime";
|
|
20
20
|
import { parseBuffer } from "music-metadata";
|
|
21
21
|
//#region extensions/matrix/src/matrix/send/client.ts
|
|
22
|
-
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-
|
|
22
|
+
const loadMatrixSendClientRuntime = createLazyRuntimeModule(() => import("./client-bootstrap-Cb1tHsT4.mjs").then((n) => n.t));
|
|
23
23
|
function resolveMediaMaxBytes(accountId, cfg) {
|
|
24
24
|
if (!cfg) throw new Error("Matrix media limits requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
25
|
+
const resolvedCfg = requireRuntimeConfig(cfg, "Matrix media limits");
|
|
25
26
|
const mediaMaxMb = resolveMatrixAccountConfig({
|
|
26
|
-
cfg:
|
|
27
|
+
cfg: resolvedCfg,
|
|
27
28
|
accountId
|
|
28
29
|
}).mediaMaxMb;
|
|
29
30
|
return typeof mediaMaxMb === "number" && mediaMaxMb > 0 ? mediaMaxMb * 1024 * 1024 : void 0;
|
|
@@ -359,7 +360,7 @@ async function resolveMatrixRoomId(client, raw) {
|
|
|
359
360
|
//#region extensions/matrix/src/matrix/delivery-plan.ts
|
|
360
361
|
const DELIVERY_PLAN_VERSION = 1;
|
|
361
362
|
const DELIVERY_PLAN_NAMESPACE = "outbound-delivery-plans";
|
|
362
|
-
const DELIVERY_PLAN_TTL_MS =
|
|
363
|
+
const DELIVERY_PLAN_TTL_MS = 864e5;
|
|
363
364
|
var MatrixDeliveryPlanInvariantError = class extends Error {
|
|
364
365
|
constructor(message) {
|
|
365
366
|
super(message);
|
|
@@ -370,8 +371,8 @@ function createDeliveryPlanStore() {
|
|
|
370
371
|
return getMatrixRuntime().state.openBlobStore({
|
|
371
372
|
namespace: DELIVERY_PLAN_NAMESPACE,
|
|
372
373
|
maxEntries: 1e4,
|
|
373
|
-
maxBytesPerEntry:
|
|
374
|
-
maxBytesPerNamespace:
|
|
374
|
+
maxBytesPerEntry: 8388608,
|
|
375
|
+
maxBytesPerNamespace: 268435456,
|
|
375
376
|
overflowPolicy: "reject-new",
|
|
376
377
|
defaultTtlMs: DELIVERY_PLAN_TTL_MS
|
|
377
378
|
});
|
|
@@ -639,7 +640,8 @@ function isPollEventType(eventType) {
|
|
|
639
640
|
}
|
|
640
641
|
function getTextContent(text) {
|
|
641
642
|
if (!isRecord(text)) return "";
|
|
642
|
-
|
|
643
|
+
const value = text["m.text"] ?? text["org.matrix.msc1767.text"] ?? text.body;
|
|
644
|
+
return normalizeOptionalString(value) ?? "";
|
|
643
645
|
}
|
|
644
646
|
function parsePollStart(content) {
|
|
645
647
|
const poll = content["m.poll.start"] ?? content[ORG_POLL_START] ?? content["m.poll"];
|
|
@@ -852,8 +854,9 @@ function isMarkdownEscaped(markdown, index) {
|
|
|
852
854
|
return slashCount % 2 === 1;
|
|
853
855
|
}
|
|
854
856
|
function projectMatrixMarkdown(markdown) {
|
|
857
|
+
const normalized = (markdown ?? "").replace(/\r\n?/gu, "\n");
|
|
855
858
|
return renderMarkdownWithMarkers({
|
|
856
|
-
text:
|
|
859
|
+
text: normalized,
|
|
857
860
|
styles: [],
|
|
858
861
|
links: []
|
|
859
862
|
}, {
|
|
@@ -1427,11 +1430,12 @@ function markdownToMatrixBody(markdown) {
|
|
|
1427
1430
|
const close = offsets[index + 1];
|
|
1428
1431
|
if (open !== void 0 && close !== void 0) body = `${body.slice(0, open)}[Spoiler]${body.slice(close + 2)}`;
|
|
1429
1432
|
}
|
|
1430
|
-
|
|
1433
|
+
const ir = markdownToIR(body, {
|
|
1431
1434
|
enableHtmlUnderline: true,
|
|
1432
1435
|
headingStyle: "rich",
|
|
1433
1436
|
linkify: true
|
|
1434
|
-
})
|
|
1437
|
+
});
|
|
1438
|
+
return renderMarkdownWithMarkers(ir, {
|
|
1435
1439
|
styleMarkers: {},
|
|
1436
1440
|
escapeText: (text) => text
|
|
1437
1441
|
}, MATRIX_FORMAT_PROFILE);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.
|
|
2
|
-
import "./accounts-
|
|
3
|
-
import { n as bootstrapMatrixVerification } from "./verification-
|
|
1
|
+
import { a as resolveMatrixAccountConfig, n as hasExplicitMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import "./accounts-BJ6ECCac.mjs";
|
|
3
|
+
import { n as bootstrapMatrixVerification } from "./verification-DOT16noD.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) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
2
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.
|
|
3
|
-
import { r as resolveDefaultMatrixAccountId } from "./accounts-
|
|
4
|
-
import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.
|
|
5
|
-
import { r as updateMatrixAccountConfig } from "./config-update-
|
|
6
|
-
import { t as isSupportedMatrixAvatarSource } from "./profile-
|
|
1
|
+
import { s as resolveMatrixEnvAuthReadiness } from "./account-selection-DZMazUgX.mjs";
|
|
2
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
3
|
+
import { r as resolveDefaultMatrixAccountId } from "./accounts-BJ6ECCac.mjs";
|
|
4
|
+
import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
|
|
5
|
+
import { r as updateMatrixAccountConfig } from "./config-update-B_4qZ5bV.mjs";
|
|
6
|
+
import { t as isSupportedMatrixAvatarSource } from "./profile-ClrB3IgR.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
9
9
|
import { DEFAULT_ACCOUNT_ID, addWildcardAllowFrom, applyAccountNameToChannelSection, normalizeAccountId, normalizeAllowFromEntries, normalizeSecretInputString, prepareScopedSetupConfig } from "openclaw/plugin-sdk/setup";
|
|
@@ -164,8 +164,9 @@ function validateMatrixSetupInput(params) {
|
|
|
164
164
|
function applyMatrixSetupAccountConfig(params) {
|
|
165
165
|
const input = params.input;
|
|
166
166
|
const normalizedAccountId = normalizeAccountId(params.accountId);
|
|
167
|
+
const migratedCfg = normalizedAccountId !== DEFAULT_ACCOUNT_ID ? moveSingleMatrixAccountConfigToNamedAccount(params.cfg) : params.cfg;
|
|
167
168
|
const next = applyAccountNameToChannelSection({
|
|
168
|
-
cfg:
|
|
169
|
+
cfg: migratedCfg,
|
|
169
170
|
channelKey: channel$1,
|
|
170
171
|
accountId: normalizedAccountId,
|
|
171
172
|
name: input.name
|
|
@@ -310,7 +311,7 @@ const matrixSetupAdapter = {
|
|
|
310
311
|
input
|
|
311
312
|
}),
|
|
312
313
|
afterAccountConfigWritten: async ({ previousCfg, cfg, accountId, runtime }) => {
|
|
313
|
-
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-
|
|
314
|
+
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-CUKhebeX.mjs");
|
|
314
315
|
await runMatrixSetupBootstrapAfterConfigWrite({
|
|
315
316
|
previousCfg,
|
|
316
317
|
cfg,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { n as requiresExplicitMatrixDefaultAccount, s as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
3
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.
|
|
4
|
-
import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-
|
|
5
|
-
import { n as isMatrixRoomId } from "./target-ids-Nwx7cMVE.
|
|
6
|
-
import { r as updateMatrixAccountConfig } from "./config-update-
|
|
7
|
-
import { a as moveSingleMatrixAccountConfigToNamedAccount, i as createMatrixSetupDmPolicy } from "./setup-core-
|
|
8
|
-
import { n as validateMatrixHomeserverUrl, r as isPrivateOrLoopbackHost, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.
|
|
9
|
-
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { n as requiresExplicitMatrixDefaultAccount, s as resolveMatrixEnvAuthReadiness } from "./account-selection-DZMazUgX.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
4
|
+
import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-BJ6ECCac.mjs";
|
|
5
|
+
import { n as isMatrixRoomId } from "./target-ids-Nwx7cMVE.mjs";
|
|
6
|
+
import { r as updateMatrixAccountConfig } from "./config-update-B_4qZ5bV.mjs";
|
|
7
|
+
import { a as moveSingleMatrixAccountConfigToNamedAccount, i as createMatrixSetupDmPolicy } from "./setup-core-BnqoLunq.mjs";
|
|
8
|
+
import { n as validateMatrixHomeserverUrl, r as isPrivateOrLoopbackHost, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.mjs";
|
|
9
|
+
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-mtxF2mHI.mjs";
|
|
10
10
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
12
12
|
import { formatDocsLink, hasConfiguredSecretInput, mergeAllowFromEntries, normalizeAccountId as normalizeAccountId$1, promptAccountId, promptChannelAccessConfig, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
@@ -68,12 +68,13 @@ async function promptMatrixAllowFrom(params) {
|
|
|
68
68
|
}).configured;
|
|
69
69
|
const isFullUserId = (value) => value.startsWith("@") && value.includes(":");
|
|
70
70
|
while (true) {
|
|
71
|
-
const
|
|
71
|
+
const entry = await prompter.text({
|
|
72
72
|
message: "Matrix allowFrom (full @user:server; display name only if unique)",
|
|
73
73
|
placeholder: "@user:server",
|
|
74
74
|
initialValue: existingAllowFrom[0] ? String(existingAllowFrom[0]) : void 0,
|
|
75
75
|
validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
|
|
76
|
-
})
|
|
76
|
+
});
|
|
77
|
+
const parts = splitSetupEntries(entry);
|
|
77
78
|
const resolvedIds = [];
|
|
78
79
|
const pending = [];
|
|
79
80
|
const unresolved = [];
|
|
@@ -90,7 +91,7 @@ async function promptMatrixAllowFrom(params) {
|
|
|
90
91
|
pending.push(part);
|
|
91
92
|
}
|
|
92
93
|
if (pending.length > 0) {
|
|
93
|
-
const { resolveMatrixTargets } = await import("./resolve-targets-
|
|
94
|
+
const { resolveMatrixTargets } = await import("./resolve-targets-Bke5jHKS.mjs").then((n) => n.n);
|
|
94
95
|
const results = await resolveMatrixTargets({
|
|
95
96
|
cfg,
|
|
96
97
|
accountId,
|
|
@@ -158,14 +159,15 @@ async function configureMatrixInviteAutoJoin(params) {
|
|
|
158
159
|
}
|
|
159
160
|
if (policy === "always") return setMatrixAutoJoin(params.cfg, policy, [], accountId);
|
|
160
161
|
while (true) {
|
|
161
|
-
const
|
|
162
|
+
const rawAllowlist = await params.prompter.text({
|
|
162
163
|
message: "Matrix invite auto-join allowlist (comma-separated)",
|
|
163
164
|
placeholder: "!roomId:server, !roomId, #alias:server, *",
|
|
164
165
|
initialValue: currentAllowlist[0] ? currentAllowlist.join(", ") : void 0,
|
|
165
166
|
validate: (value) => {
|
|
166
167
|
return splitSetupEntries(value).length > 0 ? void 0 : "Required";
|
|
167
168
|
}
|
|
168
|
-
})
|
|
169
|
+
});
|
|
170
|
+
const allowlist = normalizeUniqueStringEntries(splitSetupEntries(rawAllowlist));
|
|
169
171
|
const invalidEntries = allowlist.filter((entry) => !isMatrixInviteAutoJoinTarget(entry));
|
|
170
172
|
if (allowlist.length === 0 || invalidEntries.length > 0) {
|
|
171
173
|
await params.prompter.note(["Use only stable Matrix invite targets for auto-join: !roomId:server (or the suffixless !roomId form on room version 12+), #alias:server, or *.", invalidEntries.length > 0 ? `Invalid: ${invalidEntries.join(", ")}` : void 0].filter(Boolean).join("\n"), "Matrix invite auto-join");
|
|
@@ -194,41 +196,43 @@ async function configureMatrixAccessPrompts(params) {
|
|
|
194
196
|
placeholder: "!roomId:server, !roomId, #alias:server, Project Room",
|
|
195
197
|
updatePrompt: Boolean(existingGroups)
|
|
196
198
|
});
|
|
197
|
-
if (accessConfig)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
199
|
+
if (accessConfig) {
|
|
200
|
+
if (accessConfig.policy !== "allowlist") next = updateMatrixAccountConfig(next, params.accountId, { groupPolicy: accessConfig.policy });
|
|
201
|
+
else {
|
|
202
|
+
let roomKeys = accessConfig.entries;
|
|
203
|
+
if (accessConfig.entries.length > 0) try {
|
|
204
|
+
const resolvedIds = [];
|
|
205
|
+
const unresolved = [];
|
|
206
|
+
for (const entry of accessConfig.entries) {
|
|
207
|
+
const trimmed = normalizeOptionalString(entry) ?? "";
|
|
208
|
+
if (!trimmed) continue;
|
|
209
|
+
const cleaned = trimmed.replace(/^(room|channel):/i, "").trim();
|
|
210
|
+
if (isMatrixRoomId(cleaned)) {
|
|
211
|
+
resolvedIds.push(cleaned);
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
const { listMatrixDirectoryGroupsLive } = await import("./directory-live-DggLE-28.mjs").then((n) => n.t);
|
|
215
|
+
const matches = await listMatrixDirectoryGroupsLive({
|
|
216
|
+
cfg: next,
|
|
217
|
+
accountId: params.accountId,
|
|
218
|
+
query: trimmed,
|
|
219
|
+
limit: 10
|
|
220
|
+
});
|
|
221
|
+
const best = matches.find((match) => normalizeLowercaseStringOrEmpty(match.name) === normalizeLowercaseStringOrEmpty(trimmed)) ?? matches[0];
|
|
222
|
+
if (best?.id) resolvedIds.push(best.id);
|
|
223
|
+
else unresolved.push(entry);
|
|
210
224
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
query: trimmed,
|
|
216
|
-
limit: 10
|
|
217
|
-
});
|
|
218
|
-
const best = matches.find((match) => normalizeLowercaseStringOrEmpty(match.name) === normalizeLowercaseStringOrEmpty(trimmed)) ?? matches[0];
|
|
219
|
-
if (best?.id) resolvedIds.push(best.id);
|
|
220
|
-
else unresolved.push(entry);
|
|
225
|
+
roomKeys = [...resolvedIds, ...unresolved.map((entry) => normalizeOptionalString(entry)).filter((entry) => Boolean(entry))];
|
|
226
|
+
if (resolvedIds.length > 0 || unresolved.length > 0) await params.prompter.note([resolvedIds.length > 0 ? `Resolved: ${resolvedIds.join(", ")}` : void 0, unresolved.length > 0 ? `Unresolved (kept as typed): ${unresolved.join(", ")}` : void 0].filter(Boolean).join("\n"), "Matrix rooms");
|
|
227
|
+
} catch (err) {
|
|
228
|
+
await params.prompter.note(`Room lookup failed; keeping entries as typed. ${String(err)}`, "Matrix rooms");
|
|
221
229
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
230
|
+
next = updateMatrixAccountConfig(next, params.accountId, {
|
|
231
|
+
groupPolicy: "allowlist",
|
|
232
|
+
groups: Object.fromEntries(roomKeys.map((key) => [key, { enabled: true }])),
|
|
233
|
+
rooms: null
|
|
234
|
+
});
|
|
226
235
|
}
|
|
227
|
-
next = updateMatrixAccountConfig(next, params.accountId, {
|
|
228
|
-
groupPolicy: "allowlist",
|
|
229
|
-
groups: Object.fromEntries(roomKeys.map((key) => [key, { enabled: true }])),
|
|
230
|
-
rooms: null
|
|
231
|
-
});
|
|
232
236
|
}
|
|
233
237
|
return await configureMatrixInviteAutoJoin({
|
|
234
238
|
cfg: next,
|
|
@@ -335,40 +339,42 @@ async function runMatrixConfigure(params) {
|
|
|
335
339
|
userId = "";
|
|
336
340
|
}
|
|
337
341
|
}
|
|
338
|
-
if (!hasConfiguredSecretInput(accessToken) && !hasConfiguredSecretInput(password))
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
342
|
+
if (!hasConfiguredSecretInput(accessToken) && !hasConfiguredSecretInput(password)) {
|
|
343
|
+
if (await params.prompter.select({
|
|
344
|
+
message: "Matrix auth method",
|
|
345
|
+
options: [{
|
|
346
|
+
value: "token",
|
|
347
|
+
label: "Access token (user ID fetched automatically)"
|
|
348
|
+
}, {
|
|
349
|
+
value: "password",
|
|
350
|
+
label: "Password (requires user ID)"
|
|
351
|
+
}]
|
|
352
|
+
}) === "token") {
|
|
353
|
+
accessToken = normalizeStringifiedOptionalString(await params.prompter.text({
|
|
354
|
+
message: "Matrix access token",
|
|
355
|
+
sensitive: true,
|
|
356
|
+
validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
|
|
357
|
+
})) ?? "";
|
|
358
|
+
password = void 0;
|
|
359
|
+
userId = "";
|
|
360
|
+
} else {
|
|
361
|
+
userId = normalizeStringifiedOptionalString(await params.prompter.text({
|
|
362
|
+
message: "Matrix user ID",
|
|
363
|
+
initialValue: existing.userId ?? envUserId,
|
|
364
|
+
validate: (value) => {
|
|
365
|
+
const raw = normalizeOptionalString(value) ?? "";
|
|
366
|
+
if (!raw) return "Required";
|
|
367
|
+
if (!raw.startsWith("@")) return "Matrix user IDs should start with @";
|
|
368
|
+
if (!raw.includes(":")) return "Matrix user IDs should include a server (:server)";
|
|
369
|
+
}
|
|
370
|
+
})) ?? "";
|
|
371
|
+
password = normalizeStringifiedOptionalString(await params.prompter.text({
|
|
372
|
+
message: "Matrix password",
|
|
373
|
+
sensitive: true,
|
|
374
|
+
validate: (value) => normalizeOptionalString(value) ? void 0 : "Required"
|
|
375
|
+
})) ?? "";
|
|
376
|
+
accessToken = void 0;
|
|
377
|
+
}
|
|
372
378
|
}
|
|
373
379
|
const deviceName = normalizeStringifiedOptionalString(await params.prompter.text({
|
|
374
380
|
message: "Matrix device name (optional)",
|
|
@@ -458,7 +464,7 @@ const matrixOnboardingAdapter = {
|
|
|
458
464
|
});
|
|
459
465
|
},
|
|
460
466
|
afterConfigWritten: async ({ previousCfg, cfg, accountId, runtime }) => {
|
|
461
|
-
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-
|
|
467
|
+
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-CUKhebeX.mjs");
|
|
462
468
|
await runMatrixSetupBootstrapAfterConfigWrite({
|
|
463
469
|
previousCfg,
|
|
464
470
|
cfg,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.
|
|
2
|
-
import { M as resolveMatrixSqliteStateEnv, l as resolveMatrixStoragePaths, o as recordCurrentStorageMetaDeviceId } from "./storage-
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
|
|
2
|
+
import { M as resolveMatrixSqliteStateEnv, l as resolveMatrixStoragePaths, o as recordCurrentStorageMetaDeviceId } from "./storage-B-nf2ReN.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -13,7 +13,7 @@ const STARTUP_VERIFICATION_MIGRATIONS_NAMESPACE = "startup-verification-migratio
|
|
|
13
13
|
const STARTUP_VERIFICATION_MAX_ENTRIES = 1e3;
|
|
14
14
|
const DEFAULT_STARTUP_VERIFICATION_MODE = "if-unverified";
|
|
15
15
|
const DEFAULT_STARTUP_VERIFICATION_COOLDOWN_HOURS = 24;
|
|
16
|
-
const DEFAULT_STARTUP_VERIFICATION_FAILURE_COOLDOWN_MS =
|
|
16
|
+
const DEFAULT_STARTUP_VERIFICATION_FAILURE_COOLDOWN_MS = 36e5;
|
|
17
17
|
function normalizeCooldownHours(value) {
|
|
18
18
|
if (typeof value !== "number" || !Number.isFinite(value)) return DEFAULT_STARTUP_VERIFICATION_COOLDOWN_HOURS;
|
|
19
19
|
return Math.max(0, value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.
|
|
2
|
-
import { n as resolveMatrixAccountStorageRoot } from "./storage-paths-gUmSydsW.
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.mjs";
|
|
2
|
+
import { n as resolveMatrixAccountStorageRoot } from "./storage-paths-gUmSydsW.mjs";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -33,7 +33,7 @@ const LEGACY_CRYPTO_MIGRATION_NAMESPACE = "legacy-crypto-migration";
|
|
|
33
33
|
const IDB_SNAPSHOT_NAMESPACE = "idb-snapshot";
|
|
34
34
|
const SMALL_STATE_MAX_ENTRIES = 10;
|
|
35
35
|
const IDB_SNAPSHOT_MAX_ENTRIES = 2e4;
|
|
36
|
-
const IDB_SNAPSHOT_MAX_CHUNKS = Math.floor(
|
|
36
|
+
const IDB_SNAPSHOT_MAX_CHUNKS = Math.floor(19999 / 2);
|
|
37
37
|
const IDB_SNAPSHOT_CHUNK_BYTES = 24e3;
|
|
38
38
|
const MATRIX_RECOVERY_KEY_FILENAME = "recovery-key.json";
|
|
39
39
|
const MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME = "legacy-crypto-migration.json";
|
|
@@ -487,8 +487,9 @@ function resolvePreferredMatrixStorageRoot(params) {
|
|
|
487
487
|
}
|
|
488
488
|
function resolveMatrixStoragePaths(params) {
|
|
489
489
|
const env = params.env ?? process.env;
|
|
490
|
+
const stateDir = params.stateDir ?? getMatrixRuntime().state.resolveStateDir(env, os.homedir);
|
|
490
491
|
const canonical = resolveMatrixAccountStorageRoot({
|
|
491
|
-
stateDir
|
|
492
|
+
stateDir,
|
|
492
493
|
homeserver: params.homeserver,
|
|
493
494
|
userId: params.userId,
|
|
494
495
|
accessToken: params.accessToken,
|
|
@@ -526,7 +527,7 @@ function resolveMatrixStateFilePath(params) {
|
|
|
526
527
|
}
|
|
527
528
|
async function maybeMigrateLegacyStorage(params) {
|
|
528
529
|
const hasAccountScopedLegacyStorageFile = fs.existsSync(params.storagePaths.storagePath);
|
|
529
|
-
const syncCache = hasAccountScopedLegacyStorageFile ? await import("./
|
|
530
|
+
const syncCache = hasAccountScopedLegacyStorageFile ? await import("./sync-cache-state-6Hjn1K-v.mjs").then((n) => n.s) : null;
|
|
530
531
|
const hasAccountScopedLegacyStorage = hasAccountScopedLegacyStorageFile && await syncCache?.readLegacyMatrixSyncCacheState(params.storagePaths.rootDir) !== null;
|
|
531
532
|
const hasAccountScopedRecoveryKey = fs.existsSync(params.storagePaths.recoveryKeyPath);
|
|
532
533
|
const hasAccountScopedLegacyCryptoMigration = fs.existsSync(path.join(params.storagePaths.rootDir, MATRIX_LEGACY_CRYPTO_MIGRATION_FILENAME));
|
|
@@ -573,7 +574,7 @@ async function maybeMigrateLegacyStorage(params) {
|
|
|
573
574
|
if (skippedExistingTargets.length > 0) logger.warn?.(`matrix: legacy client storage files were left in place because their migrated targets already existed.\n${skippedExistingTargets.join("\n")}`);
|
|
574
575
|
}
|
|
575
576
|
async function migrateLegacySyncCacheToSqlite(params) {
|
|
576
|
-
const syncCache = await import("./
|
|
577
|
+
const syncCache = await import("./sync-cache-state-6Hjn1K-v.mjs").then((n) => n.s);
|
|
577
578
|
const persisted = await syncCache.readLegacyMatrixSyncCacheState(params.sourceRootDir);
|
|
578
579
|
if (!persisted) return;
|
|
579
580
|
const store = getMatrixRuntime().state.openKeyedStore(syncCache.openMatrixSyncCacheStoreOptions(params.targetRootDir));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, o as removeBindingRecord, s as resolveBindingKey } from "./thread-bindings-shared-oNPiyMWY.
|
|
1
|
+
import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, o as removeBindingRecord, s as resolveBindingKey } from "./thread-bindings-shared-oNPiyMWY.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/matrix/src/matrix/subagent-hooks.ts
|
|
@@ -13,7 +13,11 @@ async function handleMatrixSubagentEnded(event) {
|
|
|
13
13
|
const bindingId = resolveBindingKey(binding);
|
|
14
14
|
if ((await bindingService.unbind({
|
|
15
15
|
bindingId,
|
|
16
|
-
reason
|
|
16
|
+
reason,
|
|
17
|
+
scope: {
|
|
18
|
+
channel: "matrix",
|
|
19
|
+
accountId: binding.accountId
|
|
20
|
+
}
|
|
17
21
|
})).some((entry) => entry.bindingId === bindingId)) removedBindingKeys.add(bindingId);
|
|
18
22
|
}
|
|
19
23
|
}
|