feat(ui): WorkerClient supports list/task agent settings + ListUpdated event
This commit is contained in:
@@ -45,6 +45,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
|||||||
public event Action<string>? TaskUpdatedEvent;
|
public event Action<string>? TaskUpdatedEvent;
|
||||||
public event Action<string>? WorktreeUpdatedEvent;
|
public event Action<string>? WorktreeUpdatedEvent;
|
||||||
public event Action<string>? RunNowRequestedEvent;
|
public event Action<string>? RunNowRequestedEvent;
|
||||||
|
public event Action<string>? ListUpdatedEvent;
|
||||||
|
|
||||||
public WorkerClient(string signalRUrl)
|
public WorkerClient(string signalRUrl)
|
||||||
{
|
{
|
||||||
@@ -110,6 +111,11 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
|||||||
{
|
{
|
||||||
Dispatcher.UIThread.Post(() => WorktreeUpdatedEvent?.Invoke(taskId));
|
Dispatcher.UIThread.Post(() => WorktreeUpdatedEvent?.Invoke(taskId));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_hub.On<string>("ListUpdated", listId =>
|
||||||
|
{
|
||||||
|
Dispatcher.UIThread.Post(() => ListUpdatedEvent?.Invoke(listId));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task StartAsync()
|
public Task StartAsync()
|
||||||
@@ -271,6 +277,26 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
|||||||
await _hub.InvokeAsync("UpdateAppSettings", dto);
|
await _hub.InvokeAsync("UpdateAppSettings", dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task UpdateListAsync(UpdateListDto dto)
|
||||||
|
{
|
||||||
|
await _hub.InvokeAsync("UpdateList", dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateListConfigAsync(UpdateListConfigDto dto)
|
||||||
|
{
|
||||||
|
await _hub.InvokeAsync("UpdateListConfig", dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ListConfigDto?> GetListConfigAsync(string listId)
|
||||||
|
{
|
||||||
|
return await _hub.InvokeAsync<ListConfigDto?>("GetListConfig", listId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto)
|
||||||
|
{
|
||||||
|
await _hub.InvokeAsync("UpdateTaskAgentSettings", dto);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<WorktreeCleanupDto?> CleanupFinishedWorktreesAsync()
|
public async Task<WorktreeCleanupDto?> CleanupFinishedWorktreesAsync()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -318,3 +344,7 @@ public sealed record WorktreeCleanupDto(int Removed);
|
|||||||
public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);
|
public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks);
|
||||||
public record MergeResultDto(string Status, IReadOnlyList<string> ConflictFiles, string? ErrorMessage);
|
public record MergeResultDto(string Status, IReadOnlyList<string> ConflictFiles, string? ErrorMessage);
|
||||||
public record MergeTargetsDto(string DefaultBranch, IReadOnlyList<string> LocalBranches);
|
public record MergeTargetsDto(string DefaultBranch, IReadOnlyList<string> LocalBranches);
|
||||||
|
public sealed record UpdateListDto(string Id, string Name, string? WorkingDir, string DefaultCommitType);
|
||||||
|
public sealed record UpdateListConfigDto(string ListId, string? Model, string? SystemPrompt, string? AgentPath);
|
||||||
|
public sealed record UpdateTaskAgentSettingsDto(string TaskId, string? Model, string? SystemPrompt, string? AgentPath);
|
||||||
|
public sealed record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user