mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 13:22:35 -07:00
feat(hooks): adds support for RuntimeHook functions. (#19598)
This commit is contained in:
@@ -8,7 +8,7 @@ import type { Config } from '../config/config.js';
|
||||
import type { HookPlanner, HookEventContext } from './hookPlanner.js';
|
||||
import type { HookRunner } from './hookRunner.js';
|
||||
import type { HookAggregator, AggregatedHookResult } from './hookAggregator.js';
|
||||
import { HookEventName } from './types.js';
|
||||
import { HookEventName, HookType } from './types.js';
|
||||
import type {
|
||||
HookConfig,
|
||||
HookInput,
|
||||
@@ -500,7 +500,10 @@ export class HookEventHandler {
|
||||
* Get hook name from config for display or telemetry
|
||||
*/
|
||||
private getHookName(config: HookConfig): string {
|
||||
return config.name || config.command || 'unknown-command';
|
||||
if (config.type === HookType.Command) {
|
||||
return config.name || config.command || 'unknown-command';
|
||||
}
|
||||
return config.name || 'unknown-hook';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -513,7 +516,7 @@ export class HookEventHandler {
|
||||
/**
|
||||
* Get hook type from execution result for telemetry
|
||||
*/
|
||||
private getHookTypeFromResult(result: HookExecutionResult): 'command' {
|
||||
private getHookTypeFromResult(result: HookExecutionResult): HookType {
|
||||
return result.hookConfig.type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user