Sequence compose edit scripts

sequence-compose-edit-scripts · version 1.0.0 · Sequences & diffs · free, no key needed

Compose two sequence edit scripts into one per-item keep/delete/insert script.

Use when you need to: sequence compose edit scripts · compose two sequence edit scripts · compose keep delete insert scripts.

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "first": [
    {
      "op": "keep",
      "value": "A"
    },
    {
      "op": "delete",
      "value": "B"
    },
    {
      "op": "insert",
      "value": "C"
    }
  ],
  "second": [
    {
      "op": "keep",
      "value": "A"
    },
    {
      "op": "keep",
      "value": "C"
    },
    {
      "op": "insert",
      "value": "D"
    }
  ]
}

Response:

{
  "result": {
    "ops": [
      {
        "op": "keep",
        "value": "A",
        "left_index": 0,
        "right_index": 0
      },
      {
        "op": "delete",
        "value": "B",
        "left_index": 1
      },
      {
        "op": "insert",
        "value": "C",
        "right_index": 1
      },
      {
        "op": "insert",
        "value": "D",
        "right_index": 2
      }
    ],
    "keeps": 1,
    "deletions": 1,
    "insertions": 2
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "sequence-compose-edit-scripts",
  "version": "1.0.0",
  "input": {
    "first": [
      {
        "op": "keep",
        "value": "A"
      },
      {
        "op": "delete",
        "value": "B"
      },
      {
        "op": "insert",
        "value": "C"
      }
    ],
    "second": [
      {
        "op": "keep",
        "value": "A"
      },
      {
        "op": "keep",
        "value": "C"
      },
      {
        "op": "insert",
        "value": "D"
      }
    ]
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/sequence-compose-edit-scripts/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"first":[{"op":"keep","value":"A"},{"op":"delete","value":"B"},{"op":"insert","value":"C"}],"second":[{"op":"keep","value":"A"},{"op":"keep","value":"C"},{"op":"insert","value":"D"}]}'

The machine-readable contract is at /v1/tools/sequence-compose-edit-scripts/versions/1.0.0.

CLI

node cli.mjs run sequence-compose-edit-scripts 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.