54 lines
1.2 KiB
C#
Executable File
54 lines
1.2 KiB
C#
Executable File
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MarketAlly.AIPlugin.Analysis
|
|
{
|
|
public static class WarningsAnalysisAdapter
|
|
{
|
|
public static async Task<object> CallExistingWarningsAnalysisAsync(AIPluginRegistry registry, string solutionPath, string phase, int maxAttempts, bool applyFixes)
|
|
{
|
|
try
|
|
{
|
|
var parameters = new Dictionary<string, object>
|
|
{
|
|
["solutionPath"] = solutionPath,
|
|
["phase"] = phase,
|
|
["maxAttempts"] = maxAttempts,
|
|
["applyFixes"] = applyFixes
|
|
};
|
|
|
|
var result = await registry.CallFunctionAsync("WarningsAnalysis", parameters);
|
|
|
|
if (result.Success)
|
|
{
|
|
return result.Data;
|
|
}
|
|
else
|
|
{
|
|
return CreateFallbackWarningsData(phase);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine($"Warning: WarningsAnalysis plugin failed: {ex.Message}");
|
|
return CreateFallbackWarningsData(phase);
|
|
}
|
|
}
|
|
|
|
private static object CreateFallbackWarningsData(string phase)
|
|
{
|
|
return new
|
|
{
|
|
Phase = phase,
|
|
Timestamp = DateTime.UtcNow,
|
|
TotalWarnings = 0,
|
|
WarningsFixed = 0,
|
|
Summary = "Warnings analysis unavailable - skipped"
|
|
};
|
|
}
|
|
}
|
|
}
|