fix: satisfy skills visibility lint

This commit is contained in:
Mariano Belinky
2026-05-02 20:34:50 +02:00
parent 91adb1fb44
commit 63bac4340f
2 changed files with 10 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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,
};
}