refactor: trim secondary test helper exports · openclaw/openclaw@a93ce36
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
File tree
src/channels/plugins/contracts/test-helpers
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import { |
2 | | -listChannelCatalogEntries, |
3 | | -type PluginChannelCatalogEntry, |
4 | | -} from "../../../../plugins/channel-catalog-registry.js"; |
5 | 1 | import { |
6 | 2 | loadBundledPluginPublicSurface, |
7 | 3 | loadBundledPluginPublicSurfaceSync, |
@@ -14,7 +10,6 @@ type ChannelPluginApiModule = Record<string, unknown>;
|
14 | 10 | |
15 | 11 | const channelPluginCache = new Map<ChannelId, ChannelPlugin | null>(); |
16 | 12 | const channelPluginPromiseCache = new Map<ChannelId, Promise<ChannelPlugin | null>>(); |
17 | | -let channelCatalogEntries: PluginChannelCatalogEntry[] | undefined; |
18 | 13 | |
19 | 14 | function isChannelPlugin(value: unknown): value is ChannelPlugin { |
20 | 15 | return ( |
@@ -30,13 +25,6 @@ export function listBundledChannelPluginIds(): readonly ChannelId[] {
|
30 | 25 | return listCatalogBundledChannelPluginIds() as ChannelId[]; |
31 | 26 | } |
32 | 27 | |
33 | | -export function getBundledChannelCatalogEntry( |
34 | | -id: ChannelId, |
35 | | -): PluginChannelCatalogEntry | undefined { |
36 | | -channelCatalogEntries ??= listChannelCatalogEntries({ origin: "bundled" }); |
37 | | -return channelCatalogEntries.find((entry) => entry.pluginId === id || entry.channel.id === id); |
38 | | -} |
39 | | - |
40 | 28 | export function getBundledChannelPlugin(id: ChannelId): ChannelPlugin | undefined { |
41 | 29 | if (channelPluginCache.has(id)) { |
42 | 30 | return channelPluginCache.get(id) ?? undefined; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -305,13 +305,6 @@ export function requireSessionStorePath(cfg: { session?: { store?: string } }):
|
305 | 305 | return storePath; |
306 | 306 | } |
307 | 307 | |
308 | | -export async function readSessionStore(cfg: { |
309 | | -session?: { store?: string }; |
310 | | -}): Promise<Record<string, { elevatedLevel?: string }>> { |
311 | | -const storeRaw = await fs.readFile(requireSessionStorePath(cfg), "utf-8"); |
312 | | -return JSON.parse(storeRaw) as Record<string, { elevatedLevel?: string }>; |
313 | | -} |
314 | | - |
315 | 308 | export async function expectInlineCommandHandledAndStripped(params: { |
316 | 309 | home: string; |
317 | 310 | getReplyFromConfig: typeof import("../../../src/auto-reply/reply.js").getReplyFromConfig; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。