Edit a file by replacing exact string occurrences.
For small payloads (combined old/new under _EDIT_INLINE_MAX_BYTES),
runs a server-side Python script via execute() — single round-trip,
no file transfer. For larger payloads, uploads old/new strings as
temp files and runs a server-side replace script — the source file
never leaves the sandbox.
read() normalizes CRLF to LF for the LLM, so old_string is
typically LF-only. The server-side script tries old_string as-is
first, then CRLF- and LF-normalized variants, and applies the same
transform to new_string so the file's line-ending style is
preserved on write. On mixed-ending files, replace_all=True only
touches occurrences in the first matching style — subsequent edits
can replace the rest.
If True, replace every occurrence.
If False (default), error when more than one
occurrence exists.