zeph_plugins/lib.rs
1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Plugin packaging and management for Zeph.
5//!
6//! A plugin is a directory (local or remote git) containing:
7//! - `plugin.toml` — manifest describing the plugin (name, version, skills, MCP servers, config overlay)
8//! - one or more skill directories with `SKILL.md` files
9//! - optional MCP server declarations
10//!
11//! Plugins are installed to `~/.local/share/zeph/plugins/<name>/` and loaded at agent startup.
12//!
13//! # Security Model
14//!
15//! - Plugin config overlays are **tighten-only**: they can add to `blocked_commands`,
16//! narrow `allowed_commands`, or raise `disambiguation_threshold` — never loosen constraints.
17//! - Plugin MCP entries are validated against `mcp.allowed_commands` at install time.
18//! - `.bundled` markers are stripped recursively from all plugin skill trees.
19//! - Skill name conflicts with managed, bundled, or other plugin skills are hard-errors at install.
20
21pub mod error;
22pub(crate) mod integrity;
23pub mod manager;
24pub mod manifest;
25pub mod overlay;
26pub mod types;
27
28pub use error::PluginError;
29pub use manager::{
30 AddResult, AutoUpdateResult, AutoUpdateStatus, DisableResult, InstalledPlugin,
31 MAX_ARCHIVE_BYTES, PluginManager, PluginSource, RemoveResult, SkillScanInput,
32 download_and_extract, validate_url_scheme_ephemeral,
33};
34pub use manifest::PluginManifest;
35pub use overlay::{ResolvedOverlay, apply_plugin_config_overlays};
36pub use types::PluginName;