Text conflict parse
text-conflict-parse · version 1.0.0 · Text · free, no key needed
Parse merge or diff3 conflict-marker text into ordered text and conflict parts.
Use when you need to: text conflict parse · parse conflict marker blocks · split merge conflict text into parts.
Decide before calling
Read the versioned contract and the supported scope below. Reuse text-conflict-parse@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use text-conflict-parse@1.0.0 for text conflict parse. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- text conflict parse
- parse conflict marker blocks
- split merge conflict text into parts
Not supported
- nested conflict markers
- git mergetool filesystem access
- unicode normalization
- fuzzy matching
- RFC 6902 JSON Patch
Behavior
- text is scanned as line records; conflict blocks start at a line whose text begins with "<<<<< " plus a nonempty label.
- A merge block is ours lines, a line whose text is "=======", theirs lines, then a ">>>>>>> " closer. diff3 inserts a "||||||| " base section before =======.
- Nested <<<<<<< markers, missing closers, unknown marker order, and ||||||| without a following ======= are rejected.
- parts is an ordered list of {type:"text", text} or {type:"conflict", ours, theirs} with base only when a ||||||| section existed.
- ours, theirs, and base are the inner texts without marker lines, preserving inner bytes including original record eols.
- conflict_count is the number of conflict parts. Empty text yields no parts and conflict_count 0.
Input
text(string, required): max length 262144
Output
parts(array of object, required)conflict_count(integer, required): min 0
Limits
- max text bytes: 262144
- max line count: 4096
- max line bytes: 16384
- max output bytes: 1048576
Example
Request input:
{
"text": "keep\n<<<<<<< ours\naaa\n=======\nbbb\n>>>>>>> theirs\n"
}
Response:
{
"result": {
"parts": [
{
"type": "text",
"text": "keep\n"
},
{
"type": "conflict",
"ours": "aaa\n",
"theirs": "bbb\n"
}
],
"conflict_count": 1
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "text-conflict-parse",
"version": "1.0.0",
"input": {
"text": "keep\n<<<<<<< ours\naaa\n=======\nbbb\n>>>>>>> theirs\n"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/text-conflict-parse/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"text":"keep\n<<<<<<< ours\naaa\n=======\nbbb\n>>>>>>> theirs\n"}'
The machine-readable contract is at /v1/tools/text-conflict-parse/versions/1.0.0.
CLI
node cli.mjs run text-conflict-parse 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Text conflict render: Render text and conflict parts as merge or diff3 conflict-marker text.
- Markdown sections chunk: Chunk a CommonMark document into sections at its top-level ATX and setext headings, with levels, paths and spans.
- Text delimiter chunk: Split text on an explicit literal delimiter (Python str.split rules, optional max_splits) with spans and line numbers.
- Text paragraphs split: Split text into paragraphs separated by blank lines (CommonMark line rules) with code point spans and line numbers.
- Text sentences chunk: Pack whole UAX #29 sentences into chunks of at most max_size code points, UTF-16 units or UTF-8 bytes.
- Text sentences split: Split text into sentences using the default Unicode UAX #29 sentence boundary rules (Unicode 17.0.0).