UNPKG

ai-debug-local-mcp

Version:

🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh

119 lines • 4.64 kB
/** * Enhanced Tool Metadata System * Inspired by Wordware's approach to richer MCP tool descriptions */ export interface ToolMetadata { /** Required context for this tool to function properly */ requiredContext: RequiredContext[]; /** Authority level needed to execute this tool */ authority: AuthorityLevel; /** Feedback mechanisms for error handling and retries */ feedback: FeedbackConfig; /** When this tool works best - contextual hints */ bestUsedWhen: string[]; /** Whether this tool has rich training data (affects AI selection probability) */ trainingDataRich: boolean; /** Computational cost level */ costLevel: 'low' | 'medium' | 'high'; /** Framework compatibility */ frameworkCompatibility: FrameworkCompatibility[]; /** Tool category for intelligent filtering */ category: ToolCategory; /** Prerequisites that must be met before using this tool */ prerequisites: Prerequisite[]; /** Expected outcomes and success indicators */ expectedOutcomes: ExpectedOutcome[]; } export interface RequiredContext { type: 'active_session' | 'framework_detected' | 'user_consent' | 'project_setup' | 'network_access'; description: string; critical: boolean; } export type AuthorityLevel = 'read_only' | 'user_interaction' | 'file_modification' | 'system_modification' | 'network_access'; export interface FeedbackConfig { /** How to handle errors - retry patterns */ errorHandling: 'immediate_fail' | 'retry_with_context' | 'escalate_to_human'; /** Maximum retry attempts */ maxRetries: number; /** Whether this tool can provide feedback about its own execution */ selfValidating: boolean; /** Signals that indicate successful execution */ successIndicators: string[]; } export interface FrameworkCompatibility { framework: 'react' | 'vue' | 'angular' | 'nextjs' | 'flutter' | 'phoenix' | 'rails' | 'general'; compatibility: 'high' | 'medium' | 'low'; notes?: string; } export type ToolCategory = 'core' | 'interaction' | 'monitoring' | 'analysis' | 'testing' | 'performance' | 'accessibility' | 'security' | 'framework' | 'background'; export interface Prerequisite { type: 'tool_execution' | 'state_condition' | 'user_action' | 'system_requirement'; description: string; checkFunction?: string; } export interface ExpectedOutcome { type: 'data_collection' | 'state_change' | 'user_feedback' | 'system_modification'; description: string; measurable: boolean; timeframe?: 'immediate' | 'short_term' | 'long_term'; } /** * Enhanced Tool Definition with Metadata */ export interface EnhancedTool { name: string; description: string; inputSchema: any; metadata: ToolMetadata; /** Background agent configuration if this tool supports continuous operation */ backgroundAgent?: BackgroundAgentConfig; } export interface BackgroundAgentConfig { /** Whether this tool can run as a background agent */ supportsBackground: boolean; /** Polling interval in milliseconds for background monitoring */ pollingInterval?: number; /** Conditions that trigger the background agent */ triggers: AgentTrigger[]; /** Maximum runtime for background operation */ maxRuntime?: number; /** Resource limits for background operation */ resourceLimits?: ResourceLimits; } export interface AgentTrigger { type: 'time_interval' | 'file_change' | 'performance_threshold' | 'error_occurrence' | 'user_activity'; config: any; description: string; } export interface ResourceLimits { maxMemoryMB: number; maxCpuPercent: number; maxNetworkRequests: number; } /** * Context-Aware Tool Selection * Limits tools based on current debugging context to improve performance */ export interface DebugContext { sessionId?: string; framework?: string; phase: 'initial' | 'deep_dive' | 'performance' | 'testing' | 'resolution'; userExperience: 'beginner' | 'intermediate' | 'expert'; projectComplexity: 'simple' | 'moderate' | 'complex'; timeConstraint: 'none' | 'moderate' | 'urgent'; } export interface ToolSelectionStrategy { /** Maximum number of tools to present (following Wordware's <15 rule) */ maxTools: number; /** Scoring weights for tool selection */ selectionWeights: { frameworkMatch: number; trainingDataRich: number; userHistoryMatch: number; costEfficiency: number; authorityLevel: number; }; /** Minimum score threshold for tool inclusion */ minimumScore: number; } //# sourceMappingURL=enhanced-tool-metadata.d.ts.map