Introduce the WASM plugin system foundation: - Add extism 1.9 as an optional dependency behind `plugins-wasm` feature - Create `src/plugins/` module with manifest types, error types, and stub host - Add `Plugin` CLI subcommands (list, install, remove, info) behind cfg gate - Add `PluginsConfig` to the config schema with sensible defaults All plugin code is behind `#[cfg(feature = "plugins-wasm")]` so the default build is unaffected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
818 B
Rust
34 lines
818 B
Rust
//! Plugin error types.
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum PluginError {
|
|
#[error("plugin not found: {0}")]
|
|
NotFound(String),
|
|
|
|
#[error("invalid manifest: {0}")]
|
|
InvalidManifest(String),
|
|
|
|
#[error("failed to load WASM module: {0}")]
|
|
LoadFailed(String),
|
|
|
|
#[error("plugin execution failed: {0}")]
|
|
ExecutionFailed(String),
|
|
|
|
#[error("permission denied: plugin '{plugin}' requires '{permission}'")]
|
|
PermissionDenied { plugin: String, permission: String },
|
|
|
|
#[error("plugin '{0}' is already loaded")]
|
|
AlreadyLoaded(String),
|
|
|
|
#[error("plugin capability not supported: {0}")]
|
|
UnsupportedCapability(String),
|
|
|
|
#[error("IO error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("TOML parse error: {0}")]
|
|
TomlParse(#[from] toml::de::Error),
|
|
}
|