/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ /** * @plan:PLAN-20260216-HOOKSYSTEMREWRITE.P09,P10,P11,P20 * @requirement:HOOK-014,HOOK-015,HOOK-016a,HOOK-016b,HOOK-017,HOOK-018,HOOK-019,HOOK-020,HOOK-021,HOOK-022,HOOK-023,HOOK-024,HOOK-025,HOOK-026,HOOK-027,HOOK-028,HOOK-029,HOOK-030,HOOK-031,HOOK-134 * @pseudocode:analysis/pseudocode/03-tool-hook-pipeline.md */ import type { Config } from '../config/config.js'; import { BeforeToolHookOutput, AfterToolHookOutput, NotificationType } from '../hooks/types.js'; import type { ToolResult, ToolCallConfirmationDetails } from '../tools/tools.js'; /** * Trigger BeforeTool hook for a tool call * * @requirement:HOOK-134 - Returns typed result instead of void * * @param config - Configuration object with hook system access * @param toolName - Name of the tool being called * @param toolInput - Input arguments for the tool * @returns BeforeToolHookOutput if hooks execute, undefined otherwise */ export declare function triggerBeforeToolHook(config: Config, toolName: string, toolInput: Record): Promise; /** * Trigger AfterTool hook (non-blocking) * * @requirement:HOOK-134 - Returns typed result instead of void * * @param config - Configuration object with hook system access * @param toolName - Name of the tool that was called * @param toolInput - Input/arguments that were passed to the tool * @param toolOutput - Output/response from the tool * @returns AfterToolHookOutput if hooks execute, undefined otherwise */ export declare function triggerAfterToolHook(config: Config, toolName: string, toolInput: Record, toolOutput: ToolResult): Promise; /** * Result from triggering a Notification hook */ export interface NotificationHookResult { notificationType: NotificationType; message: string; details: SerializableConfirmationDetails; } /** * Serializable representation of tool confirmation details for hooks. * Excludes function properties like onConfirm that can't be serialized. * Uses index signature for Record compatibility. */ interface SerializableConfirmationDetails { [key: string]: unknown; type: 'edit' | 'exec' | 'mcp' | 'info'; title: string; fileName?: string; filePath?: string; fileDiff?: string; originalContent?: string | null; newContent?: string; isModifying?: boolean; command?: string; rootCommand?: string; serverName?: string; toolName?: string; toolDisplayName?: string; prompt?: string; urls?: string[]; } /** * Trigger ToolPermission Notification hook before showing confirmation dialog. * * This hook fires before the user is prompted to confirm a tool execution, * allowing external systems to be notified about pending tool confirmations * (e.g., for desktop notifications, logging, or integration with other tools). * * @param config - Configuration object with hook system access * @param confirmationDetails - Details about the tool requiring confirmation * @returns NotificationHookResult if hooks execute, undefined otherwise */ export declare function triggerToolNotificationHook(config: Config, confirmationDetails: ToolCallConfirmationDetails): Promise; export {};