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Original file: /npm/@autodev/github-agent-action@0.5.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar core = require('@actions/core');\nvar rest = require('@octokit/rest');\nvar githubAgent = require('@autodev/github-agent');\nvar express = require('express');\nvar webhooks = require('@octokit/webhooks');\nvar github = require('@actions/github');\n\nfunction _interopNamespaceDefault(e) {\n    var n = Object.create(null);\n    if (e) {\n        Object.keys(e).forEach(function (k) {\n            if (k !== 'default') {\n                var d = Object.getOwnPropertyDescriptor(e, k);\n                Object.defineProperty(n, k, d.get ? d : {\n                    enumerable: true,\n                    get: function () { return e[k]; }\n                });\n            }\n        });\n    }\n    n.default = e;\n    return Object.freeze(n);\n}\n\nvar core__namespace = /*#__PURE__*/_interopNamespaceDefault(core);\nvar github__namespace = /*#__PURE__*/_interopNamespaceDefault(github);\n\nclass IssueAnalyzer {\n    constructor(context) {\n        this.context = context;\n        // Initialize services using the same pattern as analyze-issue.js\n        this.githubService = new githubAgent.GitHubService(context.config.githubToken);\n        this.contextAnalyzer = new githubAgent.ContextAnalyzer(context.workspacePath);\n        this.reportGenerator = new githubAgent.AnalysisReportGenerator(context.config.githubToken);\n        this.llmService = new githubAgent.LLMService();\n        // Default label configuration\n        this.labelConfig = {\n            bugLabel: 'bug',\n            featureLabel: 'enhancement',\n            documentationLabel: 'documentation',\n            enhancementLabel: 'enhancement',\n            questionLabel: 'question',\n            analysisCompleteLabel: 'analysis-complete'\n        };\n    }\n    /**\n     * Analyze an issue using the same logic as analyze-issue.js\n     */\n    async analyzeIssue(options = {}) {\n        const startTime = Date.now();\n        try {\n            console.log(`🔍 Starting analysis for issue #${this.context.issueNumber} in ${this.context.owner}/${this.context.repo}`);\n            // Step 1: Get the issue (same as analyze-issue.js line 327)\n            const issue = await this.githubService.getIssue(this.context.owner, this.context.repo, this.context.issueNumber);\n            console.log(`📋 Issue: \"${issue.title}\"`);\n            // Step 2: Fetch URL content if enabled (same as analyze-issue.js line 360)\n            let urlContent = [];\n            if (options.includeCodeSearch !== false && issue.body) {\n                try {\n                    urlContent = await githubAgent.fetchUrlsFromIssue(issue.body, 10000);\n                    console.log(`🔗 Fetched content from ${urlContent.length} URLs`);\n                }\n                catch (error) {\n                    console.warn('URL fetching failed:', error);\n                }\n            }\n            // Step 3: Enhance issue with URL content (same as analyze-issue.js line 384)\n            const enhancedIssue = {\n                ...issue,\n                urlContent: urlContent\n            };\n            // Step 4: Perform the analysis (same as analyze-issue.js line 391)\n            const analysisResult = await this.contextAnalyzer.analyzeIssue(enhancedIssue);\n            // Step 5: Generate comprehensive report (same as analyze-issue.js line 408)\n            const { report } = await this.reportGenerator.generateAndUploadReport(this.context.owner, this.context.repo, this.context.issueNumber, analysisResult, {\n                uploadToGitHub: false, // We'll handle comment separately\n                language: 'en',\n                includeFileContent: options.includeCodeSearch !== false,\n                maxFiles: 10\n            });\n            // Use the generated report as our analysis result\n            const result = {\n                success: true,\n                analysisResult: {\n                    text: report, // This is the detailed analysis text\n                    analysisResult: analysisResult,\n                    executionTime: Date.now() - startTime\n                },\n                executionTime: Date.now() - startTime\n            };\n            // Generate labels based on the analysis\n            const recommendedLabels = this.extractLabelsFromAnalysis(report);\n            result.labelsAdded = recommendedLabels;\n            console.log(`✅ Analysis completed in ${result.executionTime}ms`);\n            return result;\n        }\n        catch (error) {\n            const errorMessage = error instanceof Error ? error.message : String(error);\n            console.error('❌ Analysis failed:', errorMessage);\n            return {\n                success: false,\n                error: errorMessage,\n                executionTime: Date.now() - startTime\n            };\n        }\n    }\n    /**\n     * Extract labels from analysis text using simple pattern matching\n     */\n    extractLabelsFromAnalysis(analysisText) {\n        const labels = [];\n        // Convert to lowercase for pattern matching\n        const text = analysisText.toLowerCase();\n        // Pattern matching for different types of issues\n        if (text.includes('bug') || text.includes('error') || text.includes('issue') || text.includes('problem')) {\n            labels.push(this.labelConfig.bugLabel || 'bug');\n        }\n        if (text.includes('enhancement') || text.includes('feature') || text.includes('improve')) {\n            labels.push(this.labelConfig.enhancementLabel || 'enhancement');\n        }\n        if (text.includes('documentation') || text.includes('docs') || text.includes('readme')) {\n            labels.push(this.labelConfig.documentationLabel || 'documentation');\n        }\n        if (text.includes('question') || text.includes('help') || text.includes('how to')) {\n            labels.push(this.labelConfig.questionLabel || 'question');\n        }\n        // Complexity assessment\n        if (text.includes('complex') || text.includes('difficult') || text.includes('challenging')) {\n            labels.push('complex');\n        }\n        // Always add analysis complete label\n        if (this.labelConfig.analysisCompleteLabel) {\n            labels.push(this.labelConfig.analysisCompleteLabel);\n        }\n        // Remove duplicates\n        return [...new Set(labels)];\n    }\n    /**\n     * Generate comment text for the issue using LLM (similar to agent.ts approach)\n     */\n    async generateComment(analysisResult) {\n        if (!analysisResult || !analysisResult.analysisResult) {\n            return `## 🤖 Automated Issue Analysis\n\nAnalysis completed successfully. Please check the analysis results for detailed information.\n\n---\n*This analysis was generated automatically by AutoDev GitHub Agent*`;\n        }\n        // Try to generate enhanced comment using LLM\n        try {\n            if (this.llmService.isAvailable()) {\n                const comment = await this.generateEnhancedComment(analysisResult);\n                return comment;\n            }\n            else {\n                console.log('LLM service not available, using enhanced formatting');\n                return this.generateEnhancedFormattedComment(analysisResult);\n            }\n        }\n        catch (error) {\n            console.warn('Failed to generate enhanced comment, falling back to basic format:', error);\n            // Fallback to using the report text directly\n            return `## 🤖 Automated Issue Analysis\n\n${analysisResult.text || 'Analysis completed successfully.'}\n\n**Analysis completed in:** ${analysisResult.executionTime || 'N/A'}ms\n\n---\n*This analysis was generated automatically by AutoDev GitHub Agent*`;\n        }\n    }\n    /**\n     * Generate enhanced comment using LLM\n     */\n    async generateEnhancedComment(analysisResult) {\n        const issue = analysisResult.analysisResult?.issue;\n        const analysis = analysisResult.analysisResult;\n        if (!issue || !analysis) {\n            throw new Error('Missing issue or analysis data for LLM comment generation');\n        }\n        try {\n            // Create a mock issue for the LLM service\n            const mockIssue = {\n                ...issue,\n                number: this.context.issueNumber,\n                state: 'open',\n                created_at: new Date().toISOString(),\n                updated_at: new Date().toISOString(),\n                html_url: `https://github.com/${this.context.owner}/${this.context.repo}/issues/${this.context.issueNumber}`,\n                labels: issue.labels || []\n            };\n            // Use the existing LLM service to generate analysis report\n            const llmReport = await this.llmService.generateAnalysisReport(mockIssue, analysis);\n            // Format the LLM report as a GitHub comment\n            const comment = this.formatLLMReportAsComment(llmReport, analysisResult);\n            return comment;\n        }\n        catch (error) {\n            const errorMessage = error instanceof Error ? error.message : String(error);\n            console.warn('LLM service failed:', errorMessage);\n            throw new Error(`LLM comment generation failed: ${errorMessage}`);\n        }\n    }\n    /**\n     * Generate enhanced formatted comment without LLM\n     */\n    generateEnhancedFormattedComment(analysisResult) {\n        const analysis = analysisResult.analysisResult;\n        const sections = [];\n        // Header\n        sections.push('## 🤖 Automated Issue Analysis');\n        sections.push('');\n        // Summary\n        if (analysis?.summary) {\n            sections.push('### 📋 Summary');\n            sections.push(analysis.summary);\n            sections.push('');\n        }\n        // Files analyzed\n        if (analysis?.relatedCode?.files && analysis.relatedCode.files.length > 0) {\n            sections.push('### 📁 Relevant Files');\n            const topFiles = analysis.relatedCode.files.slice(0, 5);\n            topFiles.forEach((file) => {\n                sections.push(`- \\`${file.path}\\``);\n            });\n            if (analysis.relatedCode.files.length > 5) {\n                sections.push(`- ... and ${analysis.relatedCode.files.length - 5} more files`);\n            }\n            sections.push('');\n        }\n        // Suggestions\n        if (analysis?.suggestions && analysis.suggestions.length > 0) {\n            sections.push('### 💡 Recommendations');\n            analysis.suggestions.forEach((suggestion, index) => {\n                const desc = suggestion.description || suggestion;\n                sections.push(`${index + 1}. ${desc}`);\n            });\n            sections.push('');\n        }\n        // Original report content if available\n        if (analysisResult.text) {\n            sections.push('### 📊 Detailed Analysis');\n            sections.push(analysisResult.text);\n            sections.push('');\n        }\n        // Execution info\n        if (analysisResult.executionTime) {\n            sections.push(`**Analysis completed in:** ${analysisResult.executionTime}ms`);\n            sections.push('');\n        }\n        // Footer\n        sections.push('---');\n        sections.push('*This analysis was generated automatically by [AutoDev GitHub Agent](https://github.com/unit-mesh/autodev-worker)*');\n        return sections.join('\\n');\n    }\n    /**\n     * Format LLM analysis report as a GitHub comment\n     */\n    formatLLMReportAsComment(llmReport, analysisResult) {\n        const sections = [];\n        // Header\n        sections.push('## 🤖 Automated Issue Analysis');\n        sections.push('');\n        // Summary\n        if (llmReport.summary) {\n            sections.push('### 📋 Summary');\n            sections.push(llmReport.summary);\n            sections.push('');\n        }\n        // Current Issues\n        if (llmReport.current_issues && llmReport.current_issues.length > 0) {\n            sections.push('### 🔍 Issues Identified');\n            llmReport.current_issues.forEach((issue) => {\n                sections.push(`- ${issue}`);\n            });\n            sections.push('');\n        }\n        // Recommendations\n        if (llmReport.recommendations && llmReport.recommendations.length > 0) {\n            sections.push('### 💡 Recommendations');\n            llmReport.recommendations.forEach((rec, index) => {\n                sections.push(`${index + 1}. ${rec}`);\n            });\n            sections.push('');\n        }\n        // Detailed Plan\n        if (llmReport.detailed_plan && llmReport.detailed_plan.steps && llmReport.detailed_plan.steps.length > 0) {\n            sections.push('### 📝 Implementation Plan');\n            llmReport.detailed_plan.steps.forEach((step, index) => {\n                sections.push(`#### ${index + 1}. ${step.title}`);\n                if (step.description) {\n                    sections.push(step.description);\n                }\n                if (step.files_to_modify && step.files_to_modify.length > 0) {\n                    sections.push(`**Files to modify:** ${step.files_to_modify.join(', ')}`);\n                }\n                if (step.changes_needed && step.changes_needed.length > 0) {\n                    sections.push('**Changes needed:**');\n                    step.changes_needed.forEach((change) => {\n                        sections.push(`- ${change}`);\n                    });\n                }\n                sections.push('');\n            });\n        }\n        // Execution info\n        if (analysisResult.executionTime) {\n            sections.push(`**Analysis completed in:** ${analysisResult.executionTime}ms`);\n            sections.push('');\n        }\n        // Footer\n        sections.push('---');\n        sections.push('*This analysis was generated automatically by [AutoDev GitHub Agent](https://github.com/unit-mesh/autodev-worker)*');\n        return sections.join('\\n');\n    }\n    /**\n     * Update label configuration\n     */\n    setLabelConfig(config) {\n        this.labelConfig = { ...this.labelConfig, ...config };\n    }\n}\n\nclass GitHubActionService {\n    constructor(config) {\n        // Get configuration from GitHub Actions inputs or environment\n        this.config = this.loadConfig(config);\n        // Initialize Octokit with GitHub token\n        this.octokit = new rest.Octokit({\n            auth: this.config.githubToken\n        });\n        console.log('🔧 GitHub Action Service initialized');\n        console.log(`📁 Workspace: ${this.config.workspacePath}`);\n        console.log(`🤖 Auto Comment: ${this.config.autoComment}`);\n        console.log(`🏷️ Auto Label: ${this.config.autoLabel}`);\n    }\n    /**\n     * Load configuration from GitHub Actions inputs or environment\n     */\n    loadConfig(overrides) {\n        const config = {\n            githubToken: this.getInput('github-token') || process.env.GITHUB_TOKEN || '',\n            workspacePath: this.getInput('workspace-path') || process.env.GITHUB_WORKSPACE || process.cwd(),\n            webhookSecret: this.getInput('webhook-secret') || process.env.WEBHOOK_SECRET,\n            autoComment: this.getBooleanInput('auto-comment') ?? true,\n            autoLabel: this.getBooleanInput('auto-label') ?? true,\n            analysisDepth: this.getInput('analysis-depth') || 'medium',\n            triggerEvents: this.getInput('trigger-events')?.split(',') || ['opened', 'edited', 'reopened'],\n            excludeLabels: this.getInput('exclude-labels')?.split(',').filter(Boolean) || [],\n            includeLabels: this.getInput('include-labels')?.split(',').filter(Boolean) || [],\n            ...overrides\n        };\n        if (!config.githubToken) {\n            throw new Error('GitHub token is required. Set GITHUB_TOKEN environment variable or github-token input.');\n        }\n        // Set LLM API keys as environment variables for the underlying github-agent\n        const openaiKey = this.getInput('openai-api-key') || process.env.OPENAI_API_KEY;\n        const deepseekToken = this.getInput('deepseek-token') || process.env.DEEPSEEK_TOKEN;\n        const glmToken = this.getInput('glm-token') || process.env.GLM_TOKEN;\n        if (openaiKey) {\n            process.env.OPENAI_API_KEY = openaiKey;\n        }\n        if (deepseekToken) {\n            process.env.DEEPSEEK_TOKEN = deepseekToken;\n        }\n        if (glmToken) {\n            process.env.GLM_TOKEN = glmToken;\n        }\n        return config;\n    }\n    /**\n     * Get input value (works in both GitHub Actions and standalone mode)\n     */\n    getInput(name) {\n        try {\n            return core__namespace.getInput(name);\n        }\n        catch {\n            // Fallback for standalone mode\n            return process.env[name.toUpperCase().replace('-', '_')] || '';\n        }\n    }\n    /**\n     * Get boolean input value\n     */\n    getBooleanInput(name) {\n        const value = this.getInput(name);\n        if (!value)\n            return undefined;\n        return value.toLowerCase() === 'true';\n    }\n    /**\n     * Process an issue with simplified options\n     */\n    async processIssue(options) {\n        const context = {\n            owner: options.owner,\n            repo: options.repo,\n            issueNumber: options.issueNumber,\n            eventType: 'manual',\n            action: options.action || 'analyze',\n            workspacePath: this.config.workspacePath,\n            config: {\n                ...this.config,\n                autoComment: options.autoComment ?? this.config.autoComment,\n                autoLabel: options.autoLabel ?? this.config.autoLabel,\n                analysisDepth: options.depth || this.config.analysisDepth\n            }\n        };\n        return this.processIssueWithContext(context);\n    }\n    /**\n     * Process an issue with full context\n     */\n    async processIssueWithContext(context) {\n        try {\n            console.log(`🔍 Processing issue #${context.issueNumber} in ${context.owner}/${context.repo}`);\n            // Validate issue exists and is accessible\n            await this.validateIssue(context);\n            // Create issue analyzer\n            const analyzer = new IssueAnalyzer(context);\n            // Configure analysis options\n            const analysisOptions = {\n                depth: context.config.analysisDepth,\n                includeCodeSearch: true,\n                includeSymbolAnalysis: true,\n                timeout: 120000\n            };\n            // Perform analysis\n            const result = await analyzer.analyzeIssue(analysisOptions);\n            if (!result.success) {\n                throw new Error(result.error || 'Analysis failed');\n            }\n            // Add comment if configured and analysis was successful\n            if (context.config.autoComment && result.analysisResult) {\n                try {\n                    await this.addAnalysisComment(context, result);\n                    result.commentAdded = true;\n                    console.log(`💬 Added analysis comment to issue #${context.issueNumber}`);\n                }\n                catch (error) {\n                    console.warn('Failed to add comment:', error);\n                    // Don't fail the entire process if comment fails\n                }\n            }\n            // Add labels if configured\n            if (context.config.autoLabel && result.labelsAdded && result.labelsAdded.length > 0) {\n                try {\n                    await this.addLabelsToIssue(context, result.labelsAdded);\n                    console.log(`🏷️ Added labels to issue #${context.issueNumber}: ${result.labelsAdded.join(', ')}`);\n                }\n                catch (error) {\n                    console.warn('Failed to add labels:', error);\n                    // Don't fail the entire process if labeling fails\n                }\n            }\n            // Set GitHub Actions outputs if running in Actions context\n            this.setOutputs(result);\n            return result;\n        }\n        catch (error) {\n            const errorMessage = error instanceof Error ? error.message : String(error);\n            console.error(`❌ Failed to process issue #${context.issueNumber}:`, errorMessage);\n            // Set error output for GitHub Actions\n            this.setErrorOutput(errorMessage);\n            return {\n                success: false,\n                error: errorMessage\n            };\n        }\n    }\n    /**\n     * Validate that the issue exists and is accessible\n     */\n    async validateIssue(context) {\n        try {\n            const { data: issue } = await this.octokit.issues.get({\n                owner: context.owner,\n                repo: context.repo,\n                issue_number: context.issueNumber\n            });\n            console.log(`✅ Issue #${context.issueNumber} validated: \"${issue.title}\"`);\n        }\n        catch (error) {\n            if (error instanceof Error && 'status' in error) {\n                const status = error.status;\n                if (status === 404) {\n                    throw new Error(`Issue #${context.issueNumber} not found in ${context.owner}/${context.repo}`);\n                }\n                else if (status === 403) {\n                    throw new Error(`Access denied to issue #${context.issueNumber} in ${context.owner}/${context.repo}`);\n                }\n            }\n            throw new Error(`Failed to validate issue: ${error instanceof Error ? error.message : String(error)}`);\n        }\n    }\n    /**\n     * Add analysis comment to the issue\n     */\n    async addAnalysisComment(context, result) {\n        if (!result.analysisResult) {\n            throw new Error('No analysis result to comment');\n        }\n        // Create analyzer to generate LLM-powered comment\n        const analyzer = new IssueAnalyzer(context);\n        // Generate comment body using LLM\n        const commentBody = await analyzer.generateComment(result);\n        await this.octokit.issues.createComment({\n            owner: context.owner,\n            repo: context.repo,\n            issue_number: context.issueNumber,\n            body: commentBody\n        });\n    }\n    /**\n     * Add labels to the issue\n     */\n    async addLabelsToIssue(context, labels) {\n        await this.octokit.issues.addLabels({\n            owner: context.owner,\n            repo: context.repo,\n            issue_number: context.issueNumber,\n            labels\n        });\n    }\n    /**\n     * Set GitHub Actions outputs\n     */\n    setOutputs(result) {\n        try {\n            core__namespace.setOutput('success', result.success.toString());\n            core__namespace.setOutput('comment-added', (result.commentAdded || false).toString());\n            if (result.labelsAdded) {\n                core__namespace.setOutput('labels-added', result.labelsAdded.join(','));\n            }\n            if (result.executionTime) {\n                core__namespace.setOutput('execution-time', result.executionTime.toString());\n            }\n            if (result.error) {\n                core__namespace.setOutput('error', result.error);\n            }\n        }\n        catch {\n            // Ignore errors if not running in GitHub Actions context\n        }\n    }\n    /**\n     * Set error output for GitHub Actions\n     */\n    setErrorOutput(error) {\n        try {\n            core__namespace.setFailed(error);\n            core__namespace.setOutput('success', 'false');\n            core__namespace.setOutput('error', error);\n        }\n        catch {\n            // Ignore errors if not running in GitHub Actions context\n        }\n    }\n    /**\n     * Get current configuration\n     */\n    getConfig() {\n        return { ...this.config };\n    }\n    /**\n     * Update configuration\n     */\n    updateConfig(updates) {\n        this.config = { ...this.config, ...updates };\n    }\n}\n\nclass WebhookHandler {\n    constructor(actionService, options = {}) {\n        this.actionService = actionService;\n        this.options = {\n            path: '/webhook',\n            port: 3000,\n            ...options\n        };\n        this.app = express();\n        this.app.use(express.json());\n        // Initialize webhooks with secret if provided\n        this.webhooks = new webhooks.Webhooks({\n            secret: this.options.secret || 'default-secret'\n        });\n        this.setupWebhookHandlers();\n        this.setupRoutes();\n    }\n    /**\n     * Setup webhook event handlers\n     */\n    setupWebhookHandlers() {\n        // Handle issue opened events\n        this.webhooks.on('issues.opened', async ({ payload }) => {\n            console.log(`📝 Issue opened: #${payload.issue.number} in ${payload.repository.full_name}`);\n            try {\n                await this.handleIssueEvent(payload, 'opened');\n                if (this.options.onIssueOpened) {\n                    await this.options.onIssueOpened(payload);\n                }\n            }\n            catch (error) {\n                console.error('Error handling issue opened event:', error);\n            }\n        });\n        // Handle issue edited events\n        this.webhooks.on('issues.edited', async ({ payload }) => {\n            console.log(`✏️ Issue edited: #${payload.issue.number} in ${payload.repository.full_name}`);\n            try {\n                await this.handleIssueEvent(payload, 'edited');\n                if (this.options.onIssueEdited) {\n                    await this.options.onIssueEdited(payload);\n                }\n            }\n            catch (error) {\n                console.error('Error handling issue edited event:', error);\n            }\n        });\n        // Handle issue labeled events\n        this.webhooks.on('issues.labeled', async ({ payload }) => {\n            console.log(`🏷️ Issue labeled: #${payload.issue.number} in ${payload.repository.full_name}`);\n            try {\n                if (this.options.onIssueLabeled) {\n                    await this.options.onIssueLabeled(payload);\n                }\n            }\n            catch (error) {\n                console.error('Error handling issue labeled event:', error);\n            }\n        });\n        // Handle issue assigned events\n        this.webhooks.on('issues.assigned', async ({ payload }) => {\n            console.log(`👤 Issue assigned: #${payload.issue.number} in ${payload.repository.full_name}`);\n            try {\n                if (this.options.onIssueAssigned) {\n                    await this.options.onIssueAssigned(payload);\n                }\n            }\n            catch (error) {\n                console.error('Error handling issue assigned event:', error);\n            }\n        });\n        // Handle webhook errors\n        this.webhooks.onError((error) => {\n            console.error('Webhook error:', error);\n        });\n    }\n    /**\n     * Setup Express routes\n     */\n    setupRoutes() {\n        // Health check endpoint\n        this.app.get('/health', (req, res) => {\n            res.json({\n                status: 'healthy',\n                timestamp: new Date().toISOString(),\n                service: 'github-agent-action-webhook'\n            });\n        });\n        // Webhook endpoint\n        this.app.post(this.options.path, async (req, res) => {\n            try {\n                await this.webhooks.verifyAndReceive({\n                    id: req.headers['x-github-delivery'],\n                    name: req.headers['x-github-event'],\n                    signature: req.headers['x-hub-signature-256'],\n                    payload: JSON.stringify(req.body)\n                });\n                res.status(200).json({ message: 'Webhook processed successfully' });\n            }\n            catch (error) {\n                console.error('Webhook processing error:', error);\n                res.status(400).json({\n                    error: 'Webhook processing failed',\n                    message: error instanceof Error ? error.message : 'Unknown error'\n                });\n            }\n        });\n        // Manual trigger endpoint for testing\n        this.app.post('/trigger/:owner/:repo/:issueNumber', async (req, res) => {\n            try {\n                const { owner, repo, issueNumber } = req.params;\n                const { action = 'manual', depth = 'medium' } = req.body;\n                console.log(`🔧 Manual trigger for issue #${issueNumber} in ${owner}/${repo}`);\n                const result = await this.actionService.processIssue({\n                    owner,\n                    repo,\n                    issueNumber: parseInt(issueNumber),\n                    action,\n                    depth\n                });\n                res.json({\n                    success: true,\n                    result,\n                    message: `Analysis completed for issue #${issueNumber}`\n                });\n            }\n            catch (error) {\n                console.error('Manual trigger error:', error);\n                res.status(500).json({\n                    success: false,\n                    error: error instanceof Error ? error.message : 'Unknown error'\n                });\n            }\n        });\n        // Status endpoint\n        this.app.get('/status', (req, res) => {\n            res.json({\n                service: 'github-agent-action',\n                version: process.env.npm_package_version || '0.1.0',\n                uptime: process.uptime(),\n                memory: process.memoryUsage(),\n                webhookPath: this.options.path,\n                timestamp: new Date().toISOString()\n            });\n        });\n    }\n    /**\n     * Handle issue events (opened, edited, etc.)\n     */\n    async handleIssueEvent(payload, eventType) {\n        if (!payload.issue || !payload.repository) {\n            console.warn('Invalid payload: missing issue or repository data');\n            return;\n        }\n        // Check if we should process this issue\n        if (!this.shouldProcessIssue(payload, eventType)) {\n            console.log(`⏭️ Skipping issue #${payload.issue.number} - does not meet processing criteria`);\n            return;\n        }\n        const context = {\n            owner: payload.repository.owner.login,\n            repo: payload.repository.name,\n            issueNumber: payload.issue.number,\n            eventType,\n            action: payload.action,\n            workspacePath: process.cwd(), // This could be configured\n            config: this.getActionConfig()\n        };\n        try {\n            console.log(`🚀 Processing issue #${context.issueNumber} in ${context.owner}/${context.repo}`);\n            const result = await this.actionService.processIssueWithContext(context);\n            if (result.success) {\n                console.log(`✅ Successfully processed issue #${context.issueNumber}`);\n                // Log analysis results\n                if (result.analysisResult) {\n                    console.log(`📊 Analysis completed in ${result.executionTime}ms`);\n                }\n                if (result.commentAdded) {\n                    console.log(`💬 Comment added to issue #${context.issueNumber}`);\n                }\n                if (result.labelsAdded && result.labelsAdded.length > 0) {\n                    console.log(`🏷️ Labels added: ${result.labelsAdded.join(', ')}`);\n                }\n            }\n            else {\n                console.error(`❌ Failed to process issue #${context.issueNumber}: ${result.error}`);\n            }\n        }\n        catch (error) {\n            console.error(`💥 Error processing issue #${context.issueNumber}:`, error);\n        }\n    }\n    /**\n     * Determine if an issue should be processed based on configuration\n     */\n    shouldProcessIssue(payload, eventType) {\n        const config = this.getActionConfig();\n        // Check if event type is in trigger events\n        if (config.triggerEvents && !config.triggerEvents.includes(eventType)) {\n            return false;\n        }\n        // Check exclude labels\n        if (config.excludeLabels && payload.issue) {\n            const issueLabels = payload.issue.labels.map(label => label.name);\n            const hasExcludedLabel = config.excludeLabels.some(label => issueLabels.includes(label));\n            if (hasExcludedLabel) {\n                return false;\n            }\n        }\n        // Check include labels (if specified, issue must have at least one)\n        if (config.includeLabels && config.includeLabels.length > 0 && payload.issue) {\n            const issueLabels = payload.issue.labels.map(label => label.name);\n            const hasIncludedLabel = config.includeLabels.some(label => issueLabels.includes(label));\n            if (!hasIncludedLabel) {\n                return false;\n            }\n        }\n        return true;\n    }\n    /**\n     * Get action configuration from environment or defaults\n     */\n    getActionConfig() {\n        return {\n            githubToken: process.env.GITHUB_TOKEN || '',\n            workspacePath: process.env.WORKSPACE_PATH || process.cwd(),\n            webhookSecret: process.env.WEBHOOK_SECRET,\n            autoComment: process.env.AUTO_COMMENT === 'true',\n            autoLabel: process.env.AUTO_LABEL === 'true',\n            analysisDepth: process.env.ANALYSIS_DEPTH || 'medium',\n            triggerEvents: process.env.TRIGGER_EVENTS?.split(',') || ['opened', 'edited', 'reopened'],\n            excludeLabels: process.env.EXCLUDE_LABELS?.split(',') || [],\n            includeLabels: process.env.INCLUDE_LABELS?.split(',') || []\n        };\n    }\n    /**\n     * Start the webhook server\n     */\n    async start() {\n        const port = this.options.port || 3000;\n        return new Promise((resolve) => {\n            this.app.listen(port, () => {\n                console.log(`🚀 GitHub Agent Action webhook server started on port ${port}`);\n                console.log(`📡 Webhook endpoint: http://localhost:${port}${this.options.path}`);\n                console.log(`🏥 Health check: http://localhost:${port}/health`);\n                console.log(`📊 Status: http://localhost:${port}/status`);\n                resolve();\n            });\n        });\n    }\n    /**\n     * Get the Express app instance\n     */\n    getApp() {\n        return this.app;\n    }\n    /**\n     * Get webhook instance for advanced configuration\n     */\n    getWebhooks() {\n        return this.webhooks;\n    }\n}\n\n/**\n * AutoDev GitHub Agent Action\n *\n * Automated GitHub issue analysis using AI-powered code analysis.\n * This package provides both GitHub Actions integration and standalone webhook server capabilities.\n */\n// Core exports\n/**\n * Main entry point for GitHub Actions\n * This function is called when the action runs in a GitHub workflow\n */\nasync function run() {\n    try {\n        console.log('🚀 Starting AutoDev GitHub Agent Action');\n        // Initialize the action service\n        const actionService = new GitHubActionService();\n        // Get context from GitHub Actions\n        const context = github__namespace.context;\n        // Check if this is an issue event\n        if (context.eventName === 'issues') {\n            const payload = context.payload;\n            if (!payload.issue) {\n                throw new Error('No issue found in event payload');\n            }\n            console.log(`📝 Processing issue #${payload.issue.number}: ${payload.issue.title}`);\n            // Process the issue\n            const result = await actionService.processIssue({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                issueNumber: payload.issue.number,\n                action: payload.action\n            });\n            if (result.success) {\n                console.log('✅ Issue analysis completed successfully');\n                if (result.commentAdded) {\n                    console.log('💬 Analysis comment added to issue');\n                }\n                if (result.labelsAdded && result.labelsAdded.length > 0) {\n                    console.log(`🏷️ Labels added: ${result.labelsAdded.join(', ')}`);\n                }\n            }\n            else {\n                throw new Error(result.error || 'Issue analysis failed');\n            }\n        }\n        else {\n            console.log(`ℹ️ Event type '${context.eventName}' is not supported. Only 'issues' events are processed.`);\n        }\n    }\n    catch (error) {\n        const errorMessage = error instanceof Error ? error.message : String(error);\n        console.error('❌ Action failed:', errorMessage);\n        core__namespace.setFailed(errorMessage);\n    }\n}\n/**\n * Create and start a webhook server for standalone operation\n */\nasync function startWebhookServer(options = {}) {\n    console.log('🌐 Starting GitHub Agent Action webhook server');\n    // Initialize action service\n    const actionService = new GitHubActionService({\n        githubToken: options.githubToken || process.env.GITHUB_TOKEN,\n        workspacePath: options.workspacePath || process.cwd(),\n        webhookSecret: options.webhookSecret || process.env.WEBHOOK_SECRET\n    });\n    // Create webhook handler\n    const webhookHandler = new WebhookHandler(actionService, {\n        port: options.port || parseInt(process.env.PORT || '3000'),\n        secret: options.webhookSecret || process.env.WEBHOOK_SECRET || 'default-secret',\n        path: '/webhook'\n    });\n    // Start the server\n    await webhookHandler.start();\n    return webhookHandler;\n}\n/**\n * Analyze a specific issue (for manual/programmatic use)\n */\nasync function analyzeIssue(options) {\n    console.log(`🔍 Analyzing issue #${options.issueNumber} in ${options.owner}/${options.repo}`);\n    const actionService = new GitHubActionService({\n        githubToken: options.githubToken || process.env.GITHUB_TOKEN,\n        workspacePath: options.workspacePath || process.cwd()\n    });\n    return actionService.processIssue({\n        owner: options.owner,\n        repo: options.repo,\n        issueNumber: options.issueNumber,\n        depth: options.depth,\n        autoComment: options.autoComment,\n        autoLabel: options.autoLabel\n    });\n}\n/**\n * Utility function to validate configuration\n */\nfunction validateConfig() {\n    const errors = [];\n    // Check for required environment variables\n    if (!process.env.GITHUB_TOKEN) {\n        errors.push('GITHUB_TOKEN environment variable is required');\n    }\n    // Check for GitHub Actions context if running in Actions\n    try {\n        const context = github__namespace.context;\n        if (context.eventName && !['issues', 'issue_comment'].includes(context.eventName)) {\n            errors.push(`Event type '${context.eventName}' is not supported`);\n        }\n    }\n    catch {\n        // Not running in GitHub Actions context, which is fine for standalone mode\n    }\n    return {\n        valid: errors.length === 0,\n        errors\n    };\n}\n/**\n * Get version information\n */\nfunction getVersion() {\n    return process.env.npm_package_version || '0.1.0';\n}\n/**\n * Default export for convenience\n */\nvar index = {\n    run,\n    startWebhookServer,\n    analyzeIssue,\n    validateConfig,\n    getVersion,\n    GitHubActionService,\n    WebhookHandler\n};\n// Auto-run if this is the main module and we're in GitHub Actions context\nif (require.main === module) {\n    // Check if we're in GitHub Actions context\n    if (process.env.GITHUB_ACTIONS === 'true') {\n        run().catch(error => {\n            console.error('Fatal error:', error);\n            process.exit(1);\n        });\n    }\n    else {\n        // Standalone mode - start webhook server\n        const port = parseInt(process.env.PORT || '3000');\n        console.log(`🚀 Starting in standalone mode on port ${port}`);\n        startWebhookServer({ port }).catch(error => {\n            console.error('Failed to start webhook server:', error);\n            process.exit(1);\n        });\n    }\n}\n\nexports.GitHubActionService = GitHubActionService;\nexports.IssueAnalyzer = IssueAnalyzer;\nexports.WebhookHandler = WebhookHandler;\nexports.analyzeIssue = analyzeIssue;\nexports.default = index;\nexports.getVersion = getVersion;\nexports.run = run;\nexports.startWebhookServer = startWebhookServer;\nexports.validateConfig = validateConfig;\n\n"]}