/** * Hook Handler - Manages extension hook execution * * Encapsulates all hook-related logic for the agent service. */ import type { AgentMessage } from '@earendil-works/pi-agent-core'; import type { ExtensionHookRunner } from '../../extensions/index.js'; export interface HookHandlerDeps { hookRunner?: ExtensionHookRunner; sessionKey?: string; agentId: string; } export declare class HookHandler { private deps; constructor(deps: HookHandlerDeps); private getContext; trigger(event: string, eventData: Record): Promise; /** Run a hook with an explicit session key (e.g. webchat turn lifecycle). */ triggerWithSessionKey(sessionKey: string, event: string, eventData: Record): Promise; runMessageSending(to: string, content: string, channel?: string): Promise<{ send: boolean; content?: string; reason?: string; }>; runMessageSent(to: string, content: string, success: boolean, error: string | undefined, channel?: string): Promise; runInputHook(text: string, images: Array<{ type: string; data: string; mimeType?: string; }>, source: string): Promise<{ text: string; images: Array<{ type: string; data: string; mimeType?: string; }>; action: 'continue' | 'handled'; skipAgent: boolean; response?: string; }>; runContextHook(messages: AgentMessage[]): Promise<{ messages: AgentMessage[]; modified: boolean; }>; }