Implementation Notification hook with three scenario and add test

This commit is contained in:
DennisYu07 2026-03-04 21:54:25 -08:00
parent 1ee871fc60
commit 263bbaa633
16 changed files with 1115 additions and 20 deletions

View file

@ -20,6 +20,7 @@ import type {
AgentType,
PermissionMode,
PreCompactTrigger,
NotificationType,
} from './types.js';
const debugLogger = createDebugLogger('TRUSTED_HOOKS');
@ -215,4 +216,22 @@ export class HookSystem {
? createHookOutput('PreCompact', result.finalOutput)
: undefined;
}
/**
* Fire a Notification event
*/
async fireNotificationEvent(
message: string,
notificationType: NotificationType,
title?: string,
): Promise<DefaultHookOutput | undefined> {
const result = await this.hookEventHandler.fireNotificationEvent(
message,
notificationType,
title,
);
return result.finalOutput
? createHookOutput('Notification', result.finalOutput)
: undefined;
}
}