@openclaw/matrix 2026.7.2-beta.1 → 2026.7.2-beta.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/{account-selection-Bz00QTmQ.js → account-selection-kqquRzCf.js} +5 -5
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime--Ei44Vo2.js → approval-handler.runtime-BEa98wwG.js} +5 -5
- package/dist/{approval-ids-C_2kSMdJ.js → approval-ids-Dfn7oQAm.js} +1 -1
- package/dist/{approval-reaction-auth-TdVPcgxP.js → approval-reaction-auth-kXkCJBGi.js} +2 -2
- package/dist/{approval-reactions-BgU51JGd.js → approval-reactions-D-BxBK_L.js} +1 -1
- package/dist/auth-presence.js +13 -21
- package/dist/{channel-CxqDh7mS.js → channel-j331Xd7b.js} +14 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-wNfJc57I.js → channel.runtime-BIwlVfQw.js} +15 -16
- package/dist/{cli-o00oTJhx.js → cli-0EcKfqFw.js} +25 -15
- package/dist/{cli-metadata-Gf3HSJ2c.js → cli-metadata-Xq1Xb15R.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-ClHisZbf.js → client-BtG4quUl.js} +2 -2
- package/dist/{client-DP0nmFxK.js → client-CA0PULls.js} +2 -2
- package/dist/{client-bootstrap-PqYOS-mO.js → client-bootstrap-Dk5EAn3n.js} +1 -1
- package/dist/{config-schema-CG9goLWp.js → config-schema-B5GRV8wL.js} +8 -10
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-D9z9RjCM.js → create-client-WQExaby_.js} +4 -4
- package/dist/credentials-W2EmwRhu.js +65 -0
- package/dist/credentials-read-DVmFCm7X.js +77 -0
- package/dist/{credentials-write.runtime-J_EUt5WP.js → credentials-write.runtime-Be9zNSUw.js} +1 -1
- package/dist/{crypto-runtime-BHcxauC4.js → crypto-runtime-CAff-n15.js} +4 -4
- package/dist/{directory-live-DPy2aaPF.js → directory-live-DiC-0XBC.js} +3 -3
- package/dist/{doctor-BGTs609f.js → doctor-DwUVm5Lw.js} +1 -1
- package/dist/{doctor-contract-D2qTLe-C.js → doctor-contract-BA2Y6Crx.js} +1 -1
- package/dist/doctor-contract-api.js +117 -11
- package/dist/{draft-stream-De7uikGn.js → draft-stream-CTLKtJJ0.js} +1 -1
- package/dist/{encryption-guidance-BFfgq7c7.js → encryption-guidance-CbEFe38F.js} +1 -1
- package/dist/{file-sync-store-Cxb0ckyX.js → file-sync-store-CPkgnSXp.js} +23 -6
- package/dist/helper-api.js +2 -2
- package/dist/{http-client-W4TJQM6r.js → http-client-BmrgOZTL.js} +2 -2
- package/dist/{idb-persistence-iUZoHZkp.js → idb-persistence-Dyy6ipgU.js} +3 -3
- package/dist/{inbound-dedupe-DcMs0YXL.js → inbound-dedupe-CaBLblef.js} +19 -38
- package/dist/index.js +1 -1
- package/dist/{logger-BMClpI5b.js → logger-D0GCSDQq.js} +1 -1
- package/dist/{logging-CFJrbDAN.js → logging-QH-48Gr6.js} +1 -1
- package/dist/{media-text-DWaotsZB.js → media-text-BMXEXb1j.js} +1 -1
- package/dist/{messages-Dm3K4ZvM.js → messages-3UBHfZrN.js} +3 -3
- package/dist/{monitor-C_kgPPeV.js → monitor-BtUIds8T.js} +135 -136
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-sBV-Govx.js +3 -0
- package/dist/{profile-update-iUHCoks3.js → profile-update-Bh2XtJwN.js} +3 -3
- package/dist/{reaction-events-0tubdHRM.js → reaction-events-BwAKtUyQ.js} +3 -3
- package/dist/record-shared-CWWx6fvI.js +2 -0
- package/dist/{recovery-key-store-Bx0zTJcB.js → recovery-key-store-CW6eePfp.js} +2 -2
- package/dist/{resolve-targets-DlLrfWDy.js → resolve-targets-DVoj-YxB.js} +1 -1
- package/dist/{resolver.runtime-MeaT1zXx.js → resolver.runtime-CC0VVsAt.js} +1 -1
- package/dist/{runtime-CveSqMOP.js → runtime-6S3DNFNv.js} +1 -1
- package/dist/runtime-api.js +6 -6
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{sdk-CI8E2TKg.js → sdk-CIDZXWpZ.js} +7 -7
- package/dist/{secret-contract-OZoQf0kI.js → secret-contract-M3hRmGO-.js} +21 -5
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-C7xuGWpv.js → send-BJbrdmNm.js} +4 -3
- package/dist/session-binding-contract-api.js +2 -2
- package/dist/{setup-bootstrap-CCsexWTZ.js → setup-bootstrap-DGPOOdz-.js} +2 -2
- package/dist/{setup-core-DlmTyIP0.js → setup-core-XCdAx1nY.js} +3 -3
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-2SS94JV0.js → setup-surface-CzUiTe_k.js} +6 -6
- package/dist/{shared-DgvN5rBx.js → shared-DquM1oz6.js} +7 -7
- package/dist/{startup-verification-CbIyF7z1.js → startup-verification-CA00kebL.js} +3 -3
- package/dist/{storage-BtSOar8T.js → storage-CzHxeF5E.js} +9 -9
- package/dist/{thread-bindings-BI8MHWp9.js → thread-bindings-Cw194yEn.js} +4 -4
- package/dist/{tool-actions.runtime-CnyhVPoY.js → tool-actions.runtime-C0jgWYhX.js} +19 -15
- package/dist/{verification-DLSe3sP7.js → verification-DjxyWTNP.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +70 -70
- package/package.json +4 -4
- package/dist/async-lock-BcLS4KOc.js +0 -19
- package/dist/credentials-DnhsLAuR.js +0 -56
- package/dist/credentials-read-BtS-HRT5.js +0 -112
- package/dist/probe.runtime-Dry8PTWC.js +0 -3
- package/dist/record-shared-CvzjvHRn.js +0 -2
- package/dist/{deps-DDbghaZH.js → deps-CcVJfvRM.js} +1 -1
- package/dist/{storage-paths-B4_I9iqO.js → storage-paths-gUmSydsW.js} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as listMatrixEnvAccountIds, t as getMatrixScopedEnvVarNames } from "./env-vars-B0NxQnPk.js";
|
|
2
|
-
import { t as isRecord } from "./record-shared-
|
|
2
|
+
import { t as isRecord$1 } from "./record-shared-CWWx6fvI.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { listCombinedAccountIds, listConfiguredAccountIds, resolveListedDefaultAccountId, resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-core";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -102,20 +102,20 @@ function hasConfiguredDefaultMatrixAccountSource(params) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
function resolveMatrixChannelConfig(cfg) {
|
|
105
|
-
return isRecord(cfg.channels?.matrix) ? cfg.channels.matrix : null;
|
|
105
|
+
return isRecord$1(cfg.channels?.matrix) ? cfg.channels.matrix : null;
|
|
106
106
|
}
|
|
107
107
|
function findMatrixAccountEntry(cfg, accountId) {
|
|
108
108
|
const channel = resolveMatrixChannelConfig(cfg);
|
|
109
109
|
if (!channel) return null;
|
|
110
|
-
const accounts = isRecord(channel.accounts) ? channel.accounts : null;
|
|
110
|
+
const accounts = isRecord$1(channel.accounts) ? channel.accounts : null;
|
|
111
111
|
if (!accounts) return null;
|
|
112
112
|
const entry = resolveNormalizedAccountEntry(accounts, accountId, normalizeAccountId);
|
|
113
|
-
return isRecord(entry) ? entry : null;
|
|
113
|
+
return isRecord$1(entry) ? entry : null;
|
|
114
114
|
}
|
|
115
115
|
function resolveConfiguredMatrixAccountIds(cfg, env = process.env) {
|
|
116
116
|
const channel = resolveMatrixChannelConfig(cfg);
|
|
117
117
|
const configuredAccountIds = listConfiguredAccountIds({
|
|
118
|
-
accounts: channel && isRecord(channel.accounts) ? channel.accounts : void 0,
|
|
118
|
+
accounts: channel && isRecord$1(channel.accounts) ? channel.accounts : void 0,
|
|
119
119
|
normalizeAccountId
|
|
120
120
|
});
|
|
121
121
|
if (hasConfiguredDefaultMatrixAccountSource({
|
package/dist/api.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-
|
|
1
|
+
import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-kqquRzCf.js";
|
|
2
2
|
import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-B0NxQnPk.js";
|
|
3
|
-
import { a as resolveMatrixCredentialsPath, i as resolveMatrixCredentialsFilename, n as resolveMatrixAccountStorageRoot, o as resolveMatrixHomeserverKey, r as resolveMatrixCredentialsDir, s as sanitizeMatrixPathSegment, t as hashMatrixAccessToken } from "./storage-paths-
|
|
4
|
-
import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-
|
|
5
|
-
import { t as matrixPlugin } from "./channel-
|
|
3
|
+
import { a as resolveMatrixCredentialsPath, i as resolveMatrixCredentialsFilename, n as resolveMatrixAccountStorageRoot, o as resolveMatrixHomeserverKey, r as resolveMatrixCredentialsDir, s as sanitizeMatrixPathSegment, t as hashMatrixAccessToken } from "./storage-paths-gUmSydsW.js";
|
|
4
|
+
import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-XCdAx1nY.js";
|
|
5
|
+
import { t as matrixPlugin } from "./channel-j331Xd7b.js";
|
|
6
6
|
import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, n as getMatrixThreadBindingManager, p as setMatrixThreadBindingMaxAgeBySessionKey, s as resetMatrixThreadBindingsForTests } from "./thread-bindings-shared-CKnY4LSd.js";
|
|
7
|
-
import { n as matrixOnboardingAdapter } from "./setup-surface-
|
|
8
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-
|
|
7
|
+
import { n as matrixOnboardingAdapter } from "./setup-surface-CzUiTe_k.js";
|
|
8
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-Cw194yEn.js";
|
|
9
9
|
//#region extensions/matrix/api.ts
|
|
10
10
|
const matrixSessionBindingAdapterChannels = ["matrix"];
|
|
11
11
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as resolveMatrixAccount } from "./setup-core-
|
|
2
|
-
import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-
|
|
1
|
+
import { g as resolveMatrixAccount } from "./setup-core-XCdAx1nY.js";
|
|
2
|
+
import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-j331Xd7b.js";
|
|
3
3
|
import { a as resolveMatrixTargetIdentity } from "./target-ids-B-5aQxwn.js";
|
|
4
|
-
import { a as sendMessageMatrix, i as reactMatrixMessage, p as repairMatrixDirectRooms, s as sendSingleTextMessageMatrix } from "./send-
|
|
5
|
-
import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-
|
|
6
|
-
import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-
|
|
4
|
+
import { a as sendMessageMatrix, i as reactMatrixMessage, p as repairMatrixDirectRooms, s as sendSingleTextMessageMatrix } from "./send-BJbrdmNm.js";
|
|
5
|
+
import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-D-BxBK_L.js";
|
|
6
|
+
import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-3UBHfZrN.js";
|
|
7
7
|
import { listMessageReceiptPlatformIds, resolveMessageReceiptPrimaryId } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
8
|
import { normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as normalizeMatrixUserId } from "./config-schema-
|
|
1
|
+
import { a as normalizeMatrixUserId } from "./config-schema-B5GRV8wL.js";
|
|
2
2
|
//#region extensions/matrix/src/approval-ids.ts
|
|
3
3
|
function normalizeMatrixApproverId(value) {
|
|
4
4
|
return normalizeMatrixUserId(String(value)) || void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as resolveMatrixAccount } from "./setup-core-
|
|
2
|
-
import { t as normalizeMatrixApproverId } from "./approval-ids-
|
|
1
|
+
import { g as resolveMatrixAccount } from "./setup-core-XCdAx1nY.js";
|
|
2
|
+
import { t as normalizeMatrixApproverId } from "./approval-ids-Dfn7oQAm.js";
|
|
3
3
|
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
4
4
|
//#region extensions/matrix/src/approval-reaction-auth.ts
|
|
5
5
|
function normalizeMatrixExecApproverId(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getOptionalMatrixRuntime } from "./runtime-
|
|
1
|
+
import { n as getOptionalMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
2
2
|
import { normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/routing";
|
|
3
3
|
import { createApprovalReactionTargetStore } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
4
4
|
//#region extensions/matrix/src/approval-reactions.ts
|
package/dist/auth-presence.js
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
1
|
+
import { c as normalizeMatrixStoredCredentials, t as MATRIX_CREDENTIALS_NAMESPACE } from "./credentials-read-DVmFCm7X.js";
|
|
2
|
+
import { createPluginStateSyncKeyedStore } from "openclaw/plugin-sdk/runtime-doctor";
|
|
6
3
|
//#region extensions/matrix/auth-presence.ts
|
|
7
|
-
function listMatrixCredentialPaths(_cfg, env = process.env) {
|
|
8
|
-
const credentialsDir = resolveMatrixCredentialsDir(resolveStateDir(env, os.homedir));
|
|
9
|
-
const paths = /* @__PURE__ */ new Set([resolveMatrixCredentialsFilename(), resolveMatrixCredentialsFilename("default")]);
|
|
10
|
-
try {
|
|
11
|
-
const entries = fs.readdirSync(credentialsDir, { withFileTypes: true });
|
|
12
|
-
for (const entry of entries) if (entry.isFile() && /^credentials(?:-[a-z0-9._-]+)?\.json$/i.test(entry.name)) paths.add(entry.name);
|
|
13
|
-
} catch {}
|
|
14
|
-
return [...paths].map((filename) => path.join(credentialsDir, filename));
|
|
15
|
-
}
|
|
16
4
|
function hasAnyMatrixAuth(params, env = process.env) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
const resolvedEnv = params && typeof params === "object" && "cfg" in params ? params.env ?? env : env;
|
|
6
|
+
try {
|
|
7
|
+
return createPluginStateSyncKeyedStore("matrix", {
|
|
8
|
+
namespace: MATRIX_CREDENTIALS_NAMESPACE,
|
|
9
|
+
maxEntries: 256,
|
|
10
|
+
overflowPolicy: "reject-new",
|
|
11
|
+
env: resolvedEnv
|
|
12
|
+
}).entries().some((entry) => normalizeMatrixStoredCredentials(entry.value) !== null);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
24
16
|
}
|
|
25
17
|
//#endregion
|
|
26
18
|
export { hasAnyMatrixAuth };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-
|
|
1
|
+
import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-kqquRzCf.js";
|
|
2
2
|
import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
|
|
3
|
-
import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, n as matrixSetupAdapter, p as listMatrixAccountIds, t as createMatrixSetupWizardProxy, u as namedAccountPromotionKeys } from "./setup-core-
|
|
4
|
-
import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-
|
|
5
|
-
import { t as normalizeMatrixApproverId } from "./approval-ids-
|
|
3
|
+
import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, n as matrixSetupAdapter, p as listMatrixAccountIds, t as createMatrixSetupWizardProxy, u as namedAccountPromotionKeys } from "./setup-core-XCdAx1nY.js";
|
|
4
|
+
import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-B5GRV8wL.js";
|
|
5
|
+
import { t as normalizeMatrixApproverId } from "./approval-ids-Dfn7oQAm.js";
|
|
6
6
|
import { a as resolveMatrixTargetIdentity, i as resolveMatrixDirectUserId, n as normalizeMatrixMessagingTarget, r as normalizeMatrixResolvableTarget, t as isMatrixQualifiedUserId } from "./target-ids-B-5aQxwn.js";
|
|
7
7
|
import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
|
|
8
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
8
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BA2Y6Crx.js";
|
|
9
9
|
import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKey } from "./thread-bindings-shared-CKnY4LSd.js";
|
|
10
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
10
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-M3hRmGO-.js";
|
|
11
11
|
import { n as resolveMatrixInboundConversation, t as defaultTopLevelPlacement } from "./thread-binding-api-DRbBZlhS.js";
|
|
12
12
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
13
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
@@ -127,7 +127,7 @@ const matrixMessageActions = {
|
|
|
127
127
|
return extractToolSend(args, "sendMessage");
|
|
128
128
|
},
|
|
129
129
|
handleAction: async (ctx) => {
|
|
130
|
-
const { handleMatrixAction } = await import("./tool-actions.runtime-
|
|
130
|
+
const { handleMatrixAction } = await import("./tool-actions.runtime-C0jgWYhX.js");
|
|
131
131
|
const { action, params, cfg, accountId, mediaLocalRoots } = ctx;
|
|
132
132
|
const dispatch = async (actionParams) => await handleMatrixAction({
|
|
133
133
|
...actionParams,
|
|
@@ -601,7 +601,7 @@ const matrixNativeApprovalCapability = createApproverRestrictedNativeApprovalCap
|
|
|
601
601
|
approvalKind,
|
|
602
602
|
request
|
|
603
603
|
}),
|
|
604
|
-
load: async () => (await import("./approval-handler.runtime
|
|
604
|
+
load: async () => (await import("./approval-handler.runtime-BEa98wwG.js")).matrixApprovalNativeRuntime
|
|
605
605
|
})
|
|
606
606
|
});
|
|
607
607
|
const splitMatrixApprovalCapability = splitChannelApprovalCapability(matrixNativeApprovalCapability);
|
|
@@ -780,7 +780,7 @@ function resolveMatrixGroupToolPolicy(params) {
|
|
|
780
780
|
}
|
|
781
781
|
//#endregion
|
|
782
782
|
//#region extensions/matrix/src/resolver.ts
|
|
783
|
-
const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-
|
|
783
|
+
const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-CC0VVsAt.js"), "matrixResolverRuntime");
|
|
784
784
|
const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs, kind, runtime }) => (await loadMatrixChannelRuntime$1()).resolveMatrixTargets({
|
|
785
785
|
cfg,
|
|
786
786
|
accountId,
|
|
@@ -906,9 +906,9 @@ function resolveMatrixOutboundSessionRoute(params) {
|
|
|
906
906
|
//#endregion
|
|
907
907
|
//#region extensions/matrix/src/channel.ts
|
|
908
908
|
let matrixStartupLock = Promise.resolve();
|
|
909
|
-
const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-
|
|
910
|
-
const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
911
|
-
const loadMatrixDoctorModule = createLazyRuntimeModule(() => import("./doctor-
|
|
909
|
+
const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-CzUiTe_k.js").then((n) => n.t), "matrixSetupWizard");
|
|
910
|
+
const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BIwlVfQw.js"), "matrixChannelRuntime");
|
|
911
|
+
const loadMatrixDoctorModule = createLazyRuntimeModule(() => import("./doctor-DwUVm5Lw.js"));
|
|
912
912
|
const meta = {
|
|
913
913
|
id: "matrix",
|
|
914
914
|
label: "Matrix",
|
|
@@ -1176,6 +1176,7 @@ const matrixPlugin = createChatChannelPlugin({
|
|
|
1176
1176
|
messaging: {
|
|
1177
1177
|
defaultMarkdownTableMode: "bullets",
|
|
1178
1178
|
targetPrefixes: ["matrix"],
|
|
1179
|
+
targetIdComparison: "case-sensitive",
|
|
1179
1180
|
normalizeTarget: normalizeMatrixMessagingTarget,
|
|
1180
1181
|
resolveInboundConversation: ({ to, conversationId, threadId }) => resolveMatrixInboundConversation({
|
|
1181
1182
|
to,
|
|
@@ -1280,7 +1281,7 @@ const matrixPlugin = createChatChannelPlugin({
|
|
|
1280
1281
|
await previousLock;
|
|
1281
1282
|
let monitorMatrixProvider;
|
|
1282
1283
|
try {
|
|
1283
|
-
monitorMatrixProvider = (await import("./monitor-
|
|
1284
|
+
monitorMatrixProvider = (await import("./monitor-BtUIds8T.js")).monitorMatrixProvider;
|
|
1284
1285
|
} finally {
|
|
1285
1286
|
releaseLock();
|
|
1286
1287
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as matrixPlugin } from "./channel-
|
|
1
|
+
import { t as matrixPlugin } from "./channel-j331Xd7b.js";
|
|
2
2
|
export { matrixPlugin };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-
|
|
1
|
+
import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-BJbrdmNm.js";
|
|
2
2
|
import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
|
|
3
|
-
import { f as resolveMatrixAuth } from "./shared-
|
|
4
|
-
import "./client-
|
|
5
|
-
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { f as resolveMatrixAuth } from "./shared-DquM1oz6.js";
|
|
4
|
+
import "./client-CA0PULls.js";
|
|
5
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DiC-0XBC.js";
|
|
6
6
|
import { p as resolveOutboundSendDep, r as chunkTextForOutbound } from "./runtime-api-D1xI_cvh.js";
|
|
7
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
7
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-DVoj-YxB.js";
|
|
8
8
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { createReplyToFanout } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
10
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
12
|
import { renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
13
|
-
import { resolvePayloadMediaUrls } from "openclaw/plugin-sdk/reply-payload";
|
|
13
|
+
import { resolvePayloadMediaUrls, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
|
|
14
14
|
//#region extensions/matrix/src/matrix/probe.ts
|
|
15
|
-
const loadMatrixProbeRuntimeDeps = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
15
|
+
const loadMatrixProbeRuntimeDeps = createLazyRuntimeModule(() => import("./probe.runtime-sBV-Govx.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient })));
|
|
16
16
|
async function probeMatrix(params) {
|
|
17
17
|
const started = Date.now();
|
|
18
18
|
const result = {
|
|
@@ -160,12 +160,12 @@ const matrixChannelRuntime = {
|
|
|
160
160
|
const urls = resolvePayloadMediaUrls(payload);
|
|
161
161
|
const payloadText = resolveMatrixPayloadText(payload);
|
|
162
162
|
if (urls.length > 0) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
const lastResult = await sendPayloadMediaSequence({
|
|
164
|
+
text: payloadText,
|
|
165
|
+
mediaUrls: urls,
|
|
166
|
+
send: async ({ text, mediaUrl, isFirst }) => await send(to, text, {
|
|
167
167
|
cfg,
|
|
168
|
-
mediaUrl
|
|
168
|
+
mediaUrl,
|
|
169
169
|
mediaAccess,
|
|
170
170
|
mediaLocalRoots,
|
|
171
171
|
mediaReadFile,
|
|
@@ -175,9 +175,9 @@ const matrixChannelRuntime = {
|
|
|
175
175
|
audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
|
|
176
176
|
extraContent: isFirst ? resolveMatrixExtraContent(payload) : void 0,
|
|
177
177
|
onDeliveryResult: resolveMatrixDeliveryProgress(onDeliveryResult)
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
if (lastResult !== void 0) return {
|
|
181
181
|
channel: "matrix",
|
|
182
182
|
messageId: lastResult.messageId,
|
|
183
183
|
roomId: lastResult.roomId
|
|
@@ -185,7 +185,6 @@ const matrixChannelRuntime = {
|
|
|
185
185
|
}
|
|
186
186
|
const result = await send(to, payloadText, {
|
|
187
187
|
cfg,
|
|
188
|
-
mediaUrl: payload.mediaUrl,
|
|
189
188
|
mediaAccess,
|
|
190
189
|
mediaLocalRoots,
|
|
191
190
|
mediaReadFile,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
|
|
2
|
-
import { t as getMatrixRuntime } from "./runtime-
|
|
3
|
-
import { c as resolveMatrixConfigPath, g as resolveMatrixAccount, l as updateMatrixAccountConfig, n as matrixSetupAdapter } from "./setup-core-
|
|
2
|
+
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
3
|
+
import { c as resolveMatrixConfigPath, g as resolveMatrixAccount, l as updateMatrixAccountConfig, n as matrixSetupAdapter } from "./setup-core-XCdAx1nY.js";
|
|
4
4
|
import { t as formatMatrixErrorMessage } from "./errors-C47hvAF8.js";
|
|
5
|
-
import { n as withResolvedActionClient } from "./client-
|
|
6
|
-
import { p as resolveMatrixAuthContext } from "./shared-
|
|
7
|
-
import "./client-
|
|
5
|
+
import { n as withResolvedActionClient } from "./client-BtG4quUl.js";
|
|
6
|
+
import { p as resolveMatrixAuthContext } from "./shared-DquM1oz6.js";
|
|
7
|
+
import "./client-CA0PULls.js";
|
|
8
8
|
import { a as formatZonedTimestamp } from "./runtime-api-D1xI_cvh.js";
|
|
9
9
|
import { isOpenClawManagedMatrixDevice, summarizeMatrixDeviceHealth } from "./device-health-D4LBxuPq.js";
|
|
10
|
-
import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-
|
|
11
|
-
import { a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, g as runMatrixSelfVerification, h as restoreMatrixRoomKeyBackup, l as getMatrixVerificationSas, m as resetMatrixRoomKeyBackup, n as bootstrapMatrixVerification, p as requestMatrixVerification, r as cancelMatrixVerification, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-
|
|
10
|
+
import { n as updateMatrixOwnProfile, t as applyMatrixProfileUpdate } from "./profile-update-Bh2XtJwN.js";
|
|
11
|
+
import { a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, g as runMatrixSelfVerification, h as restoreMatrixRoomKeyBackup, l as getMatrixVerificationSas, m as resetMatrixRoomKeyBackup, n as bootstrapMatrixVerification, p as requestMatrixVerification, r as cancelMatrixVerification, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-DjxyWTNP.js";
|
|
12
12
|
import { t as resolveMatrixRoomKeyBackupIssue } from "./backup-health-Dm_YMVFT.js";
|
|
13
|
-
import { setMatrixSdkConsoleLogging, setMatrixSdkLogMode } from "./logging-
|
|
13
|
+
import { setMatrixSdkConsoleLogging, setMatrixSdkLogMode } from "./logging-QH-48Gr6.js";
|
|
14
14
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
15
15
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
16
16
|
import { parseStrictInteger, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -36,8 +36,9 @@ async function pruneMatrixStaleGatewayDevices(opts = {}) {
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region extensions/matrix/src/cli.ts
|
|
38
38
|
let matrixCliExitScheduled = false;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
39
|
+
const MATRIX_CLI_RECOVERY_KEY_STDIN_MAX_BYTES = 1024 * 1024;
|
|
40
|
+
const loadMatrixActionClientModule = createLazyRuntimeModule(() => import("./client-BtG4quUl.js").then((n) => n.t));
|
|
41
|
+
const loadMatrixDirectManagementModule = createLazyRuntimeModule(() => import("./send-BJbrdmNm.js").then((n) => n.d));
|
|
41
42
|
function scheduleMatrixCliExit() {
|
|
42
43
|
if (matrixCliExitScheduled || process.env.VITEST) return;
|
|
43
44
|
matrixCliExitScheduled = true;
|
|
@@ -54,8 +55,14 @@ function markCliFailure() {
|
|
|
54
55
|
}
|
|
55
56
|
async function readMatrixCliRecoveryKeyFromStdin() {
|
|
56
57
|
const chunks = [];
|
|
57
|
-
|
|
58
|
-
const
|
|
58
|
+
let totalBytes = 0;
|
|
59
|
+
for await (const chunk of process.stdin) {
|
|
60
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk));
|
|
61
|
+
totalBytes += buffer.byteLength;
|
|
62
|
+
if (totalBytes > MATRIX_CLI_RECOVERY_KEY_STDIN_MAX_BYTES) throw new Error(`Matrix recovery key stdin exceeds ${MATRIX_CLI_RECOVERY_KEY_STDIN_MAX_BYTES} bytes.`);
|
|
63
|
+
chunks.push(buffer);
|
|
64
|
+
}
|
|
65
|
+
const recoveryKey = Buffer.concat(chunks, totalBytes).toString("utf8").trim();
|
|
59
66
|
if (!recoveryKey) throw new Error("Matrix recovery key was requested from stdin, but stdin was empty.");
|
|
60
67
|
return recoveryKey;
|
|
61
68
|
}
|
|
@@ -205,7 +212,7 @@ async function addMatrixAccount(params) {
|
|
|
205
212
|
backupVersion: null
|
|
206
213
|
};
|
|
207
214
|
if (accountConfig.encryption === true) {
|
|
208
|
-
const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-
|
|
215
|
+
const { maybeBootstrapNewEncryptedMatrixAccount } = await import("./setup-bootstrap-DGPOOdz-.js");
|
|
209
216
|
verificationBootstrap = await maybeBootstrapNewEncryptedMatrixAccount({
|
|
210
217
|
previousCfg: cfg,
|
|
211
218
|
cfg: updated,
|
|
@@ -936,13 +943,16 @@ function registerMatrixCli(params) {
|
|
|
936
943
|
errorPrefix: "Direct room repair failed"
|
|
937
944
|
});
|
|
938
945
|
});
|
|
939
|
-
root.command("encryption").description("Set up Matrix end-to-end encryption").command("setup").description("Enable Matrix E2EE, bootstrap verification, and print next steps").option("--account <id>", "Account ID (for multi-account setups)").option("--recovery-key <key>", "Recovery key to apply before bootstrap").option("--force-reset-cross-signing", "Force reset cross-signing identity before bootstrap (requires active recovery key)").option("--verbose", "Show detailed diagnostics").option("--json", "Output as JSON").action(async (options) => {
|
|
946
|
+
root.command("encryption").description("Set up Matrix end-to-end encryption").command("setup").description("Enable Matrix E2EE, bootstrap verification, and print next steps").option("--account <id>", "Account ID (for multi-account setups)").option("--recovery-key <key>", "Recovery key to apply before bootstrap (prefer --recovery-key-stdin)").option("--recovery-key-stdin", "Read the Matrix recovery key from stdin").option("--force-reset-cross-signing", "Force reset cross-signing identity before bootstrap (requires active recovery key)").option("--verbose", "Show detailed diagnostics").option("--json", "Output as JSON").action(async (options) => {
|
|
940
947
|
await runMatrixCliCommand({
|
|
941
948
|
verbose: options.verbose === true,
|
|
942
949
|
json: options.json === true,
|
|
943
950
|
run: async () => await setupMatrixEncryption({
|
|
944
951
|
account: options.account,
|
|
945
|
-
recoveryKey:
|
|
952
|
+
recoveryKey: await resolveMatrixCliRecoveryKeyInput({
|
|
953
|
+
recoveryKey: options.recoveryKey,
|
|
954
|
+
recoveryKeyStdin: options.recoveryKeyStdin
|
|
955
|
+
}),
|
|
946
956
|
forceResetCrossSigning: options.forceResetCrossSigning === true
|
|
947
957
|
}),
|
|
948
958
|
onText: (result, verbose) => {
|
|
@@ -2,7 +2,7 @@ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
|
2
2
|
//#region extensions/matrix/src/cli-metadata.ts
|
|
3
3
|
function registerMatrixCliMetadata(api) {
|
|
4
4
|
api.registerCli(async ({ program }) => {
|
|
5
|
-
const { registerMatrixCli } = await import("./cli-
|
|
5
|
+
const { registerMatrixCli } = await import("./cli-0EcKfqFw.js");
|
|
6
6
|
registerMatrixCli({ program });
|
|
7
7
|
}, { descriptors: [{
|
|
8
8
|
name: "matrix",
|
package/dist/cli-metadata.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-
|
|
1
|
+
import { n as registerMatrixCliMetadata, t as cli_metadata_default } from "./cli-metadata-Xq1Xb15R.js";
|
|
2
2
|
export { cli_metadata_default as default, registerMatrixCliMetadata };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { u as resolveMatrixRoomId } from "./send-
|
|
3
|
-
import { n as withResolvedRuntimeMatrixClient } from "./client-bootstrap-
|
|
2
|
+
import { u as resolveMatrixRoomId } from "./send-BJbrdmNm.js";
|
|
3
|
+
import { n as withResolvedRuntimeMatrixClient } from "./client-bootstrap-Dk5EAn3n.js";
|
|
4
4
|
//#region extensions/matrix/src/matrix/actions/client.ts
|
|
5
5
|
var client_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
withResolvedActionClient: () => withResolvedActionClient,
|
|
@@ -3,8 +3,8 @@ import { t as getMatrixScopedEnvVarNames } from "./env-vars-B0NxQnPk.js";
|
|
|
3
3
|
import { i as resolveScopedMatrixEnvConfig, r as resolveMatrixEnvAuthReadiness, t as hasReadyMatrixEnvAuth } from "./env-auth-CQsYbz-p.js";
|
|
4
4
|
import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
|
|
5
5
|
import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
|
|
6
|
-
import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, m as resolveMatrixConfigForAccount, n as releaseSharedClientInstance, o as stopSharedClientForAccount, p as resolveMatrixAuthContext, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient } from "./shared-
|
|
7
|
-
import { t as createMatrixClient } from "./create-client-
|
|
6
|
+
import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, m as resolveMatrixConfigForAccount, n as releaseSharedClientInstance, o as stopSharedClientForAccount, p as resolveMatrixAuthContext, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient } from "./shared-DquM1oz6.js";
|
|
7
|
+
import { t as createMatrixClient } from "./create-client-WQExaby_.js";
|
|
8
8
|
//#region extensions/matrix/src/matrix/client.ts
|
|
9
9
|
var client_exports = /* @__PURE__ */ __exportAll({
|
|
10
10
|
acquireSharedMatrixClient: () => acquireSharedMatrixClient,
|
|
@@ -8,7 +8,7 @@ var client_bootstrap_exports = /* @__PURE__ */ __exportAll({
|
|
|
8
8
|
resolveRuntimeMatrixClientWithReadiness: () => resolveRuntimeMatrixClientWithReadiness,
|
|
9
9
|
withResolvedRuntimeMatrixClient: () => withResolvedRuntimeMatrixClient
|
|
10
10
|
});
|
|
11
|
-
const loadMatrixSharedClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([import("./client-
|
|
11
|
+
const loadMatrixSharedClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([import("./client-CA0PULls.js").then((n) => n.t), import("./shared-DquM1oz6.js").then((n) => n.a)]).then(([clientModule, sharedModule]) => ({
|
|
12
12
|
acquireSharedMatrixClient: clientModule.acquireSharedMatrixClient,
|
|
13
13
|
resolveMatrixAuthContext: clientModule.resolveMatrixAuthContext,
|
|
14
14
|
releaseSharedClientInstance: sharedModule.releaseSharedClientInstance
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
|
|
2
|
-
import { g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, p as listMatrixAccountIds } from "./setup-core-
|
|
2
|
+
import { g as resolveMatrixAccount, h as resolveDefaultMatrixAccountId, p as listMatrixAccountIds } from "./setup-core-XCdAx1nY.js";
|
|
3
3
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
4
4
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
|
|
8
8
|
import { normalizeStringEntries as normalizeStringEntries$1 } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
9
|
-
import { AllowFromListSchema, BlockStreamingCoalesceSchema, ContextVisibilityModeSchema, GroupPolicySchema, MarkdownConfigSchema, MentionPatternsPolicySchema,
|
|
9
|
+
import { AllowFromListSchema, BlockStreamingCoalesceSchema, ContextVisibilityModeSchema, GroupPolicySchema, MarkdownConfigSchema, MentionPatternsPolicySchema, buildChannelConfigSchema, buildGroupEntrySchema, buildNestedDmConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
|
|
10
10
|
import { buildSecretInputSchema } from "openclaw/plugin-sdk/secret-input";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
//#region extensions/matrix/src/matrix/monitor/allowlist.ts
|
|
@@ -180,18 +180,16 @@ const botLoopProtectionSchema = z.object({
|
|
|
180
180
|
windowSeconds: z.number().int().positive().optional(),
|
|
181
181
|
cooldownSeconds: z.number().int().positive().optional()
|
|
182
182
|
}).strict().optional();
|
|
183
|
-
const matrixRoomSchema =
|
|
183
|
+
const matrixRoomSchema = buildGroupEntrySchema({
|
|
184
184
|
account: z.string().optional(),
|
|
185
|
-
enabled: z.boolean().optional(),
|
|
186
|
-
requireMention: z.boolean().optional(),
|
|
187
185
|
allowBots: z.union([z.boolean(), z.literal("mentions")]).optional(),
|
|
188
186
|
botLoopProtection: botLoopProtectionSchema,
|
|
189
|
-
tools: ToolPolicySchema,
|
|
190
187
|
autoReply: z.boolean().optional(),
|
|
191
|
-
users: AllowFromListSchema
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
users: AllowFromListSchema
|
|
189
|
+
}).omit({
|
|
190
|
+
toolsBySender: true,
|
|
191
|
+
allowFrom: true
|
|
192
|
+
}).strict().optional();
|
|
195
193
|
const matrixNetworkSchema = z.object({ dangerouslyAllowPrivateNetwork: z.boolean().optional() }).strict().optional();
|
|
196
194
|
const matrixStreamingSchema = z.object({
|
|
197
195
|
mode: z.enum([
|
package/dist/contract-api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, n as matrixSetupAdapter, u as namedAccountPromotionKeys } from "./setup-core-
|
|
2
|
-
import { n as matrixOnboardingAdapter } from "./setup-surface-
|
|
1
|
+
import { d as resolveSingleAccountPromotionTarget, f as singleAccountKeysToMove, n as matrixSetupAdapter, u as namedAccountPromotionKeys } from "./setup-core-XCdAx1nY.js";
|
|
2
|
+
import { n as matrixOnboardingAdapter } from "./setup-surface-CzUiTe_k.js";
|
|
3
3
|
export { matrixSetupAdapter, matrixOnboardingAdapter as matrixSetupWizard, namedAccountPromotionKeys, resolveSingleAccountPromotionTarget, singleAccountKeysToMove };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
|
|
3
|
-
import { d as writeStorageMeta, l as resolveMatrixStoragePaths, r as maybeMigrateLegacyStorage } from "./storage-
|
|
4
|
-
import "./shared-
|
|
3
|
+
import { d as writeStorageMeta, l as resolveMatrixStoragePaths, r as maybeMigrateLegacyStorage } from "./storage-CzHxeF5E.js";
|
|
4
|
+
import "./shared-DquM1oz6.js";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
-
import fs from "node:fs";
|
|
8
7
|
import { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
8
|
+
import fs from "node:fs";
|
|
9
9
|
//#region extensions/matrix/src/matrix/client/create-client.ts
|
|
10
10
|
var create_client_exports = /* @__PURE__ */ __exportAll({ createMatrixClient: () => createMatrixClient });
|
|
11
|
-
const loadMatrixCreateClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([import("./sdk-
|
|
11
|
+
const loadMatrixCreateClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([import("./sdk-CIDZXWpZ.js"), import("./logging-QH-48Gr6.js")]).then(([sdkModule, loggingModule]) => ({
|
|
12
12
|
MatrixClient: sdkModule.MatrixClient,
|
|
13
13
|
ensureMatrixSdkLoggingConfigured: loggingModule.ensureMatrixSdkLoggingConfigured
|
|
14
14
|
})));
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { a as resolveMatrixCredentialsPath, r as resolveMatrixCredentialsDir } from "./storage-paths-gUmSydsW.js";
|
|
2
|
+
import { a as isMatrixCredentialRevocation, c as normalizeMatrixStoredCredentials, l as openMatrixCredentialsStore, n as clearMatrixCredentials, o as loadMatrixCredentials, r as credentialsMatchConfig, s as matrixCredentialsStoreKey } from "./credentials-read-DVmFCm7X.js";
|
|
3
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
|
+
//#region extensions/matrix/src/matrix/credentials.ts
|
|
5
|
+
function requireCredentialStoreUpdate(store) {
|
|
6
|
+
if (!store.update) throw new Error("Matrix credentials require atomic plugin-state updates");
|
|
7
|
+
return store.update;
|
|
8
|
+
}
|
|
9
|
+
async function saveMatrixCredentials(credentials, env = process.env, accountId) {
|
|
10
|
+
const normalizedAccountId = normalizeAccountId(accountId);
|
|
11
|
+
const store = openMatrixCredentialsStore(env);
|
|
12
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
13
|
+
requireCredentialStoreUpdate(store)(matrixCredentialsStoreKey(normalizedAccountId), (current) => {
|
|
14
|
+
const existing = normalizeMatrixStoredCredentials(current, normalizedAccountId);
|
|
15
|
+
return {
|
|
16
|
+
accountId: normalizedAccountId,
|
|
17
|
+
homeserver: credentials.homeserver,
|
|
18
|
+
userId: credentials.userId,
|
|
19
|
+
accessToken: credentials.accessToken,
|
|
20
|
+
...typeof credentials.deviceId === "string" ? { deviceId: credentials.deviceId } : {},
|
|
21
|
+
createdAt: existing?.createdAt ?? now,
|
|
22
|
+
lastUsedAt: now
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async function saveBackfilledMatrixDeviceId(credentials, env = process.env, accountId) {
|
|
27
|
+
const normalizedAccountId = normalizeAccountId(accountId);
|
|
28
|
+
const store = openMatrixCredentialsStore(env);
|
|
29
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
30
|
+
let result = "saved";
|
|
31
|
+
requireCredentialStoreUpdate(store)(matrixCredentialsStoreKey(normalizedAccountId), (current) => {
|
|
32
|
+
if (isMatrixCredentialRevocation(current, normalizedAccountId)) {
|
|
33
|
+
result = "skipped";
|
|
34
|
+
return current;
|
|
35
|
+
}
|
|
36
|
+
const existing = normalizeMatrixStoredCredentials(current, normalizedAccountId);
|
|
37
|
+
if (existing && (existing.homeserver !== credentials.homeserver || existing.userId !== credentials.userId || existing.accessToken !== credentials.accessToken)) {
|
|
38
|
+
result = "skipped";
|
|
39
|
+
return existing;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
accountId: normalizedAccountId,
|
|
43
|
+
homeserver: credentials.homeserver,
|
|
44
|
+
userId: credentials.userId,
|
|
45
|
+
accessToken: credentials.accessToken,
|
|
46
|
+
...typeof credentials.deviceId === "string" ? { deviceId: credentials.deviceId } : {},
|
|
47
|
+
createdAt: existing?.createdAt ?? now,
|
|
48
|
+
lastUsedAt: now
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
async function touchMatrixCredentials(env = process.env, accountId) {
|
|
54
|
+
const normalizedAccountId = normalizeAccountId(accountId);
|
|
55
|
+
requireCredentialStoreUpdate(openMatrixCredentialsStore(env))(matrixCredentialsStoreKey(normalizedAccountId), (current) => {
|
|
56
|
+
if (isMatrixCredentialRevocation(current, normalizedAccountId)) return current;
|
|
57
|
+
const existing = normalizeMatrixStoredCredentials(current, normalizedAccountId);
|
|
58
|
+
return existing ? {
|
|
59
|
+
...existing,
|
|
60
|
+
lastUsedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
61
|
+
} : void 0;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { clearMatrixCredentials, credentialsMatchConfig, loadMatrixCredentials, resolveMatrixCredentialsDir, resolveMatrixCredentialsPath, saveBackfilledMatrixDeviceId, saveMatrixCredentials, touchMatrixCredentials };
|