import { ServerOptions } from '@modelcontextprotocol/sdk/server/index.js';
export { ServerOptions as McpServerOptions } from '@modelcontextprotocol/sdk/server/index.js';
import http from 'node:http';
import * as fs from 'fs';
import { OpenAIProvider } from '@ai-sdk/openai';
import { z } from 'zod';
export { Implementation as McpImplementation } from '@modelcontextprotocol/sdk/types.js';

type PlatformType$1 = 'github' | 'gitlab' | 'jira' | 'azure-devops' | 'bitbucket';
type IssueState = 'open' | 'closed' | 'in_progress' | 'resolved' | 'todo' | 'done';
interface PlatformUser {
    id: string | number;
    login: string;
    displayName?: string;
    email?: string;
    avatarUrl?: string;
}
interface PlatformLabel {
    id: string | number;
    name: string;
    color?: string;
    description?: string | null;
}
interface PlatformIssue$1 {
    id: string | number;
    number: string | number;
    title: string;
    body: string | null;
    state: IssueState;
    author: PlatformUser | null;
    assignees: PlatformUser[];
    labels: PlatformLabel[];
    created_at: string;
    updated_at: string;
    closed_at?: string | null;
    url: string;
    platform: PlatformType$1;
    platformSpecific?: Record<string, any>;
}
interface PlatformRepository {
    id: string | number;
    name: string;
    fullName: string;
    description?: string | null;
    language?: string | null;
    defaultBranch?: string;
    url: string;
    platform: PlatformType$1;
}
interface PlatformComment {
    id: string | number;
    body: string;
    author: PlatformUser | null;
    created_at: string;
    updated_at: string;
    url: string;
}
interface IssueQueryOptions {
    state?: IssueState | 'all';
    labels?: string[];
    assignee?: string;
    author?: string;
    since?: string;
    until?: string;
    perPage?: number;
    page?: number;
    sortBy?: 'created' | 'updated' | 'priority';
    sortOrder?: 'asc' | 'desc';
}
interface PlatformConfig$1 {
    type: PlatformType$1;
    baseUrl?: string;
    token: string;
    additionalConfig?: Record<string, any>;
}
interface IPlatformService {
    readonly platformType: PlatformType$1;
    readonly config: PlatformConfig$1;
    getRepository(owner: string, repo: string): Promise<PlatformRepository>;
    getIssues(owner: string, repo: string, options?: IssueQueryOptions): Promise<PlatformIssue$1[]>;
    getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    getIssueComments(owner: string, repo: string, issueId: string | number): Promise<PlatformComment[]>;
    addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<PlatformComment>;
    isConfigured(): boolean;
    validateConnection(): Promise<boolean>;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
}

interface GitHubConfig {
    token: string;
    owner: string;
    repo: string;
}
interface GitHubIssue {
    id: number;
    number: number;
    title: string;
    body: string | null;
    state: 'open' | 'closed';
    user: {
        login: string;
        id: number;
    } | null;
    labels: Array<{
        id: number;
        name: string;
        color: string;
        description: string | null;
    }>;
    assignees: Array<{
        login: string;
        id: number;
    }>;
    milestone?: {
        number: number;
        title: string;
    };
    created_at: string;
    updated_at: string;
    closed_at: string | null;
    html_url: string;
}
interface CodeContext {
    files: Array<{
        path: string;
        content: string;
        relevanceScore: number;
    }>;
    symbols: Array<{
        name: string;
        type: string;
        location: {
            file: string;
            line: number;
            column: number;
        };
        description?: string;
    }>;
    apis: Array<{
        path: string;
        method: string;
        description?: string;
    }>;
}
interface IssueAnalysisResult {
    issue: GitHubIssue | PlatformIssue;
    relatedCode: CodeContext;
    suggestions: Array<{
        type: 'file' | 'function' | 'api' | 'symbol';
        description: string;
        location?: string;
        confidence: number;
    }>;
    summary: string;
}
type Preset = "GitHub" | "GitLab" | "Jira" | "AzureDevOps" | "Bitbucket" | "Multi";
interface GitHubAgentImplementation {
    name: string;
    version: string;
    githubToken?: string;
    workspacePath?: string;
    platformType?: PlatformType;
    platformConfig?: PlatformConfig;
}

