mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:40:44 +00:00
perf: narrow Matrix account runtime imports
This commit is contained in:
@@ -4,8 +4,8 @@ import {
|
||||
listConfiguredAccountIds,
|
||||
resolveMergedAccountConfig,
|
||||
resolveNormalizedAccountEntry,
|
||||
} from "openclaw/plugin-sdk/account-resolution";
|
||||
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
||||
} from "openclaw/plugin-sdk/account-resolution-runtime";
|
||||
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input-runtime";
|
||||
import type { CoreConfig, MatrixAccountConfig, MatrixConfig } from "../types.js";
|
||||
|
||||
type MatrixRoomEntries = Record<string, NonNullable<MatrixConfig["groups"]>[string]>;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
||||
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
||||
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input-runtime";
|
||||
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
||||
import {
|
||||
resolveConfiguredMatrixAccountIds,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
||||
import {
|
||||
coerceSecretRef,
|
||||
normalizeResolvedSecretInputString,
|
||||
} from "openclaw/plugin-sdk/secret-input";
|
||||
} from "openclaw/plugin-sdk/secret-input-runtime";
|
||||
import type { PinnedDispatcherPolicy } from "openclaw/plugin-sdk/ssrf-dispatcher";
|
||||
import {
|
||||
requiresExplicitMatrixDefaultAccount,
|
||||
|
||||
@@ -420,6 +420,10 @@
|
||||
"types": "./dist/plugin-sdk/account-resolution.d.ts",
|
||||
"default": "./dist/plugin-sdk/account-resolution.js"
|
||||
},
|
||||
"./plugin-sdk/account-resolution-runtime": {
|
||||
"types": "./dist/plugin-sdk/account-resolution-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/account-resolution-runtime.js"
|
||||
},
|
||||
"./plugin-sdk/agent-config-primitives": {
|
||||
"types": "./dist/plugin-sdk/agent-config-primitives.d.ts",
|
||||
"default": "./dist/plugin-sdk/agent-config-primitives.js"
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
"account-core",
|
||||
"account-id",
|
||||
"account-resolution",
|
||||
"account-resolution-runtime",
|
||||
"agent-config-primitives",
|
||||
"allow-from",
|
||||
"allowlist-config-edit",
|
||||
|
||||
20
src/plugin-sdk/account-resolution-runtime.ts
Normal file
20
src/plugin-sdk/account-resolution-runtime.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export { resolveMergedAccountConfig } from "../channels/plugins/account-helpers.js";
|
||||
export { resolveNormalizedAccountEntry } from "../routing/account-lookup.js";
|
||||
|
||||
/** List normalized configured account ids from a raw channel account record map. */
|
||||
export function listConfiguredAccountIds(params: {
|
||||
accounts: Record<string, unknown> | undefined;
|
||||
normalizeAccountId: (accountId: string) => string;
|
||||
}): string[] {
|
||||
if (!params.accounts) {
|
||||
return [];
|
||||
}
|
||||
const ids = new Set<string>();
|
||||
for (const key of Object.keys(params.accounts)) {
|
||||
if (!key) {
|
||||
continue;
|
||||
}
|
||||
ids.add(params.normalizeAccountId(key));
|
||||
}
|
||||
return [...ids];
|
||||
}
|
||||
Reference in New Issue
Block a user