| 1 | # Extensions DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own core lifecycle extension implementations for backend and WebUI extension points. |
| 6 | - Keep built-in hook behavior ordered, discoverable, and compatible with plugin extension discovery. |
| 7 | |
| 8 | ## Ownership |
| 9 | |
| 10 | - `python/` contains backend lifecycle hooks executed through `helpers.extension`. |
| 11 | - `webui/` contains frontend extension contributions loaded through `webui/js/extensions.js`. |
| 12 | - Plugin-specific extensions belong inside each plugin's `extensions/` directory. |
| 13 | |
| 14 | ## Local Contracts |
| 15 | |
| 16 | - Extension directory names are runtime extension point names. |
| 17 | - File ordering matters when names include numeric prefixes. |
| 18 | - Extensions must be safe to run repeatedly when the lifecycle point can fire multiple times. |
| 19 | - Secret masking, auth, security, and persistence extensions must not be bypassed by convenience changes. |
| 20 | |
| 21 | ## Work Guidance |
| 22 | |
| 23 | - Keep extension code small and focused on its hook point. |
| 24 | - Move shared logic into `helpers/` when it is reused outside one extension. |
| 25 | - Coordinate changes with plugin extension docs and tests when extension point semantics change. |
| 26 | |
| 27 | ## Verification |
| 28 | |
| 29 | - Run targeted lifecycle, prompt, stream, WebSocket, or WebUI extension tests for changed hook points. |
| 30 | - Smoke-test startup when changing initialization, migration, or system-prompt extensions. |
| 31 | |
| 32 | ## Child DOX Index |
| 33 | |
| 34 | Direct child DOX files: |
| 35 | |
| 36 | | Child | Scope | |
| 37 | | --- | --- | |
| 38 | | [python/AGENTS.md](python/AGENTS.md) | Backend lifecycle extension hook files. | |
| 39 | | [webui/AGENTS.md](webui/AGENTS.md) | Frontend extension contributions. | |