Skip to content

Commit 5525000

Browse files
sharpninjaCopilot
andcommitted
fix: eliminate VM004, VM005, VM006 violations in MainWindowViewModel
Replace direct Process.Start calls with _processLauncher service methods. Replace Timer/FileSystemWatcher with _timerService/_serviceFactory abstractions. Replace JsonDocument.Parse/JsonNode.Parse with _jsonParser service methods. Move WatchFileSystem factory method to McpServiceFactory to avoid FileSystemWatcher type name in ViewModel file. Remove dead code: OnAgentsReadmeFileChanged, OnAgentsReadmeFileRenamed, OnAgentsReadmeWatcherError event handlers (replaced by watcher callback). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6feeeab commit 5525000

2 files changed

Lines changed: 190 additions & 287 deletions

File tree

src/McpServerManager.Core/Services/McpServiceFactory.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using McpServer.Client;
3+
using McpServer.UI.Core.Services;
34

45
namespace McpServerManager.Core.Services;
56

@@ -72,4 +73,10 @@ public McpAgentEventStreamService CreateEventStreamService(
7273
resolveApiKey: resolveApiKey,
7374
resolveWorkspacePath: resolveWorkspacePath);
7475
}
76+
77+
/// <summary>
78+
/// Watches a directory for file changes matching the given filter.
79+
/// </summary>
80+
public IWatcherHandle WatchFileSystem(string directory, string filter, Action<string> onChanged)
81+
=> new Infrastructure.FileSystemWatcherService().Watch(directory, filter, onChanged);
7582
}

0 commit comments

Comments
 (0)