mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 12:42:38 +00:00
refactor(agent): move Core orchestrators to Runtime/, flatten Interop/
Part 1 of 5 in Monitoring/ bounded-context restructure. Moves Monitoring/Core/* (minus EventSpool/EventUploadOrchestrator/DeviceInfoProvider/EnrollmentCompletionHandler which belong to later PRs) into Monitoring/Runtime/. Interop/ stays on Monitoring root. Pure folder move + namespace update; no behavior change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using Xunit;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Tests.Core
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Agent.Core.Tests.Helpers;
|
||||
using AutopilotMonitor.Shared;
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Agent.Core.Tests.Helpers;
|
||||
using AutopilotMonitor.Shared;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using Xunit;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Tests.Core
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
+2
@@ -4,6 +4,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Collectors.GatherCollectors
|
||||
{
|
||||
public class FileCollector : IGatherRuleCollector
|
||||
|
||||
+2
@@ -5,6 +5,8 @@ using System.Linq;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Collectors.GatherCollectors
|
||||
{
|
||||
public class JsonCollector : IGatherRuleCollector
|
||||
|
||||
+2
@@ -7,6 +7,8 @@ using System.Text.RegularExpressions;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Tracking;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Collectors.GatherCollectors
|
||||
{
|
||||
public class LogParserCollector : IGatherRuleCollector
|
||||
|
||||
+2
@@ -7,6 +7,8 @@ using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Collectors.GatherCollectors
|
||||
{
|
||||
public class XmlCollector : IGatherRuleCollector
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ using System.Threading;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Interop;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
using Microsoft.Win32;
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Agent.Core.Security;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Analyzers;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages agent analyzers: initialization from remote config, startup execution
|
||||
+1
-1
@@ -5,7 +5,7 @@ using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Security;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Handles agent cleanup on enrollment completion:
|
||||
+2
-1
@@ -5,13 +5,14 @@ using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Collectors;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Replay;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Tracking;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages collector lifecycle: start/stop, idle detection, restart after activity,
|
||||
+5
-4
@@ -6,10 +6,11 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Shared;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Result of a diagnostics package upload attempt.
|
||||
@@ -134,15 +135,15 @@ namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
foreach (var entry in _configuration.DiagnosticsLogPaths ?? new System.Collections.Generic.List<Shared.Models.DiagnosticsLogPath>())
|
||||
{
|
||||
// Resolve %LOGGED_ON_USER_PROFILE% token and get profile path for guard exception
|
||||
var userProfilePath = Collectors.UserProfileResolver.ContainsUserProfileToken(entry.Path)
|
||||
? Collectors.UserProfileResolver.GetLoggedOnUserProfilePath() : null;
|
||||
var userProfilePath = UserProfileResolver.ContainsUserProfileToken(entry.Path)
|
||||
? UserProfileResolver.GetLoggedOnUserProfilePath() : null;
|
||||
|
||||
if (!Collectors.DiagnosticsPathGuards.IsDiagnosticsPathAllowed(entry.Path, _configuration.UnrestrictedMode, userProfilePath))
|
||||
{
|
||||
_logger.Warning($"Diagnostics path blocked by guard: {entry.Path}");
|
||||
continue;
|
||||
}
|
||||
var expandedPath = Collectors.UserProfileResolver.ExpandCustomTokens(entry.Path);
|
||||
var expandedPath = UserProfileResolver.ExpandCustomTokens(entry.Path);
|
||||
if (expandedPath == null)
|
||||
{
|
||||
_logger.Warning($"Diagnostics path skipped (no user session for token): {entry.Path}");
|
||||
+2
-1
@@ -7,12 +7,13 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Tracking;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Thin coordinator for the Autopilot Monitor Agent. Delegates to:
|
||||
+2
-1
@@ -4,11 +4,12 @@ using System.Threading;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Collectors;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages periodic collectors (PerformanceCollector, AgentSelfMetricsCollector) and their
|
||||
+1
-1
@@ -5,7 +5,7 @@ using AutopilotMonitor.Agent.Core.Monitoring.Interop;
|
||||
using Microsoft.Win32;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Watches a registry key for changes using RegNotifyChangeKeyValue.
|
||||
+1
-1
@@ -5,7 +5,7 @@ using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes server-issued actions delivered via ingest responses.
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages persistent session ID storage to maintain tracking across agent restarts
|
||||
+2
-1
@@ -2,8 +2,9 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Management;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Collectors;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Collectors
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Resolves the custom %LOGGED_ON_USER_PROFILE% token to the logged-on user's profile path.
|
||||
+1
-1
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Interop;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Launches a process in the logged-in user's desktop session from a SYSTEM context.
|
||||
+1
-1
@@ -5,7 +5,7 @@ using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Core
|
||||
namespace AutopilotMonitor.Agent.Core.Monitoring.Runtime
|
||||
{
|
||||
/// <summary>
|
||||
/// Consumes the three self-update marker files written by SelfUpdater on every agent startup
|
||||
@@ -5,6 +5,7 @@ using System.Reflection;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Shared;
|
||||
using Microsoft.Win32;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Collectors;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Network;
|
||||
using AutopilotMonitor.Shared;
|
||||
using AutopilotMonitor.Shared.Models;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using AutopilotMonitor.Agent.Core.Configuration;
|
||||
using AutopilotMonitor.Agent.Core.Logging;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Core;
|
||||
using AutopilotMonitor.Agent.Core.Monitoring.Runtime;
|
||||
using AutopilotMonitor.Agent.Core.Security;
|
||||
using AutopilotMonitor.Shared;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user