UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

28 lines (27 loc) • 1.15 kB
import { c as normalizeOptionalLowercaseString } from "./string-coerce-1VuiLaaR.mjs"; import { i as passesManifestOwnerBasePolicy } from "./manifest-owner-policy-B2H7kBCF.mjs"; //#region src/channels/plugins/bundled-setup-policy.ts function shouldIncludeChannelSetupFeatureForConfig(params) { if (!params.config) return true; const pluginId = params.plugin.id; if (!passesManifestOwnerBasePolicy({ plugin: { id: pluginId }, normalizedConfig: params.normalizedConfig, allowRestrictiveAllowlistBypass: true })) return false; let hasExplicitChannelDisable = false; for (const channelId of params.plugin.channels ?? [pluginId]) { const normalizedChannelId = normalizeOptionalLowercaseString(channelId); if (!normalizedChannelId) continue; const channelConfig = params.config.channels?.[normalizedChannelId]; if (!channelConfig || typeof channelConfig !== "object" || Array.isArray(channelConfig)) continue; if (channelConfig.enabled === false) { hasExplicitChannelDisable = true; continue; } return true; } return !hasExplicitChannelDisable; } //#endregion export { shouldIncludeChannelSetupFeatureForConfig as t };