fix: update config types
This commit is contained in:
@@ -338,7 +338,7 @@ export function applySyntheticConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
};
|
||||
}
|
||||
|
||||
export function applyXiaomiProviderConfig(cfg: MoltbotConfig): MoltbotConfig {
|
||||
export function applyXiaomiProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
const models = { ...cfg.agents?.defaults?.models };
|
||||
models[XIAOMI_DEFAULT_MODEL_REF] = {
|
||||
...models[XIAOMI_DEFAULT_MODEL_REF],
|
||||
@@ -387,7 +387,7 @@ export function applyXiaomiProviderConfig(cfg: MoltbotConfig): MoltbotConfig {
|
||||
};
|
||||
}
|
||||
|
||||
export function applyXiaomiConfig(cfg: MoltbotConfig): MoltbotConfig {
|
||||
export function applyXiaomiConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
const next = applyXiaomiProviderConfig(cfg);
|
||||
const existingModel = next.agents?.defaults?.model;
|
||||
return {
|
||||
|
||||
@@ -64,13 +64,13 @@ export const normalizePluginsConfig = (
|
||||
};
|
||||
};
|
||||
|
||||
const hasExplicitMemorySlot = (plugins?: MoltbotConfig["plugins"]) =>
|
||||
const hasExplicitMemorySlot = (plugins?: OpenClawConfig["plugins"]) =>
|
||||
Boolean(plugins?.slots && Object.prototype.hasOwnProperty.call(plugins.slots, "memory"));
|
||||
|
||||
const hasExplicitMemoryEntry = (plugins?: MoltbotConfig["plugins"]) =>
|
||||
const hasExplicitMemoryEntry = (plugins?: OpenClawConfig["plugins"]) =>
|
||||
Boolean(plugins?.entries && Object.prototype.hasOwnProperty.call(plugins.entries, "memory-core"));
|
||||
|
||||
const hasExplicitPluginConfig = (plugins?: MoltbotConfig["plugins"]) => {
|
||||
const hasExplicitPluginConfig = (plugins?: OpenClawConfig["plugins"]) => {
|
||||
if (!plugins) return false;
|
||||
if (typeof plugins.enabled === "boolean") return true;
|
||||
if (Array.isArray(plugins.allow) && plugins.allow.length > 0) return true;
|
||||
@@ -83,9 +83,9 @@ const hasExplicitPluginConfig = (plugins?: MoltbotConfig["plugins"]) => {
|
||||
};
|
||||
|
||||
export function applyTestPluginDefaults(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
env: NodeJS.ProcessEnv = process.env,
|
||||
): MoltbotConfig {
|
||||
): OpenClawConfig {
|
||||
if (!env.VITEST) return cfg;
|
||||
const plugins = cfg.plugins;
|
||||
const explicitConfig = hasExplicitPluginConfig(plugins);
|
||||
@@ -119,7 +119,7 @@ export function applyTestPluginDefaults(
|
||||
}
|
||||
|
||||
export function isTestDefaultMemorySlotDisabled(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
env: NodeJS.ProcessEnv = process.env,
|
||||
): boolean {
|
||||
if (!env.VITEST) return false;
|
||||
|
||||
Reference in New Issue
Block a user