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