mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-21 03:21:11 -07:00
feat(hooks): adds support for RuntimeHook functions. (#19598)
This commit is contained in:
@@ -21,6 +21,9 @@ import type {
|
||||
AfterModelHookOutput,
|
||||
BeforeToolSelectionHookOutput,
|
||||
McpToolContext,
|
||||
HookConfig,
|
||||
HookEventName,
|
||||
ConfigSource,
|
||||
} from './types.js';
|
||||
import { NotificationType } from './types.js';
|
||||
import type { AggregatedHookResult } from './hookAggregator.js';
|
||||
@@ -202,6 +205,17 @@ export class HookSystem {
|
||||
return this.hookRegistry.getAllHooks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new hook programmatically
|
||||
*/
|
||||
registerHook(
|
||||
config: HookConfig,
|
||||
eventName: HookEventName,
|
||||
options?: { matcher?: string; sequential?: boolean; source?: ConfigSource },
|
||||
): void {
|
||||
this.hookRegistry.registerHook(config, eventName, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire hook events directly
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user