type HttpServeOptions = {
    port: number;
    hostname?: string;
};
declare class GitHubAgentServer {
    private impl;
    private mcpInst;
    private mcpStdioTransport?;
    private mcpHttpTransportSessions?;
    private managedHttpServer?;
    private expressApp?;
    private isDestroyed;
    private preset;
    constructor(impl: GitHubAgentImplementation, options?: ServerOptions);
    private ensureExpressApp;
    private ensureMcpHttpTransportSessions;
    private ensureMcpStdioTransport;
    private ensureDestroyed;
    private ensurePreset;
    loadPreset(preset: Preset): void;
    serveHttp(options: HttpServeOptions): Promise<http.Server>;
    serveStdio(): Promise<void>;
    destroy(): Promise<void>;
}

declare class GitHubService {
    private octokit;
    constructor(token: string);
    getIssues(owner: string, repo: string, options?: {
        state?: 'open' | 'closed' | 'all';
        labels?: string;
        assignee?: string;
        since?: string;
        per_page?: number;
        page?: number;
    }): Promise<GitHubIssue[]>;
    getIssue(owner: string, repo: string, issueNumber: number): Promise<GitHubIssue>;
    getRepositoryInfo(owner: string, repo: string): Promise<{
        id: number;
        name: string;
        full_name: string;
        description: string;
        language: string;
        default_branch: string;
        html_url: string;
    }>;
    addIssueComment(owner: string, repo: string, issueNumber: number, body: string): Promise<{
        id: number;
        html_url: string;
        created_at: string;
        updated_at: string;
    }>;
    createIssue(owner: string, repo: string, issueData: {
        title: string;
        body?: string;
        labels?: string[];
        assignees?: string[];
        milestone?: number;
    }): Promise<GitHubIssue>;
    getIssueComments(owner: string, repo: string, issueNumber: number): Promise<Array<{
        id: number;
        body: string;
        user: {
            login: string;
            id: number;
        } | null;
        created_at: string;
        updated_at: string;
        html_url: string;
    }>>;
}

declare abstract class BasePlatformService implements IPlatformService {
    readonly platformType: PlatformType$1;
    readonly config: PlatformConfig$1;
    constructor(config: PlatformConfig$1);
    abstract getRepository(owner: string, repo: string): Promise<any>;
    abstract getIssues(owner: string, repo: string, options?: any): Promise<PlatformIssue$1[]>;
    abstract getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    abstract getIssueComments(owner: string, repo: string, issueId: string | number): Promise<any[]>;
    abstract addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<any>;
    abstract parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    abstract buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
    isConfigured(): boolean;
    validateConnection(): Promise<boolean>;
    protected mapToGenericState(platformState: string): IssueState;
    protected mapFromGenericState(genericState: IssueState): string;
    protected handleError(error: any, operation: string): never;
    protected isValidUrl(url: string): boolean;
}

declare class PlatformServiceFactory {
    private static instances;
    static create(config: PlatformConfig$1): Promise<IPlatformService>;
    static createFromEnv(platformType?: PlatformType$1): Promise<IPlatformService>;
    private static detectPlatformFromEnv;
    private static buildConfigFromEnv;
    static getSupportedPlatforms(): PlatformType$1[];
    static clearCache(): void;
    static isSupported(platformType: string): platformType is PlatformType$1;
}

declare class GitHubPlatformService extends BasePlatformService {
    private octokit;
    constructor(config: PlatformConfig$1);
    getRepository(owner: string, repo: string): Promise<PlatformRepository>;
    getIssues(owner: string, repo: string, options?: IssueQueryOptions): Promise<PlatformIssue$1[]>;
    getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    getIssueComments(owner: string, repo: string, issueId: string | number): Promise<PlatformComment[]>;
    addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<PlatformComment>;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
    validateConnection(): Promise<boolean>;
    private mapToGenericIssue;
}

