Resolve git conflict markers in package-lock.json or a YAML lockfile

$0.005 USDC per call · Developer and security · POST /api/v1/lockfile-merge · Id lockfile-merge

Takes a lockfile (package-lock.json or a YAML lockfile such as pnpm-lock.yaml) containing git merge-conflict markers, rebuilds both sides, and merges them key by key (using the diff3 base when present), returning the resolved file or the exact conflicting key paths with both values, for agents rebasing or merging branches. An optional prefer=ours|theirs applies one explicit policy to the remaining conflicts. A merged lockfile is not validated against the registry or dependency graph: run the package manager to regenerate it. yarn.lock and other non-JSON/YAML formats are not supported.

What you get

Resolves lockfile conflicts deterministically instead of hand-editing thousands of lines.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/lockfile-merge. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/lockfile-merge \
  -H 'content-type: application/json' \
  -d '{"content":"{\n  \"packages\": {\n<<<<<<< HEAD\n    \"node_modules/a\": { \"version\": \"1.0.0\" },\n=======\n    \"node_modules/b\": { \"version\": \"2.0.0\" },\n>>>>>>> feature\n    \"node_modules/c\": { \"version\": \"3.0.0\" }\n  }\n}\n"}'

Input

FieldTypeRequiredDescription
contentstring; length 0..200000yesWhole file text; YAML at most 100000 characters.
formatstring; one of "auto", "json", "yaml"noDefault auto: JSON when the file starts with { or [.
preferstring; one of "none", "ours", "theirs"noPolicy for keys changed on both sides. Default none: report them.

Example request body

{
  "content": "{\n  \"packages\": {\n<<<<<<< HEAD\n    \"node_modules/a\": { \"version\": \"1.0.0\" },\n=======\n    \"node_modules/b\": { \"version\": \"2.0.0\" },\n>>>>>>> feature\n    \"node_modules/c\": { \"version\": \"3.0.0\" }\n  }\n}\n"
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
formatstringno
hunksintegerno
baseKnownbooleanno
autoMergedintegernoKeys that appear on one side only and were carried over.
conflictCountintegerno
conflictsarray<object>no
resolvedstringnoMerged file text, present only when no conflict remains.
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the code-preflight-kit package.

Machine-readable