import type { NeuroLinkMiddleware, MiddlewareConfig, MiddlewareContext, MiddlewareRegistrationOptions, MiddlewareExecutionResult } from "../types/index.js"; import type { LanguageModelMiddleware } from "../types/index.js"; /** * Manages the registration, configuration, and execution of middleware for a single factory instance. */ export declare class MiddlewareRegistry { private middleware; private globalConfigs; private executionStats; /** * Register a middleware */ register(middleware: NeuroLinkMiddleware, options?: MiddlewareRegistrationOptions): void; /** * Unregister a middleware */ unregister(middlewareId: string): boolean; /** * Get a registered middleware */ get(middlewareId: string): NeuroLinkMiddleware | undefined; /** * List all registered middleware */ list(): NeuroLinkMiddleware[]; /** * Get middleware IDs sorted by priority */ getSortedIds(): string[]; /** * Build middleware chain based on configuration */ buildChain(context: MiddlewareContext, config?: Record): LanguageModelMiddleware[]; /** * Determine if middleware should be applied based on conditions */ private shouldApplyMiddleware; /** * Configure middleware with runtime configuration */ private configureMiddleware; /** * Record middleware execution statistics */ private recordExecution; /** * Get execution statistics for a middleware */ getExecutionStats(middlewareId: string): MiddlewareExecutionResult[]; /** * Get aggregated statistics for all middleware */ getAggregatedStats(): Record; /** * Clear execution statistics */ clearStats(middlewareId?: string): void; /** * Check if a middleware is registered */ has(middlewareId: string): boolean; /** * Get the number of registered middleware */ size(): number; /** * Clear all registered middleware */ clear(): void; }