/** * Message Router - Routes inbound messages to the appropriate agent session * * Implements the routing resolution logic: * 1. peer matching - exact DM/group/channel ID * 2. guild matching - Discord server ID * 3. team matching - Slack team ID * 4. account matching - specific account instance * 5. channel matching - whole platform wildcard * 6. default - default agent */ import type { ConfigManager } from "../config/manager.js"; import type { SessionManager } from "./sessions.js"; import type { ChannelScope, InboundMessage, RouteResolution } from "./types/index.js"; /** Router options */ export interface RouterOptions { configManager: ConfigManager; sessionManager: SessionManager; } /** Message router */ export declare class MessageRouter { private configManager; private sessionManager; constructor(options: RouterOptions); /** * Resolve route for an inbound message * * Routing priority (high to low): * 1. peer matching - exact DM/group/channel ID * 2. guild matching - Discord server ID * 3. team matching - Slack team ID * 4. account matching - specific account instance * 5. channel matching - whole platform wildcard * 6. default - default agent */ resolveRoute(message: InboundMessage): Promise; /** * Find matching binding */ private findBinding; /** * Check if sender has access based on binding policy */ private checkAccess; /** * Parse session key into components */ parseSessionKey(key: string): { agentId: string; channel: string; scope: ChannelScope; identifier: string; }; /** * Build session key from components */ buildSessionKey(agentId: string, channel: string, scope: ChannelScope, identifier: string): string; /** * Check if message should be processed (access control) */ canProcess(message: InboundMessage): Promise<{ allowed: boolean; reason?: string; requiresPairing?: boolean; }>; /** * Get or create session for message */ getOrCreateSession(message: InboundMessage): Promise; /** * Get agent configuration for message */ getAgentConfig(message: InboundMessage): { id: string; name: string; description?: string | undefined; model: { provider: string; model: string; }; systemPrompt?: string | undefined; skills: string[]; tools?: { allow?: string[] | undefined; deny?: string[] | undefined; } | undefined; sandbox?: { enabled: boolean; workspace?: string | undefined; } | undefined; session: { historyLimit: number; dmHistoryLimit?: number | undefined; idleMinutes: number; dailyResetHour: number; compression: "none" | "summary"; queuing: "collect" | "concurrent" | "followup" | "sequential" | "steer"; }; bootstrap: { files: string[]; maxChars: number; }; memory: { enabled: boolean; files: string[]; }; } | undefined; /** * Get all active routes */ getActiveRoutes(): Array<{ channel: string; agentId: string; bindType: string; bindValue: string; }>; } //# sourceMappingURL=router.d.ts.map