declare class GitLabPlatformService extends BasePlatformService {
    private baseUrl;
    private headers;
    constructor(config: PlatformConfig$1);
    getRepository(owner: string, repo: string): Promise<PlatformRepository>;
    getIssues(owner: string, repo: string, options?: IssueQueryOptions): Promise<PlatformIssue$1[]>;
    getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    getIssueComments(owner: string, repo: string, issueId: string | number): Promise<PlatformComment[]>;
    addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<PlatformComment>;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
    validateConnection(): Promise<boolean>;
    private mapToGenericIssue;
}

declare class JiraPlatformService extends BasePlatformService {
    private baseUrl;
    private headers;
    constructor(config: PlatformConfig$1);
    getRepository(owner: string, repo: string): Promise<PlatformRepository>;
    getIssues(owner: string, repo: string, options?: IssueQueryOptions): Promise<PlatformIssue$1[]>;
    getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    getIssueComments(owner: string, repo: string, issueId: string | number): Promise<PlatformComment[]>;
    addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<PlatformComment>;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
    validateConnection(): Promise<boolean>;
    private mapToGenericIssue;
}

declare class AzureDevOpsPlatformService extends BasePlatformService {
    constructor(config: PlatformConfig$1);
    getRepository(owner: string, repo: string): Promise<PlatformRepository>;
    getIssues(owner: string, repo: string, options?: IssueQueryOptions): Promise<PlatformIssue$1[]>;
    getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    getIssueComments(owner: string, repo: string, issueId: string | number): Promise<PlatformComment[]>;
    addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<PlatformComment>;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
}

declare class BitbucketPlatformService extends BasePlatformService {
    constructor(config: PlatformConfig$1);
    getRepository(owner: string, repo: string): Promise<PlatformRepository>;
    getIssues(owner: string, repo: string, options?: IssueQueryOptions): Promise<PlatformIssue$1[]>;
    getIssue(owner: string, repo: string, issueId: string | number): Promise<PlatformIssue$1>;
    getIssueComments(owner: string, repo: string, issueId: string | number): Promise<PlatformComment[]>;
    addIssueComment(owner: string, repo: string, issueId: string | number, body: string): Promise<PlatformComment>;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
}

declare function createPlatformService(platformType?: string): Promise<IPlatformService>;
declare function getSupportedPlatforms(): readonly ["github", "gitlab", "jira", "azure-devops", "bitbucket"];

declare class PlatformAdapter {
    private platformService;
    constructor(platformService: IPlatformService);
    static createFromEnv(platformType?: string): Promise<PlatformAdapter>;
    getPlatformService(): IPlatformService;
    getRepositoryInfo(owner: string, repo: string): Promise<{
        id: string | number;
        name: string;
        full_name: string;
        description: string;
        language: string;
        default_branch: string;
        html_url: string;
    }>;
    getIssues(owner: string, repo: string, options?: {
        state?: 'open' | 'closed' | 'all';
        labels?: string;
        assignee?: string;
        since?: string;
        per_page?: number;
        page?: number;
    }): Promise<GitHubIssue[]>;
    getIssue(owner: string, repo: string, issueNumber: number): Promise<GitHubIssue>;
    addIssueComment(owner: string, repo: string, issueNumber: number, body: string): Promise<{
        id: number;
        html_url: string;
        created_at: string;
        updated_at: string;
    }>;
    getIssueComments(owner: string, repo: string, issueNumber: number): Promise<Array<{
        id: number;
        body: string;
        user: {
            login: string;
            id: number;
        } | null;
        created_at: string;
        updated_at: string;
        html_url: string;
    }>>;
    private convertToGitHubIssue;
    private mapToGitHubState;
    parseIssueUrl(url: string): {
        owner: string;
        repo: string;
        issueId: string | number;
        platform: string;
    } | null;
    buildIssueUrl(owner: string, repo: string, issueId: string | number): string;
    isConfigured(): boolean;
    validateConnection(): Promise<boolean>;
    getPlatformType(): string;
}

interface SearchKeywords {
    primary: string[];
    secondary: string[];
    technical: string[];
    contextual: string[];
}

