refactor(ui): bring IWorkerClient to parity with WorkerClient
Add 16 missing members to IWorkerClient (IsReconnecting, WorkerLogReceivedEvent, PrimeFired, LastApproveTarget, Refresh/RestoreDefaultAgents, UpdateAppSettings, prime schedule CRUD, UpdateList/UpdateListConfig, all worktree ops). Switch all production consumers off the concrete WorkerClient type; only Program.cs/App host still resolves the concrete registration. Update StubWorkerClient and FakeWorkerClient to satisfy the expanded interface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,8 @@ sealed class FakeWorkerClient : IWorkerClient
|
||||
public int WakeQueueCalls { get; private set; }
|
||||
|
||||
public bool IsConnected => false;
|
||||
public bool IsReconnecting => false;
|
||||
public string? LastApproveTarget => null;
|
||||
#pragma warning disable CS0067 // events required by IWorkerClient but not exercised by this fake
|
||||
public event System.ComponentModel.PropertyChangedEventHandler? PropertyChanged;
|
||||
public event Action<string, string, DateTime>? TaskStartedEvent;
|
||||
@@ -30,6 +32,7 @@ sealed class FakeWorkerClient : IWorkerClient
|
||||
public event Action<string>? WorktreeUpdatedEvent;
|
||||
public event Action<string>? ListUpdatedEvent;
|
||||
public event Action<string, string>? TaskMessageEvent;
|
||||
public event Action<WorkerLogEntry>? WorkerLogReceivedEvent;
|
||||
public void RaiseTaskUpdated(string taskId) => TaskUpdatedEvent?.Invoke(taskId);
|
||||
public void RaiseWorktreeUpdated(string taskId) => WorktreeUpdatedEvent?.Invoke(taskId);
|
||||
public void RaiseTaskMessage(string taskId, string line) => TaskMessageEvent?.Invoke(taskId, line);
|
||||
@@ -39,6 +42,8 @@ sealed class FakeWorkerClient : IWorkerClient
|
||||
public Task ResetTaskAsync(string taskId) => Task.CompletedTask;
|
||||
public Task CancelTaskAsync(string taskId) => Task.CompletedTask;
|
||||
public Task<List<AgentInfo>> GetAgentsAsync() => Task.FromResult(new List<AgentInfo>());
|
||||
public Task RefreshAgentsAsync() => Task.CompletedTask;
|
||||
public Task<SeedResultDto?> RestoreDefaultAgentsAsync() => Task.FromResult<SeedResultDto?>(null);
|
||||
public Task<ListConfigDto?> GetListConfigAsync(string listId) => Task.FromResult<ListConfigDto?>(null);
|
||||
public Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto) => Task.CompletedTask;
|
||||
public Task SetTaskStatusAsync(string taskId, TaskStatus status) => Task.CompletedTask;
|
||||
@@ -76,6 +81,7 @@ sealed class FakeWorkerClient : IWorkerClient
|
||||
public event Action<string, string, IReadOnlyList<string>>? PlanningMergeConflictEvent;
|
||||
public event Action<string>? PlanningMergeAbortedEvent;
|
||||
public event Action<string>? PlanningCompletedEvent;
|
||||
public event Action<PrimeFiredEvent>? PrimeFired;
|
||||
#pragma warning restore CS0067
|
||||
|
||||
public Task<MergeTargetsDto?> GetMergeTargetsAsync(string taskId) => Task.FromResult<MergeTargetsDto?>(null);
|
||||
@@ -85,6 +91,17 @@ sealed class FakeWorkerClient : IWorkerClient
|
||||
public Task AbortPlanningMergeAsync(string planningTaskId) => Task.CompletedTask;
|
||||
|
||||
public Task<AppSettingsDto?> GetAppSettingsAsync() => Task.FromResult<AppSettingsDto?>(null);
|
||||
public Task UpdateAppSettingsAsync(AppSettingsDto dto) => Task.CompletedTask;
|
||||
public Task<List<PrimeScheduleDto>> GetPrimeSchedulesAsync() => Task.FromResult(new List<PrimeScheduleDto>());
|
||||
public Task<PrimeScheduleDto?> UpsertPrimeScheduleAsync(PrimeScheduleDto dto) => Task.FromResult<PrimeScheduleDto?>(null);
|
||||
public Task DeletePrimeScheduleAsync(Guid id) => Task.CompletedTask;
|
||||
public Task UpdateListAsync(UpdateListDto dto) => Task.CompletedTask;
|
||||
public Task UpdateListConfigAsync(UpdateListConfigDto dto) => Task.CompletedTask;
|
||||
public Task<WorktreeCleanupDto?> CleanupFinishedWorktreesAsync(string? listId = null) => Task.FromResult<WorktreeCleanupDto?>(null);
|
||||
public Task<WorktreeResetDto?> ResetAllWorktreesAsync() => Task.FromResult<WorktreeResetDto?>(null);
|
||||
public Task<List<WorktreeOverviewDto>> GetWorktreesOverviewAsync(string? listId) => Task.FromResult(new List<WorktreeOverviewDto>());
|
||||
public Task<(bool Ok, string? Error)> SetWorktreeStateAsync(string taskId, WorktreeState newState) => Task.FromResult((true, (string?)null));
|
||||
public Task<ForceRemoveResultDto?> ForceRemoveWorktreeAsync(string taskId) => Task.FromResult<ForceRemoveResultDto?>(null);
|
||||
public Task<string?> GetWeekReportAsync(DateOnly start, DateOnly end) => Task.FromResult<string?>(null);
|
||||
public Task<string> GenerateWeekReportAsync(DateOnly start, DateOnly end) => Task.FromResult("");
|
||||
public Task<bool> RunDailyPrepNowAsync() => Task.FromResult(false);
|
||||
|
||||
Reference in New Issue
Block a user