openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 1.13 kB
JavaScript
import { l as isRecord } from "./record-coerce-CVPuDqcc.mjs";
//#region src/config/channel-config-activation.ts
function resolveChannelConfigRecord(e, t) {
const n = e.channels?.[t];
return isRecord(n) ? n : null;
}
/** Returns true when channel settings supply activation intent beyond enabled/disabled state. */
function hasMeaningfulChannelConfig(e, t) {
if (!isRecord(e)) return false;
return Object.keys(e).some((e) => e !== "enabled" && (t !== "msteams" || e !== "legacyWebhook"));
}
function hasMeaningfulChannelConfigShallow(e, t) {
return isRecord(e) && e.enabled === true || hasMeaningfulChannelConfig(e, t);
}
/** Channel configuration can admit bundled plugin capabilities through an allowlist. */
function resolveChannelConfigActivationFacts(e) {
return Object.keys(e.channels ?? {}).filter((t) => {
const n = resolveChannelConfigRecord(e, t);
return n?.enabled !== false && hasMeaningfulChannelConfigShallow(n, t);
}).sort();
}
//#endregion
export { resolveChannelConfigRecord as i, hasMeaningfulChannelConfigShallow as n, resolveChannelConfigActivationFacts as r, hasMeaningfulChannelConfig as t };