Agent Skills: Unify Representation & Centralize Loading (#15833)

This commit is contained in:
N. Taylor Mullen
2026-01-03 16:24:36 -08:00
committed by GitHub
parent 30f5c4af4a
commit f0a039f7c0
13 changed files with 410 additions and 451 deletions

View File

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

View File

@@ -45,6 +45,8 @@ async function listAction(
name: skill.name,
description: skill.description,
disabled: skill.disabled,
location: skill.location,
body: skill.body,
})),
showDescriptions: useShowDescriptions,
};

View File

@@ -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', () => {

View File

@@ -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[];