interface FilePriority {
    pattern: string;
    score: number;
    reason: string;
}
interface LLMKeywordAnalysis {
    primary_keywords: string[];
    technical_terms: string[];
    error_patterns: string[];
    component_names: string[];
    file_patterns: string[];
    search_strategies: string[];
    file_priorities?: FilePriority[];
    issue_type: string;
    confidence: number;
}
interface CodeRelevanceAnalysis {
    is_relevant: boolean;
    relevance_score: number;
    reason: string;
    specific_areas: string[];
    confidence: number;
}
interface LLMAnalysisReport {
    summary: string;
    current_issues: string[];
    detailed_plan: {
        title: string;
        steps: Array<{
            step_number: number;
            title: string;
            description: string;
            files_to_modify: string[];
            changes_needed: string[];
        }>;
    };
    recommendations: Array<{
        type: 'file' | 'function' | 'api' | 'symbol';
        description: string;
        location?: string;
        confidence: number;
    }>;
    confidence: number;
}

declare class LLMService {
    private llmConfig;
    private logFile;
    private fallbackService;
    constructor();
    isAvailable(): boolean;
    getProviderName(): string;
    private log;
    analyzeIssueForKeywords(issue: GitHubIssue & {
        urlContent?: any[];
    }): Promise<LLMKeywordAnalysis>;
    private buildKeywordExtractionPrompt;
    private parseKeywordAnalysis;
    generateAnalysisReport(issue: GitHubIssue, analysisResult: IssueAnalysisResult): Promise<LLMAnalysisReport>;
    private buildStructuredAnalysisPlanPrompt;
    private buildAnalysisReportPrompt;
    private parseStructuredAnalysisPlan;
    private fallbackStructuredAnalysisPlan;
    private parseAnalysisReport;
    analyzeCodeRelevance(issue: GitHubIssue & {
        urlContent?: any[];
    }, filePath: string, fileContent: string): Promise<CodeRelevanceAnalysis>;
    private buildCodeRelevancePrompt;
    private parseCodeRelevanceAnalysis;
}

type AnalyzerType = 'llm' | 'rule-based' | 'hybrid' | 'auto';
type CacheType = 'memory' | 'file' | 'redis';
type SearchType = 'ripgrep' | 'filesystem' | 'hybrid';
interface AnalyzerConfig {
    type: AnalyzerType;
    workspacePath: string;
    cacheType?: CacheType;
    searchType?: SearchType;
    llmService?: LLMService;
    options?: {
        batchSize?: number;
        maxFilesToAnalyze?: number;
        cacheConfig?: any;
        searchOptions?: any;
    };
}

declare class ContextAnalyzer {
    private workspacePath;
    private analysisStrategy;
    private cacheManager;
    private cacheKeyGenerator;
    private initialized;
    constructor(workspacePath?: string, config?: Partial<AnalyzerConfig>);
    private initializeComponents;
    private initializeFallbackComponents;
    private ensureInitialized;
    findRelevantCode(issue: GitHubIssue & {
        urlContent?: any[];
    }): Promise<CodeContext>;
    analyzeIssue(issue: GitHubIssue & {
        urlContent?: any[];
    }): Promise<IssueAnalysisResult>;
    private generateSuggestions;
    private generateSummary;
    static create(workspacePath: string, config?: {
        strategy?: 'llm' | 'rule-based' | 'hybrid' | 'auto';
        cacheType?: 'memory' | 'file' | 'redis';
        searchType?: 'ripgrep' | 'filesystem' | 'hybrid';
        llmService?: LLMService;
    }): Promise<ContextAnalyzer>;
    getAnalysisInfo(): {
        strategy: string;
        cacheStats?: any;
    };
    clearCache(): Promise<void>;
    private scanWorkspaceFiles;
    private isRelevantFile;
    generateSmartKeywords(issue: GitHubIssue): Promise<SearchKeywords>;
}

interface FileLoadOptions {
    maxSize?: number;
    encoding?: BufferEncoding;
    useCache?: boolean;
}
declare class FileLoader {
    private static instance;
    private cache;
    private readonly DEFAULT_MAX_SIZE;
    static getInstance(): FileLoader;
    loadFile(filePath: string, options?: FileLoadOptions): Promise<string | null>;
    loadFiles(filePaths: string[], options?: FileLoadOptions): Promise<Array<{
        path: string;
        content: string | null;
        error?: string;
    }>>;
    exists(filePath: string): Promise<boolean>;
    getStats(filePath: string): Promise<fs.Stats | null>;
    clearCache(filePath?: string): void;
    getCacheStats(): {
        size: number;
        totalSize: number;
    };
}

