UNPKG

mcp-adr-analysis-server

Version:

MCP server for analyzing Architectural Decision Records and project architecture

88 lines 3.2 kB
/** * Prompt Execution Utilities * * This module provides utilities for executing prompts with AI when enabled, * or falling back to returning prompts for external execution. */ import { AIExecutionResult } from './ai-executor.js'; export interface PromptExecutionOptions { /** Whether to force prompt-only mode regardless of configuration */ forcePromptOnly?: boolean; /** Model to use for AI execution */ model?: string; /** Temperature for AI responses */ temperature?: number; /** Maximum tokens for AI responses */ maxTokens?: number; /** System prompt to use */ systemPrompt?: string; /** Expected response format */ responseFormat?: 'text' | 'json'; /** Schema for JSON validation (if responseFormat is 'json') */ schema?: any; } export interface PromptExecutionResult { /** The result content (either AI response or formatted prompt) */ content: string; /** Whether the result was generated by AI or is a prompt */ isAIGenerated: boolean; /** AI execution metadata (if AI was used) */ aiMetadata?: AIExecutionResult['metadata']; /** Token usage (if AI was used) */ usage?: AIExecutionResult['usage']; /** Model used (if AI was used) */ model?: string; } /** * Execute a prompt with AI if enabled, otherwise return formatted prompt */ export declare function executePromptWithFallback(prompt: string, instructions: string, options?: PromptExecutionOptions): Promise<PromptExecutionResult>; /** * Execute a prompt that expects structured ADR suggestions */ export declare function executeADRSuggestionPrompt(prompt: string, instructions: string, options?: PromptExecutionOptions): Promise<PromptExecutionResult>; /** * Execute a prompt that expects to generate actual ADRs */ export declare function executeADRGenerationPrompt(prompt: string, instructions: string, options?: PromptExecutionOptions): Promise<PromptExecutionResult>; /** * Execute a prompt for project ecosystem analysis */ export declare function executeEcosystemAnalysisPrompt(prompt: string, instructions: string, options?: PromptExecutionOptions): Promise<PromptExecutionResult>; /** * Execute a prompt for research question generation */ export declare function executeResearchPrompt(prompt: string, instructions: string, options?: PromptExecutionOptions): Promise<PromptExecutionResult>; /** * Check if AI execution is currently available */ export declare function isAIExecutionAvailable(): boolean; /** * Get AI execution status for debugging */ export declare function getAIExecutionStatus(): { isEnabled: boolean; hasApiKey: boolean; executionMode: string; model: string; reason: string | undefined; }; /** * Get AI execution status and configuration info (legacy) */ export declare function getAIExecutionInfo(): { available: boolean; mode: 'full' | 'prompt-only'; model?: string; cacheEnabled?: boolean; }; /** * Format execution result for MCP tool response */ export declare function formatMCPResponse(result: PromptExecutionResult): { content: Array<{ type: 'text'; text: string; }>; }; //# sourceMappingURL=prompt-execution.d.ts.map