mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
refactor: trim secondary test helper exports
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
import {
|
||||
listChannelCatalogEntries,
|
||||
type PluginChannelCatalogEntry,
|
||||
} from "../../../../plugins/channel-catalog-registry.js";
|
||||
import {
|
||||
loadBundledPluginPublicSurface,
|
||||
loadBundledPluginPublicSurfaceSync,
|
||||
@@ -14,7 +10,6 @@ type ChannelPluginApiModule = Record<string, unknown>;
|
||||
|
||||
const channelPluginCache = new Map<ChannelId, ChannelPlugin | null>();
|
||||
const channelPluginPromiseCache = new Map<ChannelId, Promise<ChannelPlugin | null>>();
|
||||
let channelCatalogEntries: PluginChannelCatalogEntry[] | undefined;
|
||||
|
||||
function isChannelPlugin(value: unknown): value is ChannelPlugin {
|
||||
return (
|
||||
@@ -30,13 +25,6 @@ export function listBundledChannelPluginIds(): readonly ChannelId[] {
|
||||
return listCatalogBundledChannelPluginIds() as ChannelId[];
|
||||
}
|
||||
|
||||
export function getBundledChannelCatalogEntry(
|
||||
id: ChannelId,
|
||||
): PluginChannelCatalogEntry | undefined {
|
||||
channelCatalogEntries ??= listChannelCatalogEntries({ origin: "bundled" });
|
||||
return channelCatalogEntries.find((entry) => entry.pluginId === id || entry.channel.id === id);
|
||||
}
|
||||
|
||||
export function getBundledChannelPlugin(id: ChannelId): ChannelPlugin | undefined {
|
||||
if (channelPluginCache.has(id)) {
|
||||
return channelPluginCache.get(id) ?? undefined;
|
||||
|
||||
@@ -305,13 +305,6 @@ export function requireSessionStorePath(cfg: { session?: { store?: string } }):
|
||||
return storePath;
|
||||
}
|
||||
|
||||
export async function readSessionStore(cfg: {
|
||||
session?: { store?: string };
|
||||
}): Promise<Record<string, { elevatedLevel?: string }>> {
|
||||
const storeRaw = await fs.readFile(requireSessionStorePath(cfg), "utf-8");
|
||||
return JSON.parse(storeRaw) as Record<string, { elevatedLevel?: string }>;
|
||||
}
|
||||
|
||||
export async function expectInlineCommandHandledAndStripped(params: {
|
||||
home: string;
|
||||
getReplyFromConfig: typeof import("../../../src/auto-reply/reply.js").getReplyFromConfig;
|
||||
|
||||
Reference in New Issue
Block a user