aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
37
akode-rs/ext/mcp/src/plugin_contributor.rs
Normal file
37
akode-rs/ext/mcp/src/plugin_contributor.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
//! 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))),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user