/** * Sampling Handler - Utilities for MCP Sampling * * Sampling allows the server to request LLM completions from the client. * This is useful for autonomous analysis where the server needs * the LLM to reason about data. * * Note: The client (Cursor) must support sampling capability for this to work. * If not supported, functions will return null and callers should fall back * to direct analysis. */ export interface SamplingMessage { role: 'user' | 'assistant'; content: { type: 'text'; text: string; }; } export interface SamplingRequest { messages: SamplingMessage[]; systemPrompt?: string; maxTokens?: number; temperature?: number; includeContext?: string; } export interface SamplingResponse { content: { type: 'text'; text: string; }; model?: string; stopReason?: string; } /** * Check if the client supports sampling */ export declare function isSamplingSupported(): boolean; /** * Request an LLM completion from the client via MCP sampling * * @param request - The sampling request parameters * @returns The LLM response, or null if sampling is not supported */ export declare function requestSampling(request: SamplingRequest): Promise; /** * Request LLM analysis of security data * * This is a convenience wrapper for common security analysis patterns. * Falls back to returning null if sampling isn't supported. */ export declare function requestAnalysis(analysisType: 'coverage' | 'gaps' | 'comparison' | 'recommendation', data: Record, context?: string): Promise<{ analysis: string; reasoning: string; } | null>; /** * Check sampling availability and return status info */ export declare function getSamplingStatus(): { available: boolean; reason: string; recommendation: string; };