mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:30:44 +00:00
fix: satisfy skills visibility lint
This commit is contained in:
@@ -176,20 +176,23 @@ function normalizeInstallOptions(
|
||||
|
||||
function isSkillVisibleInAvailableSkillsPrompt(entry: SkillEntry): boolean {
|
||||
if (entry.exposure) {
|
||||
return entry.exposure.includeInAvailableSkillsPrompt !== false;
|
||||
return (
|
||||
entry.exposure.includeInAvailableSkillsPrompt ||
|
||||
!("includeInAvailableSkillsPrompt" in entry.exposure)
|
||||
);
|
||||
}
|
||||
if (entry.invocation) {
|
||||
return entry.invocation.disableModelInvocation !== true;
|
||||
return !entry.invocation.disableModelInvocation;
|
||||
}
|
||||
return entry.skill.disableModelInvocation !== true;
|
||||
return !entry.skill.disableModelInvocation;
|
||||
}
|
||||
|
||||
function isSkillUserInvocable(entry: SkillEntry): boolean {
|
||||
if (entry.exposure) {
|
||||
return entry.exposure.userInvocable !== false;
|
||||
return entry.exposure.userInvocable || !("userInvocable" in entry.exposure);
|
||||
}
|
||||
if (entry.invocation) {
|
||||
return entry.invocation.userInvocable !== false;
|
||||
return entry.invocation.userInvocable || !("userInvocable" in entry.invocation);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,10 +65,10 @@ export function disableUnavailableSkillsInConfig(
|
||||
if (skills.length === 0) {
|
||||
return config;
|
||||
}
|
||||
const entries = { ...(config.skills?.entries ?? {}) };
|
||||
const entries = { ...config.skills?.entries };
|
||||
for (const skill of skills) {
|
||||
entries[skill.skillKey] = {
|
||||
...(entries[skill.skillKey] ?? {}),
|
||||
...entries[skill.skillKey],
|
||||
enabled: false,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user