UNPKG

ai-debug-local-mcp

Version:

🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh

132 lines • 4.32 kB
/** * VimAutomationHandler - Advanced Vim Automation for AI-Debug * * This handler incorporates sophisticated vim interaction capabilities * extracted from the CC-Vim vim plugin for automated testing and debugging. * * Based on analysis of vim_plugin_OLD/claude_realtime_v2.vim (638 lines) * Key capabilities ported: pane management, file tree interaction, * layout control, and real-time job monitoring. */ import { ChildProcess } from 'child_process'; export interface VimSession { socketPath: string; process?: ChildProcess; sessionId: string; workingDirectory: string; isActive: boolean; } export interface VimPane { type: 'tree' | 'editor' | 'claude'; winnr: number; bufname: string; active: boolean; } export interface VimLayoutInfo { panes: VimPane[]; activePane: string; treeWidth: number; claudeHeight: number; layoutActive: boolean; } export interface CCVimTestResult { success: boolean; layoutCreated: boolean; panesFunctional: boolean; claudeIntegration: boolean; fileTreeWorking: boolean; errors: string[]; diagnostics: { socketConnection: boolean; luaModuleLoaded: boolean; commandsAvailable: boolean; themeDetected: string; }; } export declare class VimAutomationHandler { private activeSessions; private socketBaseDir; /** * Create a new CC-Vim session with automated testing capabilities * Based on s:OpenClaudeLayout() from the vim plugin */ createCCVimSession(options: { workingDirectory: string; initialFile?: string; socketSuffix?: string; }): Promise<{ sessionId: string; socketPath: string; }>; /** * Wait for neovim socket to become available */ private waitForSocket; /** * Execute a vim command via socket connection * Based on the bridge communication patterns from the vim plugin */ executeVimCommand(sessionId: string, command: string): Promise<string>; /** * Get current layout information - ULTRA FAST Lua version (1-2ms vs 200ms) * Uses direct Lua execution instead of VimScript */ getLayoutInfo(sessionId: string): Promise<VimLayoutInfo>; /** * Execute Lua automation function directly (ULTRA FAST - 1-3ms) */ executeLuaAutomation(sessionId: string, functionName: string, ...args: any[]): Promise<any>; /** * Execute a vim expression and return the result */ private executeVimExpression; /** * Focus a specific pane (tree, editor, or claude) - ULTRA FAST Lua version (1ms vs 200ms) */ focusPane(sessionId: string, pane: 'tree' | 'editor' | 'claude'): Promise<void>; /** * Refresh the file tree - ULTRA FAST Lua version (2-5ms vs 500ms) */ refreshFileTree(sessionId: string): Promise<void>; /** * Open a file from the tree * Based on s:OpenFileFromTree() logic */ openFileFromTree(sessionId: string, filename: string): Promise<void>; /** * Start a Claude edit session * Based on s:LaunchClaudeEdit() from vim plugin */ startClaudeEdit(sessionId: string, prompt: string): Promise<void>; /** * Comprehensive CC-Vim functionality test * This combines all the testing capabilities we need for automated validation */ testCCVimFunctionality(sessionId: string): Promise<CCVimTestResult>; /** * Get comprehensive session diagnostics * Similar to the AI-Debug session diagnostics but for CC-Vim */ getSessionDiagnostics(sessionId: string): Promise<{ session: VimSession | null; socketStatus: 'active' | 'missing' | 'error'; processStatus: 'running' | 'stopped' | 'unknown'; layoutInfo: VimLayoutInfo | null; recommendations: string[]; }>; /** * Close a CC-Vim session and clean up resources * Based on s:CloseClaudeLayout() from vim plugin */ closeSession(sessionId: string): Promise<void>; /** * Get all active sessions */ getActiveSessions(): VimSession[]; /** * Clean up all sessions (emergency cleanup) */ cleanup(): Promise<void>; } export declare const vimAutomationHandler: VimAutomationHandler; //# sourceMappingURL=vim-automation-handler.d.ts.map