mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-18 05:50:30 -07:00
feat(hooks): Hook Agent Lifecycle Integration (#9105)
This commit is contained in:
@@ -76,6 +76,7 @@ import type { EventEmitter } from 'node:events';
|
||||
import { MessageBus } from '../confirmation-bus/message-bus.js';
|
||||
import { PolicyEngine } from '../policy/policy-engine.js';
|
||||
import type { PolicyEngineConfig } from '../policy/types.js';
|
||||
import { HookSystem } from '../hooks/index.js';
|
||||
import type { UserTierId } from '../code_assist/types.js';
|
||||
import { getCodeAssistServer } from '../code_assist/codeAssist.js';
|
||||
import type { Experiments } from '../code_assist/experiments/experiments.js';
|
||||
@@ -415,6 +416,7 @@ export class Config {
|
||||
| undefined;
|
||||
private experiments: Experiments | undefined;
|
||||
private experimentsPromise: Promise<void> | undefined;
|
||||
private hookSystem?: HookSystem;
|
||||
|
||||
private previewModelFallbackMode = false;
|
||||
private previewModelBypassMode = false;
|
||||
@@ -627,6 +629,12 @@ export class Config {
|
||||
await this.getExtensionLoader().start(this),
|
||||
]);
|
||||
|
||||
// Initialize hook system if enabled
|
||||
if (this.enableHooks) {
|
||||
this.hookSystem = new HookSystem(this);
|
||||
await this.hookSystem.initialize();
|
||||
}
|
||||
|
||||
await this.geminiClient.initialize();
|
||||
}
|
||||
|
||||
@@ -1475,6 +1483,13 @@ export class Config {
|
||||
return registry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the hook system instance
|
||||
*/
|
||||
getHookSystem(): HookSystem | undefined {
|
||||
return this.hookSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hooks configuration
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user