import type { MessageRouterOptions, ServiceHandler, CapabilitiesResponse } from '@azeth/common'; /** Message router for XMTP structured message dispatch. * * Receives raw message strings, parses them, dispatches by type, * and returns JSON response strings. Handles rate limiting, reputation * gating, service execution, and capabilities advertising. */ export declare class MessageRouter { private readonly _skills; private readonly _agentName; private readonly _agentAddress; private readonly _httpEndpoint?; private readonly _minReputationForService; private readonly _reputationChecker?; private readonly _onFriendRequest?; private readonly _onFriendAccept?; private readonly _textFallbackHandler?; private readonly _handlers; private readonly _rateLimiter; /** Create a new MessageRouter with the given options. * * @param options - Router configuration including skills, agent identity, and callbacks */ constructor(options: MessageRouterOptions); /** Route an incoming message to the appropriate handler and return a JSON response. * * Flow: rate limit check → JSON parse → structured dispatch or text fallback. * All responses are valid JSON strings. * * @param sender - Sender identifier (address or inbox ID) * @param content - Raw message content string * @returns JSON response string */ routeMessage(sender: string, content: string): Promise; /** Register a handler function for a named service. * * The handler will be invoked when a `service-request` message * arrives for a free skill matching the given name. * * @param serviceName - Service name (case-insensitive matching at dispatch time) * @param handler - Async function that processes the request payload */ registerHandler(serviceName: string, handler: ServiceHandler): void; /** Remove a previously registered handler for a service. * * @param serviceName - Service name to unregister */ removeHandler(serviceName: string): void; /** Get the names of all services that have registered handlers. * * @returns Array of service names with active handlers */ getRegisteredHandlers(): string[]; /** Build the capabilities response advertising this agent's services. * * @returns CapabilitiesResponse with service catalog, free/paid separation, and usage examples */ buildCapabilities(): CapabilitiesResponse; /** Stop the rate limiter cleanup timer. * * Call this when the router is no longer needed to prevent timer leaks. */ destroy(): void; private _handleStructuredMessage; private _handleServiceRequest; private _handleServiceInquiry; private _handleTextMessage; } //# sourceMappingURL=message-router.d.ts.map