namespace ThreadPilot.Services { using System; using System.Collections.Generic; using System.Threading.Tasks; using ThreadPilot.Models; public class ProfileApplicationEventArgs : EventArgs { public ConditionalProcessProfile Profile { get; set; } = new(); public ProcessModel Process { get; set; } = new(); public SystemState SystemState { get; set; } = new(); public bool WasApplied { get; set; } public string Reason { get; set; } = string.Empty; public DateTime Timestamp { get; set; } = DateTime.UtcNow; } public class ProfileConflictEventArgs : EventArgs { public List ConflictingProfiles { get; set; } = new(); public ProcessModel Process { get; set; } = new(); public ConditionalProcessProfile SelectedProfile { get; set; } = new(); public string Resolution { get; set; } = string.Empty; } public interface IConditionalProfileService { Task InitializeAsync(); Task AddProfileAsync(ConditionalProcessProfile profile); Task RemoveProfileAsync(string profileId); Task UpdateProfileAsync(ConditionalProcessProfile profile); Task> GetAllProfilesAsync(); Task> GetProfilesForProcessAsync(string processName); Task> EvaluateProfilesAsync(ProcessModel process); Task ApplyBestProfileAsync(ProcessModel process); Task GetSystemStateAsync(); Task StartMonitoringAsync(); Task StopMonitoringAsync(); bool IsMonitoring { get; } ConditionalProcessProfile ResolveProfileConflict(List conflictingProfiles, ProcessModel process); ConditionalProcessProfile CreateDefaultProfile(string processName); Task<(bool IsValid, List Errors)> ValidateProfileAsync(ConditionalProcessProfile profile); Task ExportProfilesToJsonAsync(); Task ImportProfilesFromJsonAsync(string json); event EventHandler? ProfileApplied; event EventHandler? ProfileConflictResolved; event EventHandler? SystemStateChanged; } }