feat(hooks): Hook Agent Lifecycle Integration (#9105)

This commit is contained in:
Edilmo Palencia
2025-11-24 14:31:48 -08:00
committed by GitHub
parent 6ae33cb892
commit 67e001eccd
12 changed files with 631 additions and 3 deletions
+15
View File
@@ -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
*/