# diff_patch_apply (`net.2xcel.aus.diff-patch-apply`)

> Agent Utility Service (AUS) Atomic Git Diff & Patch Apply: Validates, tests, and applies unified diff patches with syntax verification and rollback safety.

## Metadata & Execution
- **Namespace**: `net.2xcel.aus.diff-patch-apply`
- **Canonical HTML Page**: https://aipages.tech/tool/net.2xcel.aus.diff-patch-apply
- **JSON Specification**: https://aipages.tech/api/tools/net.2xcel.aus.diff-patch-apply
- **Execution Endpoint**: `POST https://aipages.tech/tool/diff-patch-apply`
- **Connection Protocol**: `http`
- **Pricing**: $0.1 USDC per call (Base Mainnet Chain ID 8453)
- **Health Status**: `unknown`
- **Capabilities**: git-diff, patch-application, code-modification
- **Authentication**: x402 payment protocol (Header: x-payment-receipt; Token: USDC on Base Mainnet; Recipient: 0xE57cB8C73c4000EA04ba0eb607228CbAec7f8e9C)

## Input Parameters (JSON Schema Draft-07)
```json
{
  "type": "object",
  "properties": {
    "base_content": {
      "type": "string",
      "description": "Target source code file string"
    },
    "patch": {
      "type": "string",
      "description": "Unified diff or patch syntax to apply"
    }
  },
  "required": [
    "base_content",
    "patch"
  ]
}
```

## Invocation Examples

### 1. Zero-Friction Sandbox Test (No Payment Required)
```bash
curl -X POST "https://aipages.tech/tool/net.2xcel.aus.diff-patch-apply" \
  -H "Content-Type: application/json" \
  -H "x-playground-test: true" \
  -H "x-agent-id: markdown-agent" \
  -d '{}'
```

### 2. Production Invocation (x402 Base Mainnet Settlement)
```bash
curl -X POST "https://aipages.tech/tool/diff-patch-apply" \
  -H "Content-Type: application/json" \
  -H "x-payment-receipt: <BASE_USDC_PAYMENT_RECEIPT>" \
  -d '{}'
```
