mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 13:34:15 -07:00
feat(admin): support admin-enforced settings for Agent Skills (#16406)
This commit is contained in:
@@ -79,12 +79,26 @@ async function disableAction(
|
||||
return;
|
||||
}
|
||||
const skillManager = context.services.config?.getSkillManager();
|
||||
if (skillManager?.isAdminEnabled() === false) {
|
||||
context.ui.addItem(
|
||||
{
|
||||
type: MessageType.ERROR,
|
||||
text: 'Agent skills are disabled by your admin.',
|
||||
},
|
||||
Date.now(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const skill = skillManager?.getSkill(skillName);
|
||||
if (!skill) {
|
||||
context.ui.addItem({
|
||||
type: MessageType.ERROR,
|
||||
text: `Skill "${skillName}" not found.`,
|
||||
});
|
||||
context.ui.addItem(
|
||||
{
|
||||
type: MessageType.ERROR,
|
||||
text: `Skill "${skillName}" not found.`,
|
||||
},
|
||||
Date.now(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,6 +135,18 @@ async function enableAction(
|
||||
return;
|
||||
}
|
||||
|
||||
const skillManager = context.services.config?.getSkillManager();
|
||||
if (skillManager?.isAdminEnabled() === false) {
|
||||
context.ui.addItem(
|
||||
{
|
||||
type: MessageType.ERROR,
|
||||
text: 'Agent skills are disabled by your admin.',
|
||||
},
|
||||
Date.now(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const result = enableSkill(context.services.settings, skillName);
|
||||
|
||||
let feedback = renderSkillActionFeedback(
|
||||
|
||||
Reference in New Issue
Block a user