mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-12-04 01:18:39 +00:00
2.5 KiB
2.5 KiB
Plugin Installer DOX
Purpose
- Own installing and updating plugins from ZIP uploads, Git repositories, and the community Plugin Index.
Ownership
helpers/install.pyowns archive extraction, Git install/update, validation, hook execution, and install finalization.helpers/compatibility.pyowns advisory version matching and bounded, read-only GitHub manifest retrieval. It reusespackaging, already installed by the framework's LangChain dependency, and safe YAML loading.api/plugin_install.pyowns install/update/index API dispatch.webui/owns Plugin Hub, ZIP, Git, detail, and shared install UI.plugin.yamlandREADME.mdown metadata and behavior notes.
Local Contracts
- Install third-party plugins into
usr/plugins/, not bundledplugins/. - Reject unsafe archive paths, missing manifests, invalid manifests, and plugin name conflicts.
- Run plugin install hooks and refresh plugin state after successful changes.
- Download fallback thumbnails only when no supported thumbnail exists; repository-provided images change through Git updates.
- Browse tag filters match every tag on a plugin, counting each plugin once per tag. Keep Welcome, Provider, and Channels available even with zero results so welcome-screen, model-setup, and channel shortcuts have a visible selected filter.
- Hub details and install preflight read optional
a0_versionfrom default-branchplugin.yaml, independent of Index metadata. Compare againsthelpers.git.get_version(). Mismatches and unavailable/invalid metadata require an advisory popup with the current version, declared requirement and an explicit continue choice; retain the security/scan confirmation. Escape untrusted popup values and ignore stale detail responses. This does not gate direct Git/ZIP APIs, updates, or activation. - Rebase local commits during Git updates; on conflicts restore the checkout and report the conflicting files through the existing structured error, persistent toast, and detail view.
Work Guidance
- Keep installer validation aligned with plugin contracts and Plugin Index expectations.
Verification
- Run
python -m unittest discover -s tests -p test_plugin_compatibility.pyandnode --test tests/test_plugin_compatibility.mjsfor requirement syntax, manifest boundaries, warning/override/cancel behavior, escaping and stale requests. - Smoke-test ZIP install, Git install, Plugin Hub install, and Git update paths after changes.
Child DOX Index
No child DOX files.