@openclaw/matrix 2026.9.1-beta.1 → 2026.9.2
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-BZWN9tGS.js → account-config-CRsKoMqJ.js} +1 -1
- package/dist/{account-selection-CWuhuFn1.js → account-selection-DA-jfx22.js} +74 -36
- package/dist/{accounts-BCzyubQt.js → accounts-DR1c4xF_.js} +4 -5
- package/dist/api.js +5 -5
- package/dist/{approval-handler.runtime-G9fLHUWe.js → approval-handler.runtime-BJCD4dLf.js} +34 -11
- package/dist/{approval-ids-C6FD3pVY.js → approval-ids-Bst7HM_o.js} +1 -1
- package/dist/{approval-reaction-auth-60xHiDtQ.js → approval-reaction-auth-DhH8QOSe.js} +2 -2
- package/dist/{approval-reactions-tXh9KYrW.js → approval-reactions-1fwEhoK9.js} +1 -1
- package/dist/{channel-CBEvelTE.js → channel-Bs8VLb6q.js} +63 -58
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel.runtime-CCJRhdH5.js +76 -0
- package/dist/{channel.setup-sWPOGyQG.js → channel.setup-DhmDXwPp.js} +32 -22
- package/dist/{cli-DrTD2a_q.js → cli-IvDUuiDH.js} +179 -135
- package/dist/{cli-metadata-DrYVwQ_r.js → cli-metadata-BGryAl2e.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-hs1ePy2O.js → client-Dj4mcf-s.js} +73 -22
- package/dist/{client-bootstrap-BxdxjCwA.js → client-bootstrap-n1Rqc8Go.js} +1 -1
- package/dist/{client-BUtHbzib.js → client-oNOlldJI.js} +2 -2
- package/dist/{config-update-Bor_Pjsv.js → config-update-BnX26jCO.js} +48 -31
- package/dist/contract-api.js +2 -2
- package/dist/{credentials-BdAaWuiR.js → credentials-DJj2xs3q.js} +4 -8
- package/dist/{credentials-read-B37cQknZ.js → credentials-read-mexhw-Ur.js} +7 -5
- package/dist/{credentials-write.runtime-nAV2-5uR.js → credentials-write.runtime-DQt-kgJq.js} +1 -1
- package/dist/{crypto-runtime-C4WDYxlP.js → crypto-runtime-m1eplj3b.js} +7 -7
- package/dist/crypto-snapshot-doctor.runtime-D0v841D_.js +91 -0
- package/dist/{deps-CcVJfvRM.js → deps-mtxF2mHI.js} +1 -1
- package/dist/{directory-live-D0KfJlby.js → directory-live-DLUgWBhA.js} +8 -6
- package/dist/{doctor-EWf9CDso.js → doctor-CJE8wO6y.js} +1 -1
- package/dist/{doctor-contract-DEt4O4Zt.js → doctor-contract-HyWFZQVG.js} +5 -4
- package/dist/doctor-contract-api.js +89 -109
- package/dist/{draft-stream-B_m79Ynb.js → draft-stream-DglwxWzJ.js} +1 -1
- package/dist/{encryption-guidance-DmLY8NiO.js → encryption-guidance-BNcZNQZI.js} +3 -2
- package/dist/helper-api.js +1 -1
- package/dist/{http-client-D8o8b9u6.js → http-client-DOmFvKvB.js} +10 -7
- package/dist/{idb-persistence-DfgW720p.js → idb-persistence-CU7CNLlX.js} +2 -2
- package/dist/{idb-persistence-lock-DAJ49nZX.js → idb-persistence-lock-B3fZXyF_.js} +1 -1
- package/dist/{inbound-dedupe-RvSLqdsz.js → inbound-dedupe-Ch33GU06.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{messages-Dow9EOoJ.js → messages-Czn8lNEh.js} +154 -5
- package/dist/{monitor-DBB47wTy.js → monitor-DouG43FJ.js} +200 -156
- package/dist/outbound-Co_tJyE6.js +220 -0
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-B1YPxG9x.js +2 -0
- package/dist/{profile-update-C61NR24_.js → profile-update-CAl8nZNG.js} +5 -4
- package/dist/{profile-D-Wubo0A.js → profile-vmjsmhh4.js} +1 -1
- package/dist/{reaction-events-BZUgLIZI.js → reaction-events-C_7G7bvI.js} +9 -7
- package/dist/{resolve-targets-DXzZwsIY.js → resolve-targets-B64O69Nd.js} +1 -1
- package/dist/{resolver.runtime-p5qJ3Kst.js → resolver.runtime-TRmePJDV.js} +1 -1
- package/dist/{room-info-BXQA7y10.js → room-info-6viLR3NH.js} +55 -1
- package/dist/runtime-api.js +2 -2
- package/dist/{sdk-CljOKEvc.js → sdk-C1yfda1L.js} +534 -26
- package/dist/{send-BKu9Ghi4.js → send-B5XChnvB.js} +31 -33
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-CpE6C3qV.js → setup-bootstrap-S_loyUyM.js} +3 -3
- package/dist/{setup-core-CyvaCOOr.js → setup-core-XkIfQ65J.js} +8 -7
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-DtRvRcCT.js → setup-surface-B2yZ8KGc.js} +84 -79
- package/dist/{startup-verification-Cs08ca8u.js → startup-verification-1Ney1mmI.js} +2 -2
- package/dist/{storage-BsGuHngK.js → storage-BVf4uucD.js} +5 -4
- package/dist/{subagent-hooks-CMoZaARG.js → subagent-hooks-DeICLbU5.js} +5 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/sync-cache-state-d-A_OhbU.js +234 -0
- package/dist/{thread-bindings-BvyU66kE.js → thread-bindings-BkBnn4te.js} +4 -4
- package/dist/{tool-actions.runtime-DD6jUxFK.js → tool-actions.runtime-a5L5xGSP.js} +226 -215
- package/dist/{verification-BP-3-XYn.js → verification-XJtTc5DI.js} +2 -2
- 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/matrix-js-sdk/lib/client.d.ts +2 -1
- package/node_modules/matrix-js-sdk/lib/client.js +6 -2
- package/node_modules/matrix-js-sdk/lib/sync.js +8 -8
- package/node_modules/matrix-js-sdk/src/client.ts +7 -3
- package/node_modules/matrix-js-sdk/src/sync.ts +8 -8
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- 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 +17 -3
- package/package.json +8 -7
- package/dist/channel.runtime-CiDl9deX.js +0 -276
- package/dist/env-auth-MVS-Vv41.js +0 -64
- package/dist/file-sync-store-DjskBX2o.js +0 -436
- package/dist/media-text-OR9uoC4W.js +0 -153
- package/dist/probe.runtime-CRM7RIrB.js +0 -2
- package/dist/recovery-key-store-CognuDys.js +0 -276
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
|
-
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input
|
|
2
|
+
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
|
3
3
|
import { listConfiguredAccountIds, resolveMergedAccountConfig, resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-resolution-runtime";
|
|
4
4
|
//#region extensions/matrix/src/matrix/account-config.ts
|
|
5
5
|
function resolveMatrixBaseConfig(cfg) {
|
|
@@ -30,6 +30,66 @@ function resolveMatrixAccountStringValues(params) {
|
|
|
30
30
|
return resolved;
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
|
+
//#region extensions/matrix/src/matrix/client/env-auth.ts
|
|
34
|
+
function cleanEnv(value) {
|
|
35
|
+
return normalizeOptionalString(value) ?? "";
|
|
36
|
+
}
|
|
37
|
+
function resolveGlobalMatrixEnvConfig(env) {
|
|
38
|
+
return {
|
|
39
|
+
homeserver: cleanEnv(env.MATRIX_HOMESERVER),
|
|
40
|
+
userId: cleanEnv(env.MATRIX_USER_ID),
|
|
41
|
+
accessToken: cleanEnv(env.MATRIX_ACCESS_TOKEN) || void 0,
|
|
42
|
+
password: cleanEnv(env.MATRIX_PASSWORD) || void 0,
|
|
43
|
+
deviceId: cleanEnv(env.MATRIX_DEVICE_ID) || void 0,
|
|
44
|
+
deviceName: cleanEnv(env.MATRIX_DEVICE_NAME) || void 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function hasReadyMatrixEnvAuth(config) {
|
|
48
|
+
const homeserver = cleanEnv(config.homeserver);
|
|
49
|
+
const userId = cleanEnv(config.userId);
|
|
50
|
+
const accessToken = cleanEnv(config.accessToken);
|
|
51
|
+
const password = cleanEnv(config.password);
|
|
52
|
+
return Boolean(homeserver && (accessToken || userId && password));
|
|
53
|
+
}
|
|
54
|
+
function resolveScopedMatrixEnvConfig(accountId, env = process.env) {
|
|
55
|
+
const keys = getMatrixScopedEnvVarNames(accountId);
|
|
56
|
+
return {
|
|
57
|
+
homeserver: cleanEnv(env[keys.homeserver]),
|
|
58
|
+
userId: cleanEnv(env[keys.userId]),
|
|
59
|
+
accessToken: cleanEnv(env[keys.accessToken]) || void 0,
|
|
60
|
+
password: cleanEnv(env[keys.password]) || void 0,
|
|
61
|
+
deviceId: cleanEnv(env[keys.deviceId]) || void 0,
|
|
62
|
+
deviceName: cleanEnv(env[keys.deviceName]) || void 0
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function resolveMatrixEnvAuthReadiness(accountId, env = process.env) {
|
|
66
|
+
const normalizedAccountId = normalizeAccountId(accountId);
|
|
67
|
+
const scoped = resolveScopedMatrixEnvConfig(normalizedAccountId, env);
|
|
68
|
+
const scopedReady = hasReadyMatrixEnvAuth(scoped);
|
|
69
|
+
if (normalizedAccountId !== DEFAULT_ACCOUNT_ID) {
|
|
70
|
+
const keys = getMatrixScopedEnvVarNames(normalizedAccountId);
|
|
71
|
+
return {
|
|
72
|
+
ready: scopedReady,
|
|
73
|
+
homeserver: scoped.homeserver || void 0,
|
|
74
|
+
userId: scoped.userId || void 0,
|
|
75
|
+
sourceHint: `${keys.homeserver} (+ auth vars)`,
|
|
76
|
+
missingMessage: `Set per-account env vars for "${normalizedAccountId}" (for example ${keys.homeserver} + ${keys.accessToken} or ${keys.userId} + ${keys.password}).`
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const defaultScoped = resolveScopedMatrixEnvConfig(DEFAULT_ACCOUNT_ID, env);
|
|
80
|
+
const global = resolveGlobalMatrixEnvConfig(env);
|
|
81
|
+
const defaultScopedReady = hasReadyMatrixEnvAuth(defaultScoped);
|
|
82
|
+
const globalReady = hasReadyMatrixEnvAuth(global);
|
|
83
|
+
const defaultKeys = getMatrixScopedEnvVarNames(DEFAULT_ACCOUNT_ID);
|
|
84
|
+
return {
|
|
85
|
+
ready: defaultScopedReady || globalReady,
|
|
86
|
+
homeserver: defaultScoped.homeserver || global.homeserver || void 0,
|
|
87
|
+
userId: defaultScoped.userId || global.userId || void 0,
|
|
88
|
+
sourceHint: "MATRIX_* or MATRIX_DEFAULT_*",
|
|
89
|
+
missingMessage: `Set Matrix env vars for the default account (for example MATRIX_HOMESERVER + MATRIX_ACCESS_TOKEN, MATRIX_USER_ID + MATRIX_PASSWORD, or ${defaultKeys.homeserver} + ${defaultKeys.accessToken}).`
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
33
93
|
//#region extensions/matrix/src/account-selection.ts
|
|
34
94
|
function readConfiguredMatrixString(value) {
|
|
35
95
|
return normalizeOptionalString(value) ?? "";
|
|
@@ -48,30 +108,6 @@ function resolveMatrixChannelStringSources(entry) {
|
|
|
48
108
|
deviceName: readConfiguredMatrixString(entry.deviceName)
|
|
49
109
|
};
|
|
50
110
|
}
|
|
51
|
-
function readEnvMatrixString(env, key) {
|
|
52
|
-
return normalizeOptionalString(env[key]) ?? "";
|
|
53
|
-
}
|
|
54
|
-
function resolveScopedMatrixEnvStringSources(accountId, env) {
|
|
55
|
-
const keys = getMatrixScopedEnvVarNames(accountId);
|
|
56
|
-
return {
|
|
57
|
-
homeserver: readEnvMatrixString(env, keys.homeserver),
|
|
58
|
-
userId: readEnvMatrixString(env, keys.userId),
|
|
59
|
-
accessToken: readEnvMatrixString(env, keys.accessToken),
|
|
60
|
-
password: readEnvMatrixString(env, keys.password),
|
|
61
|
-
deviceId: readEnvMatrixString(env, keys.deviceId),
|
|
62
|
-
deviceName: readEnvMatrixString(env, keys.deviceName)
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function resolveGlobalMatrixEnvStringSources(env) {
|
|
66
|
-
return {
|
|
67
|
-
homeserver: readEnvMatrixString(env, "MATRIX_HOMESERVER"),
|
|
68
|
-
userId: readEnvMatrixString(env, "MATRIX_USER_ID"),
|
|
69
|
-
accessToken: readEnvMatrixString(env, "MATRIX_ACCESS_TOKEN"),
|
|
70
|
-
password: readEnvMatrixString(env, "MATRIX_PASSWORD"),
|
|
71
|
-
deviceId: readEnvMatrixString(env, "MATRIX_DEVICE_ID"),
|
|
72
|
-
deviceName: readEnvMatrixString(env, "MATRIX_DEVICE_NAME")
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
111
|
function hasUsableResolvedMatrixAuth(values) {
|
|
76
112
|
return Boolean(values.homeserver && (values.accessToken || values.userId));
|
|
77
113
|
}
|
|
@@ -82,9 +118,9 @@ function resolveEffectiveMatrixAccountSources(params) {
|
|
|
82
118
|
const normalizedAccountId = normalizeAccountId(params.accountId);
|
|
83
119
|
return resolveMatrixAccountStringValues({
|
|
84
120
|
accountId: normalizedAccountId,
|
|
85
|
-
scopedEnv:
|
|
121
|
+
scopedEnv: resolveScopedMatrixEnvConfig(normalizedAccountId, params.env),
|
|
86
122
|
channel: resolveMatrixChannelStringSources(params.channel),
|
|
87
|
-
globalEnv:
|
|
123
|
+
globalEnv: resolveGlobalMatrixEnvConfig(params.env)
|
|
88
124
|
});
|
|
89
125
|
}
|
|
90
126
|
function hasUsableEffectiveMatrixAccountSource(params) {
|
|
@@ -121,16 +157,17 @@ function resolveConfiguredMatrixAccountIds(cfg, env = process.env) {
|
|
|
121
157
|
channel,
|
|
122
158
|
env
|
|
123
159
|
})) configuredAccountIds.push(DEFAULT_ACCOUNT_ID);
|
|
160
|
+
const readyEnvAccountIds = listMatrixEnvAccountIds(env).filter((accountId) => normalizeAccountId(accountId) === DEFAULT_ACCOUNT_ID ? hasConfiguredDefaultMatrixAccountSource({
|
|
161
|
+
channel,
|
|
162
|
+
env
|
|
163
|
+
}) : hasUsableEffectiveMatrixAccountSource({
|
|
164
|
+
channel,
|
|
165
|
+
accountId,
|
|
166
|
+
env
|
|
167
|
+
}));
|
|
124
168
|
return listCombinedAccountIds({
|
|
125
169
|
configuredAccountIds,
|
|
126
|
-
additionalAccountIds:
|
|
127
|
-
channel,
|
|
128
|
-
env
|
|
129
|
-
}) : hasUsableEffectiveMatrixAccountSource({
|
|
130
|
-
channel,
|
|
131
|
-
accountId,
|
|
132
|
-
env
|
|
133
|
-
})),
|
|
170
|
+
additionalAccountIds: readyEnvAccountIds,
|
|
134
171
|
fallbackAccountIdWhenEmpty: channel ? DEFAULT_ACCOUNT_ID : void 0
|
|
135
172
|
});
|
|
136
173
|
}
|
|
@@ -138,8 +175,9 @@ function resolveMatrixDefaultOrOnlyAccountId(cfg, env = process.env) {
|
|
|
138
175
|
const channel = resolveMatrixChannelConfig(cfg);
|
|
139
176
|
if (!channel) return DEFAULT_ACCOUNT_ID;
|
|
140
177
|
const configuredDefault = normalizeOptionalAccountId(typeof channel.defaultAccount === "string" ? channel.defaultAccount : void 0);
|
|
178
|
+
const configuredAccountIds = resolveConfiguredMatrixAccountIds(cfg, env);
|
|
141
179
|
return resolveListedDefaultAccountId({
|
|
142
|
-
accountIds:
|
|
180
|
+
accountIds: configuredAccountIds,
|
|
143
181
|
configuredDefaultAccountId: configuredDefault,
|
|
144
182
|
ambiguousFallbackAccountId: DEFAULT_ACCOUNT_ID
|
|
145
183
|
});
|
|
@@ -154,4 +192,4 @@ function requiresExplicitMatrixDefaultAccount(cfg, env = process.env) {
|
|
|
154
192
|
return !(configuredDefault && configuredAccountIds.includes(configuredDefault));
|
|
155
193
|
}
|
|
156
194
|
//#endregion
|
|
157
|
-
export { resolveMatrixDefaultOrOnlyAccountId as a, resolveMatrixChannelConfig as i, requiresExplicitMatrixDefaultAccount as n,
|
|
195
|
+
export { resolveMatrixDefaultOrOnlyAccountId as a, resolveScopedMatrixEnvConfig as c, resolveMatrixChannelConfig as i, resolveMatrixAccountStringValues as l, requiresExplicitMatrixDefaultAccount as n, resolveGlobalMatrixEnvConfig as o, resolveConfiguredMatrixAccountIds as r, resolveMatrixEnvAuthReadiness as s, findMatrixAccountEntry as t };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { a as resolveMatrixDefaultOrOnlyAccountId,
|
|
2
|
-
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-
|
|
3
|
-
import {
|
|
4
|
-
import { i as loadMatrixCredentials, n as credentialsMatchConfig } from "./credentials-read-B37cQknZ.js";
|
|
1
|
+
import { a as resolveMatrixDefaultOrOnlyAccountId, c as resolveScopedMatrixEnvConfig, l as resolveMatrixAccountStringValues, o as resolveGlobalMatrixEnvConfig, r as resolveConfiguredMatrixAccountIds } from "./account-selection-DA-jfx22.js";
|
|
2
|
+
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
|
|
3
|
+
import { i as loadMatrixCredentials, n as credentialsMatchConfig } from "./credentials-read-mexhw-Ur.js";
|
|
5
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
|
-
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input
|
|
6
|
+
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
|
8
7
|
//#region extensions/matrix/src/matrix/accounts.ts
|
|
9
8
|
function clean(value) {
|
|
10
9
|
return normalizeOptionalString(value) ?? "";
|
package/dist/api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-
|
|
1
|
+
import { a as resolveMatrixDefaultOrOnlyAccountId, i as resolveMatrixChannelConfig, n as requiresExplicitMatrixDefaultAccount, r as resolveConfiguredMatrixAccountIds, t as findMatrixAccountEntry } from "./account-selection-DA-jfx22.js";
|
|
2
2
|
import { n as listMatrixEnvAccountIds, r as resolveMatrixEnvAccountToken, t as getMatrixScopedEnvVarNames } from "./env-vars-dGqak9dN.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 { t as matrixPlugin } from "./channel-
|
|
5
|
-
import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-
|
|
4
|
+
import { t as matrixPlugin } from "./channel-Bs8VLb6q.js";
|
|
5
|
+
import { n as matrixSetupAdapter, t as createMatrixSetupWizardProxy } from "./setup-core-XkIfQ65J.js";
|
|
6
6
|
import { f as setMatrixThreadBindingMaxAgeBySessionKey, n as getMatrixThreadBindingManager, u as setMatrixThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings-shared-oNPiyMWY.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-B2yZ8KGc.js";
|
|
8
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-BkBnn4te.js";
|
|
9
9
|
export { createMatrixSetupWizardProxy, createMatrixThreadBindingManager, findMatrixAccountEntry, getMatrixScopedEnvVarNames, getMatrixThreadBindingManager, hashMatrixAccessToken, listMatrixEnvAccountIds, matrixOnboardingAdapter, matrixOnboardingAdapter as matrixSetupWizard, matrixPlugin, matrixSetupAdapter, requiresExplicitMatrixDefaultAccount, resolveConfiguredMatrixAccountIds, resolveMatrixAccountStorageRoot, resolveMatrixChannelConfig, resolveMatrixCredentialsDir, resolveMatrixCredentialsFilename, resolveMatrixCredentialsPath, resolveMatrixDefaultOrOnlyAccountId, resolveMatrixEnvAccountToken, resolveMatrixHomeserverKey, sanitizeMatrixPathSegment, setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingMaxAgeBySessionKey };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { i as resolveMatrixAccount } from "./accounts-
|
|
2
|
-
import { C as shouldHandleMatrixApprovalRequest, S as isMatrixAnyApprovalClientEnabled } from "./channel-
|
|
1
|
+
import { i as resolveMatrixAccount } from "./accounts-DR1c4xF_.js";
|
|
2
|
+
import { C as shouldHandleMatrixApprovalRequest, S as isMatrixAnyApprovalClientEnabled } from "./channel-Bs8VLb6q.js";
|
|
3
3
|
import { o as resolveMatrixTargetIdentity } from "./target-ids-Nwx7cMVE.js";
|
|
4
|
-
import { a as sendSingleTextMessageMatrix, n as reactMatrixMessage, r as sendMessageMatrix
|
|
5
|
-
import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-
|
|
6
|
-
import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-
|
|
4
|
+
import { C as repairMatrixDirectRooms, a as sendSingleTextMessageMatrix, n as reactMatrixMessage, r as sendMessageMatrix } from "./send-B5XChnvB.js";
|
|
5
|
+
import { a as unregisterMatrixApprovalReactionTarget, n as listMatrixApprovalReactionBindings, r as registerMatrixApprovalReactionTarget, t as buildMatrixApprovalReactionHint } from "./approval-reactions-1fwEhoK9.js";
|
|
6
|
+
import { n as editMatrixMessage, t as deleteMatrixMessage } from "./messages-Czn8lNEh.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";
|
|
10
10
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
11
11
|
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
12
12
|
import { buildExecApprovalPendingReplyPayload, buildPluginApprovalPendingReplyPayload } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
13
|
-
import { buildPluginApprovalResolvedReplyPayload } from "openclaw/plugin-sdk/approval-runtime";
|
|
13
|
+
import { buildApprovalPendingReplyPayload, buildPluginApprovalResolvedReplyPayload } from "openclaw/plugin-sdk/approval-runtime";
|
|
14
14
|
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
15
15
|
//#region extensions/matrix/src/approval-handler.runtime.ts
|
|
16
16
|
const MATRIX_APPROVAL_METADATA_KEY = "com.openclaw.approval";
|
|
@@ -110,6 +110,13 @@ function buildMatrixApprovalMetadata(params) {
|
|
|
110
110
|
...params.view.pluginId != null ? { pluginId: params.view.pluginId } : {},
|
|
111
111
|
...params.view.toolName != null ? { toolName: params.view.toolName } : {}
|
|
112
112
|
};
|
|
113
|
+
if (params.view.approvalKind === "system-agent") return {
|
|
114
|
+
...base,
|
|
115
|
+
kind: "system-agent",
|
|
116
|
+
commandText: params.view.commandText,
|
|
117
|
+
operationSummary: params.view.operationSummary,
|
|
118
|
+
...params.view.agentId != null ? { agentId: params.view.agentId } : {}
|
|
119
|
+
};
|
|
113
120
|
return {
|
|
114
121
|
...base,
|
|
115
122
|
kind: "exec",
|
|
@@ -126,7 +133,8 @@ function buildMatrixApprovalMetadata(params) {
|
|
|
126
133
|
}
|
|
127
134
|
function buildPendingApprovalContent(params) {
|
|
128
135
|
const allowedDecisions = params.view.actions.map((action) => action.decision);
|
|
129
|
-
|
|
136
|
+
let payload;
|
|
137
|
+
if (params.view.approvalKind === "plugin") payload = buildPluginApprovalPendingReplyPayload({
|
|
130
138
|
request: {
|
|
131
139
|
approvalKind: "plugin",
|
|
132
140
|
id: params.view.approvalId,
|
|
@@ -144,7 +152,17 @@ function buildPendingApprovalContent(params) {
|
|
|
144
152
|
},
|
|
145
153
|
nowMs: params.nowMs,
|
|
146
154
|
allowedDecisions
|
|
147
|
-
})
|
|
155
|
+
});
|
|
156
|
+
else if (params.view.approvalKind === "system-agent") payload = buildApprovalPendingReplyPayload({
|
|
157
|
+
approvalKind: "system-agent",
|
|
158
|
+
approvalId: params.view.approvalId,
|
|
159
|
+
approvalSlug: params.view.approvalId.slice(0, 8),
|
|
160
|
+
text: `OpenClaw change requires approval:\n${params.view.operationSummary}`,
|
|
161
|
+
agentId: params.view.agentId,
|
|
162
|
+
allowedDecisions,
|
|
163
|
+
sessionKey: params.view.sessionKey
|
|
164
|
+
});
|
|
165
|
+
else payload = buildExecApprovalPendingReplyPayload({
|
|
148
166
|
approvalId: params.view.approvalId,
|
|
149
167
|
approvalSlug: params.view.approvalId.slice(0, 8),
|
|
150
168
|
approvalCommandId: params.view.approvalId,
|
|
@@ -179,10 +197,11 @@ function buildResolvedApprovalText(view) {
|
|
|
179
197
|
resolvedBy: view.resolvedBy ?? void 0,
|
|
180
198
|
ts: 0
|
|
181
199
|
} }).text ?? "";
|
|
200
|
+
const decisionLabel = view.approvalKind === "system-agent" && view.terminalStatus === "cancelled" ? "Cancelled" : view.approvalKind === "system-agent" && view.applicationStatus === "applied" ? "Applied" : view.approvalKind === "system-agent" && view.applicationStatus === "not-applied" ? "Not applied" : view.decision === "allow-once" ? "Allowed once" : view.decision === "allow-always" ? "Allowed always" : "Denied";
|
|
182
201
|
return [
|
|
183
|
-
|
|
202
|
+
`${view.approvalKind === "system-agent" ? "OpenClaw change" : "Exec approval"}: ${decisionLabel}`,
|
|
184
203
|
"",
|
|
185
|
-
"Command",
|
|
204
|
+
view.approvalKind === "system-agent" ? "Change" : "Command",
|
|
186
205
|
buildMarkdownCodeBlock(view.commandText)
|
|
187
206
|
].join("\n");
|
|
188
207
|
}
|
|
@@ -196,7 +215,11 @@ function buildMarkdownCodeBlock(text) {
|
|
|
196
215
|
].join("\n");
|
|
197
216
|
}
|
|
198
217
|
const matrixApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
199
|
-
eventKinds: [
|
|
218
|
+
eventKinds: [
|
|
219
|
+
"exec",
|
|
220
|
+
"plugin",
|
|
221
|
+
"system-agent"
|
|
222
|
+
],
|
|
200
223
|
availability: {
|
|
201
224
|
isConfigured: ({ cfg, accountId, context }) => {
|
|
202
225
|
const resolved = resolveHandlerContext({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as normalizeMatrixUserId } from "./channel.setup-
|
|
1
|
+
import { a as normalizeMatrixUserId } from "./channel.setup-DhmDXwPp.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 { i as resolveMatrixAccount } from "./accounts-
|
|
2
|
-
import { t as normalizeMatrixApproverId } from "./approval-ids-
|
|
1
|
+
import { i as resolveMatrixAccount } from "./accounts-DR1c4xF_.js";
|
|
2
|
+
import { t as normalizeMatrixApproverId } from "./approval-ids-Bst7HM_o.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) {
|
|
@@ -24,7 +24,7 @@ const MATRIX_APPROVAL_REACTION_ORDER = [
|
|
|
24
24
|
];
|
|
25
25
|
const PERSISTENT_NAMESPACE = "matrix.approval-reactions";
|
|
26
26
|
const PERSISTENT_MAX_ENTRIES = 1e3;
|
|
27
|
-
const DEFAULT_REACTION_TARGET_TTL_MS =
|
|
27
|
+
const DEFAULT_REACTION_TARGET_TTL_MS = 864e5;
|
|
28
28
|
const reportPersistentApprovalReactionError = createPluginStateErrorReporter(getOptionalMatrixRuntime, "matrix", "approval-reaction-state", "Matrix persistent approval reaction state failed");
|
|
29
29
|
function readPersistedTarget(target) {
|
|
30
30
|
const value = target;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-
|
|
2
|
-
import { a as resolveMatrixAccountConfig } from "./account-config-
|
|
3
|
-
import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-
|
|
4
|
-
import { a as normalizeMatrixUserId, r as DEFAULT_ACCOUNT_ID$2, t as matrixPluginBase } from "./channel.setup-
|
|
5
|
-
import { t as normalizeMatrixApproverId } from "./approval-ids-
|
|
1
|
+
import { n as requiresExplicitMatrixDefaultAccount } from "./account-selection-DA-jfx22.js";
|
|
2
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-CRsKoMqJ.js";
|
|
3
|
+
import { i as resolveMatrixAccount, r as resolveDefaultMatrixAccountId, t as listMatrixAccountIds } from "./accounts-DR1c4xF_.js";
|
|
4
|
+
import { a as normalizeMatrixUserId, r as DEFAULT_ACCOUNT_ID$2, t as matrixPluginBase } from "./channel.setup-DhmDXwPp.js";
|
|
5
|
+
import { t as normalizeMatrixApproverId } from "./approval-ids-Bst7HM_o.js";
|
|
6
6
|
import { a as resolveMatrixDirectUserId, i as normalizeMatrixResolvableTarget, n as isMatrixRoomId, o as resolveMatrixTargetIdentity, r as normalizeMatrixMessagingTarget, t as isMatrixQualifiedUserId } from "./target-ids-Nwx7cMVE.js";
|
|
7
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
7
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-HyWFZQVG.js";
|
|
8
8
|
import { n as MATRIX_REACTION_EVENT_TYPE } from "./reaction-common-DkrQdBSZ.js";
|
|
9
9
|
import { f as setMatrixThreadBindingMaxAgeBySessionKey, u as setMatrixThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings-shared-oNPiyMWY.js";
|
|
10
10
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-CufozuyJ.js";
|
|
@@ -32,12 +32,12 @@ import { createChannelExecApprovalProfile, getExecApprovalReplyMetadata, isChann
|
|
|
32
32
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
33
33
|
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
|
|
34
34
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
35
|
-
import { buildAgentSessionKey, deriveLastRoutePolicy,
|
|
35
|
+
import { buildAgentSessionKey, deriveLastRoutePolicy, parseThreadSessionSuffix, resolveAgentIdFromSessionKey, resolveAgentRoute, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
36
36
|
import { formatLocationText, logInboundDrop, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
|
|
37
37
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-local-roots";
|
|
38
38
|
import { buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
39
39
|
import { resolveConfiguredAcpBindingRecord } from "openclaw/plugin-sdk/acp-binding-resolve-runtime";
|
|
40
|
-
import {
|
|
40
|
+
import { resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
41
41
|
import { deliveryContextFromSession, getSessionEntry, resolveStorePath, sessionDeliveryOrigin } from "openclaw/plugin-sdk/session-store-runtime";
|
|
42
42
|
//#region extensions/matrix/src/actions.ts
|
|
43
43
|
const MATRIX_PLUGIN_HANDLED_ACTIONS = /* @__PURE__ */ new Set([
|
|
@@ -149,7 +149,7 @@ const matrixMessageActions = {
|
|
|
149
149
|
return account && createActionGate(account.config.actions)("messages") ? payload : null;
|
|
150
150
|
},
|
|
151
151
|
handleAction: async (ctx) => {
|
|
152
|
-
const { handleMatrixAction } = await import("./tool-actions.runtime-
|
|
152
|
+
const { handleMatrixAction } = await import("./tool-actions.runtime-a5L5xGSP.js");
|
|
153
153
|
const { action, params, cfg, accountId, mediaLocalRoots } = ctx;
|
|
154
154
|
const dispatch = async (actionParams) => await handleMatrixAction({
|
|
155
155
|
...actionParams,
|
|
@@ -412,9 +412,10 @@ const isMatrixExecApprovalClientEnabled = matrixExecApprovalProfile.isClientEnab
|
|
|
412
412
|
const isMatrixExecApprovalAuthorizedSender = matrixExecApprovalProfile.isAuthorizedSender;
|
|
413
413
|
const resolveMatrixExecApprovalTarget = matrixExecApprovalProfile.resolveTarget;
|
|
414
414
|
function isMatrixApprovalClientEnabled(params) {
|
|
415
|
-
if (params.approvalKind === "exec") return isMatrixExecApprovalClientEnabled(params);
|
|
415
|
+
if (params.approvalKind === "exec" || params.approvalKind === "system-agent") return isMatrixExecApprovalClientEnabled(params);
|
|
416
|
+
const config = resolveMatrixExecApprovalConfig(params);
|
|
416
417
|
return isChannelExecApprovalClientEnabledFromConfig({
|
|
417
|
-
enabled:
|
|
418
|
+
enabled: config?.enabled,
|
|
418
419
|
approverCount: getMatrixApprovalApprovers(params).length
|
|
419
420
|
});
|
|
420
421
|
}
|
|
@@ -425,10 +426,13 @@ function isMatrixAnyApprovalClientEnabled(params) {
|
|
|
425
426
|
}) || isMatrixApprovalClientEnabled({
|
|
426
427
|
...params,
|
|
427
428
|
approvalKind: "plugin"
|
|
429
|
+
}) || isMatrixApprovalClientEnabled({
|
|
430
|
+
...params,
|
|
431
|
+
approvalKind: "system-agent"
|
|
428
432
|
});
|
|
429
433
|
}
|
|
430
434
|
function shouldHandleMatrixApprovalRequest(params) {
|
|
431
|
-
if (params.approvalKind !== "exec" && params.approvalKind !== "plugin") return false;
|
|
435
|
+
if (params.approvalKind !== "exec" && params.approvalKind !== "plugin" && params.approvalKind !== "system-agent") return false;
|
|
432
436
|
if (!matchesMatrixRequestAccount({
|
|
433
437
|
...params,
|
|
434
438
|
approvalKind: params.approvalKind
|
|
@@ -547,7 +551,7 @@ function resolveSuppressionAccountId(params) {
|
|
|
547
551
|
const resolveMatrixOriginTarget = createChannelNativeOriginTargetResolver({
|
|
548
552
|
channel: "matrix",
|
|
549
553
|
shouldHandleRequest: ({ cfg, accountId, approvalKind, request }) => {
|
|
550
|
-
if (approvalKind !== "exec" && approvalKind !== "plugin") return false;
|
|
554
|
+
if (approvalKind !== "exec" && approvalKind !== "plugin" && approvalKind !== "system-agent") return false;
|
|
551
555
|
return shouldHandleMatrixApprovalRequest({
|
|
552
556
|
cfg,
|
|
553
557
|
accountId,
|
|
@@ -615,7 +619,11 @@ const matrixNativeApprovalCapability = createApproverRestrictedNativeApprovalCap
|
|
|
615
619
|
resolveApproverDmTargets: resolveMatrixApproverDmTargets,
|
|
616
620
|
notifyOriginWhenDmOnly: true,
|
|
617
621
|
nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
|
|
618
|
-
eventKinds: [
|
|
622
|
+
eventKinds: [
|
|
623
|
+
"exec",
|
|
624
|
+
"plugin",
|
|
625
|
+
"system-agent"
|
|
626
|
+
],
|
|
619
627
|
isConfigured: ({ cfg, accountId }) => isMatrixAnyApprovalClientEnabled({
|
|
620
628
|
cfg,
|
|
621
629
|
accountId
|
|
@@ -626,7 +634,7 @@ const matrixNativeApprovalCapability = createApproverRestrictedNativeApprovalCap
|
|
|
626
634
|
approvalKind,
|
|
627
635
|
request
|
|
628
636
|
}),
|
|
629
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
637
|
+
load: async () => (await import("./approval-handler.runtime-BJCD4dLf.js")).matrixApprovalNativeRuntime
|
|
630
638
|
})
|
|
631
639
|
});
|
|
632
640
|
const splitMatrixApprovalCapability = splitChannelApprovalCapability(matrixNativeApprovalCapability);
|
|
@@ -907,9 +915,6 @@ function resolveMatrixDmSessionKey(params) {
|
|
|
907
915
|
}
|
|
908
916
|
});
|
|
909
917
|
}
|
|
910
|
-
function shouldApplyMatrixPerRoomDmSessionScope(params) {
|
|
911
|
-
return params.isDirectMessage && !params.configuredSessionKey;
|
|
912
|
-
}
|
|
913
918
|
function resolveMatrixInboundRoute(params) {
|
|
914
919
|
const baseRoute = params.resolveAgentRoute({
|
|
915
920
|
cfg: params.cfg,
|
|
@@ -926,25 +931,20 @@ function resolveMatrixInboundRoute(params) {
|
|
|
926
931
|
});
|
|
927
932
|
const bindingConversationId = params.threadId ?? params.roomId;
|
|
928
933
|
const bindingParentConversationId = params.threadId ? params.roomId : void 0;
|
|
929
|
-
const
|
|
934
|
+
const bindingRef = {
|
|
930
935
|
channel: "matrix",
|
|
931
936
|
accountId: params.accountId,
|
|
932
937
|
conversationId: bindingConversationId,
|
|
933
938
|
parentConversationId: bindingParentConversationId
|
|
939
|
+
};
|
|
940
|
+
const runtimeRoute = resolveRuntimeConversationBindingRoute({
|
|
941
|
+
route: baseRoute,
|
|
942
|
+
conversation: bindingRef,
|
|
943
|
+
touchBinding: false
|
|
934
944
|
});
|
|
935
|
-
const runtimeBinding =
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
route: {
|
|
939
|
-
...baseRoute,
|
|
940
|
-
sessionKey: boundSessionKey,
|
|
941
|
-
agentId: resolveAgentIdFromSessionKey(boundSessionKey) || baseRoute.agentId,
|
|
942
|
-
lastRoutePolicy: deriveLastRoutePolicy({
|
|
943
|
-
sessionKey: boundSessionKey,
|
|
944
|
-
mainSessionKey: baseRoute.mainSessionKey
|
|
945
|
-
}),
|
|
946
|
-
matchedBy: "binding.channel"
|
|
947
|
-
},
|
|
945
|
+
const runtimeBinding = runtimeRoute.bindingRecord;
|
|
946
|
+
if (runtimeBinding && runtimeRoute.boundSessionKey) return {
|
|
947
|
+
route: runtimeRoute.route,
|
|
948
948
|
configuredBinding: null,
|
|
949
949
|
bindingOwnerAvailable: true,
|
|
950
950
|
runtimeBindingId: runtimeBinding.bindingId
|
|
@@ -960,17 +960,14 @@ function resolveMatrixInboundRoute(params) {
|
|
|
960
960
|
const effectiveRoute = configuredBinding && configuredSessionKey ? {
|
|
961
961
|
...baseRoute,
|
|
962
962
|
sessionKey: configuredSessionKey,
|
|
963
|
-
agentId: resolveAgentIdFromSessionKey(configuredSessionKey
|
|
963
|
+
agentId: resolveAgentIdFromSessionKey(configuredSessionKey, configuredBinding.spec.agentId),
|
|
964
964
|
lastRoutePolicy: deriveLastRoutePolicy({
|
|
965
965
|
sessionKey: configuredSessionKey,
|
|
966
966
|
mainSessionKey: baseRoute.mainSessionKey
|
|
967
967
|
}),
|
|
968
968
|
matchedBy: "binding.channel"
|
|
969
969
|
} : baseRoute;
|
|
970
|
-
const dmSessionKey =
|
|
971
|
-
isDirectMessage: params.isDirectMessage,
|
|
972
|
-
configuredSessionKey
|
|
973
|
-
}) ? resolveMatrixDmSessionKey({
|
|
970
|
+
const dmSessionKey = params.isDirectMessage && !configuredSessionKey ? resolveMatrixDmSessionKey({
|
|
974
971
|
accountId: params.accountId,
|
|
975
972
|
agentId: effectiveRoute.agentId,
|
|
976
973
|
roomId: params.roomId,
|
|
@@ -999,15 +996,17 @@ function resolveMatrixInboundRoute(params) {
|
|
|
999
996
|
})
|
|
1000
997
|
},
|
|
1001
998
|
configuredBinding,
|
|
1002
|
-
bindingOwnerAvailable:
|
|
1003
|
-
runtimeBindingId: runtimeBinding?.bindingId ?? null
|
|
999
|
+
bindingOwnerAvailable: runtimeRoute.bindingOwnerAvailable ?? true,
|
|
1000
|
+
runtimeBindingId: runtimeBinding?.bindingId ?? null,
|
|
1001
|
+
pluginId: runtimeRoute.pluginId
|
|
1004
1002
|
};
|
|
1005
1003
|
}
|
|
1006
1004
|
return {
|
|
1007
1005
|
route: routeWithDmScope,
|
|
1008
1006
|
configuredBinding,
|
|
1009
|
-
bindingOwnerAvailable:
|
|
1010
|
-
runtimeBindingId: runtimeBinding?.bindingId ?? null
|
|
1007
|
+
bindingOwnerAvailable: runtimeRoute.bindingOwnerAvailable ?? true,
|
|
1008
|
+
runtimeBindingId: runtimeBinding?.bindingId ?? null,
|
|
1009
|
+
pluginId: runtimeRoute.pluginId
|
|
1011
1010
|
};
|
|
1012
1011
|
}
|
|
1013
1012
|
//#endregion
|
|
@@ -1031,7 +1030,11 @@ function resolveMatrixConversationRouteOwner(params) {
|
|
|
1031
1030
|
resolveAgentRoute
|
|
1032
1031
|
});
|
|
1033
1032
|
if (!result.bindingOwnerAvailable) return { kind: "unavailable" };
|
|
1034
|
-
if (result.
|
|
1033
|
+
if (result.pluginId) return {
|
|
1034
|
+
kind: "plugin",
|
|
1035
|
+
pluginId: result.pluginId,
|
|
1036
|
+
fallbackAgentId: result.route.agentId
|
|
1037
|
+
};
|
|
1035
1038
|
return {
|
|
1036
1039
|
kind: "agent",
|
|
1037
1040
|
agentId: result.route.agentId
|
|
@@ -1039,7 +1042,7 @@ function resolveMatrixConversationRouteOwner(params) {
|
|
|
1039
1042
|
}
|
|
1040
1043
|
//#endregion
|
|
1041
1044
|
//#region extensions/matrix/src/resolver.ts
|
|
1042
|
-
const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-
|
|
1045
|
+
const loadMatrixChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./resolver.runtime-TRmePJDV.js"), "matrixResolverRuntime");
|
|
1043
1046
|
const matrixResolverAdapter = { resolveTargets: async ({ cfg, accountId, inputs, kind, runtime }) => (await loadMatrixChannelRuntime$1()).resolveMatrixTargets({
|
|
1044
1047
|
cfg,
|
|
1045
1048
|
accountId,
|
|
@@ -1102,8 +1105,9 @@ function resolveMatrixCurrentDmRoomId(params) {
|
|
|
1102
1105
|
const sessionKey = parseThreadSessionSuffix(params.currentSessionKey).baseSessionKey ?? params.currentSessionKey?.trim();
|
|
1103
1106
|
if (!sessionKey) return;
|
|
1104
1107
|
try {
|
|
1108
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.agentId });
|
|
1105
1109
|
const currentSession = resolveMatrixStoredSessionMeta(getSessionEntry({
|
|
1106
|
-
storePath
|
|
1110
|
+
storePath,
|
|
1107
1111
|
sessionKey
|
|
1108
1112
|
}));
|
|
1109
1113
|
if (!currentSession) return;
|
|
@@ -1139,18 +1143,19 @@ function resolveMatrixOutboundSessionRoute(params) {
|
|
|
1139
1143
|
const chatType = target.kind === "user" ? "direct" : "channel";
|
|
1140
1144
|
const from = target.kind === "user" ? `matrix:${target.id}` : `matrix:channel:${target.id}`;
|
|
1141
1145
|
const to = `room:${roomScopedDmId ?? target.id}`;
|
|
1146
|
+
const baseRoute = buildChannelOutboundSessionRoute({
|
|
1147
|
+
cfg: params.cfg,
|
|
1148
|
+
agentId: params.agentId,
|
|
1149
|
+
channel: "matrix",
|
|
1150
|
+
accountId: effectiveAccountId,
|
|
1151
|
+
recipientSessionExact: target.kind === "room" ? dmSessionScope === "per-room" && isMatrixRoomId(target.id) : dmSessionScope === "per-user" ? isMatrixQualifiedUserId(target.id) : roomScopedDmId !== void 0,
|
|
1152
|
+
peer,
|
|
1153
|
+
chatType,
|
|
1154
|
+
from,
|
|
1155
|
+
to
|
|
1156
|
+
});
|
|
1142
1157
|
return buildThreadAwareOutboundSessionRoute({
|
|
1143
|
-
route:
|
|
1144
|
-
cfg: params.cfg,
|
|
1145
|
-
agentId: params.agentId,
|
|
1146
|
-
channel: "matrix",
|
|
1147
|
-
accountId: effectiveAccountId,
|
|
1148
|
-
recipientSessionExact: target.kind === "room" ? dmSessionScope === "per-room" && isMatrixRoomId(target.id) : dmSessionScope === "per-user" ? isMatrixQualifiedUserId(target.id) : roomScopedDmId !== void 0,
|
|
1149
|
-
peer,
|
|
1150
|
-
chatType,
|
|
1151
|
-
from,
|
|
1152
|
-
to
|
|
1153
|
-
}),
|
|
1158
|
+
route: baseRoute,
|
|
1154
1159
|
replyToId: params.replyToId,
|
|
1155
1160
|
threadId: params.threadId,
|
|
1156
1161
|
currentSessionKey: params.currentSessionKey,
|
|
@@ -1166,8 +1171,8 @@ function resolveMatrixOutboundSessionRoute(params) {
|
|
|
1166
1171
|
//#endregion
|
|
1167
1172
|
//#region extensions/matrix/src/channel.ts
|
|
1168
1173
|
let matrixStartupLock = Promise.resolve();
|
|
1169
|
-
const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
1170
|
-
const loadMatrixDoctorModule = createLazyRuntimeModule(() => import("./doctor-
|
|
1174
|
+
const loadMatrixChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CCJRhdH5.js"), "matrixChannelRuntime");
|
|
1175
|
+
const loadMatrixDoctorModule = createLazyRuntimeModule(() => import("./doctor-CJE8wO6y.js"));
|
|
1171
1176
|
function buildMatrixTrafficStatusSummary(snapshot) {
|
|
1172
1177
|
return {
|
|
1173
1178
|
lastInboundAt: snapshot?.lastInboundAt ?? null,
|
|
@@ -1517,7 +1522,7 @@ const matrixPlugin = createChatChannelPlugin({
|
|
|
1517
1522
|
await previousLock;
|
|
1518
1523
|
let monitorMatrixProvider;
|
|
1519
1524
|
try {
|
|
1520
|
-
monitorMatrixProvider = (await import("./monitor-
|
|
1525
|
+
monitorMatrixProvider = (await import("./monitor-DouG43FJ.js")).monitorMatrixProvider;
|
|
1521
1526
|
} finally {
|
|
1522
1527
|
releaseLock();
|
|
1523
1528
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as matrixPlugin } from "./channel-
|
|
1
|
+
import { t as matrixPlugin } from "./channel-Bs8VLb6q.js";
|
|
2
2
|
export { matrixPlugin };
|