mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 08:31:55 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
export type PluginEnableResult = {
|
||||
config: MoltbotConfig;
|
||||
config: OpenClawConfig;
|
||||
enabled: boolean;
|
||||
reason?: string;
|
||||
};
|
||||
|
||||
function ensureAllowlisted(cfg: MoltbotConfig, pluginId: string): MoltbotConfig {
|
||||
function ensureAllowlisted(cfg: OpenClawConfig, pluginId: string): OpenClawConfig {
|
||||
const allow = cfg.plugins?.allow;
|
||||
if (!Array.isArray(allow) || allow.includes(pluginId)) return cfg;
|
||||
return {
|
||||
@@ -18,7 +18,7 @@ function ensureAllowlisted(cfg: MoltbotConfig, pluginId: string): MoltbotConfig
|
||||
};
|
||||
}
|
||||
|
||||
export function enablePluginInConfig(cfg: MoltbotConfig, pluginId: string): PluginEnableResult {
|
||||
export function enablePluginInConfig(cfg: OpenClawConfig, pluginId: string): PluginEnableResult {
|
||||
if (cfg.plugins?.enabled === false) {
|
||||
return { config: cfg, enabled: false, reason: "plugins disabled" };
|
||||
}
|
||||
@@ -33,7 +33,7 @@ export function enablePluginInConfig(cfg: MoltbotConfig, pluginId: string): Plug
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
let next: MoltbotConfig = {
|
||||
let next: OpenClawConfig = {
|
||||
...cfg,
|
||||
plugins: {
|
||||
...cfg.plugins,
|
||||
|
||||
Reference in New Issue
Block a user