Merge claudedo/c4930a56575e45b2ae9be47b1c49eb39
This commit is contained in:
@@ -57,6 +57,10 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
Task<PendingQuestionDto?> GetPendingQuestionAsync(string taskId);
|
||||
Task ResetTaskAsync(string taskId);
|
||||
Task CancelTaskAsync(string taskId);
|
||||
/// <summary>Deletes a task via the worker (mirrors the MCP delete_task tool), so a deleted
|
||||
/// child correctly advances a WaitingForChildren parent. Returns (false, message) instead of
|
||||
/// throwing when the task has children or is running, preserving the FK-error UX.</summary>
|
||||
Task<(bool Ok, string? Error)> DeleteTaskAsync(string taskId);
|
||||
Task<List<AgentInfo>> GetAgentsAsync();
|
||||
Task RefreshAgentsAsync();
|
||||
Task<SeedResultDto?> RestoreDefaultAgentsAsync();
|
||||
|
||||
@@ -327,6 +327,19 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
await _hub.InvokeAsync("CancelTask", taskId);
|
||||
}
|
||||
|
||||
public async Task<(bool Ok, string? Error)> DeleteTaskAsync(string taskId)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _hub.InvokeAsync("DeleteTask", taskId, CancellationToken.None);
|
||||
return (true, null);
|
||||
}
|
||||
catch (HubException ex)
|
||||
{
|
||||
return (false, ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task WakeQueueAsync()
|
||||
{
|
||||
await _hub.InvokeAsync("WakeQueue");
|
||||
|
||||
Reference in New Issue
Block a user