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:
@@ -22,6 +22,7 @@ public abstract class StubWorkerClient : IWorkerClient
|
||||
public event Action<string>? WorktreeUpdatedEvent;
|
||||
public event Action<string>? ListUpdatedEvent;
|
||||
public event Action<string, string>? TaskMessageEvent;
|
||||
public event Action<WorkerLogEntry>? WorkerLogReceivedEvent;
|
||||
public event Action? PrepStartedEvent;
|
||||
public event Action<string>? PrepLineEvent;
|
||||
public event Action<bool>? PrepFinishedEvent;
|
||||
@@ -32,6 +33,7 @@ public abstract class StubWorkerClient : 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 int ClearMyDayCalls { get; private set; }
|
||||
@@ -42,6 +44,8 @@ public abstract class StubWorkerClient : IWorkerClient
|
||||
public void RaisePrepFinished(bool ok) => PrepFinishedEvent?.Invoke(ok);
|
||||
|
||||
public virtual bool IsConnected => false;
|
||||
public virtual bool IsReconnecting => false;
|
||||
public virtual string? LastApproveTarget => null;
|
||||
|
||||
public virtual Task WakeQueueAsync() => Task.CompletedTask;
|
||||
public virtual Task RunNowAsync(string taskId) => Task.CompletedTask;
|
||||
@@ -49,6 +53,8 @@ public abstract class StubWorkerClient : IWorkerClient
|
||||
public virtual Task ResetTaskAsync(string taskId) => Task.CompletedTask;
|
||||
public virtual Task CancelTaskAsync(string taskId) => Task.CompletedTask;
|
||||
public virtual Task<List<AgentInfo>> GetAgentsAsync() => Task.FromResult(new List<AgentInfo>());
|
||||
public virtual Task RefreshAgentsAsync() => Task.CompletedTask;
|
||||
public virtual Task<SeedResultDto?> RestoreDefaultAgentsAsync() => Task.FromResult<SeedResultDto?>(null);
|
||||
public virtual Task<ListConfigDto?> GetListConfigAsync(string listId) => Task.FromResult<ListConfigDto?>(null);
|
||||
public virtual Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto) => Task.CompletedTask;
|
||||
public virtual Task SetTaskStatusAsync(string taskId, TaskStatus status) => Task.CompletedTask;
|
||||
@@ -83,6 +89,17 @@ public abstract class StubWorkerClient : IWorkerClient
|
||||
public virtual Task<bool> RunDailyPrepNowAsync() { RunDailyPrepNowCalls++; return Task.FromResult(false); }
|
||||
public virtual Task ClearMyDayAsync() { ClearMyDayCalls++; return Task.CompletedTask; }
|
||||
public virtual Task<AppSettingsDto?> GetAppSettingsAsync() => Task.FromResult<AppSettingsDto?>(null);
|
||||
public virtual Task UpdateAppSettingsAsync(AppSettingsDto dto) => Task.CompletedTask;
|
||||
public virtual Task<List<PrimeScheduleDto>> GetPrimeSchedulesAsync() => Task.FromResult(new List<PrimeScheduleDto>());
|
||||
public virtual Task<PrimeScheduleDto?> UpsertPrimeScheduleAsync(PrimeScheduleDto dto) => Task.FromResult<PrimeScheduleDto?>(null);
|
||||
public virtual Task DeletePrimeScheduleAsync(Guid id) => Task.CompletedTask;
|
||||
public virtual Task UpdateListAsync(UpdateListDto dto) => Task.CompletedTask;
|
||||
public virtual Task UpdateListConfigAsync(UpdateListConfigDto dto) => Task.CompletedTask;
|
||||
public virtual Task<WorktreeCleanupDto?> CleanupFinishedWorktreesAsync(string? listId = null) => Task.FromResult<WorktreeCleanupDto?>(null);
|
||||
public virtual Task<WorktreeResetDto?> ResetAllWorktreesAsync() => Task.FromResult<WorktreeResetDto?>(null);
|
||||
public virtual Task<List<WorktreeOverviewDto>> GetWorktreesOverviewAsync(string? listId) => Task.FromResult(new List<WorktreeOverviewDto>());
|
||||
public virtual Task<(bool Ok, string? Error)> SetWorktreeStateAsync(string taskId, WorktreeState newState) => Task.FromResult((true, (string?)null));
|
||||
public virtual Task<ForceRemoveResultDto?> ForceRemoveWorktreeAsync(string taskId) => Task.FromResult<ForceRemoveResultDto?>(null);
|
||||
public virtual Task<List<DailyNoteDto>> GetDailyNotesAsync(DateOnly day) => Task.FromResult(new List<DailyNoteDto>());
|
||||
public virtual Task<DailyNoteDto?> AddDailyNoteAsync(DateOnly day, string text) => Task.FromResult<DailyNoteDto?>(null);
|
||||
public virtual Task UpdateDailyNoteAsync(string id, string text) => Task.CompletedTask;
|
||||
|
||||
Reference in New Issue
Block a user