pub struct PluginConfig {Show 13 fields
pub name: String,
pub kind: String,
pub description: Option<String>,
pub author: Option<String>,
pub version: Option<String>,
pub hooks: Vec<String>,
pub mode: PluginMode,
pub priority: i32,
pub on_error: OnError,
pub capabilities: HashSet<String>,
pub tags: Vec<String>,
pub conditions: Vec<PluginCondition>,
pub config: Option<Value>,
}Expand description
Declared plugin configuration from the unified YAML config.
Controls how the framework loads, schedules, and gates the plugin.
Corresponds to a single entry in the plugins: list in config YAML.
The manager holds the authoritative copy in PluginRef.trusted_config.
The plugin receives its own copy for reading via Plugin::config().
§Examples
plugins:
- name: apl-policy
kind: builtin
hooks: [tool_pre_invoke, tool_post_invoke]
mode: sequential
priority: 10
on_error: fail
capabilities: [read_security, append_labels]
config:
policy_file: apl/demo/hr_policy.yamlFields§
§name: StringUnique plugin name.
kind: StringPlugin kind — determines how the framework loads it.
"builtin"— compiled into the runtime"native://path/to/lib.so"— dlopen’d shared library"wasm://path/to/plugin.wasm"— wasmtime sandbox"python://module.path.ClassName"— PyO3 bridge"external"— MCP/gRPC/Unix socket transport
description: Option<String>Human-readable description.
Plugin author or team.
version: Option<String>Semantic version string.
hooks: Vec<String>Hook names this plugin handles.
mode: PluginModeExecution mode — determines scheduling behavior and authority.
priority: i32Execution priority — lower numbers execute first within each mode.
on_error: OnErrorError handling behavior when the plugin fails.
capabilities: HashSet<String>Declared capabilities for extension visibility gating.
Controls which extensions the plugin can see and modify.
Extensions not covered by declared capabilities appear as
None in the filtered view.
Tags for categorization and searchability.
conditions: Vec<PluginCondition>Legacy conditions for when the plugin should execute.
Each condition narrows the plugin’s scope by server, tenant, tool name, prompt name, etc. If any condition in the list matches, the plugin runs. If the list is empty (default), the plugin runs unconditionally.
Backward compatibility: Conditions are the legacy mechanism
for scoping plugins. When the host uses the unified routing
system (routes: in config YAML), routing rules handle scope
matching and conditions on the plugin are ignored. The two
mechanisms should not be used together on the same plugin.
config: Option<Value>Plugin-specific configuration (opaque to the framework).
Implementations§
Source§impl PluginConfig
impl PluginConfig
Sourcepub fn passes_conditions(&self, extensions: &Extensions) -> bool
pub fn passes_conditions(&self, extensions: &Extensions) -> bool
Whether this plugin’s conditions allow it to fire for the given
request Extensions. Used in legacy mode (routing_enabled: false)
to filter which plugins run per request — mirrors the Python
implementation’s per-plugin condition filtering.
Semantics:
- Empty
conditionsVec → fire always (no restriction). - Non-empty → fire if ANY condition matches (OR across the list, AND within each individual condition).
Field-source mapping (see project memory project_conditions_field_mapping):
server_ids←extensions.mcp.{tool|resource|prompt}.server_idtenant_ids←extensions.security.subject.claims["tenant"]tools|prompts|resources←extensions.meta.entity_name(when matchingentity_type)agents←extensions.agent.agent_iduser_patterns←extensions.security.subject.id(glob match)content_types←extensions.mcp.resource.mime_type
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§fn clone(&self) -> PluginConfig
fn clone(&self) -> PluginConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more