/** * Society Protocol — Capability Router * * Inspired by: * - DAAO (arXiv:2509.11079): Difficulty-aware routing * - DyLAN (arXiv:2310.02170): Agent importance scoring * - MaAS (arXiv:2502.04180): Per-query architecture sampling * * Analyzes incoming requests and decides: * 1. Complexity level (simple → single agent, complex → swarm) * 2. Required capabilities (what skills/specialties are needed) * 3. Routing mode (select from pool vs spawn new agents) */ export interface IncomingRequest { /** The goal / task description */ goal: string; /** Optional room to execute in */ roomId?: string; /** Optional required capabilities */ requiredCapabilities?: string[]; /** Optional priority */ priority?: 'low' | 'normal' | 'high' | 'critical'; /** Optional max agents to use */ maxAgents?: number; /** Caller identity */ callerDid?: string; /** Additional context */ context?: Record; } export type RoutingMode = 'single-agent' | 'select-from-pool' | 'spawn-team'; export interface RoleSpec { /** Role name (e.g., 'researcher', 'coder', 'reviewer') */ role: string; /** Task type for matching */ taskType: string; /** Required capabilities */ capabilities: string[]; /** Required specialties */ specialties: string[]; /** Step kind in CoC */ kind: 'task' | 'review' | 'synthesis' | 'verification'; /** Priority for this role */ priority: number; } export interface RoutingDecision { /** How to route */ mode: RoutingMode; /** Estimated complexity (0-1) */ complexity: number; /** Required roles */ roles: RoleSpec[]; /** Max agents to involve */ maxAgents: number; /** Reasoning for the decision */ reason: string; } export declare class CapabilityRouter { /** * Route an incoming request to the appropriate execution mode. */ route(request: IncomingRequest): RoutingDecision; /** * Estimate task complexity (0-1) based on text signals. * Inspired by DAAO difficulty estimation. */ estimateComplexity(request: IncomingRequest): number; /** * Detect required roles from the request text. * Returns deduplicated, priority-sorted roles. */ detectRoles(request: IncomingRequest): RoleSpec[]; /** * Suggest how many agents to use based on complexity and roles. */ private suggestAgentCount; } //# sourceMappingURL=capability-router.d.ts.map