| 1 | # Text Editor Plugin DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the native LLM-friendly text editing tool for reading, writing, and patching text files. |
| 6 | |
| 7 | ## Ownership |
| 8 | |
| 9 | - `tools/text_editor.py` owns method dispatch and agent-facing tool behavior. |
| 10 | - `helpers/` owns file operations, patch requests, context patching, stale-read tracking, and patch state. |
| 11 | - `prompts/` owns read/write/patch success and error messages. |
| 12 | - `default_config.yaml`, `plugin.yaml`, `README.md`, `extensions/`, and `webui/` own defaults, metadata, docs, hooks, and config UI. |
| 13 | |
| 14 | ## Local Contracts |
| 15 | |
| 16 | - Preserve stale-read protection before patch operations. |
| 17 | - Validate patch structures before applying edits. |
| 18 | - Read back changed regions after writes or patches where the tool contract requires confirmation. |
| 19 | - Include the active agent context id in write/patch result metadata when available so canvas consumers can open the changed file in the correct chat context. |
| 20 | |
| 21 | ## Work Guidance |
| 22 | |
| 23 | - Coordinate helper changes with prompt responses so the agent receives actionable edit feedback. |
| 24 | |
| 25 | ## Verification |
| 26 | |
| 27 | - Smoke-test read, write, patch, stale-read rejection, and error handling after tool changes. |
| 28 | |
| 29 | ## Child DOX Index |
| 30 | |
| 31 | No child DOX files. |