openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
28 lines (27 loc) • 893 B
JavaScript
import { c as normalizeOptionalLowercaseString } from "./string-coerce-CCIiB4H7.mjs";
import { i as passesManifestOwnerBasePolicy } from "./manifest-owner-policy-B8Brw4Zo.mjs";
//#region src/channels/plugins/bundled-setup-policy.ts
function shouldIncludeChannelSetupFeatureForConfig(e) {
if (!e.config) return true;
const t = e.plugin.id;
if (!passesManifestOwnerBasePolicy({
plugin: { id: t },
normalizedConfig: e.normalizedConfig,
allowRestrictiveAllowlistBypass: true
})) return false;
let n = false;
for (const r of e.plugin.channels ?? [t]) {
const t = normalizeOptionalLowercaseString(r);
if (!t) continue;
const i = e.config.channels?.[t];
if (!i || typeof i !== "object" || Array.isArray(i)) continue;
if (i.enabled === false) {
n = true;
continue;
}
return true;
}
return !n;
}
//#endregion
export { shouldIncludeChannelSetupFeatureForConfig as t };