import { McpServer } from '@modelcontextprotocol/server'; import { ResourceCatalog } from '../res/resourceCatalog.js'; /** One `arguments` entry of a prompt's front matter. */ export interface PromptArgumentSpec { name: string; description: string; required: boolean; } /** A prompt as loaded from `res/prompt/.md`. */ export interface PromptDefinition { name: string; title: string; description: string; arguments: PromptArgumentSpec[]; /** The markdown after the front matter: the message text sent to clients. */ body: string; } /** * Parse one prompt file. The front matter has exactly the shape the bundled * prompts use: `key: value` scalars plus one `arguments:` list of maps * (`- name: …` then indented `description:` / `required:`). Anything else is * rejected rather than silently ignored. CRLF is read as LF: the repository has * no `.gitattributes`, so a Windows checkout may convert the files. */ export declare function parsePromptFile(name: string, raw: string): PromptDefinition; /** * Complete the last entry of a comma-separated `metadata_list`, keeping the * entries already typed: "table,bus" → "table,business-rule". */ export declare function completeMetadataList(value: string): string[]; /** * Serves the `res/prompt/*.md` prompts through the SDK's `registerPrompt`. The * SDK owns `prompts/list`, `prompts/get` (including the -32602 answer for an * unknown prompt or invalid arguments) and `completion/complete`; this class * loads the files once and renders the message text. */ export declare class PromptManager { private readonly resourceCatalog; private prompts; /** * Prompt content is loaded once by `initialize()` and shared; prompts are * registered per MCP server instance by `registerOn()`, because the stdio * entry may build more than one instance per connection (see ToolsManager). */ constructor(resourceCatalog?: ResourceCatalog); /** Load every `res/prompt/*.md` file, in name order. */ initialize(): Promise; /** Register every loaded prompt on one server instance. */ registerOn(mcpServer: McpServer): void; private result; /** * Render a prompt for the requested metadata types. For each requested type * it injects a real authoring summary drawn from the shipped instruction * resource plus explicit pointers to the knowledge tool * (`get_fluent_knowledge`) and URIs (`sn-spec://` etc.), * then appends the complete, enum-derived catalog of supported types. * @param metadataList The comma-separated `metadata_list` argument (MCP prompt * arguments are strings on the wire, e.g. "table,business-rule"). An absent * or empty value renders the body unchanged. */ private render; /** * Render one metadata type's guidance block: a concise summary from its * instruction resource (when available) followed by explicit tool/URI pointers. * Unknown types get an actionable correction instead of a stub. */ private renderTypeSection; /** * Extract a concise summary from an instruction resource: the first couple of * substantive guidance lines, skipping the heading and the boilerplate * "Always reference ..." lead-in. Bounded so a multi-type prompt stays compact. */ private static summarizeInstruct; } //# sourceMappingURL=promptManager.d.ts.map