pub struct Plugins {
pub plugins: Vec<Plugin>,
pub problems: Vec<String>,
/* private fields */
}Expand description
Everything that loaded, and everything that did not (with the reason).
Fields§
§plugins: Vec<Plugin>§problems: Vec<String>Why a plugin or part of one was rejected. Never fatal: a broken plugin must not lock you out of your own agent.
Implementations§
Source§impl Plugins
impl Plugins
Sourcepub fn with_scripts_dir(self, dir: Option<PathBuf>) -> Self
pub fn with_scripts_dir(self, dir: Option<PathBuf>) -> Self
These plugins’ processes will be told where the agent’s scripts live. Set after
load, before Self::tools and Self::hooks copy it into what they build.
Sourcepub fn with_mcp(self, settings: McpSettings) -> Self
pub fn with_mcp(self, settings: McpSettings) -> Self
Say how MCP servers should be started: a default ceiling, or none at all (--no-mcp).
Left unset, a server that states no timeout gets DEFAULT_TIMEOUT.
Sourcepub fn with_config_mcp(self, cfg: &Config) -> Self
pub fn with_config_mcp(self, cfg: &Config) -> Self
Add the servers config.toml declares under [[mcp]] (#352), and the .env values their
token_env variables resolve against (#516). Call after load: the manifests are read
from disk, the config is already in memory.
One call rather than two, because a server handed its spec without the values is exactly the
bug #516 was: the entry says which variable, and only the config says whether it resolves.
pub fn get(&self, name: &str) -> Option<&Plugin>
Sourcepub fn prompts(&self) -> Vec<String>
pub fn prompts(&self) -> Vec<String>
Every prompt fragment, in load order (earlier directories first, then manifest order), so a profile plugin’s wording can precede a shared one.
Sourcepub fn provider_profiles(&self) -> Vec<ProviderProfile>
pub fn provider_profiles(&self) -> Vec<ProviderProfile>
Provider profiles declared by plugins, in load order: a later one with the same name replaces an earlier one, and either replaces the built-in.
Sourcepub fn tools(
&self,
workspace: &Path,
max_bytes: usize,
builtin: &[String],
) -> ToolsAndProblems
pub fn tools( &self, workspace: &Path, max_bytes: usize, builtin: &[String], ) -> ToolsAndProblems
Tools to register, each with the policy it should get and the plugin that offers it,
so the registry can say where a tool came from. builtin is the set of names the
registry already has. Rejections come back as problems.
Sourcepub fn mcp_report(&self, workspace: &Path) -> (Vec<McpServerState>, Vec<String>)
pub fn mcp_report(&self, workspace: &Path) -> (Vec<McpServerState>, Vec<String>)
The servers as mcp list reports them, with the tool counts already resolved. Cheap to
call: the servers are cached per process, so listing does not start a second copy.