mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 15:04:16 -07:00
feat(hooks): add support for friendly names and descriptions (#15174)
This commit is contained in:
@@ -356,6 +356,18 @@ describe('SettingsSchema', () => {
|
||||
'Enable local and remote subagents. Warning: Experimental feature, uses YOLO mode for subagents',
|
||||
);
|
||||
});
|
||||
|
||||
it('should have name and description in hook definitions', () => {
|
||||
const hookDef = SETTINGS_SCHEMA_DEFINITIONS['HookDefinitionArray'];
|
||||
expect(hookDef).toBeDefined();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const hookItemProperties = (hookDef as any).items.properties.hooks.items
|
||||
.properties;
|
||||
expect(hookItemProperties.name).toBeDefined();
|
||||
expect(hookItemProperties.name.type).toBe('string');
|
||||
expect(hookItemProperties.description).toBeDefined();
|
||||
expect(hookItemProperties.description.type).toBe('string');
|
||||
});
|
||||
});
|
||||
|
||||
it('has JSON schema definitions for every referenced ref', () => {
|
||||
|
||||
@@ -1891,6 +1891,10 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
|
||||
type: 'object',
|
||||
description: 'Individual hook configuration.',
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'Unique identifier for the hook.',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
description:
|
||||
@@ -1901,6 +1905,10 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
|
||||
description:
|
||||
'Shell command to execute. Receives JSON input via stdin and returns JSON output via stdout.',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'A description of the hook.',
|
||||
},
|
||||
timeout: {
|
||||
type: 'number',
|
||||
description: 'Timeout in milliseconds for hook execution.',
|
||||
|
||||
Reference in New Issue
Block a user