interface LLMProviderConfig {
    fullModel: string;
    openai: OpenAIProvider;
    quickModel: string;
    providerName: string;
}
declare function configureLLMProvider(): LLMProviderConfig | null;
declare function hasLLMProvider(): boolean;
declare function getLLMProviderStatus(): Record<string, boolean>;

interface AnalysisReportOptions {
    uploadToGitHub?: boolean;
    language?: 'en' | 'zh';
    includeFileContent?: boolean;
    maxFiles?: number;
}
interface UploadResult {
    success: boolean;
    commentId?: number;
    commentUrl?: string;
    error?: string;
}
declare class AnalysisReportGenerator {
    private llmService;
    private githubService;
    constructor(githubToken: string);
    generateAndUploadReport(owner: string, repo: string, issueNumber: number, analysisResult: IssueAnalysisResult, options?: AnalysisReportOptions): Promise<{
        report: string;
        uploadResult?: UploadResult;
    }>;
    private formatReportAsMarkdown;
    generateChineseReport(analysisResult: IssueAnalysisResult, _options?: {
        uploadToGitHub?: boolean;
    }): Promise<string>;
}

interface StructuredAnalysisPlan {
    title: string;
    current_issues: Array<{
        issue: string;
        description: string;
        severity: 'high' | 'medium' | 'low';
    }>;
    detailed_plan: Array<{
        step_number: number;
        title: string;
        file_to_modify: string;
        changes_needed: string[];
        description: string;
    }>;
    language: 'zh' | 'en';
}
declare class AnalysisFormatter {
    static formatStructuredAnalysisPlan(issue: GitHubIssue, analysisResult: IssueAnalysisResult, structuredPlan: StructuredAnalysisPlan): string;
    private static formatChineseAnalysisPlan;
    private static formatEnglishAnalysisPlan;
    static formatLegacyAnalysisAsMarkdown(issue: GitHubIssue, analysisResult: IssueAnalysisResult, keywords: any): string;
}

interface FunctionCall {
    name: string;
    parameters: Record<string, any>;
}
interface ParsedResponse {
    text: string;
    functionCalls: FunctionCall[];
    hasError: boolean;
    error?: string;
}
declare class FunctionParser {
    static parseResponse(response: string): ParsedResponse;
    private static parseFunctionCallsBlock;
    private static parseParameters;
    static validateFunctionCall(functionCall: FunctionCall, availableTools: string[]): {
        isValid: boolean;
        error?: string;
    };
    static formatFunctionCall(functionCall: FunctionCall): string;
    static extractTextOnly(response: string): string;
    static hasFunctionCalls(response: string): boolean;
    private static parseJSONFormat;
    private static isValidFunctionName;
    private static looksLikeJSON;
}

interface AgentConfig {
    workspacePath?: string;
    githubToken?: string;
    llmConfig?: LLMProviderConfig;
    verbose?: boolean;
    maxToolRounds?: number;
    enableToolChaining?: boolean;
    toolTimeout?: number;
}
interface ToolResult$1 {
    success: boolean;
    result?: any;
    error?: string;
    functionCall: FunctionCall;
    executionTime?: number;
    round?: number;
}
interface AgentResponse {
    text: string;
    toolResults: ToolResult$1[];
    success: boolean;
    error?: string;
    totalRounds?: number;
    executionTime?: number;
}
declare class AIAgent {
    private llmConfig;
    private conversationHistory;
    private config;
    private toolHandlers;
    private executionStats;
    constructor(config?: AgentConfig);
    private registerToolHandlers;
    processInput(userInput: string, context?: any): Promise<AgentResponse>;
    private processInputWithToolChaining;
    private processInputSingleRound;
    private executeToolsWithContext;
    private enhanceToolParameters;
    private executeWithTimeout;
    private enhanceErrorMessage;
    private shouldContinueToolChain;
    private buildMessagesForRound;
    private buildUserPromptForRound;
    private summarizePreviousResults;
    private generateFinalResponse;
    private generateComprehensiveFinalResponse;
    private groupResultsByRound;
    private buildExecutionSummary;
    private buildToolResultsSummary;
    private buildFallbackResponse;
    private buildMessages;
    private buildSystemPrompt;
    private buildEnhancedSystemPrompt;
    private buildContinuationSystemPrompt;
    private callLLM;
    private updateConversationHistory;
    private updateExecutionStats;
    clearHistory(): void;
    getAvailableTools(): string[];
    getLLMInfo(): {
        provider: string;
        model: string;
    };
    getExecutionStats(): typeof this.executionStats;
    getConfig(): AgentConfig;
    updateConfig(newConfig: Partial<AgentConfig>): void;
    static formatResponse(response: AgentResponse): string;
    private log;
}

