import { type GetPromptResult, type PromptMessage, type ServerContext } from "@modelcontextprotocol/server";
import { PromptArgsRawShape } from "../prompts";
/**
 * Type for content that users can return from prompt handlers
 */
export type PromptContent = GetPromptResult["messages"][number]["content"];
type UserPromptResult = PromptContent | string | number | GetPromptResult | PromptMessage[];
/**
 * Type for the original prompt handler that users write
 * The extra parameter is optional for backward compatibility
 * Supports single content values, message arrays, and full prompt results.
 */
export type UserPromptHandler = (args: PromptArgsRawShape, extra?: ServerContext) => UserPromptResult | Promise<UserPromptResult>;
/**
 * Type for the transformed handler that the MCP server expects
 */
export type McpPromptHandler = (args: PromptArgsRawShape, extra: ServerContext) => GetPromptResult | Promise<GetPromptResult>;
/**
 * Transforms a user's prompt handler into an MCP-compatible handler.
 *
 * This function:
 * 1. Passes through both args and extra parameters to the user's handler
 * 2. Transforms string/number/content responses into a single message GetPromptResult format
 * 3. Preserves explicit message roles and full result metadata
 * 4. Validates that the response is valid and throws a descriptive error if not
 *
 * @param handler - The user's prompt handler function
 * @param role - The role for single content values ("user" or "assistant")
 * @returns A transformed handler compatible with McpServer.registerPrompt
 * @throws Error if the handler returns an invalid response type
 */
export declare function transformPromptHandler(handler: UserPromptHandler, role?: "user" | "assistant"): McpPromptHandler;
export {};
