Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/patch-anchor

Applies unified-diff hunks (wrong line numbers are fine) or search/replace blocks to a supplied file text and returns the patched text, for an agent whose edit tool failed or whose diff has drifted line numbers. Each hunk is located by its content against the original file, trying exact, trailing-whitespace, outer-whitespace then collapsed-whitespace matching; the rung used is reported per hunk. I

BaseUnchecked
POSThttps://agents.writerslogic.com/api/v1/patch-anchor

UptimeNot checked yet

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agents.writerslogic.com/api/v1/patch-anchor", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"diff":"@@ -40,3 +40,3 @@\n function sub(a, b) {\n-  return a - b;\n+  return b - a;\n }\n","file":"function add(a, b) {\n  return a + b;\n}\n\nfunction sub(a, b) {\n  return a - b;\n}\n"}),
});
console.log(await res.json());

Example input

{
  "diff": "@@ -40,3 +40,3 @@\n function sub(a, b) {\n-  return a - b;\n+  return b - a;\n }\n",
  "file": "function add(a, b) {\n  return a + b;\n}\n\nfunction sub(a, b) {\n  return a - b;\n}\n"
}