mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 15:04:16 -07:00
Support for Built-in Agent Skills (#16045)
This commit is contained in:
@@ -76,6 +76,34 @@ describe('ActivateSkillTool', () => {
|
||||
expect(details.prompt).toContain('Mock folder structure');
|
||||
});
|
||||
|
||||
it('should skip confirmation for built-in skills', async () => {
|
||||
const builtinSkill = {
|
||||
name: 'builtin-skill',
|
||||
description: 'A built-in skill',
|
||||
location: '/path/to/builtin/SKILL.md',
|
||||
isBuiltin: true,
|
||||
body: 'Built-in instructions',
|
||||
};
|
||||
vi.mocked(mockConfig.getSkillManager().getSkill).mockReturnValue(
|
||||
builtinSkill,
|
||||
);
|
||||
vi.mocked(mockConfig.getSkillManager().getSkills).mockReturnValue([
|
||||
builtinSkill,
|
||||
]);
|
||||
|
||||
const params = { name: 'builtin-skill' };
|
||||
const toolWithBuiltin = new ActivateSkillTool(mockConfig, mockMessageBus);
|
||||
const invocation = toolWithBuiltin.build(params);
|
||||
|
||||
const details = await (
|
||||
invocation as unknown as {
|
||||
getConfirmationDetails: (signal: AbortSignal) => Promise<unknown>;
|
||||
}
|
||||
).getConfirmationDetails(new AbortController().signal);
|
||||
|
||||
expect(details).toBe(false);
|
||||
});
|
||||
|
||||
it('should activate a valid skill and return its content in XML tags', async () => {
|
||||
const params = { name: 'test-skill' };
|
||||
const invocation = tool.build(params);
|
||||
|
||||
@@ -80,6 +80,10 @@ class ActivateSkillToolInvocation extends BaseToolInvocation<
|
||||
return false;
|
||||
}
|
||||
|
||||
if (skill.isBuiltin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const folderStructure = await this.getOrFetchFolderStructure(
|
||||
skill.location,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user