@openclaw/matrix 2026.3.13 → 2026.5.10-beta.1
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-config-D2W-V1eQ.js +96 -0
- package/dist/account-selection-BWwIruri.js +158 -0
- package/dist/accounts-Bm90Rzvp.js +130 -0
- package/dist/active-client-uhlxdhEy.js +20 -0
- package/dist/allowlist-sTzpCn5d.js +68 -0
- package/dist/api.js +12 -0
- package/dist/approval-handler.runtime-DWTQfd4m.js +370 -0
- package/dist/approval-ids-DoC2z7tR.js +7 -0
- package/dist/approval-reaction-auth-DbcA1gGd.js +27 -0
- package/dist/approval-reactions-o2_tuH8D.js +162 -0
- package/dist/async-lock-uQfhfQIY.js +19 -0
- package/dist/auth-presence.js +26 -0
- package/dist/backup-health-Cabu_WQC.js +60 -0
- package/dist/channel-H_6lMgwf.js +1116 -0
- package/dist/channel-plugin-api.js +2 -0
- package/dist/channel.runtime-BnO9f0pR.js +246 -0
- package/dist/cli-CYZ9yVcB.js +1340 -0
- package/dist/cli-metadata-DPIHnoa6.js +22 -0
- package/dist/cli-metadata.js +2 -0
- package/dist/client-DkcXnm0X.js +25 -0
- package/dist/client-_hckQNGW.js +31 -0
- package/dist/client-bootstrap-Rb8oHvhH.js +114 -0
- package/dist/config--5-S2Akv.js +452 -0
- package/dist/config-paths-nsVaysCu.js +19 -0
- package/dist/config-schema-nPLpEgHl.js +200 -0
- package/dist/config-secret-input.runtime-DiKFehsE.js +2 -0
- package/dist/config-update-wZX-HLMn.js +143 -0
- package/dist/contract-api.js +9 -0
- package/dist/create-client-DCnqDaqd.js +64 -0
- package/dist/credentials-DV6fWXhC.js +56 -0
- package/dist/credentials-read-cmHgousK.js +112 -0
- package/dist/credentials-write.runtime-zniTq-Gr.js +17 -0
- package/dist/crypto-node.runtime-pihzdpY7.js +12 -0
- package/dist/crypto-runtime-ZI0zAtn3.js +1214 -0
- package/dist/deps-C6WqKY7m.js +235 -0
- package/dist/device-health-UVYpbA_W.js +16 -0
- package/dist/direct-management-DMMMgtTB.js +249 -0
- package/dist/direct-room-XkutHjES.js +76 -0
- package/dist/directory-live-DmOtMhyr.js +150 -0
- package/dist/doctor-C4__7c-U.js +153 -0
- package/dist/doctor-contract-D4-64QuJ.js +246 -0
- package/dist/doctor-contract-api.js +2 -0
- package/dist/draft-stream-BE2QevQQ.js +144 -0
- package/dist/encryption-guidance-BPi3A_m3.js +15 -0
- package/dist/env-auth-BJqGI8M6.js +63 -0
- package/dist/env-vars-C7uQCTKn.js +63 -0
- package/dist/errors-CTcpEDq-.js +17 -0
- package/dist/exec-approval-resolver-Bza9Dhlm.js +15 -0
- package/dist/exec-approvals-Crnh543m.js +196 -0
- package/dist/helper-api.js +4 -0
- package/dist/http-client-C7AeVJay.js +319 -0
- package/dist/index.js +46 -0
- package/dist/legacy-crypto-inspector-poDWldgy.js +41 -0
- package/dist/legacy-crypto-restore-Biw-w2ng.js +85 -0
- package/dist/logger-CnZRVrux.js +78 -0
- package/dist/logging-DZHSPP5N.js +99 -0
- package/dist/matrix-migration.runtime-WY6ffcrf.js +525 -0
- package/dist/media-text-DU6nWZuj.js +146 -0
- package/dist/messages-BpihMh82.js +140 -0
- package/dist/migration-snapshot-backup-DaCHTp8C.js +69 -0
- package/dist/migration-snapshot.runtime-CKHE3xF9.js +2 -0
- package/dist/monitor-BaRCKyLd.js +4175 -0
- package/dist/plugin-entry.handlers.runtime.js +51 -0
- package/dist/probe.runtime-BvAzYAIe.js +3 -0
- package/dist/profile-BlHu0wDX.js +111 -0
- package/dist/profile-update-DjeBNgIV.js +69 -0
- package/dist/reaction-common-ejrL19w-.js +71 -0
- package/dist/reaction-events-CiARZfjk.js +121 -0
- package/dist/record-shared-CHWJCTWf.js +2 -0
- package/dist/recovery-key-store-BTJ6jz5v.js +294 -0
- package/dist/resolve-targets-YtJnw1Tb.js +140 -0
- package/dist/resolver.runtime-D9piiGEl.js +5 -0
- package/dist/rolldown-runtime-DUslC3ob.js +14 -0
- package/dist/route-D6rg-iXN.js +161 -0
- package/dist/runtime-C6X4h_SJ.js +6 -0
- package/dist/runtime-Dog86njy.js +8 -0
- package/dist/runtime-api-DTKcXOhp.js +24 -0
- package/dist/runtime-api.js +25 -0
- package/dist/runtime-heavy-api.js +3 -0
- package/dist/runtime-setter-api.js +2 -0
- package/dist/sdk-B2vZA27-.js +1416 -0
- package/dist/secret-contract-DcrJWCQI.js +120 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/send-Bo0DU1ca.js +1200 -0
- package/dist/session-store-metadata-DQXjgNLt.js +77 -0
- package/dist/setup-bootstrap-ImenBsMt.js +62 -0
- package/dist/setup-core-CfZy05oW.js +116 -0
- package/dist/setup-dm-policy-2-r1FrQh.js +194 -0
- package/dist/setup-entry.js +19 -0
- package/dist/setup-plugin-api.js +44 -0
- package/dist/setup-surface-CqT_o61M.js +540 -0
- package/dist/shared-CpMoYKm1.js +195 -0
- package/dist/startup-abort-56edvmbM.js +32 -0
- package/dist/startup-verification-Demyp0bP.js +132 -0
- package/dist/storage-paths-BJLdnCjV.js +52 -0
- package/dist/storage-tC3ujLiW.js +281 -0
- package/dist/subagent-hooks-DQbyqq9V.js +149 -0
- package/dist/subagent-hooks-api.js +23 -0
- package/dist/sync-state-C_beeevA.js +12 -0
- package/dist/target-ids-80nQ2gql.js +77 -0
- package/dist/test-api.js +4 -0
- package/dist/thread-binding-api-Cq_E-E1K.js +17 -0
- package/dist/thread-binding-api.js +2 -0
- package/dist/thread-bindings-B9mesxXk.js +352 -0
- package/dist/thread-bindings-runtime.js +2 -0
- package/dist/thread-bindings-shared-DK-d-oYX.js +97 -0
- package/dist/timeout-abort-signal-CtaIaP1v.js +2 -0
- package/dist/tool-actions.runtime-ThYhfHtZ.js +532 -0
- package/dist/url-validation-DiK9j7jz.js +36 -0
- package/dist/verification-CZ2rDeHL.js +345 -0
- package/openclaw.plugin.json +796 -1
- package/package.json +82 -16
- package/CHANGELOG.md +0 -104
- package/index.ts +0 -22
- package/src/actions.ts +0 -195
- package/src/channel.directory.test.ts +0 -135
- package/src/channel.ts +0 -461
- package/src/config-schema.test.ts +0 -26
- package/src/config-schema.ts +0 -62
- package/src/directory-live.test.ts +0 -85
- package/src/directory-live.ts +0 -209
- package/src/group-mentions.ts +0 -52
- package/src/matrix/accounts.test.ts +0 -131
- package/src/matrix/accounts.ts +0 -114
- package/src/matrix/actions/client.ts +0 -47
- package/src/matrix/actions/limits.test.ts +0 -15
- package/src/matrix/actions/limits.ts +0 -6
- package/src/matrix/actions/messages.ts +0 -126
- package/src/matrix/actions/pins.test.ts +0 -74
- package/src/matrix/actions/pins.ts +0 -84
- package/src/matrix/actions/reactions.test.ts +0 -109
- package/src/matrix/actions/reactions.ts +0 -102
- package/src/matrix/actions/room.ts +0 -85
- package/src/matrix/actions/summary.ts +0 -75
- package/src/matrix/actions/types.ts +0 -85
- package/src/matrix/actions.ts +0 -15
- package/src/matrix/active-client.ts +0 -32
- package/src/matrix/client/config.ts +0 -245
- package/src/matrix/client/create-client.ts +0 -125
- package/src/matrix/client/logging.ts +0 -46
- package/src/matrix/client/runtime.ts +0 -4
- package/src/matrix/client/shared.test.ts +0 -85
- package/src/matrix/client/shared.ts +0 -210
- package/src/matrix/client/startup.test.ts +0 -49
- package/src/matrix/client/startup.ts +0 -29
- package/src/matrix/client/storage.ts +0 -131
- package/src/matrix/client/types.ts +0 -34
- package/src/matrix/client-bootstrap.ts +0 -47
- package/src/matrix/client.test.ts +0 -56
- package/src/matrix/client.ts +0 -14
- package/src/matrix/credentials.ts +0 -125
- package/src/matrix/deps.test.ts +0 -74
- package/src/matrix/deps.ts +0 -126
- package/src/matrix/format.test.ts +0 -33
- package/src/matrix/format.ts +0 -22
- package/src/matrix/index.ts +0 -11
- package/src/matrix/monitor/access-policy.ts +0 -126
- package/src/matrix/monitor/allowlist.test.ts +0 -45
- package/src/matrix/monitor/allowlist.ts +0 -94
- package/src/matrix/monitor/auto-join.ts +0 -72
- package/src/matrix/monitor/direct.test.ts +0 -396
- package/src/matrix/monitor/direct.ts +0 -152
- package/src/matrix/monitor/events.test.ts +0 -186
- package/src/matrix/monitor/events.ts +0 -168
- package/src/matrix/monitor/handler.body-for-agent.test.ts +0 -196
- package/src/matrix/monitor/handler.ts +0 -768
- package/src/matrix/monitor/inbound-body.test.ts +0 -73
- package/src/matrix/monitor/inbound-body.ts +0 -28
- package/src/matrix/monitor/index.test.ts +0 -18
- package/src/matrix/monitor/index.ts +0 -414
- package/src/matrix/monitor/location.ts +0 -100
- package/src/matrix/monitor/media.test.ts +0 -86
- package/src/matrix/monitor/media.ts +0 -118
- package/src/matrix/monitor/mentions.test.ts +0 -154
- package/src/matrix/monitor/mentions.ts +0 -62
- package/src/matrix/monitor/replies.test.ts +0 -184
- package/src/matrix/monitor/replies.ts +0 -124
- package/src/matrix/monitor/room-info.ts +0 -55
- package/src/matrix/monitor/rooms.test.ts +0 -124
- package/src/matrix/monitor/rooms.ts +0 -47
- package/src/matrix/monitor/threads.ts +0 -68
- package/src/matrix/monitor/types.ts +0 -39
- package/src/matrix/poll-types.test.ts +0 -21
- package/src/matrix/poll-types.ts +0 -167
- package/src/matrix/probe.ts +0 -69
- package/src/matrix/sdk-runtime.ts +0 -18
- package/src/matrix/send/client.ts +0 -99
- package/src/matrix/send/formatting.ts +0 -93
- package/src/matrix/send/media.ts +0 -230
- package/src/matrix/send/targets.test.ts +0 -98
- package/src/matrix/send/targets.ts +0 -150
- package/src/matrix/send/types.ts +0 -110
- package/src/matrix/send-queue.test.ts +0 -145
- package/src/matrix/send-queue.ts +0 -28
- package/src/matrix/send.test.ts +0 -319
- package/src/matrix/send.ts +0 -267
- package/src/onboarding.ts +0 -462
- package/src/outbound.test.ts +0 -159
- package/src/outbound.ts +0 -58
- package/src/resolve-targets.test.ts +0 -68
- package/src/resolve-targets.ts +0 -125
- package/src/runtime.ts +0 -6
- package/src/secret-input.ts +0 -13
- package/src/test-mocks.ts +0 -53
- package/src/tool-actions.ts +0 -164
- package/src/types.ts +0 -118
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { a as sendMessageMatrix, c as sendTypingMatrix, o as sendPollMatrix } from "./send-Bo0DU1ca.js";
|
|
2
|
+
import { t as isBunRuntime } from "./runtime-C6X4h_SJ.js";
|
|
3
|
+
import { n as resolveMatrixAuth } from "./config--5-S2Akv.js";
|
|
4
|
+
import "./client-_hckQNGW.js";
|
|
5
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DmOtMhyr.js";
|
|
6
|
+
import { f as resolveOutboundSendDep, n as chunkTextForOutbound } from "./runtime-api-DTKcXOhp.js";
|
|
7
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-YtJnw1Tb.js";
|
|
8
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import { createReplyToFanout } from "openclaw/plugin-sdk/outbound-runtime";
|
|
10
|
+
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
11
|
+
import { renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
12
|
+
import { resolvePayloadMediaUrls } from "openclaw/plugin-sdk/reply-payload";
|
|
13
|
+
//#region extensions/matrix/src/matrix/probe.ts
|
|
14
|
+
let matrixProbeRuntimeDepsPromise;
|
|
15
|
+
async function loadMatrixProbeRuntimeDeps() {
|
|
16
|
+
matrixProbeRuntimeDepsPromise ??= import("./probe.runtime-BvAzYAIe.js").then((runtimeModule) => ({ createMatrixClient: runtimeModule.createMatrixClient }));
|
|
17
|
+
return await matrixProbeRuntimeDepsPromise;
|
|
18
|
+
}
|
|
19
|
+
async function probeMatrix(params) {
|
|
20
|
+
const started = Date.now();
|
|
21
|
+
const result = {
|
|
22
|
+
ok: false,
|
|
23
|
+
status: null,
|
|
24
|
+
error: null,
|
|
25
|
+
elapsedMs: 0
|
|
26
|
+
};
|
|
27
|
+
if (isBunRuntime()) return {
|
|
28
|
+
...result,
|
|
29
|
+
error: "Matrix probe requires Node (bun runtime not supported)",
|
|
30
|
+
elapsedMs: Date.now() - started
|
|
31
|
+
};
|
|
32
|
+
if (!params.homeserver?.trim()) return {
|
|
33
|
+
...result,
|
|
34
|
+
error: "missing homeserver",
|
|
35
|
+
elapsedMs: Date.now() - started
|
|
36
|
+
};
|
|
37
|
+
if (!params.accessToken?.trim()) return {
|
|
38
|
+
...result,
|
|
39
|
+
error: "missing access token",
|
|
40
|
+
elapsedMs: Date.now() - started
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
const { createMatrixClient } = await loadMatrixProbeRuntimeDeps();
|
|
44
|
+
const inputUserId = normalizeOptionalString(params.userId);
|
|
45
|
+
const userId = await (await createMatrixClient({
|
|
46
|
+
homeserver: params.homeserver,
|
|
47
|
+
userId: inputUserId,
|
|
48
|
+
accessToken: params.accessToken,
|
|
49
|
+
deviceId: params.deviceId,
|
|
50
|
+
persistStorage: false,
|
|
51
|
+
localTimeoutMs: params.timeoutMs,
|
|
52
|
+
accountId: params.accountId,
|
|
53
|
+
allowPrivateNetwork: params.allowPrivateNetwork,
|
|
54
|
+
ssrfPolicy: params.ssrfPolicy,
|
|
55
|
+
dispatcherPolicy: params.dispatcherPolicy
|
|
56
|
+
})).getUserId();
|
|
57
|
+
result.ok = true;
|
|
58
|
+
result.userId = userId ?? null;
|
|
59
|
+
result.elapsedMs = Date.now() - started;
|
|
60
|
+
return result;
|
|
61
|
+
} catch (err) {
|
|
62
|
+
return {
|
|
63
|
+
...result,
|
|
64
|
+
status: typeof err === "object" && err && "statusCode" in err ? Number(err.statusCode) : result.status,
|
|
65
|
+
error: formatErrorMessage(err),
|
|
66
|
+
elapsedMs: Date.now() - started
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region extensions/matrix/src/outbound.ts
|
|
72
|
+
const MATRIX_OPENCLAW_PRESENTATION_KEY = "com.openclaw.presentation";
|
|
73
|
+
const MATRIX_OPENCLAW_PRESENTATION_TYPE = "message.presentation";
|
|
74
|
+
const MATRIX_EMPTY_PRESENTATION_FALLBACK_TEXT = "---";
|
|
75
|
+
function toRecord(value) {
|
|
76
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
77
|
+
}
|
|
78
|
+
function resolveMatrixChannelData(payload) {
|
|
79
|
+
const raw = toRecord(payload.channelData)?.matrix;
|
|
80
|
+
return toRecord(raw) ?? {};
|
|
81
|
+
}
|
|
82
|
+
function buildMatrixPresentationContent(presentation) {
|
|
83
|
+
return {
|
|
84
|
+
...presentation,
|
|
85
|
+
version: 1,
|
|
86
|
+
type: MATRIX_OPENCLAW_PRESENTATION_TYPE
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function resolveMatrixPresentationContent(payload) {
|
|
90
|
+
const presentation = toRecord(toRecord(resolveMatrixChannelData(payload).extraContent)?.[MATRIX_OPENCLAW_PRESENTATION_KEY]);
|
|
91
|
+
if (!presentation || presentation.version !== 1 || presentation.type !== MATRIX_OPENCLAW_PRESENTATION_TYPE) return;
|
|
92
|
+
return presentation;
|
|
93
|
+
}
|
|
94
|
+
function renderMatrixPresentationPayload(params) {
|
|
95
|
+
const matrixData = resolveMatrixChannelData(params.payload);
|
|
96
|
+
const fallbackText = renderMessagePresentationFallbackText({
|
|
97
|
+
text: params.payload.text,
|
|
98
|
+
presentation: params.presentation,
|
|
99
|
+
emptyFallback: MATRIX_EMPTY_PRESENTATION_FALLBACK_TEXT
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
...params.payload,
|
|
103
|
+
text: fallbackText,
|
|
104
|
+
channelData: {
|
|
105
|
+
...params.payload.channelData,
|
|
106
|
+
matrix: {
|
|
107
|
+
...matrixData,
|
|
108
|
+
extraContent: { [MATRIX_OPENCLAW_PRESENTATION_KEY]: buildMatrixPresentationContent(params.presentation) }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function resolveMatrixPayloadText(payload) {
|
|
114
|
+
const text = payload.text ?? "";
|
|
115
|
+
if (text.trim() || !resolveMatrixPresentationContent(payload)) return text;
|
|
116
|
+
return MATRIX_EMPTY_PRESENTATION_FALLBACK_TEXT;
|
|
117
|
+
}
|
|
118
|
+
function resolveMatrixExtraContent(payload) {
|
|
119
|
+
const presentation = resolveMatrixPresentationContent(payload);
|
|
120
|
+
return presentation ? { [MATRIX_OPENCLAW_PRESENTATION_KEY]: presentation } : void 0;
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region extensions/matrix/src/channel.runtime.ts
|
|
124
|
+
const matrixChannelRuntime = {
|
|
125
|
+
listMatrixDirectoryGroupsLive,
|
|
126
|
+
listMatrixDirectoryPeersLive,
|
|
127
|
+
matrixOutbound: {
|
|
128
|
+
deliveryMode: "direct",
|
|
129
|
+
chunker: chunkTextForOutbound,
|
|
130
|
+
chunkerMode: "markdown",
|
|
131
|
+
textChunkLimit: 4e3,
|
|
132
|
+
presentationCapabilities: {
|
|
133
|
+
supported: true,
|
|
134
|
+
buttons: true,
|
|
135
|
+
selects: true,
|
|
136
|
+
context: true,
|
|
137
|
+
divider: true
|
|
138
|
+
},
|
|
139
|
+
renderPresentation: ({ payload, presentation }) => renderMatrixPresentationPayload({
|
|
140
|
+
payload,
|
|
141
|
+
presentation
|
|
142
|
+
}),
|
|
143
|
+
sendPayload: async ({ cfg, to, payload, mediaLocalRoots, mediaReadFile, mediaAccess, deps, replyToId, replyToIdSource, replyToMode, threadId, accountId, audioAsVoice }) => {
|
|
144
|
+
const send = resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix;
|
|
145
|
+
const resolvedThreadId = threadId !== void 0 && threadId !== null ? String(threadId) : void 0;
|
|
146
|
+
const resolveReplyToId = createReplyToFanout({
|
|
147
|
+
...replyToId != null ? { replyToId } : {},
|
|
148
|
+
...replyToIdSource !== void 0 ? { replyToIdSource } : {},
|
|
149
|
+
...replyToMode !== void 0 ? { replyToMode } : {}
|
|
150
|
+
});
|
|
151
|
+
const urls = resolvePayloadMediaUrls(payload);
|
|
152
|
+
const payloadText = resolveMatrixPayloadText(payload);
|
|
153
|
+
if (urls.length > 0) {
|
|
154
|
+
let lastResult;
|
|
155
|
+
for (let i = 0; i < urls.length; i++) {
|
|
156
|
+
const isFirst = i === 0;
|
|
157
|
+
lastResult = await send(to, isFirst ? payloadText : "", {
|
|
158
|
+
cfg,
|
|
159
|
+
mediaUrl: urls[i],
|
|
160
|
+
mediaAccess,
|
|
161
|
+
mediaLocalRoots,
|
|
162
|
+
mediaReadFile,
|
|
163
|
+
replyToId: resolveReplyToId(),
|
|
164
|
+
threadId: resolvedThreadId,
|
|
165
|
+
accountId: accountId ?? void 0,
|
|
166
|
+
audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
|
|
167
|
+
extraContent: isFirst ? resolveMatrixExtraContent(payload) : void 0
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
channel: "matrix",
|
|
172
|
+
messageId: lastResult.messageId,
|
|
173
|
+
roomId: lastResult.roomId
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const result = await send(to, payloadText, {
|
|
177
|
+
cfg,
|
|
178
|
+
mediaUrl: payload.mediaUrl,
|
|
179
|
+
mediaAccess,
|
|
180
|
+
mediaLocalRoots,
|
|
181
|
+
mediaReadFile,
|
|
182
|
+
replyToId: resolveReplyToId(),
|
|
183
|
+
threadId: resolvedThreadId,
|
|
184
|
+
accountId: accountId ?? void 0,
|
|
185
|
+
audioAsVoice: payload.audioAsVoice ?? audioAsVoice,
|
|
186
|
+
extraContent: resolveMatrixExtraContent(payload)
|
|
187
|
+
});
|
|
188
|
+
return {
|
|
189
|
+
channel: "matrix",
|
|
190
|
+
messageId: result.messageId,
|
|
191
|
+
roomId: result.roomId
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
sendText: async ({ cfg, to, text, deps, replyToId, threadId, accountId, audioAsVoice }) => {
|
|
195
|
+
const result = await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
|
|
196
|
+
cfg,
|
|
197
|
+
replyToId: replyToId ?? void 0,
|
|
198
|
+
threadId: threadId !== void 0 && threadId !== null ? String(threadId) : void 0,
|
|
199
|
+
accountId: accountId ?? void 0,
|
|
200
|
+
audioAsVoice
|
|
201
|
+
});
|
|
202
|
+
return {
|
|
203
|
+
channel: "matrix",
|
|
204
|
+
messageId: result.messageId,
|
|
205
|
+
roomId: result.roomId
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, mediaReadFile, deps, replyToId, threadId, accountId, audioAsVoice }) => {
|
|
209
|
+
const result = await (resolveOutboundSendDep(deps, "matrix") ?? sendMessageMatrix)(to, text, {
|
|
210
|
+
cfg,
|
|
211
|
+
mediaUrl,
|
|
212
|
+
mediaLocalRoots,
|
|
213
|
+
mediaReadFile,
|
|
214
|
+
replyToId: replyToId ?? void 0,
|
|
215
|
+
threadId: threadId !== void 0 && threadId !== null ? String(threadId) : void 0,
|
|
216
|
+
accountId: accountId ?? void 0,
|
|
217
|
+
audioAsVoice
|
|
218
|
+
});
|
|
219
|
+
return {
|
|
220
|
+
channel: "matrix",
|
|
221
|
+
messageId: result.messageId,
|
|
222
|
+
roomId: result.roomId
|
|
223
|
+
};
|
|
224
|
+
},
|
|
225
|
+
sendPoll: async ({ cfg, to, poll, threadId, accountId }) => {
|
|
226
|
+
const result = await sendPollMatrix(to, poll, {
|
|
227
|
+
cfg,
|
|
228
|
+
threadId: threadId !== void 0 && threadId !== null ? threadId : void 0,
|
|
229
|
+
accountId: accountId ?? void 0
|
|
230
|
+
});
|
|
231
|
+
return {
|
|
232
|
+
channel: "matrix",
|
|
233
|
+
messageId: result.eventId,
|
|
234
|
+
roomId: result.roomId,
|
|
235
|
+
pollId: result.eventId
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
probeMatrix,
|
|
240
|
+
resolveMatrixAuth,
|
|
241
|
+
resolveMatrixTargets,
|
|
242
|
+
sendMessageMatrix,
|
|
243
|
+
sendTypingMatrix
|
|
244
|
+
};
|
|
245
|
+
//#endregion
|
|
246
|
+
export { matrixChannelRuntime };
|