mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-19 02:20:42 -07:00
Agent Skills: Unify Representation & Centralize Loading (#15833)
This commit is contained in:
@@ -58,8 +58,20 @@ describe('skillsCommand', () => {
|
||||
expect.objectContaining({
|
||||
type: MessageType.SKILLS_LIST,
|
||||
skills: [
|
||||
{ name: 'skill1', description: 'desc1' },
|
||||
{ name: 'skill2', description: 'desc2' },
|
||||
{
|
||||
name: 'skill1',
|
||||
description: 'desc1',
|
||||
disabled: undefined,
|
||||
location: '/loc1',
|
||||
body: 'body1',
|
||||
},
|
||||
{
|
||||
name: 'skill2',
|
||||
description: 'desc2',
|
||||
disabled: undefined,
|
||||
location: '/loc2',
|
||||
body: 'body2',
|
||||
},
|
||||
],
|
||||
showDescriptions: true,
|
||||
}),
|
||||
@@ -75,8 +87,20 @@ describe('skillsCommand', () => {
|
||||
expect.objectContaining({
|
||||
type: MessageType.SKILLS_LIST,
|
||||
skills: [
|
||||
{ name: 'skill1', description: 'desc1' },
|
||||
{ name: 'skill2', description: 'desc2' },
|
||||
{
|
||||
name: 'skill1',
|
||||
description: 'desc1',
|
||||
disabled: undefined,
|
||||
location: '/loc1',
|
||||
body: 'body1',
|
||||
},
|
||||
{
|
||||
name: 'skill2',
|
||||
description: 'desc2',
|
||||
disabled: undefined,
|
||||
location: '/loc2',
|
||||
body: 'body2',
|
||||
},
|
||||
],
|
||||
showDescriptions: true,
|
||||
}),
|
||||
|
||||
@@ -45,6 +45,8 @@ async function listAction(
|
||||
name: skill.name,
|
||||
description: skill.description,
|
||||
disabled: skill.disabled,
|
||||
location: skill.location,
|
||||
body: skill.body,
|
||||
})),
|
||||
showDescriptions: useShowDescriptions,
|
||||
};
|
||||
|
||||
@@ -7,13 +7,31 @@
|
||||
import { render } from '../../../test-utils/render.js';
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { SkillsList } from './SkillsList.js';
|
||||
import { type SkillDefinition } from '../../types.js';
|
||||
import { type SkillDefinition } from '@google/gemini-cli-core';
|
||||
|
||||
describe('SkillsList Component', () => {
|
||||
const mockSkills: SkillDefinition[] = [
|
||||
{ name: 'skill1', description: 'description 1', disabled: false },
|
||||
{ name: 'skill2', description: 'description 2', disabled: true },
|
||||
{ name: 'skill3', description: 'description 3', disabled: false },
|
||||
{
|
||||
name: 'skill1',
|
||||
description: 'description 1',
|
||||
disabled: false,
|
||||
location: 'loc1',
|
||||
body: 'body1',
|
||||
},
|
||||
{
|
||||
name: 'skill2',
|
||||
description: 'description 2',
|
||||
disabled: true,
|
||||
location: 'loc2',
|
||||
body: 'body2',
|
||||
},
|
||||
{
|
||||
name: 'skill3',
|
||||
description: 'description 3',
|
||||
disabled: false,
|
||||
location: 'loc3',
|
||||
body: 'body3',
|
||||
},
|
||||
];
|
||||
|
||||
it('should render enabled and disabled skills separately', () => {
|
||||
|
||||
@@ -13,11 +13,12 @@ import type {
|
||||
ToolConfirmationOutcome,
|
||||
ToolResultDisplay,
|
||||
RetrieveUserQuotaResponse,
|
||||
SkillDefinition,
|
||||
} from '@google/gemini-cli-core';
|
||||
import type { PartListUnion } from '@google/genai';
|
||||
import { type ReactNode } from 'react';
|
||||
|
||||
export type { ThoughtSummary };
|
||||
export type { ThoughtSummary, SkillDefinition };
|
||||
|
||||
export enum AuthState {
|
||||
// Attempting to authenticate or re-authenticate
|
||||
@@ -206,12 +207,6 @@ export type HistoryItemToolsList = HistoryItemBase & {
|
||||
showDescriptions: boolean;
|
||||
};
|
||||
|
||||
export interface SkillDefinition {
|
||||
name: string;
|
||||
description: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export type HistoryItemSkillsList = HistoryItemBase & {
|
||||
type: 'skills_list';
|
||||
skills: SkillDefinition[];
|
||||
|
||||
Reference in New Issue
Block a user