UNPKG

jezweb-mcp-core

Version:

Jezweb Model Context Protocol (MCP) Core - A universal server for providing AI tools and resources, designed for seamless integration with various AI models and clients. Features adaptable multi-provider support, comprehensive tool and resource management

124 lines 3.16 kB
/** * Prompt Registry - Central registry for managing MCP prompts * * This module implements the PromptRegistry interface and provides * centralized management of all available prompts for the MCP server. */ import { Prompt, PromptTemplate, PromptMessage, PromptRegistry as IPromptRegistry } from '../types/index.js'; /** * Implementation of the PromptRegistry interface */ export declare class PromptRegistry implements IPromptRegistry { private templates; constructor(); /** * Register all default prompt templates */ private registerDefaultTemplates; /** * Get all available prompts */ getPrompts(): Prompt[]; /** * Get a specific prompt by name */ getPrompt(name: string): Prompt | null; /** * Generate messages for a prompt with arguments */ generatePromptMessages(name: string, args?: Record<string, string>): PromptMessage[]; /** * Register a new prompt template */ registerPrompt(template: PromptTemplate): void; /** * Check if a prompt exists */ hasPrompt(name: string): boolean; /** * Get prompt template (internal use) */ getTemplate(name: string): PromptTemplate | null; /** * Get all prompt names */ getPromptNames(): string[]; /** * Get prompts by category */ getPromptsByCategory(category: string): Prompt[]; /** * Get prompts by tag */ getPromptsByTag(tag: string): Prompt[]; /** * Search prompts by name or description */ searchPrompts(query: string): Prompt[]; /** * Validate arguments for a prompt template */ private validateArguments; /** * Get registry statistics */ getStats(): { totalPrompts: number; categories: (string | undefined)[]; tags: string[]; promptsByCategory: any; }; /** * Export all prompts for debugging */ exportPrompts(): PromptTemplate[]; /** * Clear all prompts (for testing) */ clear(): void; /** * Reset to default prompts */ reset(): void; } /** * Global prompt registry instance */ export declare const promptRegistry: PromptRegistry; /** * Convenience functions for common operations */ /** * Get all available prompts */ export declare function getAvailablePrompts(): Prompt[]; /** * Get a specific prompt */ export declare function getPrompt(name: string): Prompt | null; /** * Generate prompt messages */ export declare function generatePromptMessages(name: string, args?: Record<string, string>): PromptMessage[]; /** * Check if a prompt exists */ export declare function hasPrompt(name: string): boolean; /** * Search prompts */ export declare function searchPrompts(query: string): Prompt[]; /** * Get prompts by category */ export declare function getPromptsByCategory(category: string): Prompt[]; /** * Get registry statistics */ export declare function getPromptRegistryStats(): { totalPrompts: number; categories: (string | undefined)[]; tags: string[]; promptsByCategory: any; }; //# sourceMappingURL=prompt-registry.d.ts.map