optivise
Version:
Optivise - The Ultimate Optimizely Development Assistant with AI-powered features, zero-config setup, and comprehensive development support
132 lines • 3.65 kB
TypeScript
/**
* Debug Helper Tool (optidev_debug_helper)
* Provides intelligent debugging assistance for Optimizely-related issues
*/
import type { Logger, LLMRequest, PromptContext } from '../types/index.js';
import { z } from 'zod';
export declare const DebugHelperRequestSchema: z.ZodObject<{
bugDescription: z.ZodString;
errorMessages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
codeContext: z.ZodOptional<z.ZodString>;
userPrompt: z.ZodOptional<z.ZodString>;
promptContext: z.ZodOptional<z.ZodAny>;
projectPath: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
bugDescription: string;
projectPath?: string | undefined;
promptContext?: any;
userPrompt?: string | undefined;
errorMessages?: string[] | undefined;
codeContext?: string | undefined;
}, {
bugDescription: string;
projectPath?: string | undefined;
promptContext?: any;
userPrompt?: string | undefined;
errorMessages?: string[] | undefined;
codeContext?: string | undefined;
}>;
export interface DebugHelperRequest {
bugDescription: string;
errorMessages?: string[];
codeContext?: string;
userPrompt?: string;
promptContext?: PromptContext;
projectPath?: string;
}
export interface BugAnalysis {
category: string;
likelyCauses: string[];
confidence: number;
severity: 'low' | 'medium' | 'high' | 'critical';
affectedComponents: string[];
}
export interface DebuggingStep {
step: number;
action: string;
command?: string;
expectedResult: string;
troubleshooting?: string[];
}
export interface Solution {
title: string;
description: string;
codeExample?: string;
difficulty: 'easy' | 'medium' | 'hard';
estimatedTime: string;
}
export interface DebugHelperResponse {
detectedProducts: string[];
bugAnalysis: BugAnalysis;
debuggingSteps: DebuggingStep[];
solutions: Solution[];
preventionTips: string[];
relatedDocumentation: Array<{
title: string;
url: string;
relevance: number;
}>;
monitoringRecommendations: string[];
llm_request?: LLMRequest;
}
export declare class DebugHelperTool {
private productDetection;
private logger;
private ruleService;
private static readonly ERROR_PATTERNS;
constructor(logger: Logger);
initialize(): Promise<void>;
/**
* Analyze bug and provide debugging assistance
*/
analyzeBug(request: DebugHelperRequest): Promise<DebugHelperResponse>;
/**
* Detect relevant products from bug description
*/
private detectProducts;
/**
* Analyze bug pattern and categorize
*/
private analyzeBugPattern;
/**
* Determine bug severity
*/
private determineSeverity;
/**
* Identify likely causes based on category and context
*/
private identifyLikelyCauses;
/**
* Identify affected components
*/
private identifyAffectedComponents;
/**
* Generate debugging steps
*/
private generateDebuggingSteps;
/**
* Generate solutions based on bug analysis
*/
private generateSolutions;
/**
* Get category-specific solutions
*/
private getCategorySpecificSolutions;
/**
* Get generic solutions
*/
private getGenericSolutions;
/**
* Generate prevention tips
*/
private generatePreventionTips;
/**
* Find related documentation
*/
private findRelatedDocumentation;
/**
* Generate monitoring recommendations
*/
private generateMonitoringRecommendations;
}
//# sourceMappingURL=debug-helper-tool.d.ts.map