diff --git a/src/channels/registry.ts b/src/channels/registry.ts index 5a6a08dfd48..3c8050767a8 100644 --- a/src/channels/registry.ts +++ b/src/channels/registry.ts @@ -1,3 +1,4 @@ +import { getActivePluginRegistry } from "../plugins/runtime.js"; import { CHANNEL_IDS, CHAT_CHANNEL_ORDER, type ChatChannelId } from "./ids.js"; import type { ChannelMeta } from "./plugins/types.js"; import type { ChannelId } from "./plugins/types.js"; @@ -7,7 +8,6 @@ export type { ChatChannelId } from "./ids.js"; export type ChatChannelMeta = ChannelMeta; const WEBSITE_URL = "https://openclaw.ai"; -const REGISTRY_STATE = Symbol.for("openclaw.pluginRegistryState"); type RegisteredChannelPluginEntry = { plugin: { @@ -17,10 +17,7 @@ type RegisteredChannelPluginEntry = { }; function listRegisteredChannelPluginEntries(): RegisteredChannelPluginEntry[] { - const globalState = globalThis as typeof globalThis & { - [REGISTRY_STATE]?: { registry?: { channels?: RegisteredChannelPluginEntry[] | null } | null }; - }; - return globalState[REGISTRY_STATE]?.registry?.channels ?? []; + return getActivePluginRegistry()?.channels ?? []; } function findRegisteredChannelPluginEntry(