Start a permission-restricted Unix JSON socket alongside the WebUI, with file-discovered core/plugin handlers and a standard-library CLI. Reuse explicit JSON API operations for local administration and plugin workflows. Allow long operations without a default execution deadline, configure JSON and transfer limits, and keep blocking operations off the transport loop. Preserve HTTP authentication, multipart behavior, RFC, and startup/update health probes. Validation: 44 socket/adapter tests and 8 plugin compatibility tests pass; syntax, handler mapping, skill examples and DOX checks pass. Full WebUI integration was unavailable without installed framework dependencies.
3.2 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. -
socket/plugin_install.pyreuses Git/index/compatibility/update API operations and acceptsinstall_zipwith an absolute server-localzip_path, copying through the existing upload helper before extraction. HTTP multipart uploads remain unchanged.
Local Contracts
- Install third-party plugins into
usr/plugins/, not bundledplugins/. - Reject unsafe archive paths, missing manifests, invalid manifests, and plugin name conflicts.
- Clean uploaded archive filenames with
helpers.security.safe_filenamebefore joining the temporary upload directory; archive-member checks remain separate. - 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.
- Keep Official immediately after All, including when empty; derive membership from the index entry's GitHub repository URL with the exact
github.comhost andagent0aiowner, never author labels or tags. Reserve the Official pill so tags cannot create a duplicate. - 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
node --test tests/test_plugin_hub_welcome.mjsfor Browse filter membership, counts, ordering, and empty categories. - 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.