Commit graph

12 commits

Author SHA1 Message Date
frdel
bebe6826cf Improve WebUI bundling, manifest and stop command
Some checks failed
Build And Publish Docker Images / plan (push) Has been cancelled
Build And Publish Docker Images / build (push) Has been cancelled
Introduce a WebUI extension manifest and rewrite the asset bundler/server to support caller-supplied entry sets, extension-injected entries, and negotiated gzip. Key changes: add get_webui_extension_manifest() to helpers/extension, refactor Stop logic into stop_context() and reuse it from the connector `/stop` command, and add a new `/rename` slash command for chat naming. ui_bundler now accepts entry_urls, includes enabled extension entry files, raises the embedded text file size limit to 512 KiB, computes per-entry-set cache keys, and returns a bundle version based on the bundle signature. ui_server applies Starlette GZip middleware, adds routes (/, /index.html, /ui/index, /safe), serves splash/safe documents, injects the serialized webui_extension_manifest into the rendered index, and streamlines the /ui/asset-bundle endpoint with ETag and gzip handling. Also add multiple WebUI assets and fonts, new/updated plugin command YAML and Python command handlers, and corresponding tests covering bundling, commands, chat naming, and WebUI behaviors. Documentation (.dox.md) updated to reflect the new runtime contracts and guidance.
2026-07-29 19:49:07 +02:00
frdel
0329003b65 Add UI asset bundler, service worker, tests
Introduce a UI asset bundler and delivery flow: adds helpers/ui_bundler.py to discover same-origin HTML/CSS/JS (<=40KiB), build a versioned JSON bundle, and serialize it for an authenticated /ui/asset-bundle endpoint (handlers added in helpers/ui_server.py with gzip and ETag support). Add webui/sw.js service-worker to accept a preload bundle, populate a per-version cache, serve bundled text entries immediately, and perform runtime caching/cleanup for eligible assets. Update webui/index.html to fetch the bundle asynchronously, send it to the worker, register the worker by bundle version, inline a non-blocking startup splash, and convert stylesheets to non-blocking preload loads. Expose extension readiness from webui/js/extensions.js (webui-extensions-loaded) so startup waits for Alpine and HTML extension loading. Add tests covering bundler behavior, service-worker expectations, and startup ordering.
2026-07-28 16:10:48 +02:00
Alessandro
9e2a1b6324 Revert "Prevent WebUI extension loading stalls"
This reverts commit bf2046ff87.
2026-07-18 13:32:52 +02:00
Alessandro
bf2046ff87 Prevent WebUI extension loading stalls
Serialize extension discovery requests to avoid exhausting embedded Chromium request resources. Always clear component loading placeholders after failures and add focused regression coverage.
2026-07-17 16:57:43 +02:00
Alessandro
70cbf6fb9d scan x-extension on DOMContentLoaded; extension-friendly CSS 2026-03-13 16:16:42 +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
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
frdel
83d369e7a0 Add frontend cache and integrate with extensions
Introduce a reusable frontend cache (webui/js/cache.js) with area-based storage, glob clearing, and enable toggles. Integrate the cache into webui/js/extensions.js (add/get/clear cache usage, define JS/HTML cache area keys, make imported JS extension defaults variadic) and adjust the HTML import/loading flow and MutationObserver callback wiring. Update webui/js/messages.js to support async message handlers (typedef allowing Promise results), make getMessageHandler async and consult extensions for custom handlers, and await setMessage/setMessage handler results. Also remove an unused DockerContainerManager import from python/tools/code_execution_tool.py.
2026-03-04 16:34:59 +01:00
frdel
5acb733b9e Refactor plugin/project helpers; add plugin UI
Major refactor of plugin and project helper APIs and add a plugin management UI.

Key changes:
- Rename project meta helpers from get_project_meta_folder -> get_project_meta and update callers across many modules (projects, memory, skills_import, secrets, subagents, skills).
- Overhaul python/helpers/plugins.py: introduce PluginMetadata and PluginListItem (Pydantic), new get_plugins_list/get_enhanced_plugins_list, support for reading plugin config (config.json), enable/disable logic (.enabled/.disabled), get_enabled_plugin_paths(), and helpers to find/read/save plugin assets. Plugin discovery now supports webui/main/config detection.
- Use enabled-plugin-aware lookups in subagents, extension loading, and other places (plugins.get_enabled_plugin_paths / get_enhanced_plugins_list used instead of previous list_plugins/get_plugin_paths where appropriate).
- Add API endpoint python/api/plugins_list.py to return JSON plugin lists.
- Add frontend plugin management UI: web components webui/components/plugins/list/plugin-list.html and pluginListStore.js; wire quick-actions button to open the plugins modal.
- Add new webui assets and config pages for example_agent and memory plugins; add plugins/plugin.json metadata for example_agent and memory.
- Memory plugin fixes: updated calls to use get_project_meta and adjusted memory path helpers to use project meta layout.
- File helper: add read_file_json to read JSON files directly.
- run_ui: tightened plugin asset serving security (only serve from plugin webui or plugin extensions/webui), added unified _serve_plugin_asset helper, and load plugin API handlers using enhanced plugin list.
- Small fixes: adjustments to parse_prompt/read_prompt/tool lookup to use updated subagents.get_paths signature, extension loader now uses enabled plugin paths, and web UI extensions JS updated to expect string paths.

These changes centralize project meta handling, improve plugin discovery and enable/disable behavior, and add a basic plugin management UI and API.
2026-02-19 17:20:14 +01:00
frdel
39a81d0d5d Refactor memory imports; add Alpine move directives
Cleanup and refactor memory plugin imports to use plugins.memory.helpers.memory directly (remove sys.path hacks) and adjust related tools (memory_load, memory_save, memory_delete, memory_forget). Move the memory quick-action entry to a new start extension file and update quick-actions HTML to remove obsolete extension points and rename the dropdown end id. Update JS extension caller to forward multiple arguments (rest params) and add several Alpine directives (move-to-start, move-to-end, move-to, move-before, move-after) plus selector helpers to support dynamic element repositioning. Also removed an unused python/__init__.py and minor whitespace/comment cleanups.
2026-02-17 11:42:12 +01:00
frdel
3bfdf91637 Support webui JS/HTML extensions and plugin paths
Add full support for loading web UI extensions from plugins: - Frontend: new extensions loader (js/extensions.js) that loads and caches JS and HTML extensions, calls JS hooks, imports HTML as <x-component> tags, normalizes paths, and replaces the old plugins.js auto-inject logic. - Messages: make setMessages async, introduce extension hooks (set_messages_before_loop / after_loop) and integrate JS extension calls; adjust Scroller usage accordingly. - Components: fix x-component path handling in several templates and components import logic. - Backend: add filters to /api/load_webui_extensions and pass them to plugin helper; update helpers to look for plugin extensions under extensions/python instead of backend. - Plugins helper: extend get_webui_extensions to accept file glob filters, dedupe matches, return relative paths, and improve error logging. - Project config: include plugins and usr/plugins JS files in jsconfig.json. - Add a small test extension file and move several plugin extension files from backend/ to python/ directories. - Minor: reset error_retries earlier in agent message loop to avoid stale retry counts.

These changes enable a flexible plugin extension system for both JS and HTML assets, improve caching and path normalization, and wire up backend APIs and helpers to support the new structure.
2026-02-17 10:17:19 +01:00
frdel
3918133cbf plugins - frontend PoC 2026-02-16 20:01:25 +01:00