/** * Tool handlers for memory operations. */ import { type MemoryInfo } from '../memory/index.js'; import type { ToolResponse } from './types.js'; /** * Interface for memory manager operations (for testability). */ export interface IMemoryManager { writeMemory(name: string, content: string): Promise; readMemory(name: string): Promise; listMemories(): Promise; deleteMemory(name: string): Promise; editMemory(name: string, needle: string, repl: string, mode: 'literal' | 'regex'): Promise<{ matchCount: number; }>; } /** * Context for memory tools. */ export interface MemoryToolContext { projectPath: string; toolGuidance: string; /** Optional memory manager instance (for testing). Uses MemoryManager if not provided. */ memoryManager?: IMemoryManager; } /** * Arguments for write_memory tool. */ export interface WriteMemoryArgs { memoryFileName: string; content: string; } /** * Parse and validate write_memory arguments. */ export declare function parseWriteMemoryArgs(args: Record | undefined): WriteMemoryArgs; /** * Handle write_memory tool. */ export declare function handleWriteMemory(args: WriteMemoryArgs, context: MemoryToolContext): Promise; /** * Arguments for read_memory tool. */ export interface ReadMemoryArgs { memoryFileName: string; } /** * Parse and validate read_memory arguments. */ export declare function parseReadMemoryArgs(args: Record | undefined): ReadMemoryArgs; /** * Handle read_memory tool. */ export declare function handleReadMemory(args: ReadMemoryArgs, context: MemoryToolContext): Promise; /** * Format memory list for display. */ export declare function formatMemoryList(memories: MemoryInfo[]): string; /** * Handle list_memories tool. */ export declare function handleListMemories(context: MemoryToolContext): Promise; /** * Arguments for delete_memory tool. */ export interface DeleteMemoryArgs { memoryFileName: string; } /** * Parse and validate delete_memory arguments. */ export declare function parseDeleteMemoryArgs(args: Record | undefined): DeleteMemoryArgs; /** * Handle delete_memory tool. */ export declare function handleDeleteMemory(args: DeleteMemoryArgs, context: MemoryToolContext): Promise; /** * Arguments for edit_memory tool. */ export interface EditMemoryArgs { memoryFileName: string; needle: string; repl: string; mode: 'literal' | 'regex'; } /** * Parse and validate edit_memory arguments. */ export declare function parseEditMemoryArgs(args: Record | undefined): EditMemoryArgs; /** * Handle edit_memory tool. */ export declare function handleEditMemory(args: EditMemoryArgs, context: MemoryToolContext): Promise; //# sourceMappingURL=memory-handlers.d.ts.map