/** * MCP Tool Handlers for UI/UX Pro Max Design Search * Provides BM25-powered search across all design data domains */ /** * Result of domain detection with confidence score */ export interface DomainMatch { domain: string; confidence: number; } /** * Auto-detect domain from query based on keywords (legacy version for backward compatibility) * @param query - Search query * @returns Detected domain name or null if no specific domain detected * @deprecated Use detectDomains() for confidence-based detection */ export declare function detectDomain(query: string): string | null; /** * Enhanced domain detection with confidence scoring * Returns multiple domain matches sorted by confidence descending * @param query - Search query * @returns Array of DomainMatch sorted by confidence (highest first), empty if no clear domain */ export declare function detectDomains(query: string): DomainMatch[]; /** * Detect framework/stack from query * @param query - Search query * @returns Array of DomainMatch with stack names, sorted by confidence descending */ export declare function detectStacks(query: string): DomainMatch[]; export interface ValidationResult { valid: boolean; query: string; originalQuery: string; maxResults: number; error?: string; } /** * Validate and sanitize search input parameters * @param query - Raw search query input * @param maxResults - Raw max results input * @returns ValidationResult with sanitized values or error */ export declare function validateSearchInput(query: unknown, maxResults?: unknown): ValidationResult; /** * Initialize all BM25 indexes with loaded data */ export declare function initializeIndexes(): void; export interface SearchResult { data: Record; score: number; } export interface SearchError { error: string; } export type SearchResponse = SearchResult[] | SearchError; /** * Search UI styles only (57 styles) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) * @deprecated Use searchVisualDesign() for merged search across styles, colors, typography, prompts */ export declare function searchStylesOnly(query: unknown, maxResults?: unknown): SearchResponse; /** * Merged search for visual design: styles, colors, typography, prompts * Combines 4 tools into 1 unified search * @param query - Search query * @param domainOrMaxResults - Optional: 'style' | 'color' | 'typography' | 'prompt' to filter by domain, OR number for maxResults (backward compat) * @param maxResults - Maximum results to return (default: 5) */ export declare function searchStyles(query: unknown, domainOrMaxResults?: 'style' | 'color' | 'typography' | 'prompt' | number, maxResults?: unknown): SearchResponse; /** * Search color palettes (95 palettes) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) */ export declare function searchColors(query: unknown, maxResults?: unknown): SearchResponse; /** * Search typography/font pairings (56 pairings) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) */ export declare function searchTypography(query: unknown, maxResults?: unknown): SearchResponse; /** * Search chart types (24 chart types) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) */ export declare function searchCharts(query: unknown, maxResults?: unknown): SearchResponse; /** * Search UX guidelines (98 guidelines) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) * @deprecated Use searchPatterns() for merged search across landing, UX guidelines, products */ export declare function searchUXGuidelines(query: unknown, maxResults?: unknown): SearchResponse; /** * Search icons (100 icons) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) */ export declare function searchIcons(query: unknown, maxResults?: unknown): SearchResponse; /** * Merged search for UI components: icons and charts * Combines search across icons (100 items) and charts (24 types) with optional type filtering * @param query - Search query * @param type - Optional filter: 'icon' or 'chart'. If omitted, searches both * @param maxResults - Maximum results to return (default: 5) */ export declare function searchComponents(query: unknown, type?: 'icon' | 'chart', maxResults?: unknown): SearchResponse; /** * Merged search for design patterns: landing layouts, UX guidelines, product recommendations * Combines 3 tools into 1 unified search * @param query - Search query * @param type - Optional filter: 'layout' | 'ux' | 'product'. If omitted, searches all three * @param maxResults - Maximum results to return (default: 5) */ export declare function searchPatterns(query: unknown, type?: 'layout' | 'ux' | 'product', maxResults?: unknown): SearchResponse; /** * Search landing page patterns * @param query - Search query * @param maxResults - Maximum results to return (default: 3) * @deprecated Use searchPatterns() for merged search across landing, UX guidelines, products */ export declare function searchLanding(query: unknown, maxResults?: unknown): SearchResponse; /** * Search product type recommendations * @param query - Search query * @param maxResults - Maximum results to return (default: 3) * @deprecated Use searchPatterns() for merged search across landing, UX guidelines, products */ export declare function searchProducts(query: unknown, maxResults?: unknown): SearchResponse; /** * Unified search across all design domains * Uses enhanced domain auto-detection with confidence scoring to prioritize relevant results * @param query - Search query * @param maxResults - Maximum results to return (default: 10) */ export declare function searchAll(query: unknown, maxResults?: unknown): SearchResponse; /** * Search AI prompt templates * @param query - Search query * @param maxResults - Maximum results to return (default: 3) */ export declare function searchPrompts(query: unknown, maxResults?: unknown): SearchResponse; /** * Search framework-specific guidelines (stacks) * @param stackName - Stack name (react, vue, nextjs, etc.) * @param query - Search query * @param maxResults - Maximum results to return (default: 3) */ export declare function searchStack(stackName: unknown, query: unknown, maxResults?: unknown): SearchResponse; /** * List available stacks */ export declare function listAvailableStacks(): string[]; /** * Search platform-specific guidelines (iOS HIG, etc.) * @param query - Search query * @param platformName - Optional platform name (ios). If omitted, searches all platforms * @param maxResults - Maximum results to return (default: 5) */ export declare function searchPlatforms(query: unknown, platformName?: string, maxResults?: unknown): SearchResponse; /** * List available platforms */ export declare function listAvailablePlatforms(): string[]; export interface DataStats { styles: number; colors: number; typography: number; charts: number; uxGuidelines: number; icons: number; landing: number; products: number; prompts: number; stacks: { [key: string]: number; }; platforms: { [key: string]: number; }; total: number; } /** * Get statistics about loaded data */ export declare function getDataStats(): DataStats; /** * Check if indexes are initialized */ export declare function isInitialized(): boolean; /** * Page intent classification result */ export interface PageIntentResult { intent: 'landing' | 'dashboard' | 'page' | 'unknown'; confidence: number; matchedKeyword: string | null; position: number; warnings: string[]; } /** * Classify page intent from query using phrase-priority matching * Multi-word phrases have higher priority than single words * * Algorithm: * 1. PHASE 1: Check multi-word phrases first (higher priority) * 2. PHASE 2: If no phrase match, scan single words left-to-right * 3. Position boost: earlier position = higher confidence * * @param query - The search query to classify * @returns PageIntentResult with intent, confidence, matched keyword, position, and warnings */ export declare function classifyPageIntent(query: string): PageIntentResult; /** * Result of platform intent detection */ export interface PlatformIntentResult { platform: 'web' | 'mobile-ios' | 'mobile-android' | 'mobile-generic' | 'cross-platform'; confidence: number; matched_keywords: string[]; framework?: string; } /** * Detect platform intent from query using weighted keyword matching * * Algorithm: * 1. Scan query for platform-specific keywords with weights * 2. Calculate score for each platform * 3. Return highest scoring platform with confidence * 4. Default to 'web' with confidence 0.3 if no platform detected * * @param query - The search query to analyze * @returns PlatformIntentResult with platform, confidence, matched keywords, and optional framework */ export declare function detectPlatformIntent(query: string): PlatformIntentResult; /** * Configuration for platform boost behavior */ export interface PlatformBoostConfig { /** Multiplier for matching platform results (default: 1.5) */ boostFactor: number; /** Penalty multiplier for non-matching platform results (default: 0.5) */ penaltyFactor: number; /** Enable/disable boost (default: true) */ enabled: boolean; } /** * Apply platform-based score boosting to search results * * Algorithm: * - If detected platform is "web": boost "web" and "both" results, penalize "mobile" * - If detected platform includes "mobile": boost "mobile" and "both" results, penalize "web" * - "cross-platform" detected: boost "both" results only * - Results are re-sorted by adjusted scores * * @param results - Array of search results with data and score * @param detectedPlatform - Platform from detectPlatformIntent (web, mobile-ios, mobile-android, etc.) * @param config - Optional configuration for boost/penalty factors * @returns Re-scored and re-sorted results */ export declare function applyPlatformBoost; score: number; }>(results: T[], detectedPlatform: string, config?: Partial): T[]; /** * Implementation checklist item for AI models to track what needs to be implemented */ export interface ChecklistItem { element: string; required: boolean; status: 'must_implement' | 'recommended'; css_location: string; description: string; } /** * Required element with complete ready-to-use code */ export interface RequiredElement { description: string; html: string; css: string; js?: string; } /** * Design System Output Interface */ export interface DesignSystemResult { _meta: { query_interpretation: string; detected_intent: 'landing' | 'dashboard' | 'page' | 'unknown'; intent_confidence: number; matched_keyword: string | null; keyword_position: number; detected_platform: 'web' | 'mobile-ios' | 'mobile-android' | 'mobile-generic' | 'cross-platform'; platform_confidence: number; platform_keywords: string[]; detected_framework?: string; specified_platform?: string | null; resolved_platform?: string; platform_output?: { safe_area_insets: string | null; navigation_type: string; primary_navigation: string; touch_target_min: string | null; }; warnings: string[]; }; markdown_guide: string; implementation_checklist: ChecklistItem[]; required_elements: { back_to_top?: RequiredElement; navbar?: RequiredElement; footer?: RequiredElement; hero?: RequiredElement; cta_button?: RequiredElement; }; product: Record | null; style: { name: string; css_code: string; effects: string; motion_config?: string; animation_variants?: string; } | null; colors: { palette: { primary: string; secondary: string; cta: string; cta_text: string; background: string; text: string; }; dark_mode?: Record; tailwind_config: string; css_variables: string; glow_effects: string; } | null; typography: { heading: string; body: string; css_import: string; tailwind_config: string; } | null; layout: { pattern: string; section_order: string; layout_css: string; grid_config?: string; bento_map?: string; responsive_strategy?: string; source: 'landing' | 'dashboard'; } | null; navigation?: { scroll_behavior?: string; sticky_config?: string; back_to_top?: string; mobile_menu?: string; }; components?: { navbar?: string; footer?: string; section_dividers?: string; }; ux_tips?: string[]; hover_effects?: string; platform_guidelines?: { platform: 'ios' | 'android'; patterns: { category: string; pattern: string; description: string; do: string; flutter_equiv: string; rn_equiv: string; }[]; } | null; } /** * Valid platform values for explicit platform parameter */ export type PlatformParameter = 'web' | 'mobile-ios' | 'mobile-android' | 'mobile' | 'react-native' | 'flutter' | 'swiftui' | 'expo'; /** * Generate a complete design system by combining styles, colors, typography, and layout patterns. * This is a synthesis tool that searches multiple domains and composes results into a unified design system. * * @param query - Product type or design description (e.g., "fintech dark", "saas minimal") * @param style - Optional specific style preference (e.g., "glassmorphism", "minimalism") * @param mode - Optional color mode preference ("light" or "dark") * @param maxResults - Maximum items per domain (default: 1) * @param platform - Optional target platform to override auto-detection * @returns Unified design system object or error */ export declare function getDesignSystem(query: unknown, style?: unknown, mode?: unknown, maxResults?: unknown, platform?: unknown, outputFormat?: unknown, includeHoverEffects?: unknown): DesignSystemResult | SearchError;