type ToolLike = (installer: (name: string, description: string, inputSchema: Record<string, z.ZodType>, handler: (args: any) => Promise<{
    content: Array<{
        type: "text" | "image" | "resource";
        text?: string;
        data?: string;
        mimeType?: string;
    }>;
}>) => void) => void;

interface ToolDefinition {
    name: string;
    description: string;
    parameters: {
        type: "object";
        properties: Record<string, any>;
        required: string[];
    };
}
declare class PromptBuilder {
    private tools;
    registerTools(tools: ToolDefinition[]): void;
    buildSystemPrompt(): string;
    buildUserPrompt(userInput: string, context?: any): string;
    static extractToolDefinitions(toolInstallers: readonly ToolLike[]): ToolDefinition[];
    private static zodToJsonSchema;
}

interface ToolResult {
    success: boolean;
    result?: any;
    error?: string;
    functionCall: FunctionCall;
}
interface ExecutionContext {
    workspacePath?: string;
    githubToken?: string;
    llmConfig?: any;
    [key: string]: any;
}
declare class ToolExecutor {
    private registeredTools;
    private context;
    constructor(context?: ExecutionContext);
    registerTools(toolInstallers: readonly ToolLike[]): void;
    executeFunction(functionCall: FunctionCall): Promise<ToolResult>;
    executeFunctions(functionCalls: FunctionCall[]): Promise<ToolResult[]>;
    executeFunctionsParallel(functionCalls: FunctionCall[]): Promise<ToolResult[]>;
    getAvailableTools(): string[];
    hasTools(toolName: string): boolean;
    updateContext(newContext: Partial<ExecutionContext>): void;
    static formatResults(results: ToolResult[]): string;
    static extractSuccessfulResults(results: ToolResult[]): any[];
    static hasFailures(results: ToolResult[]): boolean;
    static getFailureSummary(results: ToolResult[]): string;
}

declare const installExtractWebpageAsMarkdownTool: ToolLike;
declare function extractUrlsFromText(text: string): string[];
declare function fetchHtmlContent(url: string, timeout: number): Promise<string>;
declare function extractTitle(html: string): string;
declare function urlToMarkdown(html: string): Promise<string>;
declare function fetchUrlsFromIssue(issueContent: string, timeout?: number): Promise<Array<{
    url: string;
    title?: string;
    content?: string;
    content_length?: number;
    status: 'success' | 'error';
    error?: string;
}>>;

declare const installGitHubListRepositoryIssuesTool: ToolLike;

declare const installGitHubGetIssueWithAnalysisTool: ToolLike;

declare const installGitHubCreateNewIssueTool: ToolLike;

declare const installGitHubAddIssueCommentTool: ToolLike;

declare const installGitHubFindCodeByDescriptionTool: ToolLike;

declare const installGitHubAnalyzeIssueAndPostResultsTool: ToolLike;

declare const GitHubIssueTools: readonly [ToolLike, ToolLike, ToolLike, ToolLike];
declare const GitHubAnalysisTools: readonly [ToolLike, ToolLike];
declare const WebContentTools: readonly [ToolLike];
declare const GitHubTools: readonly [ToolLike, ToolLike, ToolLike, ToolLike, ToolLike, ToolLike, ToolLike];

