Replace an exact text block in an existing file.

Prefer `apply_patch` for most code/text edits when it is available, because it produces the clearest diff preview. Use `edit` when you have one precise old/new text replacement, when a patch would be awkward, or after patch attempts fail.

Rules:
- You must read the file first in the current session before editing it.
- `oldString` must match the file exactly, including whitespace.
- If `oldString` appears multiple times, provide more context or set `replaceAll: true`.
- Use `write` for new files and a structural editing tool for multi-file diffs when that capability exists.
