/** * RAG Tools Module * * Retrieval-Augmented Generation tools for semantic search, * vector store management, and context building. * * @module @wundr/mcp-server/tools/rag */ import { z } from 'zod'; import { ragFileSearchHandler, ragStoreManageHandler, ragContextBuilderHandler } from './handlers'; import type { ToolRegistry, McpTool, ToolRegistrationOptions } from '../registry'; export type { EmbeddingModel, VectorStoreType, ScoringMethod, RagFileSearchInput, RagFileSearchOutput, FileSearchResult, StoreAction, RagStoreManageInput, RagStoreManageOutput, StoreInfo, RAGContextBuilderInput, RAGContextBuilderOutput, RAGSearchOptions, RAGSearchResult, RAGSearchResults, RAGChunk, ContextStrategy, ContextSource, RagContextBuilderInput, RagContextBuilderOutput, ContextChunk, RagToolResult, RagFileSearchHandler, RagStoreManageHandler, RagContextBuilderHandler, RagToolsConfig, } from './types'; export type { RagFileSearchInput as RagFileSearchSchemaInput, RagStoreManageInput as RagStoreManageSchemaInput, RagContextBuilderInput as RagContextBuilderSchemaInput, RagToolName, } from './schemas'; export { ragFileSearchHandler, ragStoreManageHandler, ragContextBuilderHandler, } from './handlers'; export { RagFileSearchSchema, RagStoreManageSchema, RagContextBuilderSchema, RagToolSchemaEntries, } from './schemas'; export { DEFAULT_CONFIG, RAG_STORE_DIR, RAG_CACHE_DIR, RAG_TOOL_NAMES, RAG_TOOL_DESCRIPTIONS, SUPPORTED_STORE_TYPES, SUPPORTED_EMBEDDING_MODELS, SUPPORTED_CONTEXT_STRATEGIES, DEFAULT_CODE_PATTERNS, DEFAULT_DOC_PATTERNS, DEFAULT_EXCLUDE_PATTERNS, MAX_FILE_SIZE, MAX_SNIPPET_LENGTH, MAX_DOCUMENTS_PER_STORE, MAX_CONTEXT_CHUNKS, } from './constants'; /** * Register all RAG tools with a tool registry * * @param registry - Tool registry to register with (defaults to global registry) * @param options - Registration options * * @example * ```typescript * // Register with global registry * registerRagTools(); * * // Register with custom registry * const myRegistry = createToolRegistry(); * registerRagTools(myRegistry); * ``` */ export declare function registerRagTools(registry?: ToolRegistry, options?: ToolRegistrationOptions): void; /** * Initialize RAG tools - alias for registerRagTools for consistency */ export declare const initializeRagTools: typeof registerRagTools; /** * Get all RAG tool definitions without registering */ export declare function getRagToolDefinitions(): McpTool[]; /** * Get RAG tool JSON schemas for MCP registration */ export declare function getRagToolJsonSchemas(): Record; description: string; category: string; }>; declare const _default: { registerRagTools: typeof registerRagTools; initializeRagTools: typeof registerRagTools; getRagToolDefinitions: typeof getRagToolDefinitions; getRagToolJsonSchemas: typeof getRagToolJsonSchemas; ragFileSearchHandler: typeof ragFileSearchHandler; ragStoreManageHandler: typeof ragStoreManageHandler; ragContextBuilderHandler: typeof ragContextBuilderHandler; RagFileSearchSchema: z.ZodObject<{ query: z.ZodString; paths: z.ZodOptional>; includePatterns: z.ZodOptional>; excludePatterns: z.ZodOptional>; maxResults: z.ZodDefault>; minScore: z.ZodDefault>; mode: z.ZodDefault>>; includeContent: z.ZodDefault>; maxContentLength: z.ZodDefault>; }, "strip", z.ZodTypeAny, { query: string; maxResults: number; minScore: number; mode: "semantic" | "keyword" | "hybrid"; includeContent: boolean; maxContentLength: number; paths?: string[] | undefined; includePatterns?: string[] | undefined; excludePatterns?: string[] | undefined; }, { query: string; paths?: string[] | undefined; includePatterns?: string[] | undefined; excludePatterns?: string[] | undefined; maxResults?: number | undefined; minScore?: number | undefined; mode?: "semantic" | "keyword" | "hybrid" | undefined; includeContent?: boolean | undefined; maxContentLength?: number | undefined; }>; RagStoreManageSchema: z.ZodObject<{ action: z.ZodEnum<["create", "delete", "list", "status", "index", "clear", "optimize", "backup", "restore"]>; storeName: z.ZodOptional; config: z.ZodOptional>; embeddingModel: z.ZodOptional>; dimensions: z.ZodOptional; metadata: z.ZodOptional>; }, "strip", z.ZodTypeAny, { type?: "memory" | "chromadb" | "pinecone" | "qdrant" | "weaviate" | undefined; metadata?: Record | undefined; embeddingModel?: "custom" | "openai" | "cohere" | "local" | undefined; dimensions?: number | undefined; }, { type?: "memory" | "chromadb" | "pinecone" | "qdrant" | "weaviate" | undefined; metadata?: Record | undefined; embeddingModel?: "custom" | "openai" | "cohere" | "local" | undefined; dimensions?: number | undefined; }>>; indexPaths: z.ZodOptional>; backupPath: z.ZodOptional; force: z.ZodOptional; }, "strip", z.ZodTypeAny, { action: "status" | "list" | "create" | "delete" | "index" | "clear" | "optimize" | "backup" | "restore"; storeName?: string | undefined; config?: { type?: "memory" | "chromadb" | "pinecone" | "qdrant" | "weaviate" | undefined; metadata?: Record | undefined; embeddingModel?: "custom" | "openai" | "cohere" | "local" | undefined; dimensions?: number | undefined; } | undefined; indexPaths?: string[] | undefined; backupPath?: string | undefined; force?: boolean | undefined; }, { action: "status" | "list" | "create" | "delete" | "index" | "clear" | "optimize" | "backup" | "restore"; storeName?: string | undefined; config?: { type?: "memory" | "chromadb" | "pinecone" | "qdrant" | "weaviate" | undefined; metadata?: Record | undefined; embeddingModel?: "custom" | "openai" | "cohere" | "local" | undefined; dimensions?: number | undefined; } | undefined; indexPaths?: string[] | undefined; backupPath?: string | undefined; force?: boolean | undefined; }>; RagContextBuilderSchema: z.ZodObject<{ query: z.ZodString; strategy: z.ZodDefault>>; sources: z.ZodDefault, "many">>>; maxTokens: z.ZodDefault>; storeName: z.ZodOptional; additionalPaths: z.ZodOptional>; includeCode: z.ZodDefault>; includeDocs: z.ZodDefault>; conversationHistory: z.ZodOptional; content: z.ZodString; }, "strip", z.ZodTypeAny, { content: string; role: "user" | "assistant"; }, { content: string; role: "user" | "assistant"; }>, "many">>; format: z.ZodDefault>>; }, "strip", z.ZodTypeAny, { query: string; strategy: "custom" | "relevant" | "recent" | "comprehensive" | "focused"; sources: ("memory" | "files" | "store" | "combined")[]; maxTokens: number; includeCode: boolean; includeDocs: boolean; format: "plain" | "markdown" | "structured"; storeName?: string | undefined; additionalPaths?: string[] | undefined; conversationHistory?: { content: string; role: "user" | "assistant"; }[] | undefined; }, { query: string; storeName?: string | undefined; strategy?: "custom" | "relevant" | "recent" | "comprehensive" | "focused" | undefined; sources?: ("memory" | "files" | "store" | "combined")[] | undefined; maxTokens?: number | undefined; additionalPaths?: string[] | undefined; includeCode?: boolean | undefined; includeDocs?: boolean | undefined; conversationHistory?: { content: string; role: "user" | "assistant"; }[] | undefined; format?: "plain" | "markdown" | "structured" | undefined; }>; DEFAULT_CONFIG: import("./types").RagToolsConfig; RAG_TOOL_NAMES: { readonly FILE_SEARCH: "rag-file-search"; readonly STORE_MANAGE: "rag-store-manage"; readonly CONTEXT_BUILDER: "rag-context-builder"; }; RAG_TOOL_DESCRIPTIONS: { readonly "rag-file-search": "Search files using semantic, keyword, or hybrid search with relevance scoring"; readonly "rag-store-manage": "Create, manage, and maintain vector stores for RAG operations"; readonly "rag-context-builder": "Build optimal context for LLM queries using multiple sources and strategies"; }; }; export default _default; //# sourceMappingURL=index.d.ts.map