Files
openclaw/src/config/plugins-allowlist.ts
2026-02-17 00:45:02 +00:00

16 lines
373 B
TypeScript

import type { OpenClawConfig } from "./config.js";
export function ensurePluginAllowlisted(cfg: OpenClawConfig, pluginId: string): OpenClawConfig {
const allow = cfg.plugins?.allow;
if (!Array.isArray(allow) || allow.includes(pluginId)) {
return cfg;
}
return {
...cfg,
plugins: {
...cfg.plugins,
allow: [...allow, pluginId],
},
};
}