refactor(claude-do): refactor(worker): move the merge and worktree MCP tools out

`src/ClaudeDo.Worker/External/ExternalMcpService.cs` ist **1897 Zeilen** (nachgezählt 2026-09-02; die Datei ist seit dem Anlegen dieses Tasks von 1696 weiter gewachsen): ~30 DTO-Records oben plus ~25 Tool-Methoden — während **13** Geschwisterdateien `*McpTools.cs` im selben Ordner das Topic-Split-Muster schon tragen (`ListMcpTools`, `ConfigMcpTools`, `BatchMcpTools`, `NotesMcpTools`, `QueueStateMc

ClaudeDo-Task: 1862e160-ffde-4a50-aa03-bb7251f56088
This commit is contained in:
Mika Kuns
2026-09-02 13:28:33 +02:00
parent 7a0b97df59
commit 7bcca3647e
9 changed files with 479 additions and 1761 deletions
+7 -2
View File
@@ -85,8 +85,13 @@ public sealed class BatchMcpTools
};
private readonly ExternalMcpService _svc;
private readonly WorktreeMcpTools _worktree;
public BatchMcpTools(ExternalMcpService svc) => _svc = svc;
public BatchMcpTools(ExternalMcpService svc, WorktreeMcpTools worktree)
{
_svc = svc;
_worktree = worktree;
}
[McpServerTool, Description(
"Fetch a snapshot of many tasks in one call — use for an overview or polling a fan-out instead of " +
@@ -365,7 +370,7 @@ public sealed class BatchMcpTools
var id = taskIds[i];
try
{
var r = await _svc.CleanupTaskWorktree(id, force, cancellationToken);
var r = await _worktree.CleanupTaskWorktree(id, force, cancellationToken);
results.Add(new BatchCleanupResult(id, true, r.Removed, r.BranchDeleted, null, r.Number));
}
catch (OperationCanceledException) { throw; }
+1
View File
@@ -9,6 +9,7 @@ using ClaudeDo.Worker.Git;
using ClaudeDo.Worker.Hub;
using ClaudeDo.Worker.Lifecycle;
using ClaudeDo.Worker.Planning;
using Microsoft.EntityFrameworkCore;
using ModelContextProtocol;
using ModelContextProtocol.Server;
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;
+3
View File
@@ -1,10 +1,13 @@
using System.ComponentModel;
using System.Diagnostics;
using ClaudeDo.Data;
using ClaudeDo.Data.Git;
using ClaudeDo.Data.Models;
using ClaudeDo.Data.Repositories;
using ClaudeDo.Worker.Git;
using ClaudeDo.Worker.Lifecycle;
using ClaudeDo.Worker.Worktrees;
using Microsoft.EntityFrameworkCore;
using ModelContextProtocol;
using ModelContextProtocol.Server;
using TaskStatus = ClaudeDo.Data.Models.TaskStatus;