( source: 'startup' | 'resume' | 'clear' | 'compact', sessionId?: string, agentType?: string, model?: string, signal?: AbortSignal, timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS, forceSyncExecution?: boolean, )
| 4024 | * @returns Async generator that yields progress messages and hook results |
| 4025 | */ |
| 4026 | export async function* executeSessionStartHooks( |
| 4027 | source: 'startup' | 'resume' | 'clear' | 'compact', |
| 4028 | sessionId?: string, |
| 4029 | agentType?: string, |
| 4030 | model?: string, |
| 4031 | signal?: AbortSignal, |
| 4032 | timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS, |
| 4033 | forceSyncExecution?: boolean, |
| 4034 | ): AsyncGenerator<AggregatedHookResult> { |
| 4035 | const hookInput: SessionStartHookInput = { |
| 4036 | ...createBaseHookInput(undefined, sessionId), |
| 4037 | hook_event_name: 'SessionStart', |
| 4038 | source, |
| 4039 | agent_type: agentType, |
| 4040 | model, |
| 4041 | } |
| 4042 | |
| 4043 | yield* executeHooks({ |
| 4044 | hookInput, |
| 4045 | toolUseID: randomUUID(), |
| 4046 | matchQuery: source, |
| 4047 | signal, |
| 4048 | timeoutMs, |
| 4049 | forceSyncExecution, |
| 4050 | }) |
| 4051 | } |
| 4052 | |
| 4053 | /** |
| 4054 | * Execute setup hooks if configured |
no test coverage detected