/** * Gateway Plugin Loader * * Discovers and loads gateway plugins from ~/.mama/plugins/ * Each plugin is a directory with: * - plugin.json (manifest) * - index.ts or index.js (entry point) */ import type { PluginManifest, LoadedPlugin, Gateway, MessageSource } from './types.js'; import type { TurnProcessor } from './turn-contract.js'; /** * Plugin loader configuration */ export interface PluginLoaderConfig { /** Plugin directory (default: ~/.mama/plugins) */ pluginsDir?: string; /** Gateway configurations from main config */ gatewayConfigs?: Record; /** Host-owned turn processor. Never exposed directly to plugins. */ turnProcessor: TurnProcessor; /** Owner IDs resolved from host connector configuration, keyed by manifest source ID. */ ownerUserIdsBySource?: Readonly>>; } /** * Plugin Loader class */ export declare class PluginLoader { private readonly pluginsDir; private readonly gatewayConfigs; private readonly turnProcessor; private readonly ownerUserIdsBySource; private readonly plugins; private readonly messageHandlers; constructor(config: PluginLoaderConfig); /** * Discover all plugins in the plugins directory */ discover(): Promise; /** * Check if a plugin is enabled in config */ private isPluginEnabled; /** * Load and register a plugin */ loadPlugin(pluginId: string): Promise; /** * Load all discovered plugins */ loadAll(): Promise; /** * Create the API object for a plugin */ private createPluginApi; /** * Create a logger for a plugin */ private createLogger; /** * Get all loaded gateways */ getGateways(): Gateway[]; /** * Get a specific gateway by source ID */ getGateway(source: MessageSource): Gateway | undefined; /** * Get all discovered plugins */ getPlugins(): LoadedPlugin[]; /** * Stop all gateways */ stopAll(): Promise; } /** * Create a plugin loader instance */ export declare function createPluginLoader(config: PluginLoaderConfig): PluginLoader; //# sourceMappingURL=plugin-loader.d.ts.map