@openclaw/matrix 2026.7.2-beta.2 → 2026.7.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-selection-Bz00QTmQ.js → account-selection-kqquRzCf.js} +5 -5
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime-BQZdg_dJ.js → approval-handler.runtime-BEa98wwG.js} +4 -4
- package/dist/{approval-ids-De4IhOSN.js → approval-ids-Dfn7oQAm.js} +1 -1
- package/dist/{approval-reaction-auth-BLJKPLku.js → approval-reaction-auth-kXkCJBGi.js} +2 -2
- package/dist/auth-presence.js +13 -21
- package/dist/{channel-B1woOUgk.js → channel-j331Xd7b.js} +13 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BvJm9z0w.js → channel.runtime-BIwlVfQw.js} +15 -16
- package/dist/{cli-CLWOkMvw.js → cli-0EcKfqFw.js} +18 -11
- package/dist/{cli-metadata-9Naf7in0.js → cli-metadata-Xq1Xb15R.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-BUai6s29.js → client-BtG4quUl.js} +2 -2
- package/dist/{client-CPuYbNL8.js → client-CA0PULls.js} +2 -2
- package/dist/{client-bootstrap-CNVF73sF.js → client-bootstrap-Dk5EAn3n.js} +1 -1
- package/dist/{config-schema-BTSatSY3.js → config-schema-B5GRV8wL.js} +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-85ttAWDP.js → create-client-WQExaby_.js} +4 -4
- package/dist/credentials-W2EmwRhu.js +65 -0
- package/dist/credentials-read-DVmFCm7X.js +77 -0
- package/dist/{credentials-write.runtime-BDtpqvj0.js → credentials-write.runtime-Be9zNSUw.js} +1 -1
- package/dist/{crypto-runtime-DoEB5RpM.js → crypto-runtime-CAff-n15.js} +3 -3
- package/dist/{directory-live-0TyS9xep.js → directory-live-DiC-0XBC.js} +3 -3
- package/dist/{doctor-BGTs609f.js → doctor-DwUVm5Lw.js} +1 -1
- package/dist/{doctor-contract-D2qTLe-C.js → doctor-contract-BA2Y6Crx.js} +1 -1
- package/dist/doctor-contract-api.js +116 -10
- package/dist/{draft-stream-GOdPZMBm.js → draft-stream-CTLKtJJ0.js} +1 -1
- package/dist/{encryption-guidance-BFfgq7c7.js → encryption-guidance-CbEFe38F.js} +1 -1
- package/dist/{file-sync-store-CUE9WwD2.js → file-sync-store-CPkgnSXp.js} +21 -4
- package/dist/helper-api.js +2 -2
- package/dist/{idb-persistence-BiHEEzD7.js → idb-persistence-Dyy6ipgU.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{media-text-DPCtdFjk.js → media-text-BMXEXb1j.js} +1 -1
- package/dist/{messages-DCRbGLMh.js → messages-3UBHfZrN.js} +3 -3
- package/dist/{monitor-C5EOF9et.js → monitor-BtUIds8T.js} +87 -89
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-sBV-Govx.js +3 -0
- package/dist/{profile-update-DompcDyu.js → profile-update-Bh2XtJwN.js} +2 -2
- package/dist/{reaction-events-QUgxkQKQ.js → reaction-events-BwAKtUyQ.js} +2 -2
- package/dist/record-shared-CWWx6fvI.js +2 -0
- package/dist/{recovery-key-store-B2RglalK.js → recovery-key-store-CW6eePfp.js} +1 -1
- package/dist/{resolve-targets-Cx1VVArA.js → resolve-targets-DVoj-YxB.js} +1 -1
- package/dist/{resolver.runtime-PPrv3ZHu.js → resolver.runtime-CC0VVsAt.js} +1 -1
- package/dist/runtime-api.js +3 -3
- package/dist/{sdk-1TXuSiXZ.js → sdk-CIDZXWpZ.js} +5 -5
- package/dist/{secret-contract-OZoQf0kI.js → secret-contract-M3hRmGO-.js} +21 -5
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-yre1krm8.js → send-BJbrdmNm.js} +3 -2
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-DXVRCd4G.js → setup-bootstrap-DGPOOdz-.js} +2 -2
- package/dist/{setup-core-CYQRY2oG.js → setup-core-XCdAx1nY.js} +3 -3
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-BjvRQzK6.js → setup-surface-CzUiTe_k.js} +6 -6
- package/dist/{shared-BfW4lxGu.js → shared-DquM1oz6.js} +6 -6
- package/dist/{startup-verification-DSiyDKM5.js → startup-verification-CA00kebL.js} +2 -2
- package/dist/{storage-DD-EnNJE.js → storage-CzHxeF5E.js} +8 -8
- package/dist/{thread-bindings-U5ZroBeZ.js → thread-bindings-Cw194yEn.js} +3 -3
- package/dist/{tool-actions.runtime-BlfTr9b0.js → tool-actions.runtime-C0jgWYhX.js} +7 -7
- package/dist/{verification-CGnI9k1O.js → verification-DjxyWTNP.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/async-lock-BcLS4KOc.js +0 -19
- package/dist/credentials-CncWUieb.js +0 -56
- package/dist/credentials-read-CwNJrmwu.js +0 -112
- package/dist/probe.runtime-BBvciVfo.js +0 -3
- package/dist/record-shared-CvzjvHRn.js +0 -2
- package/dist/{deps-DDbghaZH.js → deps-CcVJfvRM.js} +1 -1
- package/dist/{http-client-Jw5_bwQo.js → http-client-BmrgOZTL.js} +1 -1
- package/dist/{storage-paths-B4_I9iqO.js → storage-paths-gUmSydsW.js} +1 -1
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as resolveMatrixDefaultOrOnlyAccountId, n as requiresExplicitMatrixDefaultAccount } from "./account-selection-Bz00QTmQ.js";
|
|
3
|
-
import { t as getMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
4
|
-
import { a as resolveMatrixCredentialsPath$1, r as resolveMatrixCredentialsDir$1 } from "./storage-paths-B4_I9iqO.js";
|
|
5
|
-
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
|
-
import fs from "node:fs";
|
|
7
|
-
import os from "node:os";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
//#region extensions/matrix/src/matrix/credentials-read.ts
|
|
10
|
-
var credentials_read_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
-
clearMatrixCredentials: () => clearMatrixCredentials,
|
|
12
|
-
credentialsMatchConfig: () => credentialsMatchConfig,
|
|
13
|
-
loadMatrixCredentials: () => loadMatrixCredentials,
|
|
14
|
-
resolveMatrixCredentialsDir: () => resolveMatrixCredentialsDir,
|
|
15
|
-
resolveMatrixCredentialsPath: () => resolveMatrixCredentialsPath
|
|
16
|
-
});
|
|
17
|
-
function resolveStateDir(env) {
|
|
18
|
-
try {
|
|
19
|
-
return getMatrixRuntime().state.resolveStateDir(env, os.homedir);
|
|
20
|
-
} catch {
|
|
21
|
-
const override = env.OPENCLAW_STATE_DIR?.trim();
|
|
22
|
-
if (override) return path.resolve(override);
|
|
23
|
-
const homeDir = env.OPENCLAW_HOME?.trim() || env.HOME?.trim() || os.homedir();
|
|
24
|
-
return path.join(homeDir, ".openclaw");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function resolveLegacyMatrixCredentialsPath(env) {
|
|
28
|
-
return path.join(resolveMatrixCredentialsDir(env), "credentials.json");
|
|
29
|
-
}
|
|
30
|
-
function shouldReadLegacyCredentialsForAccount(accountId) {
|
|
31
|
-
const normalizedAccountId = normalizeAccountId(accountId);
|
|
32
|
-
const cfg = getMatrixRuntime().config.current();
|
|
33
|
-
if (!cfg.channels?.matrix || typeof cfg.channels.matrix !== "object") return normalizedAccountId === DEFAULT_ACCOUNT_ID;
|
|
34
|
-
if (requiresExplicitMatrixDefaultAccount(cfg)) return false;
|
|
35
|
-
return normalizeAccountId(resolveMatrixDefaultOrOnlyAccountId(cfg)) === normalizedAccountId;
|
|
36
|
-
}
|
|
37
|
-
function resolveLegacyMigrationSourcePath(env, accountId) {
|
|
38
|
-
if (!shouldReadLegacyCredentialsForAccount(accountId)) return null;
|
|
39
|
-
const legacyPath = resolveLegacyMatrixCredentialsPath(env);
|
|
40
|
-
return legacyPath === resolveMatrixCredentialsPath(env, accountId) ? null : legacyPath;
|
|
41
|
-
}
|
|
42
|
-
function parseMatrixCredentialsFile(filePath) {
|
|
43
|
-
const raw = fs.readFileSync(filePath, "utf-8");
|
|
44
|
-
const parsed = JSON.parse(raw);
|
|
45
|
-
if (typeof parsed.homeserver !== "string" || typeof parsed.userId !== "string" || typeof parsed.accessToken !== "string") return null;
|
|
46
|
-
return parsed;
|
|
47
|
-
}
|
|
48
|
-
function loadMatrixCredentialsFile(filePath, source) {
|
|
49
|
-
try {
|
|
50
|
-
return {
|
|
51
|
-
kind: "loaded",
|
|
52
|
-
source,
|
|
53
|
-
credentials: parseMatrixCredentialsFile(filePath)
|
|
54
|
-
};
|
|
55
|
-
} catch (error) {
|
|
56
|
-
if (error?.code === "ENOENT") return { kind: "missing" };
|
|
57
|
-
throw error;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function loadLegacyMatrixCredentialsWithCurrentFallback(params) {
|
|
61
|
-
const legacy = loadMatrixCredentialsFile(params.legacyPath, "legacy");
|
|
62
|
-
if (legacy.kind === "loaded") return legacy;
|
|
63
|
-
return loadMatrixCredentialsFile(params.currentPath, "current");
|
|
64
|
-
}
|
|
65
|
-
function resolveMatrixCredentialsDir(env = process.env, stateDir) {
|
|
66
|
-
return resolveMatrixCredentialsDir$1(stateDir ?? resolveStateDir(env));
|
|
67
|
-
}
|
|
68
|
-
function resolveMatrixCredentialsPath(env = process.env, accountId) {
|
|
69
|
-
return resolveMatrixCredentialsPath$1({
|
|
70
|
-
stateDir: resolveStateDir(env),
|
|
71
|
-
accountId
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function loadMatrixCredentials(env = process.env, accountId) {
|
|
75
|
-
const currentPath = resolveMatrixCredentialsPath(env, accountId);
|
|
76
|
-
try {
|
|
77
|
-
const current = loadMatrixCredentialsFile(currentPath, "current");
|
|
78
|
-
if (current.kind === "loaded") return current.credentials;
|
|
79
|
-
const legacyPath = resolveLegacyMigrationSourcePath(env, accountId);
|
|
80
|
-
if (!legacyPath) return null;
|
|
81
|
-
const loaded = loadLegacyMatrixCredentialsWithCurrentFallback({
|
|
82
|
-
legacyPath,
|
|
83
|
-
currentPath
|
|
84
|
-
});
|
|
85
|
-
if (loaded.kind !== "loaded" || !loaded.credentials) return null;
|
|
86
|
-
if (loaded.source === "legacy") try {
|
|
87
|
-
fs.mkdirSync(path.dirname(currentPath), { recursive: true });
|
|
88
|
-
fs.renameSync(legacyPath, currentPath);
|
|
89
|
-
} catch {}
|
|
90
|
-
return loaded.credentials;
|
|
91
|
-
} catch {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function clearMatrixCredentials(env = process.env, accountId) {
|
|
96
|
-
const paths = [resolveMatrixCredentialsPath(env, accountId), resolveLegacyMigrationSourcePath(env, accountId)];
|
|
97
|
-
for (const filePath of paths) {
|
|
98
|
-
if (!filePath) continue;
|
|
99
|
-
try {
|
|
100
|
-
fs.unlinkSync(filePath);
|
|
101
|
-
} catch {}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
function credentialsMatchConfig(stored, config) {
|
|
105
|
-
if (!config.userId) {
|
|
106
|
-
if (!config.accessToken) return false;
|
|
107
|
-
return stored.homeserver === config.homeserver && stored.accessToken === config.accessToken;
|
|
108
|
-
}
|
|
109
|
-
return stored.homeserver === config.homeserver && stored.userId === config.userId;
|
|
110
|
-
}
|
|
111
|
-
//#endregion
|
|
112
|
-
export { resolveMatrixCredentialsDir as a, loadMatrixCredentials as i, credentialsMatchConfig as n, resolveMatrixCredentialsPath as o, credentials_read_exports as r, clearMatrixCredentials as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
|
+
import fs from "node:fs";
|
|
5
5
|
import { runCommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
6
6
|
//#region extensions/matrix/src/matrix/deps.ts
|
|
7
7
|
const REQUIRED_MATRIX_PACKAGES = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as buildTimeoutAbortSignal } from "./timeout-abort-signal-DMrgRFIy.js";
|
|
2
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
3
2
|
import { parseMediaContentLength } from "openclaw/plugin-sdk/media-runtime";
|
|
3
|
+
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
4
4
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
5
5
|
import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
|
|
6
6
|
import { closeDispatcher, createPinnedDispatcher, resolvePinnedHostnameWithPolicy } from "openclaw/plugin-sdk/ssrf-dispatcher";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import crypto from "node:crypto";
|
|
4
|
+
import path from "node:path";
|
|
5
5
|
//#region extensions/matrix/src/storage-paths.ts
|
|
6
6
|
function sanitizeMatrixPathSegment(value) {
|
|
7
7
|
return normalizeLowercaseStringOrEmpty(value).replace(/[^a-z0-9._-]+/g, "_").replace(/^_+|_+$/g, "") || "unknown";
|