patch_widget_code
Apply targeted string replacements to specific fields (html, css, js) in custom widget code, with options for single or global replacement.
Instructions
Make targeted string replacements in a Custom Widget's code without rewriting it.
Each edit is `{"widget_id", "field", "old", "new", "replace_all"?}` where
`field` is one of `html`, `css`, or `js`. `old` is matched literally; if it
occurs more than once the edit fails unless `replace_all` is true (then every
occurrence is replaced).
Per-edit result reports `replacements` (count) or an `error` (widget not
found / wrong type / bad field / `old` not found / ambiguous match). The change is
written to both `srcDoc` and `uncompiledSrcDoc` so a reload can't revert it;
successful edits report `synced: true`.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edits | Yes |