interface PerformanceMetrics {
    name: string;
    startTime: number;
    endTime?: number;
    duration?: number;
    memoryUsage?: NodeJS.MemoryUsage;
    metadata?: Record<string, any>;
}
declare class PerformanceMonitor {
    private static instance;
    private metrics;
    private activeTimers;
    static getInstance(): PerformanceMonitor;
    start(name: string, metadata?: Record<string, any>): void;
    end(name: string): PerformanceMetrics | null;
    time<T>(name: string, fn: () => Promise<T>, metadata?: Record<string, any>): Promise<T>;
    timeSync<T>(name: string, fn: () => T, metadata?: Record<string, any>): T;
    getMetrics(): PerformanceMetrics[];
    getSummary(): {
        totalOperations: number;
        completedOperations: number;
        activeOperations: number;
        averageDuration: number;
        slowestOperation: PerformanceMetrics | null;
    };
    clear(): void;
    logSummary(): void;
    exportMetrics(): string;
}
declare const performanceMonitor: PerformanceMonitor;
declare function timed(name?: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
declare class MemoryTracker {
    private static snapshots;
    static snapshot(label?: string): void;
    static getSnapshots(): {
        timestamp: number;
        usage: NodeJS.MemoryUsage;
        label?: string;
    }[];
    static logMemoryUsage(label?: string): void;
    static clear(): void;
}

interface UIOptions {
    verbose?: boolean;
    logFile?: string;
    showProgress?: boolean;
    colorOutput?: boolean;
}
declare class EnhancedUI {
    private verbose;
    private logFile;
    private showProgress;
    private colorOutput;
    private startTime;
    private steps;
    private currentStep;
    constructor(options?: UIOptions);
    private writeToFile;
    private formatTime;
    private getIcon;
    header(title: string, subtitle?: string): void;
    section(title: string): void;
    step(stepName: string, details?: any): void;
    stepComplete(duration?: number): void;
    stepFailed(error: string): void;
    info(message: string, data?: any): void;
    success(message: string, data?: any): void;
    warn(message: string, data?: any): void;
    error(message: string, data?: any): void;
    debug(message: string, data?: any): void;
    analysisResults(results: {
        relatedCode: {
            files: any[];
            symbols: any[];
            apis?: any[];
        };
        suggestions: any[];
        urlContent?: any[];
    }): void;
    urlProcessing(urls: string[], results: any[]): void;
    llmOperation(provider: string, model: string, operation: string, inputLength?: number, outputLength?: number): void;
    complete(message: string): void;
    displayReport(report: string, issueNumber: number): void;
    uploadSuccess(commentId: number, commentUrl: string): void;
    helpTip(errorType: 'github' | 'workspace' | 'llm' | 'general', message?: string): void;
}

export { AIAgent, AnalysisFormatter, AnalysisReportGenerator, AzureDevOpsPlatformService, BasePlatformService, BitbucketPlatformService, ContextAnalyzer, EnhancedUI, FileLoader, FunctionParser, GitHubAgentServer, GitHubAnalysisTools, GitHubIssueTools, GitHubPlatformService, GitHubService, GitHubTools, GitLabPlatformService, JiraPlatformService, LLMService, MemoryTracker, PerformanceMonitor, PlatformAdapter, PlatformServiceFactory, PromptBuilder, ToolExecutor, WebContentTools, configureLLMProvider, createPlatformService, extractTitle, extractUrlsFromText, fetchHtmlContent, fetchUrlsFromIssue, getLLMProviderStatus, getSupportedPlatforms, hasLLMProvider, installExtractWebpageAsMarkdownTool, installGitHubAddIssueCommentTool, installGitHubAnalyzeIssueAndPostResultsTool, installGitHubCreateNewIssueTool, installGitHubFindCodeByDescriptionTool, installGitHubGetIssueWithAnalysisTool, installGitHubListRepositoryIssuesTool, performanceMonitor, timed, urlToMarkdown };
export type { AgentConfig, AgentResponse, CodeContext, ExecutionContext, FunctionCall, GitHubAgentImplementation, GitHubConfig, GitHubIssue, HttpServeOptions, IPlatformService, IssueAnalysisResult, IssueQueryOptions, IssueState, LLMProviderConfig, ParsedResponse, PlatformComment, PlatformConfig$1 as PlatformConfig, PlatformIssue$1 as PlatformIssue, PlatformLabel, PlatformRepository, PlatformType$1 as PlatformType, PlatformUser, Preset, ToolDefinition, ToolResult };
