/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ /** * @plan:PLAN-20260216-HOOKSYSTEMREWRITE.P12,P13,P14,P20 * @requirement:HOOK-033,HOOK-034,HOOK-035,HOOK-041,HOOK-042,HOOK-043,HOOK-044,HOOK-045 * @pseudocode:analysis/pseudocode/04-model-hook-pipeline.md * * Lifecycle hook trigger functions (SessionStart, SessionEnd, BeforeAgent, AfterAgent) * These functions follow the same pattern as geminiChatHookTriggers.ts */ import type { Config } from '../config/config.js'; import { SessionStartSource, SessionEndReason, SessionStartHookOutput, SessionEndHookOutput, BeforeAgentHookOutput, AfterAgentHookOutput, PreCompressTrigger, PreCompressOutput } from '../hooks/types.js'; /** * Trigger SessionStart hook when a new session begins * * @param config - Configuration object with hook system access * @param source - The source of the session start (startup, resume, clear, compress) * @returns SessionStartHookOutput if hooks execute, undefined otherwise */ export declare function triggerSessionStartHook(config: Config, source: SessionStartSource): Promise; /** * Trigger SessionEnd hook when a session ends * * @param config - Configuration object with hook system access * @param reason - The reason for the session end (exit, clear, logout, etc.) * @returns SessionEndHookOutput if hooks execute, undefined otherwise */ export declare function triggerSessionEndHook(config: Config, reason: SessionEndReason): Promise; /** * Trigger BeforeAgent hook at the start of a turn (before model call) * * @param config - Configuration object with hook system access * @param prompt - The user prompt for this turn * @returns BeforeAgentHookOutput if hooks execute, undefined otherwise */ export declare function triggerBeforeAgentHook(config: Config, prompt: string): Promise; /** * Trigger AfterAgent hook at the end of a turn (after all tool calls complete) * * @param config - Configuration object with hook system access * @param prompt - The original user prompt * @param promptResponse - The agent's response * @param stopHookActive - Whether a stop hook is currently active * @returns AfterAgentHookOutput if hooks execute, undefined otherwise */ export declare function triggerAfterAgentHook(config: Config, prompt: string, promptResponse: string, stopHookActive: boolean): Promise; /** * Trigger PreCompress hook before chat compression * * @plan PLAN-20250219-GMERGE021.R4.P02 * @requirement REQ-P02-1 * * @param config - Configuration object with hook system access * @param trigger - The trigger type (manual or auto) * @returns PreCompressOutput if hooks execute, undefined otherwise */ export declare function triggerPreCompressHook(config: Config, trigger: PreCompressTrigger): Promise;