mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:21:23 +00:00
refactor(config): dedupe native command setting resolver
This commit is contained in:
@@ -21,21 +21,21 @@ export function resolveNativeSkillsEnabled(params: {
|
||||
providerSetting?: NativeCommandsSetting;
|
||||
globalSetting?: NativeCommandsSetting;
|
||||
}): boolean {
|
||||
const { providerId, providerSetting, globalSetting } = params;
|
||||
const setting = providerSetting === undefined ? globalSetting : providerSetting;
|
||||
if (setting === true) {
|
||||
return true;
|
||||
}
|
||||
if (setting === false) {
|
||||
return false;
|
||||
}
|
||||
return resolveAutoDefault(providerId);
|
||||
return resolveNativeCommandSetting(params);
|
||||
}
|
||||
|
||||
export function resolveNativeCommandsEnabled(params: {
|
||||
providerId: ChannelId;
|
||||
providerSetting?: NativeCommandsSetting;
|
||||
globalSetting?: NativeCommandsSetting;
|
||||
}): boolean {
|
||||
return resolveNativeCommandSetting(params);
|
||||
}
|
||||
|
||||
function resolveNativeCommandSetting(params: {
|
||||
providerId: ChannelId;
|
||||
providerSetting?: NativeCommandsSetting;
|
||||
globalSetting?: NativeCommandsSetting;
|
||||
}): boolean {
|
||||
const { providerId, providerSetting, globalSetting } = params;
|
||||
const setting = providerSetting === undefined ? globalSetting : providerSetting;
|
||||
@@ -45,7 +45,6 @@ export function resolveNativeCommandsEnabled(params: {
|
||||
if (setting === false) {
|
||||
return false;
|
||||
}
|
||||
// auto or undefined -> heuristic
|
||||
return resolveAutoDefault(providerId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user