feat(installer): pull in preflight check implementations as prerequisite for SystemCheckPage

Git/GitIdentity/Port/WriteAccess and Claude CLI/Version/Auth/PermissionModeAuto
checks plus the ExecutableResolver they depend on were built in two sibling
task branches that hadn't landed on main yet. Vendored the finished files in
from those branches (same content, verified building + tests green) so the
SystemCheckPage task has something to consume.
This commit is contained in:
mika kuns
2026-08-05 19:56:07 +02:00
parent bdee731376
commit 05be07b28c
30 changed files with 1683 additions and 3 deletions
@@ -0,0 +1,37 @@
using ClaudeDo.Installer.Core;
namespace ClaudeDo.Installer.Checks;
public sealed record EnvironmentCheckReport(IReadOnlyList<CheckResult> Results)
{
public bool HasBlockingError => Results.Any(r => r.Severity == CheckSeverity.Error && r.Status == CheckStatus.Failed);
}
public sealed class EnvironmentCheckService
{
private readonly IReadOnlyList<IEnvironmentCheck> _checks;
public EnvironmentCheckService(IEnumerable<IEnvironmentCheck> checks)
{
_checks = checks.ToList();
}
public async Task<EnvironmentCheckReport> RunAllAsync(InstallContext ctx, CancellationToken ct)
{
var tasks = _checks.Select(check => RunSafeAsync(check, ctx, ct)).ToArray();
var results = await Task.WhenAll(tasks);
return new EnvironmentCheckReport(results);
}
private static async Task<CheckResult> RunSafeAsync(IEnvironmentCheck check, InstallContext ctx, CancellationToken ct)
{
try
{
return await check.RunAsync(ctx, ct);
}
catch (Exception ex)
{
return CheckResult.Unknown(check.Id, check.Severity, string.Empty, ex.Message, ex.Message);
}
}
}