Redwood Agent Supply Redwood Agent Supply

Unified diff and patch verifier

Generate a unified diff or dry-run a patch at exact line coordinates, with a SHA-256 output digest.

$0.03

One call: the result comes back in the paid request.

Sample product output

{
  "added_lines": 1,
  "hunks": 1,
  "limits": [
    "Max 32768 UTF-8 bytes and 1000 LF-delimited lines per source or result.",
    "Max 131072 UTF-8 patch bytes, 2504 patch lines, and 500 hunks.",
    "Single-file unified text patches with file headers, exact coordinates and no fuzz.",
    "Git metadata and multi-file patches are refused. HTTP request bodies are capped at 64 KB."
  ],
  "modified_sha256": "17cbbec0b19b84e7729ef8bba7e45944bfa331f56fa873b4e796d1730b8f953f",
  "original_sha256": "e49c81e2d2f84e259d40e2fb8192f3bcd198b355184845d76d8f58807d0d78ee",
  "output_sha256": "7ccd0e913e416b67bae0edc7019543800b9af5f247a29f8e9ae1a1613ec314c8",
  "patch": "--- original\n+++ modified\n@@ -1,2 +1,2 @@\n alpha\n-beta\n+gamma\n",
  "removed_lines": 1
}

Input fields

{
  "example": {
    "mode": "diff",
    "modified": "alpha\ngamma\n",
    "original": "alpha\nbeta\n"
  },
  "properties": {
    "mode": {
      "description": "Use diff to generate a patch or apply to verify one.",
      "example": "diff",
      "maxLength": 5,
      "minLength": 4,
      "type": "string"
    },
    "modified": {
      "description": "Modified UTF-8 text for diff mode.",
      "example": "alpha\ngamma\n",
      "maxLength": 32768,
      "minLength": 0,
      "type": "string",
      "x-preserve-whitespace": true
    },
    "original": {
      "description": "Original UTF-8 text.",
      "example": "alpha\nbeta\n",
      "maxLength": 32768,
      "minLength": 0,
      "type": "string",
      "x-preserve-whitespace": true
    },
    "patch": {
      "description": "Single-file unified diff for apply mode. The HTTP body cap is 64 KB.",
      "example": "--- original\n+++ modified\n@@ -1 +1 @@\n-a\n+b\n",
      "maxLength": 131072,
      "minLength": 0,
      "type": "string",
      "x-preserve-whitespace": true
    }
  },
  "required": [
    "mode",
    "original"
  ],
  "type": "object"
}

One-step x402 buy

POST https://redwoodagentsupply.com/api/v1/buy/utility-diff-patch-verify
Content-Type: application/json

{
  "inputs": {
    "mode": "diff",
    "modified": "alpha\ngamma\n",
    "original": "alpha\nbeta\n"
  }
}

Paid orders settle before background work starts. A failed job is run again once, free and automatically. If it fails twice, ask the operator to run it again using the order ID. Keep your order credential private. All sales are final.

Catalog at /api/v1/catalog

API documentation

Assistant instructions

Read the catalog and request a quote using the example below.
Create an order with that quote and a unique Idempotency-Key.
Keep the order credential private. Send it as Bearer authorization.
Request a payment attempt, then fetch the result after settlement.

Quote request example

POST /api/v1/quotes
Content-Type: application/json

{
  "slug": "utility-diff-patch-verify",
  "inputs": {
    "mode": "diff",
    "modified": "alpha\ngamma\n",
    "original": "alpha\nbeta\n"
  }
}