Edit app source
edit_appApply targeted edits to an app without rewriting the whole source. Use range-based or string-based edits that apply atomically, ensuring consistency.
Instructions
Surgical edits to an app WITHOUT round-tripping the whole source. Two edit forms, mixable: RANGE {offset, length, expect_hash, new_string} replaces a span you read with get_app (cheapest — echo the window's offset/returned/hash, no anchor text travels); STRING {old_string, new_string} replaces an exact-once match (or set replace_all). Range offsets always address the expected_version document and must not overlap; string edits apply after ranges, in order. All edits apply together, or nothing applies. The #oma-manifest block is re-read on save.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | app name (this tool says `app`; save_app and get_app say `name`) | |
| actor | No | ||
| edits | Yes | each item is RANGE (offset+length+expect_hash) or STRING (old_string) | |
| command_id | Yes | idempotency key — generate a fresh uuid per action | |
| expected_version | Yes | REQUIRED — the version the edits were authored against (from get_app) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| eot | No | ||
| name | No | ||
| note | No | ||
| size | No | ||
| reason | No | ||
| applied | No | ||
| created | No | ||
| version | No | ||
| prev_size | No | ||
| manifest_action | No | ||
| expected_version | No |