/** * IntentGate — multi-signal intent classification that analyzes true user * intent before routing to an agent. * * Signals used (all heuristic, no LLM calls): * 1. Keyword/pattern matching (primary) * 2. Complexity estimation (word count, question structure, file refs) * 3. Conversational context (question vs command vs mixed) * 4. Scope detection (single-file vs multi-file vs architectural) * * The gate can operate in two modes: * - 'advise' (default): appends a system hint suggesting the right agent * - 'gate': blocks mismatched agent execution with a redirect message */ import type { IntentGateConfig, Logger } from '../types'; export type IntentTag = 'research' | 'plan' | 'implement' | 'review' | 'debug' | 'quick-fix' | 'unknown'; export type RoutedAgent = 'forge' | 'muse' | 'sage'; export type ComplexityLevel = 'trivial' | 'simple' | 'moderate' | 'complex' | 'architectural'; export interface IntentClassification { tag: IntentTag; agent: RoutedAgent; confidence: number; method: 'heuristic' | 'llm'; /** Estimated complexity of the request. */ complexity: ComplexityLevel; /** Whether the message is a question, command, or mixed. */ conversationType: 'question' | 'command' | 'mixed'; /** Scope: how many files/components are likely affected. */ scope: 'single-file' | 'multi-file' | 'architectural'; /** All scored tags, not just the winner (for diagnostics). */ allScores: Array<{ tag: IntentTag; agent: RoutedAgent; score: number; }>; } export interface GateDecision { /** Whether the current agent is appropriate. */ pass: boolean; /** Classification result. */ classification: IntentClassification; /** Human-readable redirect message (non-empty only when pass=false). */ redirectMessage: string; } export declare class IntentRouter { private config; private logger; constructor(logger: Logger, config?: IntentGateConfig); /** * Whether intent routing is enabled. */ isEnabled(): boolean; /** * Full classification with all signals. */ classify(message: string): IntentClassification; /** * Gate check: given the current agent, decide if the message should pass * or be redirected. */ gate(message: string, currentAgent: string): GateDecision; /** * Get the suggested agent for a message without full classification details. */ suggestAgent(message: string): RoutedAgent; private heuristicClassify; } //# sourceMappingURL=intent-router.d.ts.map