import type { Logger } from '@ariestools/sdk';
import type { JsonRpcRequest } from '@metamask/json-rpc-engine/v2';
import { JsonRpcEngineV2, JsonRpcServer } from '@metamask/json-rpc-engine/v2';
import type { XyoConnection } from '@xyo-network/xl1-protocol/protocol-lib';
import type { RpcContext, RpcMiddleware } from './middleware/index.js';
/**
 * Composed alternative to {@link rpcEngineFromConnection}. Builds the same
 * engine surface, but as a stack of small middleware:
 *
 *   logging → [sub-engine per viewer/runner namespace] → method-not-found
 *
 * Each sub-engine pairs a {@link createValidationMiddleware} with a
 * {@link createTypedHandlerMiddleware}, isolating one viewer's schemas + handlers.
 * Cross-cutting concerns (logging, error mapping, future auth/rate-limit) live
 * once at the root rather than inside the dispatch loop.
 */
export declare const composedRpcEngineFromConnection: (connection: XyoConnection, logger?: Logger) => JsonRpcEngineV2<JsonRpcRequest, RpcContext>;
/** Convenience wrapper that returns a spec-compliant {@link JsonRpcServer}. */
export declare const composedRpcServerFromConnection: (connection: XyoConnection, logger?: Logger) => JsonRpcServer<RpcMiddleware>;
//# sourceMappingURL=composedRpcEngineFromConnection.d.ts.map