Commit graph

9 commits

Author SHA1 Message Date
frdel
a48ac95a29 feat(plugins): Add extensibility and hooks system to plugin API
Add @extension.extensible decorators to all plugin API handler methods and core plugin functions to enable extension points. Implement plugin hooks system allowing plugins to define custom behavior via hooks.py file. Add call_plugin_hook function to execute plugin-specific hooks for events like uninstall, save_plugin_config, and get_plugin_config. Introduce uninstall_plugin function that calls uninstall hook before deletion. Move circular
2026-03-12 13:21:33 +01:00
frdel
bcbce781b8 refactor(plugins): Remove unused global toggles variable from get_toggle_state 2026-03-12 07:57:33 +01:00
frdel
36f26c1e2c Remove redundant provider reload call from plugin change handler
The provider manager now uses the plugin cache system and automatically reloads when plugins change, making the explicit reload_providers() call unnecessary.
2026-03-12 07:31:45 +01:00
linuztx
342a9584cc feat(providers): Allow plugins to add and override model providers 2026-03-12 08:29:19 +08:00
frdel
6515626242 refactor - plugin names and builtin plugins 2026-03-10 22:20:53 +01:00
frdel
999a14e31f Optimize plugin reload notifications to check for webui extensions
Add plugin_names parameter to after_plugin_change() and send_frontend_reload_notification() to enable targeted extension checking. Only send reload notification if changed plugins have webui extensions (checks extensions/webui directory existence). Defer notification send by 1 second to allow multiple rapid changes to coalesce. Update delete_plugin() to send notification before deletion for proper extension checking. Pass plugin names
2026-03-10 13:51:41 +01:00
frdel
1b89a0d359 Add tool request validation and plugin change notifications
Introduce validate_tool_request() extensible method in agent.py to validate tool request structure (dict with tool_name string and tool_args dict fields) before processing. Add after_plugin_change() helper in helpers/plugins.py that clears cache and sends a frontend reload notification (throttled to display_time interval) with a reload button. Update plugin installer install/delete flows to call after_plugin_change(). Extend notification
2026-03-10 13:08:48 +01:00
frdel
27730153ac Clear plugin cache & add API extension hooks
Add extension hooks and improve plugin cache handling. Changes include:

- Add new JSON API extension points and a cache reset handler (extensions/webui/json_api_call_before, json_api_call_after/cache_reset.js) to clear frontend cache when backend cache_reset runs.
- Rename webui extension hook directories to use fetch_api_call_* naming.
- Refactor webui/js/api.js to normalize API URLs, lazily import ./extensions.js, and call extension hooks for json_api_call_before/error/after and fetch_api_call_before/after using a ctx object.
- Rename invalidate_plugin_cache to clear_plugin_cache and call it after plugin install/delete/toggle/config save to keep plugin cache consistent.
- Harden plugin name sanitization to replace non-alphanumeric chars with underscores.
- Include extensions/**/*.js in jsconfig.json for editor tooling.

These changes improve extensibility for API lifecycle events and ensure plugin-related cache is cleared when plugin state changes.
2026-03-09 11:21:27 +01:00
frdel
d02dda3667 BIG PYTHON REFACTOR
Python scripts moved out of python/ folder to root to be unified with plugins

+ frontend extension around api calls
2026-03-05 17:28:11 +01:00
Renamed from python/helpers/plugins.py (Browse further)