38 lines
1.2 KiB
Rust
38 lines
1.2 KiB
Rust
//! Coordinates executor MCP contributions with thread-owned catalogs.
|
|
//!
|
|
//! Provider instances are shared, while catalogs and executor metadata live in thread extension
|
|
//! data.
|
|
|
|
use crate::PluginProviders;
|
|
use akode_core::config::Config;
|
|
use akode_core_plugins::ExecutorPluginProvider;
|
|
use akode_exec_server::EnvironmentManager;
|
|
use akode_extension_api::ExtensionRegistryBuilder;
|
|
use std::sync::Arc;
|
|
|
|
pub(crate) struct PluginContributor {
|
|
pub(crate) providers: PluginProviders,
|
|
}
|
|
|
|
/// Installs one coordinator for executor MCP callbacks; Core's plugin policy applies to it.
|
|
pub fn install_plugin_providers(
|
|
builder: &mut ExtensionRegistryBuilder<Config>,
|
|
providers: PluginProviders,
|
|
) {
|
|
let contributor = Arc::new(PluginContributor { providers });
|
|
builder.thread_lifecycle_contributor(contributor.clone());
|
|
builder.config_contributor(contributor.clone());
|
|
builder.mcp_server_contributor(contributor);
|
|
}
|
|
|
|
/// Installs plugin support backed by selected environment roots.
|
|
pub fn install_plugins(
|
|
builder: &mut ExtensionRegistryBuilder<Config>,
|
|
environment_manager: Arc<EnvironmentManager>,
|
|
) {
|
|
install_plugin_providers(
|
|
builder,
|
|
PluginProviders::new(Arc::new(ExecutorPluginProvider::new(environment_manager))),
|
|
);
|
|
}
|