UNPKG

arela

Version:

AI-powered CTO with multi-agent orchestration, code summarization, visual testing (web + mobile) for blazing fast development.

61 lines 1.6 kB
/** * Search Middleware - ENFORCES arela_search before grep * * This wraps agent execution and intercepts search calls. * If agent tries to use grep without arela_search first, * we BLOCK it and force them to use arela_search. */ export declare class SearchMiddleware { private searchHistory; private cwd; constructor(cwd: string); /** * Check if RAG index exists and is recent */ hasValidRagIndex(): Promise<boolean>; /** * Check if MCP server is running */ isMcpServerRunning(): Promise<boolean>; /** * Check if agent tried arela_search in last 2 minutes */ hasTriedArelaSearch(): boolean; /** * Intercept and validate a search attempt */ validateSearch(type: 'grep' | 'find' | 'arela_search', query: string): Promise<{ allowed: boolean; message?: string; suggestion?: string; }>; /** * Record a search attempt */ private recordSearch; /** * Get search statistics */ getStats(): { total: number; arelaSearches: number; grepSearches: number; blocked: number; tokensSaved: number; moneySaved: string; arelaSearchPercentage: string; }; /** * Print search statistics */ printStats(): void; } /** * Wrap agent execution with search enforcement */ export declare function executeWithSearchEnforcement(cwd: string, agentCommand: string, prompt: string): Promise<{ success: boolean; output: string; stats: any; }>; //# sourceMappingURL=search-middleware.d.ts.map