import { getActivePluginChannelRegistryFromState } from "../plugins/runtime-channel-state.js"; import {
normalizeOptionalLowercaseString,
normalizeOptionalString,
} from "../shared/string-coerce.js"; import {
CHANNEL_IDS,
CHAT_CHANNEL_ALIASES,
CHAT_CHANNEL_ORDER,
listChatChannelAliases,
normalizeChatChannelId,
type ChatChannelId,
} from "./ids.js"; import type { ChannelId } from "./plugins/channel-id.types.js"; import type { ChannelMeta } from "./plugins/types.core.js";
export { getChatChannelMeta, listChatChannels } from "./chat-meta.js";
export { CHANNEL_IDS, CHAT_CHANNEL_ORDER } from "./ids.js";
export type { ChatChannelId } from "./ids.js";
// Channel docking: prefer this helper in shared code. Importing from // `src/channels/plugins/*` can eagerly load channel implementations.
export function normalizeChannelId(raw?: string | null): ChatChannelId | null { return normalizeChatChannelId(raw);
}
// Normalizes registered channel plugins (bundled or external). // // Keep this light: we do not import channel plugins here (those are "heavy" and can pull in // monitors, web login, etc). The plugin registry must be initialized first.
export function normalizeAnyChannelId(raw?: string | null): ChannelId | null { const key = normalizeOptionalLowercaseString(raw); if (!key) { returnnull;
} return findRegisteredChannelPluginEntry(key)?.plugin.id ?? null;
}
export function listRegisteredChannelPluginIds(): ChannelId[] { return listRegisteredChannelPluginEntries().flatMap((entry) => { const id = normalizeOptionalString(entry.plugin.id); return id ? [id as ChannelId] : [];
});
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.