@openclaw/matrix 2026.7.2-beta.4 → 2026.7.2-beta.5
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/README.md +1 -1
- package/dist/api.js +4 -4
- package/dist/{approval-handler.runtime-AsawryfP.js → approval-handler.runtime-D1ibJgSk.js} +4 -4
- package/dist/{approval-ids-XAMP8vN9.js → approval-ids-2OQj32-K.js} +1 -1
- package/dist/{approval-reaction-auth-DButmM13.js → approval-reaction-auth-CCAWWkbu.js} +2 -2
- package/dist/{channel-MBtrY36B.js → channel-Cmi248PA.js} +28 -32
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-Bi4Dgy2P.js → channel.runtime-BaPXFRgT.js} +34 -40
- package/dist/{cli-CcPuMyCk.js → cli-0CNHkps5.js} +863 -843
- package/dist/{cli-metadata-DAhDhbYX.js → cli-metadata-DnXxNCoj.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-Dg8dk8NW.js → client-BFRg0kd4.js} +2 -2
- package/dist/{client-BwX6rURh.js → client-CitERujx.js} +2 -2
- package/dist/{client-bootstrap-ZAaO9fZ-.js → client-bootstrap-CkAnkzB6.js} +1 -1
- package/dist/{config-schema-CggnuwnJ.js → config-schema-BShrVROw.js} +16 -2
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-Und1YmJ2.js → create-client-f-CkRllE.js} +3 -3
- package/dist/{crypto-runtime-_j7TpS7k.js → crypto-runtime-D9_6J5tZ.js} +2 -2
- package/dist/{device-health-D4LBxuPq.js → device-health-B4-YXtJR.js} +6 -1
- package/dist/{directory-live-B6fbX6jf.js → directory-live-YRgYDx2w.js} +3 -3
- package/dist/{doctor-C0LPJGTz.js → doctor-CM8ijNpW.js} +1 -1
- package/dist/{doctor-contract-CWVdlRQR.js → doctor-contract-BMSJkkAE.js} +21 -37
- package/dist/doctor-contract-api.js +4 -4
- package/dist/{draft-stream-BfibauH1.js → draft-stream-CIjafRr0.js} +1 -1
- package/dist/{file-sync-store-DUEWCEjb.js → file-sync-store-DiiFsayX.js} +1 -1
- package/dist/{http-client-DOyTG9l2.js → http-client-CycYxU9-.js} +1 -1
- package/dist/{idb-persistence-C6zQfW2w.js → idb-persistence-B6x7dMsF.js} +5 -11
- package/dist/index.js +1 -1
- package/dist/{logging-QH-48Gr6.js → logging-DV-p52N0.js} +8 -1
- package/dist/{media-text-Cv1VIHXW.js → media-text-DlQC_k_K.js} +1 -1
- package/dist/{messages-ClTgfFl6.js → messages-Bf_s--M9.js} +3 -3
- package/dist/{monitor-2BjKS9RV.js → monitor-s--XqoxF.js} +2037 -1803
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-BJOvCHnZ.js +3 -0
- package/dist/{profile-update-C2My3TML.js → profile-update-z3aM46KS.js} +2 -2
- package/dist/{reaction-events-Cj6thhmc.js → reaction-events-DrK9Zua7.js} +2 -2
- package/dist/{recovery-key-store-0O8ARdT_.js → recovery-key-store-BNnHvXdk.js} +1 -1
- package/dist/{resolve-targets-Dn11HT76.js → resolve-targets-nNMcrV3W.js} +1 -1
- package/dist/{resolver.runtime-Zguh0hH9.js → resolver.runtime-BvaFlVLg.js} +1 -1
- package/dist/{room-info-B6vKD5DF.js → room-info-CAFZ3Z9J.js} +13 -12
- package/dist/{sdk-DiRXiRRf.js → sdk-UzPd8tst.js} +227 -181
- package/dist/{send-CZCmDQu8.js → send-C9Ssx-iV.js} +623 -108
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-C9w01xQK.js → setup-bootstrap-BBGpPKgy.js} +2 -2
- package/dist/{setup-core-D6gyoyeg.js → setup-core-a542Ernq.js} +29 -27
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-DZIEWtQC.js → setup-surface-BJrCI6KT.js} +32 -30
- package/dist/{shared-C7Vm9RxI.js → shared-CUH5otj8.js} +5 -12
- package/dist/{startup-verification-D1nscMh8.js → startup-verification-wm3_i88s.js} +1 -1
- package/dist/{storage-BrkTJZov.js → storage-BvAkgzvT.js} +20 -20
- package/dist/{thread-bindings-BcYBELC7.js → thread-bindings-D3RfVgAF.js} +4 -3
- package/dist/{tool-actions.runtime-Dbco_Vwn.js → tool-actions.runtime-Dh5ow2EK.js} +8 -8
- package/dist/{verification-DhMBWxOJ.js → verification-ZdAXdmuh.js} +1 -1
- package/package.json +4 -5
- package/dist/probe.runtime-BWkgfbiE.js +0 -3
- package/npm-shrinkwrap.json +0 -557
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Official OpenClaw channel plugin for Matrix rooms and direct messages.
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugins install @openclaw/matrix
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Configure the Matrix homeserver and bot credentials in OpenClaw. The plugin lets agents join configured rooms, receive messages, and reply through Matrix.
|
package/dist/api.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
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
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-
|
|
5
|
-
import { t as matrixPlugin } from "./channel-
|
|
4
|
+
import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-a542Ernq.js";
|
|
5
|
+
import { t as matrixPlugin } from "./channel-Cmi248PA.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-BJrCI6KT.js";
|
|
8
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-D3RfVgAF.js";
|
|
9
9
|
//#region extensions/matrix/api.ts
|
|
10
10
|
const matrixSessionBindingAdapterChannels = ["matrix"];
|
|
11
11
|
//#endregion
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as resolveMatrixAccount } from "./setup-core-
|
|
2
|
-
import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-
|
|
1
|
+
import { _ as resolveMatrixAccount } from "./setup-core-a542Ernq.js";
|
|
2
|
+
import { _ as shouldHandleMatrixApprovalRequest, g as isMatrixAnyApprovalClientEnabled } from "./channel-Cmi248PA.js";
|
|
3
3
|
import { a as resolveMatrixTargetIdentity } from "./target-ids-B-5aQxwn.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as sendSingleTextMessageMatrix, d as repairMatrixDirectRooms, n as reactMatrixMessage, r as sendMessageMatrix } from "./send-C9Ssx-iV.js";
|
|
5
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-
|
|
6
|
+
import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-Bf_s--M9.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-BShrVROw.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 { _ as resolveMatrixAccount } from "./setup-core-
|
|
2
|
-
import { t as normalizeMatrixApproverId } from "./approval-ids-
|
|
1
|
+
import { _ as resolveMatrixAccount } from "./setup-core-a542Ernq.js";
|
|
2
|
+
import { t as normalizeMatrixApproverId } from "./approval-ids-2OQj32-K.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,11 +1,11 @@
|
|
|
1
1
|
import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-kqquRzCf.js";
|
|
2
2
|
import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
|
|
3
|
-
import { _ as resolveMatrixAccount, d as namedAccountPromotionKeys, f as resolveSingleAccountPromotionTarget, g as resolveDefaultMatrixAccountId, m as listMatrixAccountIds, n as matrixSetupAdapter, p as singleAccountKeysToMove, r as matrixSetupContract, t as createMatrixSetupWizardProxy } 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 { _ as resolveMatrixAccount, d as namedAccountPromotionKeys, f as resolveSingleAccountPromotionTarget, g as resolveDefaultMatrixAccountId, m as listMatrixAccountIds, n as matrixSetupAdapter, p as singleAccountKeysToMove, r as matrixSetupContract, t as createMatrixSetupWizardProxy } from "./setup-core-a542Ernq.js";
|
|
4
|
+
import { a as normalizeMatrixUserId, n as DEFAULT_ACCOUNT_ID$2, r as matrixConfigAdapter, t as MatrixChannelConfigSchema } from "./config-schema-BShrVROw.js";
|
|
5
|
+
import { t as normalizeMatrixApproverId } from "./approval-ids-2OQj32-K.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-BMSJkkAE.js";
|
|
9
9
|
import { d as setMatrixThreadBindingIdleTimeoutBySessionKey, p as setMatrixThreadBindingMaxAgeBySessionKey } from "./thread-bindings-shared-CKnY4LSd.js";
|
|
10
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";
|
|
@@ -34,9 +34,9 @@ import { normalizeAccountId as normalizeAccountId$1, parseThreadSessionSuffix }
|
|
|
34
34
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
35
35
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
36
36
|
import { formatLocationText, logInboundDrop, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
|
|
37
|
-
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/
|
|
37
|
+
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-local-roots";
|
|
38
38
|
import { buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
39
|
-
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
39
|
+
import { deliveryContextFromSession, getSessionEntry, resolveStorePath, sessionDeliveryOrigin } from "openclaw/plugin-sdk/session-store-runtime";
|
|
40
40
|
//#region extensions/matrix/src/actions.ts
|
|
41
41
|
const MATRIX_PLUGIN_HANDLED_ACTIONS = /* @__PURE__ */ new Set([
|
|
42
42
|
"send",
|
|
@@ -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-Dh5ow2EK.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-D1ibJgSk.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-BvaFlVLg.js"), "matrixResolverRuntime");
|
|
784
784
|
const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs, kind, runtime }) => (await loadMatrixChannelRuntime$1()).resolveMatrixTargets({
|
|
785
785
|
cfg,
|
|
786
786
|
accountId,
|
|
@@ -790,38 +790,34 @@ const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs,
|
|
|
790
790
|
}) };
|
|
791
791
|
//#endregion
|
|
792
792
|
//#region extensions/matrix/src/matrix/session-store-metadata.ts
|
|
793
|
-
function trimMaybeString(value) {
|
|
794
|
-
if (typeof value !== "string") return;
|
|
795
|
-
const trimmed = value.trim();
|
|
796
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
797
|
-
}
|
|
798
793
|
function resolveMatrixRoomTargetId(value) {
|
|
799
|
-
const trimmed =
|
|
794
|
+
const trimmed = normalizeOptionalString(value);
|
|
800
795
|
if (!trimmed) return;
|
|
801
796
|
const target = resolveMatrixTargetIdentity(trimmed);
|
|
802
797
|
return target?.kind === "room" && target.id.startsWith("!") ? target.id : void 0;
|
|
803
798
|
}
|
|
804
799
|
function resolveMatrixSessionAccountId(value) {
|
|
805
|
-
const trimmed =
|
|
800
|
+
const trimmed = normalizeOptionalString(value);
|
|
806
801
|
return trimmed ? normalizeAccountId(trimmed) : void 0;
|
|
807
802
|
}
|
|
808
803
|
function resolveMatrixStoredRoomId(params) {
|
|
809
|
-
return resolveMatrixRoomTargetId(params.deliveryTo) ?? resolveMatrixRoomTargetId(params.
|
|
804
|
+
return resolveMatrixRoomTargetId(params.deliveryTo) ?? resolveMatrixRoomTargetId(params.originNativeChannelId) ?? resolveMatrixRoomTargetId(params.originTo);
|
|
810
805
|
}
|
|
811
806
|
function resolveMatrixStoredSessionMeta(entry) {
|
|
812
807
|
if (!entry) return null;
|
|
813
|
-
const
|
|
814
|
-
const
|
|
808
|
+
const deliveryContext = deliveryContextFromSession(entry);
|
|
809
|
+
const origin = sessionDeliveryOrigin(entry);
|
|
810
|
+
const channel = normalizeOptionalString(deliveryContext?.channel) ?? normalizeOptionalString(origin?.provider);
|
|
811
|
+
const accountId = resolveMatrixSessionAccountId(deliveryContext?.accountId ?? origin?.accountId) ?? void 0;
|
|
815
812
|
const roomId = resolveMatrixStoredRoomId({
|
|
816
|
-
deliveryTo:
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
originTo: entry.origin?.to
|
|
813
|
+
deliveryTo: deliveryContext?.to,
|
|
814
|
+
originNativeChannelId: origin?.nativeChannelId,
|
|
815
|
+
originTo: origin?.to
|
|
820
816
|
});
|
|
821
|
-
const chatType =
|
|
822
|
-
const directUserId = chatType === "direct" ?
|
|
823
|
-
from:
|
|
824
|
-
to: (roomId ? `room:${roomId}` : void 0) ??
|
|
817
|
+
const chatType = normalizeOptionalString(origin?.chatType) ?? normalizeOptionalString(entry.chatType);
|
|
818
|
+
const directUserId = chatType === "direct" ? normalizeOptionalString(origin?.nativeDirectUserId) ?? resolveMatrixDirectUserId({
|
|
819
|
+
from: normalizeOptionalString(origin?.from),
|
|
820
|
+
to: (roomId ? `room:${roomId}` : void 0) ?? normalizeOptionalString(deliveryContext?.to) ?? normalizeOptionalString(origin?.to),
|
|
825
821
|
chatType
|
|
826
822
|
}) : void 0;
|
|
827
823
|
if (!channel && !accountId && !roomId && !directUserId) return null;
|
|
@@ -906,9 +902,9 @@ function resolveMatrixOutboundSessionRoute(params) {
|
|
|
906
902
|
//#endregion
|
|
907
903
|
//#region extensions/matrix/src/channel.ts
|
|
908
904
|
let matrixStartupLock = Promise.resolve();
|
|
909
|
-
const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-
|
|
910
|
-
const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
911
|
-
const loadMatrixDoctorModule = createLazyRuntimeModule(() => import("./doctor-
|
|
905
|
+
const loadMatrixSetupWizard = createLazyRuntimeNamedExport(() => import("./setup-surface-BJrCI6KT.js").then((n) => n.t), "matrixSetupWizard");
|
|
906
|
+
const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-BaPXFRgT.js"), "matrixChannelRuntime");
|
|
907
|
+
const loadMatrixDoctorModule = createLazyRuntimeModule(() => import("./doctor-CM8ijNpW.js"));
|
|
912
908
|
const meta = {
|
|
913
909
|
id: "matrix",
|
|
914
910
|
label: "Matrix",
|
|
@@ -1174,7 +1170,7 @@ const matrixPlugin = createChatChannelPlugin({
|
|
|
1174
1170
|
}).map(projectMatrixConversationBinding)
|
|
1175
1171
|
},
|
|
1176
1172
|
messaging: {
|
|
1177
|
-
defaultMarkdownTableMode: "
|
|
1173
|
+
defaultMarkdownTableMode: "block",
|
|
1178
1174
|
targetPrefixes: ["matrix"],
|
|
1179
1175
|
targetIdComparison: "case-sensitive",
|
|
1180
1176
|
normalizeTarget: normalizeMatrixMessagingTarget,
|
|
@@ -1287,7 +1283,7 @@ const matrixPlugin = createChatChannelPlugin({
|
|
|
1287
1283
|
await previousLock;
|
|
1288
1284
|
let monitorMatrixProvider;
|
|
1289
1285
|
try {
|
|
1290
|
-
monitorMatrixProvider = (await import("./monitor-
|
|
1286
|
+
monitorMatrixProvider = (await import("./monitor-s--XqoxF.js")).monitorMatrixProvider;
|
|
1291
1287
|
} finally {
|
|
1292
1288
|
releaseLock();
|
|
1293
1289
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as matrixPlugin } from "./channel-
|
|
1
|
+
import { t as matrixPlugin } from "./channel-Cmi248PA.js";
|
|
2
2
|
export { matrixPlugin };
|
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as sendPollMatrix, o as sendTypingMatrix, r as sendMessageMatrix } from "./send-C9Ssx-iV.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-CUH5otj8.js";
|
|
4
|
+
import "./client-BFRg0kd4.js";
|
|
5
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-YRgYDx2w.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-nNMcrV3W.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
|
+
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
12
13
|
import { renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
13
14
|
import { resolvePayloadMediaUrls, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
|
|
14
15
|
//#region extensions/matrix/src/matrix/probe.ts
|
|
15
|
-
const loadMatrixProbeRuntimeDeps = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
16
|
+
const loadMatrixProbeRuntimeDeps = createLazyRuntimeModule(() => import("./probe.runtime-BJOvCHnZ.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient })));
|
|
16
17
|
async function probeMatrix(params) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...result,
|
|
36
|
-
error: "missing access token",
|
|
37
|
-
elapsedMs: Date.now() - started
|
|
38
|
-
};
|
|
39
|
-
try {
|
|
18
|
+
return await runChannelProbe(void 0, async () => {
|
|
19
|
+
const result = {
|
|
20
|
+
ok: false,
|
|
21
|
+
status: null,
|
|
22
|
+
error: null
|
|
23
|
+
};
|
|
24
|
+
if (isBunRuntime()) return {
|
|
25
|
+
...result,
|
|
26
|
+
error: "Matrix probe requires Node (bun runtime not supported)"
|
|
27
|
+
};
|
|
28
|
+
if (!params.homeserver?.trim()) return {
|
|
29
|
+
...result,
|
|
30
|
+
error: "missing homeserver"
|
|
31
|
+
};
|
|
32
|
+
if (!params.accessToken?.trim()) return {
|
|
33
|
+
...result,
|
|
34
|
+
error: "missing access token"
|
|
35
|
+
};
|
|
40
36
|
const { createMatrixClient } = await loadMatrixProbeRuntimeDeps();
|
|
41
37
|
const inputUserId = normalizeOptionalString(params.userId);
|
|
42
|
-
const
|
|
38
|
+
const client = await createMatrixClient({
|
|
43
39
|
homeserver: params.homeserver,
|
|
44
40
|
userId: inputUserId,
|
|
45
41
|
accessToken: params.accessToken,
|
|
@@ -50,19 +46,17 @@ async function probeMatrix(params) {
|
|
|
50
46
|
allowPrivateNetwork: params.allowPrivateNetwork,
|
|
51
47
|
ssrfPolicy: params.ssrfPolicy,
|
|
52
48
|
dispatcherPolicy: params.dispatcherPolicy
|
|
53
|
-
})
|
|
54
|
-
result.ok = true;
|
|
55
|
-
result.userId = userId ?? null;
|
|
56
|
-
result.elapsedMs = Date.now() - started;
|
|
57
|
-
return result;
|
|
58
|
-
} catch (err) {
|
|
49
|
+
});
|
|
59
50
|
return {
|
|
60
51
|
...result,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
elapsedMs: Date.now() - started
|
|
52
|
+
ok: true,
|
|
53
|
+
userId: await client.getUserId() ?? null
|
|
64
54
|
};
|
|
65
|
-
}
|
|
55
|
+
}, (error) => ({
|
|
56
|
+
ok: false,
|
|
57
|
+
status: typeof error === "object" && error && "statusCode" in error ? Number(error.statusCode) : null,
|
|
58
|
+
error: formatErrorMessage(error)
|
|
59
|
+
}));
|
|
66
60
|
}
|
|
67
61
|
//#endregion
|
|
68
62
|
//#region extensions/matrix/src/outbound.ts
|