import { Effect, Ref } from 'effect'; import type { IntentMatch, Action } from './intent'; import { ActionHandlerNotFoundError, DefaultAgentNotConfiguredError, IntentRouteError } from './errors'; import type { AgentMessage } from '../agent/agent'; import { AgentService } from '../agent/service'; type ActionHandler = (action: Action, payload?: any) => Effect.Effect; /** * Action executor for routing intents to actions */ export declare class IntentRouter { private actionHandlers; private defaultAgentId; private agentService; constructor(actionHandlersRef: Ref.Ref>, defaultAgentIdRef: Ref.Ref, agentService: typeof AgentService.Service); /** * Set the default agent ID for fallback routing */ setDefaultAgent(agentId: string): Effect.Effect; /** * Register a custom action handler */ registerActionHandler(type: string, handler: ActionHandler): Effect.Effect; /** * Route an intent match to its action */ routeIntent(match: IntentMatch, userMessage: string): Effect.Effect; /** * Route to default agent when no intent matches */ routeToDefaultAgent(userMessage: string, previousMessages?: AgentMessage[]): Effect.Effect; /** * Handle agent action - route message to an agent */ private handleAgentAction; /** * Handle function action - execute a custom function */ private handleFunctionAction; } /** * Create an IntentRouter synchronously for backward compatibility. * Uses AgentManager adapter instead of AgentService. */ export declare const createIntentRouterSync: (agentManager: { getAgent: (id: string) => any; }) => IntentRouter; /** * Create an IntentRouter with default action handlers registered */ export declare const createIntentRouter: (agentService: typeof AgentService.Service) => Effect.Effect; export {}; //# sourceMappingURL=router.d.ts.map