@openclaw/matrix 2026.9.1 → 2026.9.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-DA-jfx22.js → account-selection-Bbtc483D.js} +9 -1
- package/dist/{accounts-DR1c4xF_.js → accounts-GwSAk9vY.js} +2 -2
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime-B_6ytY5I.js → approval-handler.runtime-tJLn5JFB.js} +6 -6
- package/dist/{approval-ids-CfHtZ9d1.js → approval-ids-DJZ9ZTuS.js} +1 -1
- package/dist/{approval-reaction-auth-BpDvJqfy.js → approval-reaction-auth-Cd0sKHFc.js} +2 -2
- package/dist/{channel-b-jES-oi.js → channel-BpYiqmx-.js} +10 -39
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BkqjwEDU.js → channel.runtime-dfEvRdLQ.js} +6 -11
- package/dist/{channel.setup-BY42QaL7.js → channel.setup-oxd8RsIr.js} +7 -4
- package/dist/{cli-CtYeU7ol.js → cli-_49Vsqs4.js} +149 -115
- package/dist/{cli-metadata-B7MQjR5S.js → cli-metadata-D19lmKmz.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-D2utPQ1E.js → client-BXQCQDfY.js} +2 -2
- package/dist/{client-Dj4mcf-s.js → client-COLiUdWe.js} +6 -6
- package/dist/{client-bootstrap-n1Rqc8Go.js → client-bootstrap-CQwf9qrm.js} +1 -6
- package/dist/contract-api.js +2 -2
- package/dist/{credentials-DJj2xs3q.js → credentials-DysXbkv2.js} +2 -2
- package/dist/{credentials-read-mexhw-Ur.js → credentials-read-WWpqi88V.js} +1 -1
- package/dist/{credentials-write.runtime-DQt-kgJq.js → credentials-write.runtime-D22lPwRO.js} +1 -1
- package/dist/{crypto-runtime-m1eplj3b.js → crypto-runtime-BvunIYVn.js} +2 -2
- package/dist/{crypto-snapshot-doctor.runtime-D0v841D_.js → crypto-snapshot-doctor.runtime-DxgUMXUy.js} +2 -2
- package/dist/{directory-live-DLUgWBhA.js → directory-live-DABCxf8j.js} +2 -2
- package/dist/doctor-contract-api.js +43 -23
- package/dist/{draft-stream-DPYdv4fE.js → draft-stream-DSwgyyBi.js} +16 -5
- package/dist/{encryption-guidance-BNcZNQZI.js → encryption-guidance-mDyxJV9U.js} +1 -1
- package/dist/{event-helpers-XRfAbOIh.js → event-helpers-CspuhE9k.js} +9 -1
- package/dist/helper-api.js +3 -3
- package/dist/{http-client-DOmFvKvB.js → http-client-BfPeF4CE.js} +1 -1
- package/dist/{idb-persistence-CU7CNLlX.js → idb-persistence-DBdwHSWg.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{messages-C1U3b1oN.js → messages-H4mi9Cap.js} +6 -99
- package/dist/{monitor-SNnu-0bp.js → monitor-3Fw96uiE.js} +84 -118
- package/dist/{outbound-CeCEtF_q.js → outbound-UPI45TD_.js} +1 -1
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-DdXTrrmo.js +2 -0
- package/dist/{profile-update-Cd1p8ABr.js → profile-update-DWEg8Ylt.js} +1 -1
- package/dist/{reaction-events-DveJRUaX.js → reaction-events-D-iSW0iM.js} +5 -7
- package/dist/{resolve-targets-B64O69Nd.js → resolve-targets-BpnALDzR.js} +1 -1
- package/dist/{resolver.runtime-TRmePJDV.js → resolver.runtime-B83WkznZ.js} +1 -1
- package/dist/{room-info-DVkKDscD.js → room-info-CjnbX52D.js} +7 -4
- package/dist/runtime-api.js +2 -2
- package/dist/{sdk-C1yfda1L.js → sdk-CX9b0N8Q.js} +13 -6
- package/dist/{send-DG7Bnj7_.js → send-B9l1lKau.js} +201 -97
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-Co985F63.js → setup-bootstrap-CSI1L1lm.js} +2 -2
- package/dist/{setup-core-CEF6exLW.js → setup-core-DuTlyqRz.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BSlj1vnL.js → setup-surface-fZing1WZ.js} +6 -6
- package/dist/{startup-verification-1Ney1mmI.js → startup-verification-BTSf31hS.js} +2 -1
- package/dist/storage-CV-pfV_2.js +320 -0
- package/dist/{storage-BVf4uucD.js → storage-metadata-DYArLcq1.js} +14 -319
- package/dist/{storage-paths-gUmSydsW.js → storage-paths-DVCANXTc.js} +13 -1
- package/dist/{sync-cache-state-d-A_OhbU.js → sync-cache-state-C-mhj3xb.js} +9 -3
- package/dist/{thread-bindings-DgxQEB99.js → thread-bindings-CRyf5on_.js} +3 -2
- package/dist/{tool-actions.runtime-vbkQgU7D.js → tool-actions.runtime-D5-hTkDu.js} +10 -10
- package/dist/types-DzSc7Sqm.js +32 -0
- package/dist/{verification-D-iOebn4.js → verification-B_aqtbx-.js} +2 -2
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts +69 -4
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +526 -432
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +358 -265
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +8 -7
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +216 -183
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -1
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +7 -7
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -1
- package/node_modules/markdown-it/dist/markdown-it.cjs.js +98 -106
- package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -1
- package/node_modules/markdown-it/dist/markdown-it.d.mts +42 -71
- package/node_modules/markdown-it/dist/markdown-it.mjs +98 -106
- package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -1
- package/node_modules/markdown-it/package.json +1 -2
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +24 -3
- package/package.json +7 -7
- package/dist/probe.runtime-B1YPxG9x.js +0 -2
- package/dist/runtime-BefyhPWv.js +0 -6
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.js";
|
|
2
2
|
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
3
|
-
import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-
|
|
4
|
-
import { _ as
|
|
5
|
-
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-
|
|
3
|
+
import { n as resolveConfiguredMatrixBotUserIds } from "./accounts-GwSAk9vY.js";
|
|
4
|
+
import { _ as toLocationContext, a as resolveMatrixRoomConfig, c as canonicalizeAllowlistWithResolvedIds, d as formatLocationText, f as getAgentScopedMediaLocalRoots, g as summarizeMapping, h as patchAllowlistUsersInConfigEntries, i as resolveMatrixThreadRouting, l as createReplyPrefixOptions, m as logTypingFailure, n as resolveMatrixStoredSessionMeta, o as addAllowlistUserEntriesFromConfigEntry, p as logInboundDrop, r as resolveMatrixInboundRoute, s as buildAllowlistResolutionSummary, u as createTypingCallbacks } from "./channel-BpYiqmx-.js";
|
|
5
|
+
import { a as normalizeMatrixUserId, i as normalizeMatrixAllowList, o as resolveMatrixAllowListMatch } from "./channel.setup-oxd8RsIr.js";
|
|
6
6
|
import { n as isMatrixRoomId, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.js";
|
|
7
|
-
import {
|
|
7
|
+
import { A as promoteMatrixDirectRoomCandidate, S as isPollStartType, c as formatMatrixMediaTooLargeText, d as isLikelyBareFilename, g as resolveMatrixThreadRootId, h as resolveMatrixReplyToEventId, l as formatMatrixMediaUnavailableText, p as resolveMatrixReplacementContent, r as sendMessageMatrix, u as formatMatrixMessageText, w as parsePollStartContent, x as isPollEventType, y as formatPollAsText } from "./send-B9l1lKau.js";
|
|
8
8
|
import { i as isStrictDirectMembership, n as hasDirectMatrixMemberFlag, o as readJoinedMatrixMembers } from "./direct-room-RinHjtqX.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import { i as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
9
|
+
import { n as MATRIX_REACTION_EVENT_TYPE } from "./reaction-common-DkrQdBSZ.js";
|
|
10
|
+
import { n as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY } from "./types-DzSc7Sqm.js";
|
|
11
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-CRyf5on_.js";
|
|
12
|
+
import { l as fetchMatrixPollSnapshot, r as readMatrixMessages } from "./messages-H4mi9Cap.js";
|
|
13
|
+
import { a as throwIfMatrixStartupAborted, c as backfillMatrixAuthDeviceIdAfterStartup, i as isMatrixStartupAbortError, l as resolveMatrixAuth, n as acquireSharedMatrixClient, o as createMatrixMonitorTaskRunner, u as resolveMatrixAuthContext } from "./client-COLiUdWe.js";
|
|
14
|
+
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-BfPeF4CE.js";
|
|
15
|
+
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-UPI45TD_.js";
|
|
16
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-BpnALDzR.js";
|
|
17
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-mDyxJV9U.js";
|
|
17
18
|
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-Ch33GU06.js";
|
|
18
19
|
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-DLj4vDeu.js";
|
|
19
|
-
import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-
|
|
20
|
+
import { i as setBoundedMap, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-CjnbX52D.js";
|
|
20
21
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
21
|
-
import {
|
|
22
|
+
import { createChannelProgressDraftCompositor, createPreviewMessageReceipt, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
22
23
|
import { normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalString, normalizeStringifiedEntries, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
24
|
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
24
25
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
25
26
|
import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
26
27
|
import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
27
28
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
28
|
-
import { createChannelInboundEnvelopeBuilder, createChannelPartialDeliveryError, hasFinalInboundReplyDispatch, isChannelPartialDeliveryError, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
29
|
+
import { createAcceptedChannelDeliveryResult, createChannelInboundEnvelopeBuilder, createChannelPartialDeliveryError, hasFinalInboundReplyDispatch, isChannelPartialDeliveryError, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
29
30
|
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
30
31
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
32
|
+
import { escapeRegExp, sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
31
33
|
import { format } from "node:util";
|
|
32
34
|
import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
|
|
33
|
-
import { escapeRegExp, sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
34
35
|
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
35
36
|
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
36
37
|
import { GROUP_POLICY_BLOCKED_LABEL, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
@@ -680,6 +681,19 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
680
681
|
};
|
|
681
682
|
}
|
|
682
683
|
//#endregion
|
|
684
|
+
//#region extensions/matrix/src/matrix/monitor/types.ts
|
|
685
|
+
const EventType = {
|
|
686
|
+
RoomMessage: "m.room.message",
|
|
687
|
+
RoomMessageEncrypted: "m.room.encrypted",
|
|
688
|
+
RoomMember: "m.room.member",
|
|
689
|
+
Location: "m.location",
|
|
690
|
+
Reaction: MATRIX_REACTION_EVENT_TYPE
|
|
691
|
+
};
|
|
692
|
+
const RelationType = {
|
|
693
|
+
Replace: "m.replace",
|
|
694
|
+
Thread: "m.thread"
|
|
695
|
+
};
|
|
696
|
+
//#endregion
|
|
683
697
|
//#region extensions/matrix/src/matrix/monitor/access-state.ts
|
|
684
698
|
function normalizeMatrixEntry(raw) {
|
|
685
699
|
return normalizeMatrixAllowList([raw ?? ""])[0] ?? null;
|
|
@@ -823,7 +837,7 @@ const matrixVerificationConstants = {
|
|
|
823
837
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
824
838
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
825
839
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
826
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-
|
|
840
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./send-B9l1lKau.js").then((n) => n.k), import("./direct-room-RinHjtqX.js").then((n) => n.t)]).then(([directManagementModule, directRoomModule]) => ({
|
|
827
841
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
828
842
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
829
843
|
})));
|
|
@@ -1641,11 +1655,11 @@ async function redactMatrixDraftEvent(client, roomId, draftEventId) {
|
|
|
1641
1655
|
function buildMatrixFinalizedPreviewContent() {
|
|
1642
1656
|
return { [MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY]: true };
|
|
1643
1657
|
}
|
|
1644
|
-
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-
|
|
1658
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-B9l1lKau.js").then((n) => n.s));
|
|
1645
1659
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1646
1660
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1647
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
1648
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
1661
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-D-iSW0iM.js"));
|
|
1662
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-DSwgyyBi.js"));
|
|
1649
1663
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
1650
1664
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1651
1665
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -1661,7 +1675,7 @@ function summarizeMatrixMessageContextEvent(event) {
|
|
|
1661
1675
|
const pollSummary = parsePollStartContent(event.content);
|
|
1662
1676
|
if (pollSummary) return formatPollAsText(pollSummary);
|
|
1663
1677
|
}
|
|
1664
|
-
const content =
|
|
1678
|
+
const content = resolveMatrixReplacementContent(event) ?? event.content;
|
|
1665
1679
|
return formatMatrixMessageText({
|
|
1666
1680
|
body: readStringValue(content.body),
|
|
1667
1681
|
filename: readStringValue(content.filename),
|
|
@@ -1808,10 +1822,8 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1808
1822
|
roomId,
|
|
1809
1823
|
threadRootId
|
|
1810
1824
|
}) : void 0;
|
|
1811
|
-
let threadContextBlockedByPolicy = false;
|
|
1812
1825
|
if (threadContext?.senderId && !shouldIncludeRoomContextSender("thread", threadContext.senderId)) {
|
|
1813
1826
|
logVerboseMessage(`matrix: drop thread root context (mode=${contextVisibilityMode})`);
|
|
1814
|
-
threadContextBlockedByPolicy = true;
|
|
1815
1827
|
threadContext = void 0;
|
|
1816
1828
|
}
|
|
1817
1829
|
let replyContext;
|
|
@@ -1820,10 +1832,6 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1820
1832
|
replyToSender: threadContext.senderLabel,
|
|
1821
1833
|
replyToSenderId: threadContext.senderId
|
|
1822
1834
|
};
|
|
1823
|
-
else if (replyToEventId && replyToEventId === threadRootId && threadContextBlockedByPolicy) replyContext = await resolveReplyContext({
|
|
1824
|
-
roomId,
|
|
1825
|
-
eventId: replyToEventId
|
|
1826
|
-
});
|
|
1827
1835
|
else replyContext = replyToEventId ? await resolveReplyContext({
|
|
1828
1836
|
roomId,
|
|
1829
1837
|
eventId: replyToEventId
|
|
@@ -2001,55 +2009,34 @@ async function createMatrixDraftController(params) {
|
|
|
2001
2009
|
accountId,
|
|
2002
2010
|
log: logVerboseMessage
|
|
2003
2011
|
})) : void 0;
|
|
2004
|
-
const
|
|
2005
|
-
const shouldSuppressDefaultToolProgressMessages = Boolean(draftStream) && (shouldStreamPreviewToolProgress || params.streaming === "progress");
|
|
2012
|
+
const shouldSuppressDefaultToolProgressMessages = Boolean(draftStream) && (Boolean(draftStream) && previewToolProgressEnabled || params.streaming === "progress");
|
|
2006
2013
|
let currentDraftMessageGeneration = 0;
|
|
2007
2014
|
let currentDraftBlockOffset = 0;
|
|
2008
2015
|
let latestDraftFullText = "";
|
|
2009
2016
|
const pendingDraftBoundaries = [];
|
|
2010
2017
|
const latestQueuedDraftBoundaryOffsets = /* @__PURE__ */ new Map();
|
|
2011
2018
|
let currentDraftReplyToId = draftReplyToId;
|
|
2012
|
-
let previewPlan;
|
|
2013
|
-
let previewPlanExplanation;
|
|
2014
|
-
let previewPlanSuppressed = false;
|
|
2015
2019
|
const progressConfigEntry = accountConfig ?? cfg.channels?.matrix;
|
|
2016
2020
|
const progressSeed = `${accountId}:${roomId}`;
|
|
2017
|
-
const renderPreviewPlan = () => formatChannelProgressDraftText({
|
|
2018
|
-
entry: progressConfigEntry,
|
|
2019
|
-
lines: [...progressDraft.getSnapshot().lines],
|
|
2020
|
-
seed: progressSeed,
|
|
2021
|
-
formatLine: formatMatrixToolProgressMarkdownCode,
|
|
2022
|
-
bullet: "-",
|
|
2023
|
-
narration: previewPlanExplanation,
|
|
2024
|
-
plan: previewPlan
|
|
2025
|
-
});
|
|
2026
2021
|
const progressDraft = createChannelProgressDraftCompositor({
|
|
2027
2022
|
entry: progressConfigEntry,
|
|
2028
2023
|
mode: streaming === "quiet" ? "partial" : streaming,
|
|
2029
2024
|
active: Boolean(draftStream),
|
|
2030
2025
|
seed: progressSeed,
|
|
2031
2026
|
formatLine: formatMatrixToolProgressMarkdownCode,
|
|
2032
|
-
buildProgressEventLine: (input, options) => input.event === "approval" ? formatChannelProgressDraftLine(input, options) : buildChannelProgressDraftLineForEntry(progressConfigEntry, input, options),
|
|
2033
2027
|
update: async (text, options) => {
|
|
2034
|
-
const previewText =
|
|
2028
|
+
const previewText = text.replace(/^• /gmu, "- ");
|
|
2035
2029
|
if (!draftStream) return false;
|
|
2036
2030
|
draftStream.update(previewText);
|
|
2037
2031
|
if (options?.flush) await draftStream.flush();
|
|
2038
2032
|
return Boolean(draftStream.eventId());
|
|
2039
|
-
}
|
|
2033
|
+
},
|
|
2034
|
+
deleteCurrent: () => draftStream?.deleteCurrentMessage()
|
|
2040
2035
|
});
|
|
2041
|
-
const resetPreviewToolProgress = () => {
|
|
2042
|
-
previewPlan = void 0;
|
|
2043
|
-
previewPlanExplanation = void 0;
|
|
2044
|
-
previewPlanSuppressed = false;
|
|
2045
|
-
progressDraft.reset();
|
|
2046
|
-
};
|
|
2047
2036
|
const buildPreviewToolProgressReplyOptions = () => {
|
|
2048
2037
|
if (!shouldSuppressDefaultToolProgressMessages) return {};
|
|
2049
|
-
const options = { suppressDefaultToolProgressMessages: true };
|
|
2050
|
-
if (!shouldStreamPreviewToolProgress) return options;
|
|
2051
2038
|
return {
|
|
2052
|
-
|
|
2039
|
+
suppressDefaultToolProgressMessages: true,
|
|
2053
2040
|
onToolStart: async (payload) => {
|
|
2054
2041
|
return await progressDraft.pushToolEvent(payload);
|
|
2055
2042
|
},
|
|
@@ -2058,13 +2045,7 @@ async function createMatrixDraftController(params) {
|
|
|
2058
2045
|
},
|
|
2059
2046
|
onPlanUpdate: async (payload) => {
|
|
2060
2047
|
if (payload.phase !== "update") return false;
|
|
2061
|
-
|
|
2062
|
-
if (!draftStream || previewPlanSuppressed) return false;
|
|
2063
|
-
previewPlan = payload.steps?.length ? payload.steps.map((step) => ({ ...step })) : void 0;
|
|
2064
|
-
previewPlanExplanation = payload.explanation?.replace(/\s+/g, " ").trim() || void 0;
|
|
2065
|
-
const text = renderPreviewPlan();
|
|
2066
|
-
if (text) draftStream.update(text);
|
|
2067
|
-
return false;
|
|
2048
|
+
return await progressDraft.pushPlanProgress(payload.steps, { explanation: payload.explanation });
|
|
2068
2049
|
},
|
|
2069
2050
|
onApprovalEvent: async (payload) => {
|
|
2070
2051
|
return await progressDraft.pushApprovalEvent(payload);
|
|
@@ -2121,7 +2102,6 @@ async function createMatrixDraftController(params) {
|
|
|
2121
2102
|
latestQueuedDraftBoundaryOffsets.clear();
|
|
2122
2103
|
currentDraftReplyToId = draftReplyToId;
|
|
2123
2104
|
progressDraft.beginNewTurn({ force: true });
|
|
2124
|
-
resetPreviewToolProgress();
|
|
2125
2105
|
};
|
|
2126
2106
|
return {
|
|
2127
2107
|
draftStream,
|
|
@@ -2130,12 +2110,13 @@ async function createMatrixDraftController(params) {
|
|
|
2130
2110
|
queueDraftBlockBoundary,
|
|
2131
2111
|
advanceDraftBlockBoundary,
|
|
2132
2112
|
resetDraftBlockOffsets,
|
|
2133
|
-
|
|
2113
|
+
beginAssistantMessage: () => progressDraft.beginAssistantMessage(),
|
|
2134
2114
|
resetDraftDeliveryState,
|
|
2135
2115
|
updateDraftFromLatestFullText,
|
|
2136
2116
|
draftDisposition: () => draftDisposition,
|
|
2137
2117
|
beginDraftGeneration: () => {
|
|
2138
2118
|
draftDisposition = "active";
|
|
2119
|
+
progressDraft.resetActivity();
|
|
2139
2120
|
},
|
|
2140
2121
|
markDraftConsumed: () => {
|
|
2141
2122
|
draftDisposition = "consumed";
|
|
@@ -2153,12 +2134,7 @@ async function createMatrixDraftController(params) {
|
|
|
2153
2134
|
onPartialReply: (text) => {
|
|
2154
2135
|
if (progressDraftStreaming) return false;
|
|
2155
2136
|
latestDraftFullText = text;
|
|
2156
|
-
if (text.trim()) {
|
|
2157
|
-
previewPlanSuppressed = true;
|
|
2158
|
-
previewPlan = void 0;
|
|
2159
|
-
previewPlanExplanation = void 0;
|
|
2160
|
-
progressDraft.suppress();
|
|
2161
|
-
}
|
|
2137
|
+
if (text.trim()) progressDraft.resetActivity({ suppressed: true });
|
|
2162
2138
|
updateDraftFromLatestFullText();
|
|
2163
2139
|
return false;
|
|
2164
2140
|
}
|
|
@@ -2414,10 +2390,7 @@ async function resolveMatrixIngressAccess(config) {
|
|
|
2414
2390
|
const isRoom = !isDirectMessage;
|
|
2415
2391
|
const { audioPreflightMode, locationPayload, reservedHistorySlot, selfUserId } = paramsLocal;
|
|
2416
2392
|
const messageId = event.event_id ?? "";
|
|
2417
|
-
const threadRootId = resolveMatrixThreadRootId(
|
|
2418
|
-
event,
|
|
2419
|
-
content
|
|
2420
|
-
});
|
|
2393
|
+
const threadRootId = resolveMatrixThreadRootId(content);
|
|
2421
2394
|
const thread = resolveMatrixThreadRouting({
|
|
2422
2395
|
isDirectMessage,
|
|
2423
2396
|
threadReplies,
|
|
@@ -2494,7 +2467,7 @@ async function resolveMatrixIngressAccess(config) {
|
|
|
2494
2467
|
};
|
|
2495
2468
|
const storeAllowFrom = isDirectMessage && dmPolicy !== "allowlist" && dmPolicy !== "open" ? await readStoreAllowFrom() : [];
|
|
2496
2469
|
const roomUsers = roomConfig?.users ?? [];
|
|
2497
|
-
const { liveDmAllowFrom, liveGroupAllowFrom } = await resolveLiveAccountAllowlists();
|
|
2470
|
+
const { liveCfg, liveDmAllowFrom, liveGroupAllowFrom } = await resolveLiveAccountAllowlists();
|
|
2498
2471
|
const accessState = await resolveMatrixMonitorAccessState({
|
|
2499
2472
|
allowFrom: liveDmAllowFrom,
|
|
2500
2473
|
storeAllowFrom,
|
|
@@ -2583,6 +2556,8 @@ async function resolveMatrixIngressAccess(config) {
|
|
|
2583
2556
|
return;
|
|
2584
2557
|
}
|
|
2585
2558
|
return {
|
|
2559
|
+
cfg: liveCfg,
|
|
2560
|
+
liveDmAllowFrom,
|
|
2586
2561
|
content,
|
|
2587
2562
|
messageId,
|
|
2588
2563
|
audioPreflightMode,
|
|
@@ -2797,8 +2772,8 @@ function resolveMentions(params) {
|
|
|
2797
2772
|
//#region extensions/matrix/src/matrix/monitor/handler-ingress-content.ts
|
|
2798
2773
|
async function resolveMatrixIngressContent(config) {
|
|
2799
2774
|
const { handler, params: paramsLocal, access, roomId, event, eventType, isPollEvent, eventTs, senderId, roomHistoryTracker, commitInboundEventIfClaimed } = config;
|
|
2800
|
-
const { client, core,
|
|
2801
|
-
const { content: accessContent, messageId, audioPreflightMode, isDirectMessage, isRoom, locationPayload, reservedHistorySlot, threadRootId, thread, historyThreadId, discardReservedHistorySlot, markReservedHistorySlotConsumed, commitInboundEventIfClaimedAndDiscardReserved, roomConfig, allowBotsMode, isConfiguredBotSender, selfUserId, botLoopProtection, roomMatchMeta, getSenderName, accessState, effectiveGroupAllowFrom, effectiveRoomUsers } = access;
|
|
2775
|
+
const { client, core, accountId, accountConfig, logger, logVerboseMessage, historyLimit, mediaMaxBytes, dmSessionScope, getMemberDisplayName } = handler;
|
|
2776
|
+
const { cfg, liveDmAllowFrom, content: accessContent, messageId, audioPreflightMode, isDirectMessage, isRoom, locationPayload, reservedHistorySlot, threadRootId, thread, historyThreadId, discardReservedHistorySlot, markReservedHistorySlotConsumed, commitInboundEventIfClaimedAndDiscardReserved, roomConfig, allowBotsMode, isConfiguredBotSender, selfUserId, botLoopProtection, roomMatchMeta, getSenderName, accessState, effectiveGroupAllowFrom, effectiveRoomUsers } = access;
|
|
2802
2777
|
const { messageIngress, resolveMessageIngress } = accessState;
|
|
2803
2778
|
let content = accessContent;
|
|
2804
2779
|
let pollSnapshotPromise = null;
|
|
@@ -3082,6 +3057,8 @@ async function resolveMatrixIngressContent(config) {
|
|
|
3082
3057
|
}, historyThreadId) : void 0;
|
|
3083
3058
|
if (reservedHistorySlot && preparedTrigger) markReservedHistorySlotConsumed();
|
|
3084
3059
|
return {
|
|
3060
|
+
cfg,
|
|
3061
|
+
liveDmAllowFrom,
|
|
3085
3062
|
messageIngress,
|
|
3086
3063
|
resolveMessageIngress,
|
|
3087
3064
|
route: _route,
|
|
@@ -3232,22 +3209,14 @@ function mergeMatrixReplyDeliveryResults(results) {
|
|
|
3232
3209
|
visibleReplySent: false,
|
|
3233
3210
|
suppression: { reason: "no_visible_result" }
|
|
3234
3211
|
};
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
}
|
|
3241
|
-
for (const messageId of result.messageIds ?? []) receiptInputs.push({ messageId });
|
|
3242
|
-
}
|
|
3243
|
-
const receipt = receiptInputs.length > 0 ? createMessageReceiptFromOutboundResults({ results: receiptInputs }) : void 0;
|
|
3212
|
+
const content = joinMatrixVisibleContent(visibleResults.map((result) => result.content));
|
|
3213
|
+
if (visibleResults.some((result) => result.receipt || result.messageIds?.length)) return createAcceptedChannelDeliveryResult({
|
|
3214
|
+
deliveryResults: visibleResults,
|
|
3215
|
+
content
|
|
3216
|
+
});
|
|
3244
3217
|
return {
|
|
3245
|
-
...receipt ? {
|
|
3246
|
-
messageIds: listMessageReceiptPlatformIds(receipt),
|
|
3247
|
-
receipt
|
|
3248
|
-
} : {},
|
|
3249
3218
|
visibleReplySent: true,
|
|
3250
|
-
content
|
|
3219
|
+
content
|
|
3251
3220
|
};
|
|
3252
3221
|
}
|
|
3253
3222
|
function toMatrixPartialDeliveryError(error, settled) {
|
|
@@ -3260,13 +3229,10 @@ function toMatrixPartialDeliveryError(error, settled) {
|
|
|
3260
3229
|
}
|
|
3261
3230
|
function createMatrixReplyDeliveryResult(results) {
|
|
3262
3231
|
if (results.length === 0) return mergeMatrixReplyDeliveryResults([]);
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
messageIds: listMessageReceiptPlatformIds(receipt),
|
|
3266
|
-
receipt,
|
|
3267
|
-
visibleReplySent: true,
|
|
3232
|
+
return createAcceptedChannelDeliveryResult({
|
|
3233
|
+
results: results.map((result) => ({ receipt: result.receipt })),
|
|
3268
3234
|
content: joinMatrixVisibleContent(results.map((result) => result.content))
|
|
3269
|
-
};
|
|
3235
|
+
});
|
|
3270
3236
|
}
|
|
3271
3237
|
function resolveVisibleMatrixReplyText(text) {
|
|
3272
3238
|
if (typeof text !== "string") return;
|
|
@@ -3304,7 +3270,8 @@ async function deliverMatrixReplies(params) {
|
|
|
3304
3270
|
}
|
|
3305
3271
|
const explicitReplyToId = reply.replyToTag || reply.replyToCurrent ? reply.replyToId?.trim() : void 0;
|
|
3306
3272
|
const rawText = visibleText ?? "";
|
|
3307
|
-
const replyToIdForReply = explicitReplyToId || (params.threadId
|
|
3273
|
+
const replyToIdForReply = explicitReplyToId || (!params.threadId && params.replyToMode !== "off" && (params.replyToMode === "all" || !hasRepliedRef.value) ? (reply.replyToId ?? params.replyToId)?.trim() : void 0);
|
|
3274
|
+
const fallbackReplyToId = params.threadId ? (reply.replyToId ?? params.replyToId)?.trim() : void 0;
|
|
3308
3275
|
const onDeliveryResult = (result) => {
|
|
3309
3276
|
acceptedResults.push(result);
|
|
3310
3277
|
if (replyToIdForReply) hasRepliedRef.value = true;
|
|
@@ -3315,6 +3282,7 @@ async function deliverMatrixReplies(params) {
|
|
|
3315
3282
|
client: params.client,
|
|
3316
3283
|
cfg: params.cfg,
|
|
3317
3284
|
replyToId: replyToIdForReply,
|
|
3285
|
+
fallbackReplyToId,
|
|
3318
3286
|
threadId: params.threadId,
|
|
3319
3287
|
accountId: params.accountId,
|
|
3320
3288
|
extraContent,
|
|
@@ -3331,6 +3299,7 @@ async function deliverMatrixReplies(params) {
|
|
|
3331
3299
|
mediaUrl,
|
|
3332
3300
|
mediaLocalRoots: params.mediaLocalRoots,
|
|
3333
3301
|
replyToId: replyToIdForReply,
|
|
3302
|
+
fallbackReplyToId,
|
|
3334
3303
|
threadId: params.threadId,
|
|
3335
3304
|
audioAsVoice: reply.audioAsVoice,
|
|
3336
3305
|
accountId: params.accountId,
|
|
@@ -3428,7 +3397,7 @@ function createMatrixReplyDispatcher(config) {
|
|
|
3428
3397
|
mediaLocalRoots
|
|
3429
3398
|
}));
|
|
3430
3399
|
}
|
|
3431
|
-
const payloadReplyMismatch = !threadTarget &&
|
|
3400
|
+
const payloadReplyMismatch = (!threadTarget && replyToMode !== "off" || payload.replyToTag || payload.replyToCurrent) && normalizeOptionalString(payload.replyToId) !== draftController.currentReplyToId();
|
|
3432
3401
|
let mustDeliverFinalNormally = draftStream.mustDeliverFinalNormally();
|
|
3433
3402
|
if (Boolean(payload.text?.trim()) && !payload.isError && !payloadReplyMismatch && !mustDeliverFinalNormally) {
|
|
3434
3403
|
await draftStream.stop();
|
|
@@ -3749,7 +3718,7 @@ function createMatrixHandlerState(config) {
|
|
|
3749
3718
|
const SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE = "SESSION_RESTART_RECOVERY_TOMBSTONE";
|
|
3750
3719
|
const RESTART_RECOVERY_TOMBSTONE_NOTICE = "This session ended during gateway restart recovery and cannot accept more messages. Send /new or /reset to start a replacement session.";
|
|
3751
3720
|
function createMatrixRoomMessageHandler(params) {
|
|
3752
|
-
const { client, core, cfg, accountId, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, dmSessionScope, streaming, previewToolProgressEnabled, blockStreamingEnabled, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist, resolveStorePath: resolveStorePathImpl = resolveStorePath, createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl = createChannelInboundEnvelopeBuilder, finalizeInboundContext, resolveHumanDelayConfig: resolveHumanDelayConfigImpl = resolveHumanDelayConfig } = params;
|
|
3721
|
+
const { client, core, cfg: startupConfig, accountId, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, dmSessionScope, streaming, previewToolProgressEnabled, blockStreamingEnabled, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist, resolveStorePath: resolveStorePathImpl = resolveStorePath, createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl = createChannelInboundEnvelopeBuilder, finalizeInboundContext, resolveHumanDelayConfig: resolveHumanDelayConfigImpl = resolveHumanDelayConfig } = params;
|
|
3753
3722
|
const handlerConfig = {
|
|
3754
3723
|
...params,
|
|
3755
3724
|
allowFromResolvedEntries,
|
|
@@ -3760,11 +3729,6 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3760
3729
|
createChannelInboundEnvelopeBuilder: createChannelInboundEnvelopeBuilderImpl,
|
|
3761
3730
|
resolveHumanDelayConfig: resolveHumanDelayConfigImpl
|
|
3762
3731
|
};
|
|
3763
|
-
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
3764
|
-
cfg,
|
|
3765
|
-
channel: "matrix",
|
|
3766
|
-
accountId
|
|
3767
|
-
});
|
|
3768
3732
|
const handlerState = createMatrixHandlerState({
|
|
3769
3733
|
core,
|
|
3770
3734
|
accountId,
|
|
@@ -3870,7 +3834,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3870
3834
|
...prefix,
|
|
3871
3835
|
audioPreflightMode: shouldDeferMatrixAudioPreflightForRoomIngress({
|
|
3872
3836
|
content: prefix.content,
|
|
3873
|
-
cfg
|
|
3837
|
+
cfg: startupConfig
|
|
3874
3838
|
}) ? "defer" : "run"
|
|
3875
3839
|
});
|
|
3876
3840
|
return result && "deferredPrefix" in result ? { deferredPrefix: result.deferredPrefix } : { ingressResult: result };
|
|
@@ -3882,7 +3846,12 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3882
3846
|
})();
|
|
3883
3847
|
if (!resolvedIngressResult) return;
|
|
3884
3848
|
if ("deferredPrefix" in resolvedIngressResult) return;
|
|
3885
|
-
const { route: _route, hasExplicitSessionBinding, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, commandBodyText, media, preflightAudioTranscript, locationPayload, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection, effectiveGroupAllowFrom, effectiveRoomUsers, resolveMessageIngress } = resolvedIngressResult;
|
|
3849
|
+
const { cfg, liveDmAllowFrom, route: _route, hasExplicitSessionBinding, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, commandBodyText, media, preflightAudioTranscript, locationPayload, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection, effectiveGroupAllowFrom, effectiveRoomUsers, resolveMessageIngress } = resolvedIngressResult;
|
|
3850
|
+
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
3851
|
+
cfg,
|
|
3852
|
+
channel: "matrix",
|
|
3853
|
+
accountId
|
|
3854
|
+
});
|
|
3886
3855
|
const inboundContext = await resolveMatrixInboundContext({
|
|
3887
3856
|
resolveMessageIngress,
|
|
3888
3857
|
client,
|
|
@@ -4003,14 +3972,11 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
4003
3972
|
logVerboseMessage
|
|
4004
3973
|
});
|
|
4005
3974
|
const { deliverReply, onReplyError, turnDispatcherOptions } = replyDispatcher;
|
|
4006
|
-
const pinnedMainDmOwner = isDirectMessage ?
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
normalizeEntry: normalizeMatrixUserId
|
|
4012
|
-
});
|
|
4013
|
-
})() : null;
|
|
3975
|
+
const pinnedMainDmOwner = isDirectMessage ? resolvePinnedMainDmOwnerFromAllowlist({
|
|
3976
|
+
dmScope: cfg.session?.dmScope,
|
|
3977
|
+
allowFrom: liveDmAllowFrom,
|
|
3978
|
+
normalizeEntry: normalizeMatrixUserId
|
|
3979
|
+
}) : null;
|
|
4014
3980
|
const inboundLastRouteSessionKey = resolveInboundLastRouteSessionKey({
|
|
4015
3981
|
route: _route,
|
|
4016
3982
|
sessionKey: _route.sessionKey
|
|
@@ -4107,7 +4073,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
4107
4073
|
} : void 0,
|
|
4108
4074
|
onAssistantMessageStart: draftStream ? () => {
|
|
4109
4075
|
draftController.resetDraftBlockOffsets();
|
|
4110
|
-
draftController.
|
|
4076
|
+
draftController.beginAssistantMessage();
|
|
4111
4077
|
return false;
|
|
4112
4078
|
} : void 0,
|
|
4113
4079
|
onQueuedFollowupAdmitted: draftStream ? draftController.resetDraftDeliveryState : void 0,
|
|
@@ -4128,7 +4094,8 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
4128
4094
|
cfg,
|
|
4129
4095
|
client,
|
|
4130
4096
|
accountId: _route.accountId,
|
|
4131
|
-
replyToId: threadTarget
|
|
4097
|
+
replyToId: threadTarget || replyToMode === "off" ? void 0 : messageId,
|
|
4098
|
+
fallbackReplyToId: threadTarget,
|
|
4132
4099
|
threadId: threadTarget,
|
|
4133
4100
|
deliveryQueueId: `matrix:restart-recovery-tombstone:${_route.accountId}:${roomId}:${eventId}`,
|
|
4134
4101
|
deliveryPartIndex: 0,
|
|
@@ -4197,7 +4164,7 @@ const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.a
|
|
|
4197
4164
|
import("./config-update-BnX26jCO.js").then((n) => n.t),
|
|
4198
4165
|
import("./device-health-B4-YXtJR.js").then((n) => n.t),
|
|
4199
4166
|
import("./profile-vmjsmhh4.js").then((n) => n.n),
|
|
4200
|
-
import("./startup-verification-
|
|
4167
|
+
import("./startup-verification-BTSf31hS.js")
|
|
4201
4168
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
4202
4169
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
4203
4170
|
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
@@ -4427,7 +4394,7 @@ function resolveMatrixStreamingMode(streaming) {
|
|
|
4427
4394
|
}
|
|
4428
4395
|
function resolveMatrixPreviewToolProgress(streaming) {
|
|
4429
4396
|
if (!streaming) return true;
|
|
4430
|
-
if (resolveMatrixStreamingMode(streaming) === "progress") return streaming.progress?.toolProgress ?? streaming.preview?.toolProgress ??
|
|
4397
|
+
if (resolveMatrixStreamingMode(streaming) === "progress") return streaming.progress?.toolProgress ?? streaming.preview?.toolProgress ?? false;
|
|
4431
4398
|
return streaming.preview?.toolProgress ?? true;
|
|
4432
4399
|
}
|
|
4433
4400
|
function resolveMatrixPreviewToolProgressEnabled(streaming) {
|
|
@@ -4436,7 +4403,6 @@ function resolveMatrixPreviewToolProgressEnabled(streaming) {
|
|
|
4436
4403
|
const DEFAULT_MEDIA_MAX_MB = 20;
|
|
4437
4404
|
async function monitorMatrixProvider(opts = {}) {
|
|
4438
4405
|
if (opts.abortSignal?.aborted) return;
|
|
4439
|
-
if (isBunRuntime()) throw new Error("Matrix provider requires Node (bun runtime not supported)");
|
|
4440
4406
|
const core = getMatrixRuntime();
|
|
4441
4407
|
let cfg = core.config.current();
|
|
4442
4408
|
if (cfg.channels?.["matrix"]?.enabled === false) return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-
|
|
1
|
+
import { i as sendPollMatrix, r as sendMessageMatrix } from "./send-B9l1lKau.js";
|
|
2
2
|
import { createMessageReceiptFromOutboundResults, createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
3
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
@@ -2,7 +2,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
//#region extensions/matrix/src/plugin-entry.runtime.ts
|
|
5
|
-
const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-
|
|
5
|
+
const loadMatrixVerificationRuntime = createLazyRuntimeModule(() => import("./verification-B_aqtbx-.js").then((n) => n.y));
|
|
6
6
|
function sendError(respond, err) {
|
|
7
7
|
respond(false, { error: formatErrorMessage(err) });
|
|
8
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
2
2
|
import { n as resolveMatrixConfigPath, r as updateMatrixAccountConfig } from "./config-update-BnX26jCO.js";
|
|
3
3
|
import { r as syncMatrixOwnProfile } from "./profile-vmjsmhh4.js";
|
|
4
|
-
import { n as withResolvedActionClient } from "./client-
|
|
4
|
+
import { n as withResolvedActionClient } from "./client-BXQCQDfY.js";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
//#region extensions/matrix/src/matrix/actions/profile.ts
|
|
7
7
|
async function updateMatrixOwnProfile(opts = {}) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as resolveMatrixThreadRouting, r as resolveMatrixInboundRoute } from "./channel-BpYiqmx-.js";
|
|
3
|
+
import { g as resolveMatrixThreadRootId } from "./send-B9l1lKau.js";
|
|
3
4
|
import { a as extractMatrixReactionAnnotation } from "./reaction-common-DkrQdBSZ.js";
|
|
4
5
|
import { i as resolveMatrixApprovalReactionTargetWithPersistence, o as unregisterMatrixApprovalReactionTargetsForApproval } from "./approval-reactions-1fwEhoK9.js";
|
|
5
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -7,9 +8,9 @@ import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
|
|
|
7
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
8
9
|
import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
9
10
|
//#region extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
10
|
-
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-
|
|
11
|
+
const loadApprovalReactionAuth = createLazyRuntimeModule(() => import("./approval-reaction-auth-Cd0sKHFc.js"));
|
|
11
12
|
const loadExecApprovalResolver = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/approval-gateway-runtime"));
|
|
12
|
-
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-
|
|
13
|
+
const loadMatrixSend = createLazyRuntimeModule(() => import("./send-B9l1lKau.js").then((n) => n.s));
|
|
13
14
|
function buildMatrixApprovalTerminalText(result) {
|
|
14
15
|
const approval = result.approval;
|
|
15
16
|
const terminalLabel = approval.status === "allowed" ? approval.decision === "allow-always" ? "Allowed always" : "Allowed once" : approval.status === "denied" ? "Denied" : approval.status === "expired" ? "Expired" : "Cancelled";
|
|
@@ -129,10 +130,7 @@ async function handleInboundMatrixReaction(params) {
|
|
|
129
130
|
if (!targetSender) return;
|
|
130
131
|
if (notificationMode === "own" && targetSender !== params.selfUserId) return;
|
|
131
132
|
const targetContent = targetEvent && targetEvent.content && typeof targetEvent.content === "object" ? targetEvent.content : void 0;
|
|
132
|
-
const threadRootId = targetContent ? resolveMatrixThreadRootId(
|
|
133
|
-
event: targetEvent,
|
|
134
|
-
content: targetContent
|
|
135
|
-
}) : void 0;
|
|
133
|
+
const threadRootId = targetContent ? resolveMatrixThreadRootId(targetContent) : void 0;
|
|
136
134
|
const accountConfig = resolveMatrixAccountConfig({
|
|
137
135
|
cfg: params.cfg,
|
|
138
136
|
accountId: params.accountId
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.js";
|
|
3
|
-
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { n as listMatrixDirectoryGroupsLive, r as listMatrixDirectoryPeersLive } from "./directory-live-DABCxf8j.js";
|
|
4
4
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/matrix/src/resolve-targets.ts
|
|
6
6
|
var resolve_targets_exports = /* @__PURE__ */ __exportAll({ resolveMatrixTargets: () => resolveMatrixTargets });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
1
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-BpnALDzR.js";
|
|
2
2
|
//#region extensions/matrix/src/resolver.runtime.ts
|
|
3
3
|
const matrixResolverRuntime = { resolveMatrixTargets };
|
|
4
4
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as EventType } from "./messages-
|
|
3
|
-
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-
|
|
1
|
+
import { O as resolveMatrixRoomId } from "./send-B9l1lKau.js";
|
|
2
|
+
import { s as EventType } from "./messages-H4mi9Cap.js";
|
|
3
|
+
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-BXQCQDfY.js";
|
|
4
4
|
import { n as isMatrixNotFoundError } from "./errors-DKVS3_DO.js";
|
|
5
|
+
import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
6
|
//#region extensions/matrix/src/matrix/monitor/bounded-cache.ts
|
|
6
7
|
function setBoundedMap(map, key, value, maxEntries) {
|
|
7
8
|
map.set(key, value);
|
|
@@ -34,6 +35,7 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
34
35
|
let name = null;
|
|
35
36
|
let topic = null;
|
|
36
37
|
let canonicalAlias = null;
|
|
38
|
+
let altAliases = [];
|
|
37
39
|
let memberCount = null;
|
|
38
40
|
try {
|
|
39
41
|
const nameState = await client.getRoomStateEvent(resolvedRoom, "m.room.name", "");
|
|
@@ -46,6 +48,7 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
46
48
|
try {
|
|
47
49
|
const aliasState = await client.getRoomStateEvent(resolvedRoom, "m.room.canonical_alias", "");
|
|
48
50
|
canonicalAlias = typeof aliasState?.alias === "string" ? aliasState.alias : null;
|
|
51
|
+
altAliases = filterStringEntries(aliasState?.alt_aliases);
|
|
49
52
|
} catch {}
|
|
50
53
|
try {
|
|
51
54
|
memberCount = (await client.getJoinedRoomMembers(resolvedRoom)).length;
|
|
@@ -55,7 +58,7 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
55
58
|
name,
|
|
56
59
|
topic,
|
|
57
60
|
canonicalAlias,
|
|
58
|
-
altAliases
|
|
61
|
+
altAliases,
|
|
59
62
|
memberCount
|
|
60
63
|
};
|
|
61
64
|
});
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as resolveMatrixChannelConfig, i as resolveConfiguredMatrixAccountIds, n as findMatrixAccountEntry, o as resolveMatrixDefaultOrOnlyAccountId, r as requiresExplicitMatrixDefaultAccount, u as resolveMatrixAccountStringValues } from "./account-selection-Bbtc483D.js";
|
|
2
2
|
import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-dGqak9dN.js";
|
|
3
3
|
import { r as setMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as resolveMatrixCredentialsFilename, i as resolveMatrixCredentialsDir, l as sanitizeMatrixPathSegment, o as resolveMatrixCredentialsPath, r as resolveMatrixAccountStorageRoot, s as resolveMatrixHomeserverKey, t as hashMatrixAccessToken } from "./storage-paths-DVCANXTc.js";
|
|
5
5
|
import { f as setMatrixThreadBindingMaxAgeBySessionKey, u as setMatrixThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings-shared-oNPiyMWY.js";
|
|
6
6
|
import { n as ensureMatrixSdkInstalled, r as isMatrixSdkAvailable } from "./deps-mtxF2mHI.js";
|
|
7
7
|
import { chunkTextForOutbound as chunkTextForOutbound$1 } from "openclaw/plugin-sdk/text-chunking";
|