@openclaw/matrix 2026.11.1 → 2026.11.3
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-BPFpdMIw.mjs → account-selection-CWsL5zIU.mjs} +8 -5
- package/dist/.setup/{approval-handler.runtime-BvuXpzus.mjs → approval-handler.runtime-Co2elSYS.mjs} +9 -8
- package/dist/.setup/{approval-reactions-DMDBJos0.mjs → approval-reactions-D2pEUrFS.mjs} +3 -2
- package/dist/.setup/{backup-health-BxH69np2.mjs → backup-health-Dm_YMVFT.mjs} +2 -1
- package/dist/.setup/{channel-DYRabwmj.mjs → channel-BBvOdxTc.mjs} +44 -30
- package/dist/.setup/{channel.runtime-C0VWk0Ch.mjs → channel.runtime-DyX4mM8d.mjs} +10 -8
- package/dist/.setup/{channel.setup-Dp7V9AgV.mjs → channel.setup-p6oll48W.mjs} +15 -7
- package/dist/.setup/{cli-umlumhB6.mjs → cli-C2XKMk1U.mjs} +39 -28
- package/dist/.setup/{cli-metadata-DemZndyG.mjs → cli-metadata-C60BW1oa.mjs} +5 -3
- package/dist/.setup/{client-BIsYqIzM.mjs → client-BEl7PU1_.mjs} +25 -19
- package/dist/.setup/{client-DL_aELCJ.mjs → client-Cxv-iMwp.mjs} +5 -4
- package/dist/.setup/{client-bootstrap-kdsygurH.mjs → client-bootstrap-D1vLveT2.mjs} +3 -2
- package/dist/.setup/{client-support-CFofPPPm.mjs → client-support-D-xHScuo.mjs} +5 -3
- package/dist/.setup/{config-paths-DBpHxDyc.mjs → config-paths-CnREYb1Y.mjs} +2 -1
- package/dist/.setup/{create-client-BFkMM7SP.mjs → create-client-CrY1E3hg.mjs} +9 -8
- package/dist/.setup/{credentials-read-BOuCoy-p.mjs → credentials-read-Dj7Hj87M.mjs} +6 -5
- package/dist/.setup/{credentials-state-jxq29yQw.mjs → credentials-state-B3cuUFwZ.mjs} +2 -1
- package/dist/.setup/{credentials-B3MlOOom.mjs → credentials-udso1z0C.mjs} +6 -5
- package/dist/.setup/{crypto-node.runtime-E_hqXGxm.mjs → crypto-node.runtime-6Aj_ltHQ.mjs} +2 -1
- package/dist/.setup/{crypto-runtime-s3ogwLRO.mjs → crypto-runtime-DqX7VD1W.mjs} +19 -12
- package/dist/.setup/{crypto-state-store-CM57gchf.mjs → crypto-state-store-DclM-fO5.mjs} +5 -3
- package/dist/.setup/{crypto-store-ownership-Bratn-Np.mjs → crypto-store-ownership-Dr-T40Rp.mjs} +4 -3
- package/dist/.setup/{crypto-unsafe-state-doctor-ClzRgr8z.mjs → crypto-unsafe-state-doctor-BG9qMu0B.mjs} +8 -7
- package/dist/.setup/{deps-O7rEnklr.mjs → deps-L_1bUAGL.mjs} +2 -1
- package/dist/.setup/{device-health-CmvwmCHB.mjs → device-health-D6_ECUVe.mjs} +3 -2
- package/dist/.setup/{direct-management-BOYMqZJQ.mjs → direct-management-ZcjZgYEl.mjs} +11 -7
- package/dist/.setup/{directory-live-tItssg9q.mjs → directory-live-_yaRaktv.mjs} +6 -5
- package/dist/.setup/{doctor-contract-GiXgCj7k.mjs → doctor-contract-BANpMUbP.mjs} +3 -2
- package/dist/.setup/{draft-stream-Buru5huX.mjs → draft-stream-vO_qjwJb.mjs} +4 -3
- package/dist/.setup/{encryption-guidance-CLloQ6H7.mjs → encryption-guidance-BLUoN4aV.mjs} +4 -3
- package/dist/.setup/{env-vars-Bh1iOXJ1.mjs → env-vars-aEBngJPa.mjs} +2 -1
- package/dist/.setup/{errors-CL3YJV8U.mjs → errors-Bw4EHwKX.mjs} +2 -1
- package/dist/.setup/{event-helpers-DDUjVVf7.mjs → event-helpers-CxNgMQqH.mjs} +2 -1
- package/dist/.setup/{exec-approvals-CWeSpE6V.mjs → exec-approvals-BFT-ee9F.mjs} +9 -6
- package/dist/.setup/{file-sync-store-D1sEtAap.mjs → file-sync-store-BxUPmUoJ.mjs} +6 -5
- package/dist/.setup/{http-client-CxTmU1kT.mjs → http-client-ByR4STVQ.mjs} +7 -4
- package/dist/.setup/{idb-persistence-BF0MZglD.mjs → idb-persistence-C2TsCHY2.mjs} +7 -6
- package/dist/.setup/{idb-persistence-lock-CH2K6d_3.mjs → idb-persistence-lock-Bh3ZLIsE.mjs} +2 -1
- package/dist/.setup/{inbound-dedupe-CZnOq0ja.mjs → inbound-dedupe-sW_gaR44.mjs} +3 -2
- package/dist/.setup/{joined-room-encryption-Dl7Sb9FF.mjs → joined-room-encryption-DBbLkdvv.mjs} +3 -2
- package/dist/.setup/{logger-BX5kXvh1.mjs → logger-CuAzdD8Q.mjs} +5 -4
- package/dist/.setup/{logging-BWPjyW9s.mjs → logging-CoaEyRtA.mjs} +22 -15
- package/dist/.setup/{messages-Dt51OgyD.mjs → messages-TuEa_BPZ.mjs} +14 -9
- package/dist/.setup/{monitor-BrBbFO8h.mjs → monitor-B86Ll4B8.mjs} +166 -77
- package/dist/.setup/{onboarding-QfFvgZ85.mjs → onboarding-DOLEjkg2.mjs} +11 -10
- package/dist/.setup/{outbound-B8h2BwR2.mjs → outbound-BWsyqwt1.mjs} +4 -3
- package/dist/.setup/{profile-update-DiXtw0NM.mjs → profile-update-DiXSVBki.mjs} +8 -6
- package/dist/.setup/{reaction-events-xTg2_wZJ.mjs → reaction-events-CuUeYcBC.mjs} +9 -8
- package/dist/.setup/{resolve-targets-vlr765on.mjs → resolve-targets-Dd70hGcM.mjs} +5 -4
- package/dist/.setup/{retired-state-vIr2IB90.mjs → retired-state-C4UnLIg4.mjs} +5 -38
- package/dist/.setup/{room-info-BSvDbUmt.mjs → room-info-C13IUffQ.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-DtxDAM-x.mjs +3 -0
- package/dist/.setup/{sdk-BYR5_wri.mjs → sdk-DNW03GqJ.mjs} +47 -32
- package/dist/.setup/{secret-contract-AKnr45nw.mjs → secret-contract-DxyzKSzf.mjs} +3 -2
- package/dist/.setup/secret-contract-api-CiuSYjUy.mjs +3 -0
- package/dist/.setup/{send-BMe_VcxP.mjs → send-BGgwE5pV.mjs} +40 -24
- package/dist/.setup/{send-currentness-CAUVR-f3.mjs → send-currentness-C2rMVVIQ.mjs} +4 -2
- package/dist/.setup/{setup-bootstrap-Ch6r7Szn.mjs → setup-bootstrap-BCbltIf_.mjs} +5 -4
- package/dist/.setup/{setup-core-CRUekZa3.mjs → setup-core-Di6NtQ_J.mjs} +20 -13
- package/dist/.setup/setup-plugin-api-ORC_4yEA.mjs +3 -0
- package/dist/.setup/sqlite-state-LByPx4Yp.mjs +37 -0
- package/dist/.setup/{startup-verification-Cv_NoW_O.mjs → startup-verification-8xvGpdtK.mjs} +6 -4
- package/dist/.setup/{state-layout-walk-BqCZTHpp.mjs → state-layout-walk-BQMgMykU.mjs} +3 -2
- package/dist/.setup/{storage-B94yQdJy.mjs → storage-CN4dxdtV.mjs} +11 -8
- package/dist/.setup/{storage-paths-e_Vq6cvw.mjs → storage-paths-B51JM-pC.mjs} +2 -1
- package/dist/.setup/{subagent-hooks-CT-rdJmh.mjs → subagent-hooks-CSY4iwa_.mjs} +3 -2
- package/dist/.setup/{sync-cache-state-B-FayxeA.mjs → sync-cache-state-L1kwjhjj.mjs} +6 -4
- package/dist/.setup/{target-ids-DltG_ZHJ.mjs → target-ids-HhcaKX1n.mjs} +2 -1
- package/dist/.setup/{thread-binding-api-OtSciHmZ.mjs → thread-binding-api-BvuaKpd0.mjs} +3 -2
- package/dist/.setup/{thread-bindings-CB-jqrf4.mjs → thread-bindings-pNgPVdof.mjs} +10 -7
- package/dist/.setup/{thread-bindings-shared-FMu_szTm.mjs → thread-bindings-shared-CPjUA0Ib.mjs} +2 -1
- package/dist/.setup/{tool-actions-DjPJ6tpr.mjs → tool-actions-CFC7ZpIt.mjs} +23 -18
- package/dist/.setup/{url-validation-C77p4qT9.mjs → url-validation-CF6pG6eE.mjs} +2 -1
- package/dist/.setup/{verification-BqjyjLoq.mjs → verification-CuT5ZBDO.mjs} +5 -4
- package/dist/api.js +8 -8
- package/dist/auth-presence.js +3 -2
- package/dist/channel-plugin-api.js +2 -1
- package/dist/cli-metadata.js +2 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +18 -14
- package/dist/helper-api.js +3 -3
- package/dist/index.js +4 -3
- package/dist/plugin-entry.handlers.runtime.js +4 -3
- package/dist/runtime-api.js +8 -7
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +2 -1
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +2 -1
- package/dist/thread-bindings-runtime.js +2 -1
- package/package.json +4 -4
- package/dist/.setup/runtime-setter-api-CpwhcBQK.mjs +0 -2
- package/dist/.setup/secret-contract-api-DMSwMIxd.mjs +0 -2
- package/dist/.setup/setup-plugin-api-BZPY4Dt2.mjs +0 -2
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
2
|
-
import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
3
|
-
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-
|
|
4
|
-
import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-
|
|
5
|
-
import { n as resolveMatrixConfigPath, r as shouldStoreMatrixAccountAtTopLevel, t as resolveMatrixConfigFieldPath } from "./config-paths-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-CWsL5zIU.mjs";
|
|
3
|
+
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
4
|
+
import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-Dj7Hj87M.mjs";
|
|
5
|
+
import { n as resolveMatrixConfigPath, r as shouldStoreMatrixAccountAtTopLevel, t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { coerceSecretRef, hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
@@ -11,7 +11,7 @@ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, addWildcardAllowFrom, apply
|
|
|
11
11
|
import { resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
12
12
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$2, normalizeAccountId as normalizeAccountId$2 } from "openclaw/plugin-sdk/routing";
|
|
13
13
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
14
|
-
|
|
14
|
+
//#region extensions/matrix/src/matrix/accounts.ts
|
|
15
15
|
function clean(value) {
|
|
16
16
|
return normalizeOptionalString(value) ?? "";
|
|
17
17
|
}
|
|
@@ -142,7 +142,8 @@ async function resolveMatrixAccountAsync(params) {
|
|
|
142
142
|
configured: isMatrixAccountConfigured(prepared, stored)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region extensions/matrix/src/matrix/config-update.ts
|
|
146
147
|
var config_update_exports = /* @__PURE__ */ __exportAll({
|
|
147
148
|
resolveMatrixConfigFieldPath: () => resolveMatrixConfigFieldPath,
|
|
148
149
|
resolveMatrixConfigPath: () => resolveMatrixConfigPath,
|
|
@@ -236,7 +237,8 @@ function updateMatrixAccountConfig(cfg, accountId, patch) {
|
|
|
236
237
|
}
|
|
237
238
|
};
|
|
238
239
|
}
|
|
239
|
-
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region extensions/matrix/src/matrix/profile.ts
|
|
240
242
|
var profile_exports = /* @__PURE__ */ __exportAll({
|
|
241
243
|
isSupportedMatrixAvatarSource: () => isSupportedMatrixAvatarSource,
|
|
242
244
|
syncMatrixOwnProfile: () => syncMatrixOwnProfile
|
|
@@ -302,7 +304,8 @@ async function syncMatrixOwnProfile(params) {
|
|
|
302
304
|
...avatar
|
|
303
305
|
};
|
|
304
306
|
}
|
|
305
|
-
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region extensions/matrix/src/setup-contract.ts
|
|
306
309
|
const matrixSingleAccountKeysToMove = [
|
|
307
310
|
"homeserver",
|
|
308
311
|
"userId",
|
|
@@ -362,7 +365,8 @@ function resolveSingleAccountPromotionTarget(params) {
|
|
|
362
365
|
}
|
|
363
366
|
return DEFAULT_ACCOUNT_ID$2;
|
|
364
367
|
}
|
|
365
|
-
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region extensions/matrix/src/setup-config.ts
|
|
366
370
|
const channel$1 = "matrix";
|
|
367
371
|
const COMMON_SINGLE_ACCOUNT_KEYS_TO_MOVE = /* @__PURE__ */ new Set([
|
|
368
372
|
"name",
|
|
@@ -473,7 +477,8 @@ function applyMatrixSetupAccountConfig(params) {
|
|
|
473
477
|
initialSyncLimit: input.initialSyncLimit
|
|
474
478
|
});
|
|
475
479
|
}
|
|
476
|
-
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region extensions/matrix/src/setup-dm-policy.ts
|
|
477
482
|
function resolveMatrixSetupDmAllowFrom(policy, allowFrom) {
|
|
478
483
|
if (policy === "open") return addWildcardAllowFrom(allowFrom);
|
|
479
484
|
return normalizeAllowFromEntries(allowFrom ?? []).filter((entry) => entry !== "*");
|
|
@@ -514,7 +519,8 @@ function createMatrixSetupDmPolicy(promptAllowFrom) {
|
|
|
514
519
|
promptAllowFrom
|
|
515
520
|
});
|
|
516
521
|
}
|
|
517
|
-
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region extensions/matrix/src/setup-core.ts
|
|
518
524
|
const channel = "matrix";
|
|
519
525
|
function resolveMatrixSetupAccountId(params) {
|
|
520
526
|
return normalizeAccountId$1(params.accountId?.trim() || params.name?.trim() || DEFAULT_ACCOUNT_ID$1);
|
|
@@ -546,7 +552,7 @@ function createMatrixSetupWizardProxy(loadWizardModule) {
|
|
|
546
552
|
};
|
|
547
553
|
}
|
|
548
554
|
const finishMatrixSetupAfterConfigWrite = async ({ previousCfg, cfg, accountId, runtime }) => {
|
|
549
|
-
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-
|
|
555
|
+
const { runMatrixSetupBootstrapAfterConfigWrite } = await import("./setup-bootstrap-BCbltIf_.mjs");
|
|
550
556
|
await runMatrixSetupBootstrapAfterConfigWrite({
|
|
551
557
|
previousCfg,
|
|
552
558
|
cfg,
|
|
@@ -660,4 +666,5 @@ const matrixSetupContract = defineChannelSetupContract({
|
|
|
660
666
|
},
|
|
661
667
|
legacyAdapter: matrixSetupAdapter
|
|
662
668
|
});
|
|
669
|
+
//#endregion
|
|
663
670
|
export { resolveMatrixAccount as _, createMatrixSetupDmPolicy as a, resolveSingleAccountPromotionTarget as c, syncMatrixOwnProfile as d, config_update_exports as f, resolveDefaultMatrixAccountId as g, resolveConfiguredMatrixBotUserIds as h, matrixSetupContract as i, singleAccountKeysToMove as l, listMatrixAccountIds as m, finishMatrixSetupAfterConfigWrite as n, moveSingleMatrixAccountConfigToNamedAccount as o, updateMatrixAccountConfig as p, matrixSetupAdapter as r, namedAccountPromotionKeys as s, createMatrixSetupWizardProxy as t, profile_exports as u, resolveMatrixAccountAsync as v };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
//#region extensions/matrix/src/matrix/sqlite-state.ts
|
|
4
|
+
function resolveStateDirOverride(options) {
|
|
5
|
+
if (!options) return;
|
|
6
|
+
return options.stateDir || options.stateRootDir || getMatrixRuntime().state.resolveStateDir(options.env ?? process.env, os.homedir);
|
|
7
|
+
}
|
|
8
|
+
function resolveMatrixSqliteStateKey(options) {
|
|
9
|
+
return resolveStateDirOverride(options) ?? "";
|
|
10
|
+
}
|
|
11
|
+
function resolveMatrixSqliteStateEnv(options) {
|
|
12
|
+
const stateDir = resolveStateDirOverride(options);
|
|
13
|
+
if (!stateDir) return options?.env;
|
|
14
|
+
return {
|
|
15
|
+
...options?.env ?? process.env,
|
|
16
|
+
OPENCLAW_STATE_DIR: stateDir
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async function updateMatrixKeyedState(store, key, update, onUndefined = "keep") {
|
|
20
|
+
let observation = await store.observe(key);
|
|
21
|
+
for (;;) {
|
|
22
|
+
const value = update(observation.value);
|
|
23
|
+
if (value === void 0 && onUndefined === "skip") return false;
|
|
24
|
+
const result = await store.compareAndApply(key, observation.comparison, value === void 0 ? {
|
|
25
|
+
operation: "update",
|
|
26
|
+
action: "keep"
|
|
27
|
+
} : {
|
|
28
|
+
operation: "update",
|
|
29
|
+
action: "set",
|
|
30
|
+
value
|
|
31
|
+
});
|
|
32
|
+
if (result.status !== "conflict") return true;
|
|
33
|
+
observation = result.current;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { resolveMatrixSqliteStateKey as n, updateMatrixKeyedState as r, resolveMatrixSqliteStateEnv as t };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
+
import { r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
|
|
3
|
+
import { t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
|
|
4
|
+
import { o as resolveMatrixStoragePaths, r as recordCurrentStorageMetaDeviceId } from "./storage-CN4dxdtV.mjs";
|
|
4
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
6
|
import path from "node:path";
|
|
6
|
-
|
|
7
|
+
//#region extensions/matrix/src/matrix/monitor/startup-verification.ts
|
|
7
8
|
const STARTUP_VERIFICATION_STATE_FILENAME = "startup-verification.json";
|
|
8
9
|
const STARTUP_VERIFICATION_NAMESPACE = "startup-verification";
|
|
9
10
|
const STARTUP_VERIFICATION_MAX_ENTRIES = 1e3;
|
|
@@ -110,4 +111,5 @@ async function ensureMatrixStartupVerification(params) {
|
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
//#endregion
|
|
113
115
|
export { ensureMatrixStartupVerification };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as resolveMatrixStateLayoutChildDepth } from "./storage-paths-
|
|
1
|
+
import { c as resolveMatrixStateLayoutChildDepth } from "./storage-paths-B51JM-pC.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { hasNodeErrorCode } from "@openclaw/fs-safe/path";
|
|
4
4
|
import { walkDirectory } from "@openclaw/fs-safe/walk";
|
|
5
|
-
|
|
5
|
+
//#region extensions/matrix/src/matrix/state-layout-walk.ts
|
|
6
6
|
/** Traverse only shipped Matrix layouts; archives and unrelated descendants stay unopened. */
|
|
7
7
|
async function walkMatrixStateFiles(stateDir, includeFile, stateRootDepths = []) {
|
|
8
8
|
const matrixRoot = path.resolve(stateDir, "matrix");
|
|
@@ -23,4 +23,5 @@ async function walkMatrixStateFiles(stateDir, includeFile, stateRootDepths = [])
|
|
|
23
23
|
failedDirs: result.failedDirs.filter((failure) => failure.path !== matrixRoot || !hasNodeErrorCode(failure.error, "ENOENT"))
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
+
//#endregion
|
|
26
27
|
export { walkMatrixStateFiles as t };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
2
|
-
import { n as isMatrixActiveTokenRootDirectory, r as resolveMatrixAccountStorageRoot } from "./storage-paths-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
+
import { n as isMatrixActiveTokenRootDirectory, r as resolveMatrixAccountStorageRoot } from "./storage-paths-B51JM-pC.mjs";
|
|
3
|
+
import { i as assertMatrixSupportedStateRoot, r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
|
|
4
|
+
import { r as updateMatrixKeyedState, t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
|
|
5
|
+
import { n as MATRIX_RECOVERY_KEY_FILENAME, o as scoreMatrixCryptoStateInStore, t as MATRIX_IDB_SNAPSHOT_FILENAME } from "./crypto-state-store-DclM-fO5.mjs";
|
|
5
6
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
7
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import fs from "node:fs";
|
|
9
10
|
import os from "node:os";
|
|
10
|
-
|
|
11
|
+
//#region extensions/matrix/src/matrix/client/storage-metadata.ts
|
|
11
12
|
const STORAGE_META_NAMESPACE = "storage-meta";
|
|
12
13
|
const STORAGE_META_STATE_KEY = "current";
|
|
13
14
|
const STORAGE_META_MAX_ENTRIES = 10;
|
|
@@ -35,7 +36,8 @@ function normalizeMatrixStorageMetadata(value) {
|
|
|
35
36
|
if (value.currentTokenStateClaimed === true) metadata.currentTokenStateClaimed = true;
|
|
36
37
|
return Object.keys(metadata).length > 0 ? metadata : null;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region extensions/matrix/src/matrix/client/storage.ts
|
|
39
41
|
const DEFAULT_ACCOUNT_KEY = "default";
|
|
40
42
|
const STORAGE_META_FILENAME = "storage-meta.json";
|
|
41
43
|
function openStorageMetaStore(rootDir) {
|
|
@@ -182,8 +184,8 @@ async function maybeMigrateLegacyStorage({ storagePaths }) {
|
|
|
182
184
|
const { rootDir, storagePath } = storagePaths;
|
|
183
185
|
await assertMatrixSupportedStateRoot(rootDir);
|
|
184
186
|
if (!fs.existsSync(storagePath)) return;
|
|
185
|
-
const syncCache = await import("./sync-cache-state-
|
|
186
|
-
const { Utf8InputError } = await import("./runtime-doctor-migrations-
|
|
187
|
+
const syncCache = await import("./sync-cache-state-L1kwjhjj.mjs").then((n) => n.o);
|
|
188
|
+
const { Utf8InputError } = await import("./runtime-doctor-migrations-hxP-CXX7.mjs").then((n) => n.t);
|
|
187
189
|
const logger = getMatrixRuntime().logging.getChildLogger({ module: "matrix-storage" });
|
|
188
190
|
let persisted;
|
|
189
191
|
try {
|
|
@@ -282,4 +284,5 @@ async function repairCurrentTokenStorageMetaDeviceId(params) {
|
|
|
282
284
|
deviceId
|
|
283
285
|
});
|
|
284
286
|
}
|
|
287
|
+
//#endregion
|
|
285
288
|
export { resolveMatrixStateFilePath as a, repairCurrentTokenStorageMetaDeviceId as i, maybeMigrateLegacyStorage as n, resolveMatrixStoragePaths as o, recordCurrentStorageMetaDeviceId as r, writeStorageMeta as s, claimCurrentTokenStorageState as t };
|
|
@@ -2,7 +2,7 @@ import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/acco
|
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
|
|
5
|
+
//#region extensions/matrix/src/storage-paths.ts
|
|
6
6
|
const MATRIX_TOKEN_HASH_DIRECTORY_PATTERN = /^[a-f0-9]{16}$/u;
|
|
7
7
|
const MATRIX_SERVER_USER_DIRECTORY_PATTERN = /^.+__.+$/u;
|
|
8
8
|
function isMatrixActiveTokenRootDirectory(name) {
|
|
@@ -49,4 +49,5 @@ function resolveMatrixAccountStorageRoot(params) {
|
|
|
49
49
|
tokenHash
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
//#endregion
|
|
52
53
|
export { resolveMatrixCredentialsFilename as a, resolveMatrixStateLayoutChildDepth as c, resolveMatrixCredentialsDir as i, sanitizeMatrixPathSegment as l, isMatrixActiveTokenRootDirectory as n, resolveMatrixCredentialsPath as o, resolveMatrixAccountStorageRoot as r, resolveMatrixHomeserverKey as s, hashMatrixAccessToken as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, s as resolveBindingKey } from "./thread-bindings-shared-
|
|
1
|
+
import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, s as resolveBindingKey } from "./thread-bindings-shared-CPjUA0Ib.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
|
|
5
5
|
async function handleMatrixSubagentEnded(event) {
|
|
6
6
|
const accountId = normalizeOptionalString(event.accountId) || void 0;
|
|
7
7
|
const matching = (accountId ? listBindingsForAccount(accountId) : listAllBindings()).filter((entry) => entry.targetSessionKey === event.targetSessionKey && entry.targetKind === "subagent");
|
|
@@ -49,4 +49,5 @@ function handleMatrixSubagentDeliveryTarget(event) {
|
|
|
49
49
|
...threadId ? { threadId } : {}
|
|
50
50
|
} };
|
|
51
51
|
}
|
|
52
|
+
//#endregion
|
|
52
53
|
export { handleMatrixSubagentDeliveryTarget, handleMatrixSubagentEnded };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
2
|
-
import {
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { c as writeMatrixStateChunks, o as chunkMatrixStateJson, s as readMatrixStateChunks } from "./retired-state-C4UnLIg4.mjs";
|
|
3
|
+
import { t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
|
|
3
4
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
5
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import { asSafeIntegerInRange } from "openclaw/plugin-sdk/number-runtime";
|
|
7
8
|
import fs from "node:fs/promises";
|
|
8
9
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
9
|
-
|
|
10
|
+
//#region extensions/matrix/src/matrix/client/sync-cache-state.ts
|
|
10
11
|
var sync_cache_state_exports = /* @__PURE__ */ __exportAll({
|
|
11
12
|
MATRIX_SYNC_CACHE_VERSION: () => 1,
|
|
12
13
|
deleteMatrixSyncCacheStateFromStore: () => deleteMatrixSyncCacheStateFromStore,
|
|
@@ -129,7 +130,7 @@ function buildSyncCacheRows(payload) {
|
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
132
|
async function readLegacyMatrixSyncCacheState(storageRootDir) {
|
|
132
|
-
const { decodeUtf8Input, Utf8InputError } = await import("./runtime-doctor-migrations-
|
|
133
|
+
const { decodeUtf8Input, Utf8InputError } = await import("./runtime-doctor-migrations-hxP-CXX7.mjs").then((n) => n.t);
|
|
133
134
|
try {
|
|
134
135
|
const raw = decodeUtf8Input(await fs.readFile(resolveLegacySyncCachePath(storageRootDir)), "Legacy Matrix sync cache");
|
|
135
136
|
const persisted = normalizeLegacyPersistedStore(JSON.parse(raw));
|
|
@@ -163,4 +164,5 @@ async function deleteMatrixSyncCacheStateFromStore(params) {
|
|
|
163
164
|
await fs.rm(resolveLegacySyncCachePath(storageRootDir), { force: true }).catch(() => void 0);
|
|
164
165
|
});
|
|
165
166
|
}
|
|
167
|
+
//#endregion
|
|
166
168
|
export { readPersistedStoreFromStore as a, readLegacyMatrixSyncCacheState as i, hasMatrixSyncCacheStateInStore as n, sync_cache_state_exports as o, openMatrixSyncCacheStoreOptions as r, writeMatrixSyncCacheStateToStore as s, deleteMatrixSyncCacheStateFromStore as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/matrix/src/matrix/target-ids.ts
|
|
3
3
|
const MATRIX_PREFIX = "matrix:";
|
|
4
4
|
const ROOM_PREFIX = "room:";
|
|
5
5
|
const CHANNEL_PREFIX = "channel:";
|
|
@@ -97,4 +97,5 @@ function resolveMatrixDirectUserId(params) {
|
|
|
97
97
|
const userId = stripKnownPrefixes(params.from ?? "", [MATRIX_PREFIX, USER_PREFIX]);
|
|
98
98
|
return isMatrixQualifiedUserId(userId) ? userId : void 0;
|
|
99
99
|
}
|
|
100
|
+
//#endregion
|
|
100
101
|
export { normalizeMatrixResolvableTarget as a, normalizeMatrixMessagingTarget as i, isMatrixQualifiedUserId as n, resolveMatrixDirectUserId as o, isMatrixRoomId as r, resolveMatrixTargetIdentity as s, isMatrixInviteAutoJoinTarget as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as resolveMatrixTargetIdentity } from "./target-ids-
|
|
1
|
+
import { s as resolveMatrixTargetIdentity } from "./target-ids-HhcaKX1n.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/matrix/src/thread-binding-api.ts
|
|
4
4
|
const defaultTopLevelPlacement = "child";
|
|
5
5
|
function resolveMatrixInboundConversation(params) {
|
|
6
6
|
const rawTarget = params.to?.trim() || params.conversationId?.trim() || "";
|
|
@@ -13,4 +13,5 @@ function resolveMatrixInboundConversation(params) {
|
|
|
13
13
|
};
|
|
14
14
|
return parentConversationId ? { conversationId: parentConversationId } : null;
|
|
15
15
|
}
|
|
16
|
+
//#endregion
|
|
16
17
|
export { resolveMatrixInboundConversation as n, defaultTopLevelPlacement as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
2
|
-
import { a as listBindingsForAccount, c as setBindingRecord, d as setMatrixThreadBindingManagerEntry, m as toSessionBindingRecord, o as removeBindingRecord, r as getMatrixThreadBindingManagerEntry, s as resolveBindingKey, t as deleteMatrixThreadBindingManagerEntry } from "./thread-bindings-shared-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
+
import { a as listBindingsForAccount, c as setBindingRecord, d as setMatrixThreadBindingManagerEntry, m as toSessionBindingRecord, o as removeBindingRecord, r as getMatrixThreadBindingManagerEntry, s as resolveBindingKey, t as deleteMatrixThreadBindingManagerEntry } from "./thread-bindings-shared-CPjUA0Ib.mjs";
|
|
3
|
+
import { r as assertMatrixSupportedStateFile } from "./retired-state-C4UnLIg4.mjs";
|
|
4
|
+
import { n as resolveMatrixSqliteStateKey, t as resolveMatrixSqliteStateEnv } from "./sqlite-state-LByPx4Yp.mjs";
|
|
5
|
+
import { a as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-CN4dxdtV.mjs";
|
|
6
|
+
import { r as sendMessageMatrix } from "./send-BGgwE5pV.mjs";
|
|
6
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
8
|
import { createHash } from "node:crypto";
|
|
8
9
|
import path from "node:path";
|
|
@@ -11,7 +12,7 @@ import { registerSessionBindingAdapterV2, resolveThreadBindingFarewellText, reso
|
|
|
11
12
|
import { hasSqliteWorkerOutcomeUnknown } from "openclaw/plugin-sdk/sqlite-runtime";
|
|
12
13
|
import { resolveSessionAgentIdStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
13
14
|
import { resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/session-key-runtime";
|
|
14
|
-
|
|
15
|
+
//#region extensions/matrix/src/matrix/thread-bindings-session-adapter.ts
|
|
15
16
|
function sameBindingIncarnation(a, b) {
|
|
16
17
|
return resolveBindingKey(a) === resolveBindingKey(b) && a.boundAt === b.boundAt && a.targetSessionKey === b.targetSessionKey && a.targetKind === b.targetKind;
|
|
17
18
|
}
|
|
@@ -193,7 +194,8 @@ function createMatrixSessionBindingAdapter(params, { manager, defaults, committe
|
|
|
193
194
|
unbindRecords
|
|
194
195
|
};
|
|
195
196
|
}
|
|
196
|
-
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region extensions/matrix/src/matrix/thread-bindings.ts
|
|
197
199
|
const THREAD_BINDINGS_NAMESPACE = "thread-bindings";
|
|
198
200
|
const THREAD_BINDINGS_MAX_ENTRIES = 1e4;
|
|
199
201
|
const THREAD_BINDINGS_SWEEP_INTERVAL_MS = 6e4;
|
|
@@ -615,4 +617,5 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
615
617
|
});
|
|
616
618
|
return manager;
|
|
617
619
|
}
|
|
620
|
+
//#endregion
|
|
618
621
|
export { createMatrixThreadBindingManager as t };
|
package/dist/.setup/{thread-bindings-shared-FMu_szTm.mjs → thread-bindings-shared-CPjUA0Ib.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { projectThreadBindingRecord, resolveThreadBindingLifecycle, warnPluginSdkDeprecation } from "openclaw/plugin-sdk/thread-bindings-session-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/matrix/src/matrix/thread-bindings-shared.ts
|
|
3
3
|
const MANAGERS_BY_ACCOUNT_ID = /* @__PURE__ */ new Map();
|
|
4
4
|
const BINDINGS_BY_ACCOUNT_CONVERSATION = /* @__PURE__ */ new Map();
|
|
5
5
|
function resolveBindingKey(params) {
|
|
@@ -88,4 +88,5 @@ function createMatrixThreadBindingAsyncTimeoutSetter(update) {
|
|
|
88
88
|
}
|
|
89
89
|
const setMatrixThreadBindingIdleTimeoutBySessionKeyAsync = createMatrixThreadBindingAsyncTimeoutSetter((manager, params) => manager.setIdleTimeoutBySessionKeyAsync(params));
|
|
90
90
|
const setMatrixThreadBindingMaxAgeBySessionKeyAsync = createMatrixThreadBindingAsyncTimeoutSetter((manager, params) => manager.setMaxAgeBySessionKeyAsync(params));
|
|
91
|
+
//#endregion
|
|
91
92
|
export { listBindingsForAccount as a, setBindingRecord as c, setMatrixThreadBindingManagerEntry as d, setMatrixThreadBindingMaxAgeBySessionKey as f, listAllBindings as i, setMatrixThreadBindingIdleTimeoutBySessionKey as l, toSessionBindingRecord as m, getMatrixThreadBindingManager as n, removeBindingRecord as o, setMatrixThreadBindingMaxAgeBySessionKeyAsync as p, getMatrixThreadBindingManagerEntry as r, resolveBindingKey as s, deleteMatrixThreadBindingManagerEntry as t, setMatrixThreadBindingIdleTimeoutBySessionKeyAsync as u };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig } from "./account-config-
|
|
2
|
-
import { g as resolveDefaultMatrixAccountId } from "./setup-core-
|
|
3
|
-
import { o as resolveMatrixRoomConfig } from "./channel-
|
|
4
|
-
import { a as normalizeMatrixResolvableTarget } from "./target-ids-
|
|
5
|
-
import { l as selectOwnMatrixReactionEventIds, s as buildMatrixReactionRelationsPath, u as summarizeMatrixReactionEvents } from "./send-currentness-
|
|
6
|
-
import { c as isStrictDirectMembership, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-
|
|
7
|
-
import { C as resolveMatrixRoomId, n as reactMatrixMessage, p as buildPollResponseContent, r as sendMessageMatrix, v as isPollStartType, y as parsePollStart } from "./send-
|
|
8
|
-
import { i as parseMxc } from "./event-helpers-
|
|
9
|
-
import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as readMatrixMessages, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessage, s as EventType, t as deleteMatrixMessage } from "./messages-
|
|
10
|
-
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-
|
|
11
|
-
import { t as applyMatrixProfileUpdate } from "./profile-update-
|
|
12
|
-
import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-
|
|
13
|
-
import { n as getMatrixMemberInfo, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-
|
|
1
|
+
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
+
import { g as resolveDefaultMatrixAccountId } from "./setup-core-Di6NtQ_J.mjs";
|
|
3
|
+
import { o as resolveMatrixRoomConfig } from "./channel-BBvOdxTc.mjs";
|
|
4
|
+
import { a as normalizeMatrixResolvableTarget } from "./target-ids-HhcaKX1n.mjs";
|
|
5
|
+
import { l as selectOwnMatrixReactionEventIds, s as buildMatrixReactionRelationsPath, u as summarizeMatrixReactionEvents } from "./send-currentness-C2rMVVIQ.mjs";
|
|
6
|
+
import { c as isStrictDirectMembership, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-ZcjZgYEl.mjs";
|
|
7
|
+
import { C as resolveMatrixRoomId, n as reactMatrixMessage, p as buildPollResponseContent, r as sendMessageMatrix, v as isPollStartType, y as parsePollStart } from "./send-BGgwE5pV.mjs";
|
|
8
|
+
import { i as parseMxc } from "./event-helpers-CxNgMQqH.mjs";
|
|
9
|
+
import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as readMatrixMessages, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessage, s as EventType, t as deleteMatrixMessage } from "./messages-TuEa_BPZ.mjs";
|
|
10
|
+
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-Cxv-iMwp.mjs";
|
|
11
|
+
import { t as applyMatrixProfileUpdate } from "./profile-update-DiXSVBki.mjs";
|
|
12
|
+
import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-CuT5ZBDO.mjs";
|
|
13
|
+
import { n as getMatrixMemberInfo, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-C13IUffQ.mjs";
|
|
14
14
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
15
15
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeUniqueTrimmedStringList, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
16
|
import { ToolAuthorizationError, createActionGate, jsonResult, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
17
17
|
import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
18
18
|
import { captureChannelReadAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
19
19
|
import { resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
|
-
|
|
20
|
+
//#region extensions/matrix/src/matrix/actions/pins.ts
|
|
21
21
|
async function updateMatrixPins(roomId, opts, update) {
|
|
22
22
|
return await withResolvedRoomAction(roomId, opts, async (client, resolvedRoom) => {
|
|
23
23
|
const next = update(await readPinnedEvents(client, resolvedRoom));
|
|
@@ -41,7 +41,8 @@ async function listMatrixPins(roomId, opts = {}) {
|
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region extensions/matrix/src/matrix/actions/polls.ts
|
|
45
46
|
function normalizeOptionIndexes(indexes) {
|
|
46
47
|
const normalized = indexes.map((index) => Math.trunc(index)).filter((index) => Number.isFinite(index) && index > 0);
|
|
47
48
|
return uniqueValues(normalized);
|
|
@@ -90,7 +91,8 @@ async function voteMatrixPoll(roomId, pollId, opts = {}) {
|
|
|
90
91
|
};
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region extensions/matrix/src/matrix/actions/reactions.ts
|
|
94
96
|
async function listMatrixEmojis(roomId, opts = {}) {
|
|
95
97
|
return await withResolvedRoomAction(roomId, opts, async (client, resolvedRoom) => {
|
|
96
98
|
const [roomState, personalPack] = await Promise.all([client.doRequest("GET", `/_matrix/client/v3/rooms/${encodeURIComponent(resolvedRoom)}/state`), client.getAccountData("im.ponies.user_emotes")]);
|
|
@@ -150,7 +152,8 @@ async function removeMatrixReactions(roomId, messageId, opts = {}) {
|
|
|
150
152
|
return { removed: toRemove.length };
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region extensions/matrix/src/matrix/read-policy.ts
|
|
154
157
|
function normalizeRoomId(raw) {
|
|
155
158
|
return raw?.trim().replace(/^room:/i, "") ?? "";
|
|
156
159
|
}
|
|
@@ -282,7 +285,8 @@ async function withAuthorizedMatrixReadTarget(params) {
|
|
|
282
285
|
});
|
|
283
286
|
});
|
|
284
287
|
}
|
|
285
|
-
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region extensions/matrix/src/tool-actions.ts
|
|
286
290
|
const MATRIX_ACTION_DISABLED_MESSAGES = {
|
|
287
291
|
messages: "Matrix messages are disabled.",
|
|
288
292
|
reactions: "Matrix reactions are disabled.",
|
|
@@ -713,4 +717,5 @@ async function handleMatrixAction(ctx) {
|
|
|
713
717
|
}
|
|
714
718
|
throw new Error(`Action ${action} is not supported for provider matrix.`);
|
|
715
719
|
}
|
|
720
|
+
//#endregion
|
|
716
721
|
export { handleMatrixAction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertHttpUrlTargetsPrivateNetwork, isPrivateOrLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
2
|
-
|
|
2
|
+
//#region extensions/matrix/src/matrix/client/url-validation.ts
|
|
3
3
|
const MATRIX_HTTP_HOMESERVER_ERROR = "Matrix homeserver must use https:// unless it targets a private or loopback host";
|
|
4
4
|
function cleanString(value, requiredMessage) {
|
|
5
5
|
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
@@ -32,4 +32,5 @@ async function resolveValidatedMatrixHomeserverUrl(homeserver, opts) {
|
|
|
32
32
|
});
|
|
33
33
|
return normalized;
|
|
34
34
|
}
|
|
35
|
+
//#endregion
|
|
35
36
|
export { validateMatrixHomeserverUrl as n, resolveValidatedMatrixHomeserverUrl as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as __exportAll } from "./runtime-doctor-migrations-
|
|
2
|
-
import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-
|
|
3
|
-
import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-
|
|
1
|
+
import { n as __exportAll } from "./runtime-doctor-migrations-hxP-CXX7.mjs";
|
|
2
|
+
import { i as withStartedActionClient, n as withResolvedActionClient } from "./client-Cxv-iMwp.mjs";
|
|
3
|
+
import { n as formatMatrixEncryptionUnavailableError } from "./encryption-guidance-BLUoN4aV.mjs";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { setTimeout } from "node:timers/promises";
|
|
6
|
-
|
|
6
|
+
//#region extensions/matrix/src/matrix/actions/verification.ts
|
|
7
7
|
var verification_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
acceptMatrixVerification: () => acceptMatrixVerification,
|
|
9
9
|
bootstrapMatrixVerification: () => bootstrapMatrixVerification,
|
|
@@ -302,4 +302,5 @@ async function bootstrapMatrixVerification(opts = {}) {
|
|
|
302
302
|
forceResetCrossSigning: opts.forceResetCrossSigning === true
|
|
303
303
|
}));
|
|
304
304
|
}
|
|
305
|
+
//#endregion
|
|
305
306
|
export { scanMatrixVerificationQr as _, confirmMatrixVerificationSas as a, verifyMatrixRecoveryKey as b, getMatrixRoomKeyBackupStatus as c, listMatrixVerifications as d, mismatchMatrixVerificationSas as f, runMatrixSelfVerification as g, restoreMatrixRoomKeyBackup as h, confirmMatrixVerificationReciprocateQr as i, getMatrixVerificationSas as l, resetMatrixRoomKeyBackup as m, bootstrapMatrixVerification as n, generateMatrixVerificationQr as o, requestMatrixVerification as p, cancelMatrixVerification as r, getMatrixEncryptionStatus as s, acceptMatrixVerification as t, getMatrixVerificationStatus as u, startMatrixVerification as v, verification_exports as y };
|
package/dist/api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as resolveConfiguredMatrixAccountIds, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-
|
|
2
|
-
import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./.setup/env-vars-
|
|
3
|
-
import { a as resolveMatrixCredentialsFilename, i as resolveMatrixCredentialsDir, l as sanitizeMatrixPathSegment, o as resolveMatrixCredentialsPath, r as resolveMatrixAccountStorageRoot, s as resolveMatrixHomeserverKey, t as hashMatrixAccessToken } from "./.setup/storage-paths-
|
|
4
|
-
import { r as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./.setup/setup-core-
|
|
5
|
-
import { t as matrixPlugin } from "./.setup/channel-
|
|
6
|
-
import { f as setMatrixThreadBindingMaxAgeBySessionKey, l as setMatrixThreadBindingIdleTimeoutBySessionKey, n as getMatrixThreadBindingManager, p as setMatrixThreadBindingMaxAgeBySessionKeyAsync, u as setMatrixThreadBindingIdleTimeoutBySessionKeyAsync } from "./.setup/thread-bindings-shared-
|
|
7
|
-
import { t as matrixOnboardingAdapter } from "./.setup/onboarding-
|
|
8
|
-
import { t as createMatrixThreadBindingManager } from "./.setup/thread-bindings-
|
|
1
|
+
import { a as resolveConfiguredMatrixAccountIds, i as requiresExplicitMatrixDefaultAccount, n as findMatrixAccountEntry, o as resolveMatrixChannelConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./.setup/account-selection-CWsL5zIU.mjs";
|
|
2
|
+
import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./.setup/env-vars-aEBngJPa.mjs";
|
|
3
|
+
import { a as resolveMatrixCredentialsFilename, i as resolveMatrixCredentialsDir, l as sanitizeMatrixPathSegment, o as resolveMatrixCredentialsPath, r as resolveMatrixAccountStorageRoot, s as resolveMatrixHomeserverKey, t as hashMatrixAccessToken } from "./.setup/storage-paths-B51JM-pC.mjs";
|
|
4
|
+
import { r as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./.setup/setup-core-Di6NtQ_J.mjs";
|
|
5
|
+
import { t as matrixPlugin } from "./.setup/channel-BBvOdxTc.mjs";
|
|
6
|
+
import { f as setMatrixThreadBindingMaxAgeBySessionKey, l as setMatrixThreadBindingIdleTimeoutBySessionKey, n as getMatrixThreadBindingManager, p as setMatrixThreadBindingMaxAgeBySessionKeyAsync, u as setMatrixThreadBindingIdleTimeoutBySessionKeyAsync } from "./.setup/thread-bindings-shared-CPjUA0Ib.mjs";
|
|
7
|
+
import { t as matrixOnboardingAdapter } from "./.setup/onboarding-DOLEjkg2.mjs";
|
|
8
|
+
import { t as createMatrixThreadBindingManager } from "./.setup/thread-bindings-pNgPVdof.mjs";
|
|
9
9
|
export { createMatrixSetupWizardProxy, createMatrixThreadBindingManager, findMatrixAccountEntry, getMatrixScopedEnvVarNames, getMatrixThreadBindingManager, hashMatrixAccessToken, listMatrixEnvAccountIds, matrixOnboardingAdapter, matrixOnboardingAdapter as matrixSetupWizard, matrixPlugin, matrixSetupAdapter, requiresExplicitMatrixDefaultAccount, resolveConfiguredMatrixAccountIds, resolveMatrixAccountStorageRoot, resolveMatrixChannelConfig, resolveMatrixCredentialsDir, resolveMatrixCredentialsFilename, resolveMatrixCredentialsPath, resolveMatrixDefaultOrOnlyAccountId, resolveMatrixEnvAccountToken, resolveMatrixHomeserverKey, sanitizeMatrixPathSegment, setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingIdleTimeoutBySessionKeyAsync, setMatrixThreadBindingMaxAgeBySessionKey, setMatrixThreadBindingMaxAgeBySessionKeyAsync };
|
package/dist/auth-presence.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as normalizeMatrixStoredCredentials, t as MATRIX_CREDENTIALS_NAMESPACE } from "./.setup/credentials-state-
|
|
1
|
+
import { i as normalizeMatrixStoredCredentials, t as MATRIX_CREDENTIALS_NAMESPACE } from "./.setup/credentials-state-B3cuUFwZ.mjs";
|
|
2
2
|
import { createPluginStateKeyedStore, createPluginStateSyncKeyedStore } from "openclaw/plugin-sdk/plugin-state-store-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/matrix/auth-presence.ts
|
|
4
4
|
/** @deprecated Use hasAnyMatrixAuthAsync. Final compatibility day: 2026-12-31. */
|
|
5
5
|
function hasAnyMatrixAuth(params, env = process.env) {
|
|
6
6
|
const resolvedEnv = params && typeof params === "object" && "cfg" in params ? params.env ?? env : env;
|
|
@@ -28,4 +28,5 @@ async function hasAnyMatrixAuthAsync(params, env = process.env) {
|
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
//#endregion
|
|
31
32
|
export { hasAnyMatrixAuth, hasAnyMatrixAuthAsync };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as matrixPlugin } from "./.setup/channel-BBvOdxTc.mjs";
|
|
2
|
+
export { matrixPlugin };
|
package/dist/cli-metadata.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./.setup/cli-metadata-C60BW1oa.mjs";
|
|
2
|
+
export { cli_metadata_default as default, registerMatrixCliMetadata };
|
package/dist/contract-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as resolveSingleAccountPromotionTarget, l as singleAccountKeysToMove, r as matrixSetupAdapter, s as namedAccountPromotionKeys } from "./.setup/setup-core-
|
|
2
|
-
import { t as matrixOnboardingAdapter } from "./.setup/onboarding-
|
|
1
|
+
import { c as resolveSingleAccountPromotionTarget, l as singleAccountKeysToMove, r as matrixSetupAdapter, s as namedAccountPromotionKeys } from "./.setup/setup-core-Di6NtQ_J.mjs";
|
|
2
|
+
import { t as matrixOnboardingAdapter } from "./.setup/onboarding-DOLEjkg2.mjs";
|
|
3
3
|
export { matrixSetupAdapter, matrixOnboardingAdapter as matrixSetupWizard, namedAccountPromotionKeys, resolveSingleAccountPromotionTarget, singleAccountKeysToMove };
|