/** * Effect services for Intent matching and routing */ import { Context, Effect, Layer } from 'effect'; import type { Intent, IntentMatch } from './intent'; import type { AgentResponse, AgentMessage } from '../agent/agent'; import { AgentService } from '../agent/service'; import type { IntentMatchError, ActionHandlerNotFoundError, DefaultAgentNotConfiguredError, IntentRouteError } from './errors'; /** * Semantic matcher function type */ export type SemanticMatcherFn = (message: string, utterances: string[]) => Promise<{ matched: boolean; confidence: number; utterance?: string; }>; /** * IntentMatcherService interface */ export interface IntentMatcherService { matchIntent(message: string, semanticMatcher?: SemanticMatcherFn): Effect.Effect; registerIntents(intents: Intent[]): Effect.Effect; getIntents(): Effect.Effect; clear(): Effect.Effect; } export declare const IntentMatcherService: Context.Tag; /** * Live layer for IntentMatcherService */ export declare const IntentMatcherServiceLive: Layer.Layer; /** * IntentRouterService interface */ export interface IntentRouterService { routeIntent(match: IntentMatch, userMessage: string): Effect.Effect; routeToDefaultAgent(userMessage: string, previousMessages?: AgentMessage[]): Effect.Effect; setDefaultAgent(agentId: string): Effect.Effect; } export declare const IntentRouterService: Context.Tag; /** * Live layer for IntentRouterService * Depends on AgentService */ export declare const IntentRouterServiceLive: Layer.Layer; //# sourceMappingURL=service.d.ts.map