chore(unity): 固定Unity CLI Loop本地包并移除UnitySkills依赖
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace io.github.hatayama.uLoopMCP
|
||||
{
|
||||
/// <summary>
|
||||
/// Security Validation Result
|
||||
///
|
||||
/// Related Class: SecurityValidator
|
||||
/// </summary>
|
||||
public class SecurityValidationResult
|
||||
{
|
||||
/// <summary>Validation status</summary>
|
||||
public bool IsValid { get; set; }
|
||||
|
||||
/// <summary>List of security violations</summary>
|
||||
public List<SecurityViolation> Violations { get; set; } = new();
|
||||
|
||||
/// <summary>Compilation errors (extended)</summary>
|
||||
public List<string> CompilationErrors { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve error summary
|
||||
/// </summary>
|
||||
public string GetErrorSummary()
|
||||
{
|
||||
if (IsValid) return "No security violations detected.";
|
||||
|
||||
StringBuilder sb = new();
|
||||
sb.AppendLine($"Security validation failed with {Violations.Count} violation(s):");
|
||||
|
||||
foreach (SecurityViolation violation in Violations)
|
||||
{
|
||||
sb.AppendLine($" - [{violation.Type}] {violation.Message}");
|
||||
if (!string.IsNullOrEmpty(violation.ApiName))
|
||||
{
|
||||
sb.AppendLine($" API: {violation.ApiName}");
|
||||
}
|
||||
}
|
||||
|
||||
if (CompilationErrors?.Any() == true)
|
||||
{
|
||||
sb.AppendLine($"Compilation errors: {CompilationErrors.Count}");
|
||||
foreach (string error in CompilationErrors)
|
||||
{
|
||||
sb.AppendLine($" - {error}");
|
||||
}
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user