{"id":"text-apply-unified-patch","version":"1.0.0","description":"Apply a one-file unified patch to text at original line addresses with exact hunk matches.","supported_operations":["text apply unified patch","apply unified diff to text","apply a unified patch exactly"],"unsupported_operations":["offset or fuzz patch apply","preserve original CR/LF through unified text","git diff --git headers","binary patches","fuzzy matching","filesystem access"],"semantics":["unified is one-file unified diff text; strip is an integer 0..8 (default 0) removing that many leading path components from ---/+++ names.","text is split into line records; only CRLF, LF, and CR are terminators.","Hunks apply against the original record array at the parsed 0-based old_start addresses. old ranges must be sorted and disjoint; empty ranges at the same index overlap and are rejected.","Each hunk old side must equal the original slice; there is no search, fuzz, or offset.","Parsed body records use eol LF, or empty when a no-newline marker follows that body line. Original CR/LF is not carried through unified text.","identical is true iff the patch contains no hunks; an empty unified string is a no-op.","Output text is joinRecords of the patched records and must fit the output byte budget."],"limits":{"max_text_bytes":262144,"max_line_count":4096,"max_line_bytes":16384,"max_hunks":1024,"max_path_bytes":1024,"max_strip":8,"max_output_bytes":1048576},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["text","unified"],"properties":{"text":{"type":"string","maxLength":262144},"unified":{"type":"string","maxLength":262144},"strip":{"type":"integer","minimum":0,"maximum":8}}},"output_schema":{"type":"object","additionalProperties":false,"required":["text","identical"],"properties":{"text":{"type":"string","maxLength":1048576},"identical":{"type":"boolean"}}},"examples":[{"input":{"text":"a\nb\n","unified":"--- a\n+++ b\n@@ -1,2 +1,2 @@\n a\n-b\n+c\n"},"output":{"text":"a\nc\n","identical":false}}],"execute_url":"/v1/tools/text-apply-unified-patch/versions/1.0.0/execute"}