UNPKG

@dollhousemcp/mcp-server

Version:

DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.

111 lines 3.45 kB
/** * Search for content in the collection */ import { GitHubClient } from './GitHubClient.js'; import { CollectionCache } from '../cache/CollectionCache.js'; import { CollectionIndexCache } from '../cache/CollectionIndexCache.js'; import { SearchResults, SearchOptions } from '../types/collection.js'; export declare class CollectionSearch { private githubClient; private collectionCache; private indexCache; private searchBaseUrl; private invertedIndex; private lastIndexVersion; constructor(githubClient: GitHubClient, collectionCache: CollectionCache, indexCache: CollectionIndexCache); /** * Enhanced search using collection index with pagination and filtering * Falls back to API search and cache when index is unavailable */ searchCollectionWithOptions(query: string, options?: SearchOptions): Promise<SearchResults>; /** * Search collection for content matching query * Falls back to cached data when GitHub API is not available or not authenticated */ searchCollection(query: string): Promise<any[]>; /** * Search cached collection items */ private searchFromCache; /** * Search seed data for matching items with fuzzy matching */ private searchSeedData; /** * Fuzzy matching algorithm for partial string matches */ private fuzzyMatch; /** * Convert cache items to GitHub API format for consistent response structure */ private convertCacheItemsToGitHubFormat; /** * Update cache with fresh data from GitHub API items */ private updateCacheFromGitHubItems; /** * Format search results */ formatSearchResults(items: any[], query: string, personaIndicator?: string): string; /** * Search from collection index with full featured search and pagination */ private searchFromIndex; /** * Ensure inverted index is built and up-to-date */ private ensureInvertedIndex; /** * Search using inverted index (fast O(k) lookup) */ private searchWithInvertedIndex; /** * Fallback to linear search (legacy O(n) scan) */ private searchWithLinearScan; /** * Flatten index entries from all categories into a single array */ private flattenIndexEntries; /** * Perform search matching on index entries */ private performIndexSearch; /** * Sort search results by relevance, name, or date */ private sortSearchResults; /** * Sort search results with pre-calculated scores */ private sortSearchResultsWithScores; /** * Calculate relevance score for search results */ private calculateRelevanceScore; /** * Convert legacy search results to new SearchResults format */ private convertLegacyResults; /** * Extract element type from file path */ private extractTypeFromPath; /** * Extract category from file path */ private extractCategoryFromPath; /** * Create empty search results for error cases */ private createEmptySearchResults; /** * Enhanced format for search results with pagination info */ formatSearchResultsWithPagination(results: SearchResults, personaIndicator?: string): string; /** * Get cache statistics for debugging */ getCacheStats(): Promise<any>; } //# sourceMappingURL=CollectionSearch.d.ts.map