Merge branch 'claudedo/c1d2a92d8d8c4705ac93d5f0b2cacaa0'
This commit is contained in:
+10
-5
@@ -10,7 +10,9 @@ public sealed record BatchSetMyDayInput(string TaskId, bool IsMyDay, int? SortOr
|
||||
// taskFull is populated when found and includeDescription=true (full task incl.
|
||||
// Description/Result). Both are null when found=false.
|
||||
public sealed record BatchGetTaskResult(string Id, bool Found, TaskRefDto? Task, TaskDto? TaskFull, string? Error);
|
||||
public sealed record BatchAddTaskResult(int Index, string Title, bool Ok, TaskRefDto? Task, string? Error);
|
||||
public sealed record BatchAddTaskResult(
|
||||
int Index, string Title, bool Ok, TaskRefDto? Task,
|
||||
IReadOnlyList<PossibleDuplicateDto>? PossibleDuplicates, string? Error);
|
||||
public sealed record BatchTaskResult(string TaskId, bool Ok, string? Error);
|
||||
public sealed record BatchCancelResult(string TaskId, bool Ok, bool Cancelled, string? Error);
|
||||
public sealed record BatchCleanupResult(string TaskId, bool Ok, bool Removed, bool BranchDeleted, string? Error);
|
||||
@@ -76,8 +78,11 @@ public sealed class BatchMcpTools
|
||||
"Create many tasks in one list at once. Each item: { title, description?, model? } " +
|
||||
"(model: haiku|sonnet|opus, blank = inherit list/global default). " +
|
||||
"queueImmediately enqueues every created task. " +
|
||||
"Returns one result per item: { index, title, ok, task, error }; task is a lean reference " +
|
||||
"(id, listId, title, status, sortOrder, isMyDay), not the description you just sent. Max 100 items.")]
|
||||
"Returns one result per item: { index, title, ok, task, possibleDuplicates, error }; task is " +
|
||||
"a lean reference (id, listId, title, status, sortOrder, isMyDay), not the description you just " +
|
||||
"sent. Each item is always created — possibleDuplicates is a non-blocking heads-up (up to 3 open " +
|
||||
"tasks in the same list with a strongly overlapping title, id/title/status only); check it and " +
|
||||
"mention any hit to the caller, but do not treat it as an error. Max 100 items.")]
|
||||
public async Task<IReadOnlyList<BatchAddTaskResult>> BatchAddTasks(
|
||||
string listId,
|
||||
BatchAddTaskInput[] tasks,
|
||||
@@ -96,12 +101,12 @@ public sealed class BatchMcpTools
|
||||
var created = await _svc.AddTask(
|
||||
listId, item.Title, item.Description, createdBy,
|
||||
queueImmediately, item.Model, cancellationToken);
|
||||
results.Add(new BatchAddTaskResult(i, item.Title, true, created, null));
|
||||
results.Add(new BatchAddTaskResult(i, item.Title, true, created.Task, created.PossibleDuplicates, null));
|
||||
}
|
||||
catch (OperationCanceledException) { throw; }
|
||||
catch (Exception ex)
|
||||
{
|
||||
results.Add(new BatchAddTaskResult(i, item.Title, false, null, ex.Message));
|
||||
results.Add(new BatchAddTaskResult(i, item.Title, false, null, null, ex.Message));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
||||
Reference in New Issue
Block a user