mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
Implementation Notification hook with three scenario and add test
This commit is contained in:
parent
1ee871fc60
commit
263bbaa633
16 changed files with 1115 additions and 20 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue