/** * Plugin Registry — Load, register, and manage plugins. * * Handles plugin lifecycle, dependency resolution, event dispatching, * and workspace configuration. * * @module trellis/core/plugins */ import type { TrellisKernel } from '../kernel/trellis-kernel.js'; import type { OntologyRegistry } from '../ontology/registry.js'; import type { QueryEngine } from '../query/engine.js'; import type { PluginDef, EventCallback, WorkspaceConfig } from './types.js'; export declare class EventBus { private handlers; on(event: string, handler: EventCallback): void; off(event: string, handler: EventCallback): void; emit(event: string, data?: unknown): Promise; listEvents(): string[]; clear(): void; } export declare class PluginRegistry { private plugins; private eventBus; private workspaceConfig; private logs; /** * Register a plugin definition. Does not load it yet. */ register(def: PluginDef): void; /** * Unregister a plugin. Unloads it first if loaded. */ unregister(id: string): Promise; /** * Load a plugin (call onLoad, register middleware/ontologies/rules/events). * Resolves dependencies first. */ load(id: string, kernel?: TrellisKernel, ontologyRegistry?: OntologyRegistry, queryEngine?: QueryEngine): Promise; /** * Unload a plugin (call onUnload, remove middleware/events). */ unload(id: string): Promise; /** * Load all registered plugins in dependency order. */ loadAll(kernel?: TrellisKernel, ontologyRegistry?: OntologyRegistry, queryEngine?: QueryEngine): Promise; /** * Unload all plugins in reverse order. */ unloadAll(): Promise; get(id: string): PluginDef | undefined; isLoaded(id: string): boolean; list(): Array<{ def: PluginDef; loaded: boolean; }>; listLoaded(): PluginDef[]; getEventBus(): EventBus; emit(event: string, data?: unknown): Promise; on(event: string, handler: EventCallback): void; getWorkspaceConfig(): WorkspaceConfig; setWorkspaceConfig(config: WorkspaceConfig): void; getConfigValue(key: string): unknown; setConfigValue(key: string, value: unknown): void; getLogs(pluginId?: string): typeof this.logs; private _buildContext; private _resolveDependencyOrder; } //# sourceMappingURL=registry.d.ts.map