import { PluginHook, PluginInstance, BrainInsight } from '../types.js'; type HookEvent = PluginHook['event']; type HookContext = Record; interface HookResult { insights?: BrainInsight[]; modified?: boolean; data?: Record; error?: string; } /** * PluginSystem — extensible plugin architecture. * * Supports: * 1. Local plugins from project `shadow-brain-plugins/` directory * 2. npm packages with `shadow-brain-plugin` keyword * 3. Hookable analysis pipeline with priority ordering * 4. Plugin isolation — errors in one plugin don't crash others * 5. Hot-reload during development */ export declare class PluginSystem { private plugins; private hooks; private projectDir; private pluginsDir; constructor(projectDir?: string); /** * Discover and load all available plugins. */ loadAll(): Promise<{ loaded: number; errors: number; }>; /** * Load a single plugin from its directory. */ loadPlugin(pluginDir: string): Promise; /** * Unload a plugin by name. */ unloadPlugin(name: string): boolean; /** * Enable/disable a plugin. */ setPluginEnabled(name: string, enabled: boolean): boolean; /** * Execute hooks for a given event, passing context to each handler. */ executeHooks(event: HookEvent, context?: HookContext): Promise; /** * Execute pre-analysis hooks — can filter/modify files before analysis. */ preAnalysis(context: { files: string[]; projectDir: string; }): Promise<{ files: string[]; extraInsights: BrainInsight[]; }>; /** * Execute post-analysis hooks — can modify/filter insights after analysis. */ postAnalysis(context: { insights: BrainInsight[]; healthScore: number; }): Promise<{ insights: BrainInsight[]; }>; /** * Discover npm packages with the shadow-brain-plugin keyword. */ private discoverNpmPlugins; /** * Execute a plugin handler function. */ private executeHandler; private getPluginDir; getPlugins(): PluginInstance[]; getPlugin(name: string): PluginInstance | undefined; getHooks(event?: HookEvent): Array<{ plugin: string; hook: PluginHook; }>; getStats(): { totalPlugins: number; enabledPlugins: number; disabledPlugins: number; totalHooks: number; hooksByEvent: Record; errors: number; }; /** * Create a template plugin in the project's plugins directory. */ createTemplate(name: string): string; } export {}; //# sourceMappingURL=plugin-system.d.ts.map