/** * Plugin architecture for codedev-mcp. * Users extend the server with custom analyzers without forking. * * Plugin locations (in priority order): * 1. ./.codedev-mcp/plugins/ (project-local) * 2. ~/.codedev-mcp/plugins/ (user-global) * 3. npm packages: codedev-plugin-* (marketplace) * * Plugin format: * Each plugin is a directory with a plugin.json manifest and an index.js entry point. * npm marketplace plugins follow the same format but are installed via npm. */ export interface PluginManifest { name: string; version: string; description: string; author?: string; tools?: PluginToolDef[]; patterns?: PluginPatternDef[]; languages?: PluginLanguageDef[]; } export interface PluginToolDef { name: string; description: string; inputSchema: Record; } export interface PluginPatternDef { name: string; pattern: string; severity: string; description: string; recommendation: string; } export interface PluginLanguageDef { name: string; extensions: string[]; commentSingle?: string; commentMultiStart?: string; commentMultiEnd?: string; functionPatterns?: string[]; classPatterns?: string[]; } export interface PluginModule { tools?: Record, context: { cwd: string; }) => Promise>; } export interface LoadedPlugin { manifest: PluginManifest; pluginPath: string; module?: PluginModule; } /** * Discover and load plugins from standard locations + npm marketplace. * @param cwd - The working directory to search for plugins. * @returns An array of loaded plugins. */ export declare function loadPlugins(cwd: string): Promise; /** * Get all custom patterns from loaded plugins. * @param plugins - The loaded plugins. * @returns An array of pattern definitions from all plugins. */ export declare function getPluginPatterns(plugins: LoadedPlugin[]): PluginPatternDef[]; /** * Get all custom language definitions from plugins. * @param plugins - The loaded plugins. * @returns An array of language definitions from all plugins. */ export declare function getPluginLanguages(plugins: LoadedPlugin[]): PluginLanguageDef[]; /** * Get all custom tool definitions from plugins. * @param plugins - The loaded plugins. * @returns An array of tool definitions with their plugin names. */ export declare function getPluginTools(plugins: LoadedPlugin[]): { plugin: string; tool: PluginToolDef; }[]; /** * Execute a plugin tool handler. * @param plugin - The loaded plugin to execute. * @param toolName - The tool name to invoke. * @param params - Parameters to pass to the tool. * @param context - Execution context. * @param context.cwd - The current working directory. * @returns The string result from the tool handler. */ export declare function executePluginTool(plugin: LoadedPlugin, toolName: string, params: Record, context: { cwd: string; }): Promise; /** * Generate a plugin scaffold for users. * Produces both plugin.json (native) and package.json (npm marketplace) formats. * @param name - The plugin name. * @returns An object containing manifest, packageJson, indexJs, and readme strings. */ export declare function generatePluginScaffold(name: string): { manifest: string; packageJson: string; indexJs: string; readme: string; }; //# sourceMappingURL=plugins.d.ts.map