feat(mcp): expose the conflict resolver's hunk API over MCP
get_merge_conflicts and resolve_conflict_hunk let an MCP caller resolve a leaveConflictsInTree merge hunk-by-hunk (ours/theirs/base/literal text) instead of grep-parsing diff3 markers itself. Reuses the existing TaskMergeService/ConflictMarkerParser machinery (adds MergeSegment.StartLine and a non-staging TaskMergeService.WriteConflictFileAsync) rather than a second parser. A partially resolved file is written without git add so continue_merge keeps refusing while any hunk still has markers.
This commit is contained in:
+11
@@ -25,4 +25,15 @@ internal static class McpToolDocs
|
||||
|
||||
/// <summary>Mutations that refuse to touch a task while its agent is running.</summary>
|
||||
public const string NotWhileRunning = " Refused while the task is Running — cancel it first.";
|
||||
|
||||
/// <summary>
|
||||
/// Explains this project's diff3 conflict-marker layout so a caller grepping only for
|
||||
/// "<<<<<<</=======/>>>>>>>" doesn't mistake the "|||||||" base section for one of the two sides.
|
||||
/// No leading space (unlike the other consts here) since it also doubles as a DTO field default value.
|
||||
/// </summary>
|
||||
public const string Diff3Note =
|
||||
"Conflicts are parsed in git's diff3 style: each hunk has an 'ours' side (the target branch) and a " +
|
||||
"'theirs' side (the branch being merged in), plus an optional 'base' — the common-ancestor text for that " +
|
||||
"hunk, shown between a third '|||||||' marker and the '=======' separator. base is null when git recorded " +
|
||||
"none for that hunk.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user