using System.Collections.Generic;
using System.Reflection;
namespace io.github.hatayama.uLoopMCP
{
///
/// Compilation Result
///
/// Related Class: RoslynCompiler
///
public class CompilationResult
{
/// Compilation Success
public bool Success { get; set; }
/// Compiled Assembly
public Assembly CompiledAssembly { get; set; }
/// Errors
public List Errors { get; set; } = new();
/// Warnings
public List Warnings { get; set; } = new();
///
/// Code Formatted for Compilation
/// (After extracting and moving using statements, applying class/method wrapping)
///
public string UpdatedCode { get; set; }
/// Flag for Security Violations
public bool HasSecurityViolations { get; set; }
/// Security Violation Details
public List SecurityViolations { get; set; } = new();
/// Failure Reason Category
public CompilationFailureReason FailureReason { get; set; } = CompilationFailureReason.None;
///
/// Types that could not be auto-resolved because multiple namespace candidates were found.
/// Key: type name, Value: list of candidate namespaces.
///
public Dictionary> AmbiguousTypeCandidates { get; set; } = new();
///
/// Without this, callers cannot tell which namespaces were auto-resolved
/// and cannot advise users to include them for faster compilation.
///
public List AutoInjectedNamespaces { get; set; } = new();
///
/// Keeps internal phase timings out of normal logs while allowing tests and
/// benchmarks to compare where time is spent inside the pipeline.
///
public List Timings { get; set; } = new();
public List AdvisoryLogs { get; set; } = new();
public DynamicCompilationBackendKind CompilationBackendKind { get; set; } = DynamicCompilationBackendKind.Unknown;
}
///
/// Compilation Failure Reason Categories
///
public enum CompilationFailureReason
{
/// No Failure (Success)
None,
/// Compilation Error
CompilationError,
/// Security Violation
SecurityViolation,
/// Dynamic Assembly Addition Failed
DynamicAssemblyFailed,
/// Using Statement Addition Failed
UsingStatementFailed
}
}