import type { ISkill, IChannel, Message } from '../core/types'; import type { MCPTool } from '../tools/mcp'; /** * Plugin lifecycle hooks - v1.0.0 */ export interface PluginHooks { onInit?: () => Promise; onMessage?: (message: Message) => Promise; onResponse?: (message: Message, response: Message) => Promise; onError?: (error: Error, context?: Record) => Promise; onShutdown?: () => Promise; beforeInit?: () => Promise; afterInit?: () => Promise; beforeMessage?: (message: { content: string; }) => Promise; afterMessage?: (message: { content: string; }, response: { content: string; }) => Promise; beforeShutdown?: () => Promise; } /** * v1.6.0 — Enhanced Plugin interface with middleware pattern. * Plugins implementing this interface use next() to chain processing. */ export interface Plugin { name: string; version: string; description?: string; onInit?(runtime: any): Promise; onMessage?(message: any, next: (msg: any) => Promise): Promise; onResponse?(response: any, next: (res: any) => Promise): Promise; onError?(error: Error): void; onShutdown?(): Promise; tools?: any[]; skills?: any[]; channels?: any[]; } /** * Plugin manifest in OAD: plugins: [{ name, config }] */ export interface PluginManifest { name: string; config?: Record; } /** * Plugin interface - extend agent with skills, tools, channels, and lifecycle hooks. */ export interface IPlugin { name: string; version: string; description?: string; hooks?: PluginHooks; skills?: ISkill[]; tools?: MCPTool[]; channels?: IChannel[]; } export declare class PluginManager { private plugins; private enhancedPlugins; private logger; register(plugin: IPlugin): void; /** * Register an enhanced plugin with middleware support (v1.6.0). */ registerEnhanced(plugin: Plugin): void; unregisterEnhanced(name: string): void; getEnhanced(name: string): Plugin | undefined; listEnhanced(): Plugin[]; unregister(name: string): void; get(name: string): IPlugin | undefined; list(): { name: string; version: string; description?: string; }[]; has(name: string): boolean; runHook(hookName: keyof PluginHooks, ...args: unknown[]): Promise; /** * Initialize all plugins (legacy + enhanced). */ initAll(runtime?: any): Promise; /** * Shutdown all plugins (legacy + enhanced). */ shutdownAll(): Promise; /** * Run message through enhanced plugin middleware chain. * Each plugin calls next() to pass to the next plugin. */ runMessageMiddleware(message: any): Promise; /** * Run response through enhanced plugin middleware chain. */ runResponseMiddleware(response: any): Promise; runOnInit(): Promise; runOnMessage(message: Message): Promise; runOnResponse(message: Message, response: Message): Promise; runOnError(error: Error, context?: Record): Promise; runOnShutdown(): Promise; getAllSkills(): ISkill[]; getAllTools(): MCPTool[]; getAllChannels(): IChannel[]; } export declare function createLoggingPlugin(): IPlugin; export declare function createAnalyticsPlugin(): IPlugin; export declare function createRateLimitPlugin(maxPerMinute?: number): IPlugin; //# sourceMappingURL=index.d.ts.map