openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 992 B
JavaScript
import { c as normalizeOptionalLowercaseString } from "./string-coerce-CCIiB4H7.mjs";
import { i as normalizeChatChannelId } from "./ids-BRSWrLzE.mjs";
import { t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-constants-CkbqRgGl.mjs";
import { t as normalizeAnyChannelId } from "./registry-normalize-guW5_4yo.mjs";
//#region src/utils/message-channel-core.ts
/**
* Built-in aliases normalize through channel ids, while plugin-owned channel ids
* stay accepted even when core has no bundled alias for them.
*/
function normalizeMessageChannel(e) {
const t = normalizeOptionalLowercaseString(e);
if (!t) return;
if (t === "webchat") return INTERNAL_MESSAGE_CHANNEL;
const n = normalizeChatChannelId(t);
if (n) return n;
return normalizeAnyChannelId(t) ?? t;
}
function isNormalizedMessageChannel(e) {
const t = normalizeMessageChannel(e);
return t !== void 0 && t !== "webchat" && t === e;
}
//#endregion
export { normalizeMessageChannel as n, isNormalizedMessageChannel as t };