refactor: drop the remaining single-implementation interfaces
IBaseDirtyChecker, IInteractiveLaunchSpecService and the LaunchSpec wrapper had one implementation and one caller each; ProcessRunnerAdapter existed only to give a static class an interface, and InstallArtifactLocator used inheritance for two constructor arguments. The external MCP container now shares its singletons through a Share<T> helper instead of 17 near-identical registrations.
This commit is contained in:
@@ -128,7 +128,7 @@ public partial class App : Application
|
||||
|
||||
// Environment checks — stateless, so their infrastructure is shared; ClaudeCliLookup is
|
||||
// rebuilt per EnvironmentCheckService instance so a re-check doesn't reuse a stale result.
|
||||
sc.AddSingleton<IProcessRunner, ProcessRunnerAdapter>();
|
||||
sc.AddSingleton<IProcessRunner, ProcessRunner>();
|
||||
sc.AddSingleton<IProcessLauncher, ProcessLauncher>();
|
||||
sc.AddSingleton<IPortOwnerResolver, NetstatPortOwnerResolver>();
|
||||
sc.AddSingleton<ClaudeHelpLauncher>();
|
||||
|
||||
@@ -2,10 +2,17 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using ClaudeDo.Installer.Core.Interfaces;
|
||||
|
||||
namespace ClaudeDo.Installer.Core;
|
||||
|
||||
public static class ProcessRunner
|
||||
public sealed class ProcessRunner : IProcessRunner
|
||||
{
|
||||
/// The injectable, progress-less shape. Everything else calls the static overload directly.
|
||||
public Task<(int ExitCode, string Output)> RunAsync(
|
||||
string fileName, string arguments, string? workingDirectory, CancellationToken ct)
|
||||
=> RunAsync(fileName, arguments, workingDirectory, progress: null, ct);
|
||||
|
||||
public static async Task<(int ExitCode, string Output)> RunAsync(
|
||||
string fileName,
|
||||
string arguments,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using ClaudeDo.Installer.Core.Interfaces;
|
||||
|
||||
namespace ClaudeDo.Installer.Core;
|
||||
|
||||
public sealed class ProcessRunnerAdapter : IProcessRunner
|
||||
{
|
||||
public Task<(int ExitCode, string Output)> RunAsync(string fileName, string arguments, string? workingDirectory, CancellationToken ct) =>
|
||||
ProcessRunner.RunAsync(fileName, arguments, workingDirectory, progress: null, ct);
|
||||
}
|
||||
Reference in New Issue
Block a user