feat(plugins): hot reload des plugins sans relancer IdeA — use case ReloadPlugin (invalidation registry/catalogue, resultat hashes+changed), tools MCP d'administration plugin agent-facing (mcp/plugins.rs + PluginToolProvider), evenement domaine plugin_reloaded relaye sur le wire (dto/events), exposition openai_tools rafraichie, wiring app-tauri — #271/#269 (QA verte #273: application 32, mcp_server 38, openai_tools 10, plugin_install_load 5, plugin 10, wire 1 — 96 tests ciblés; app-tauri compile sans desktop runtime)
This commit is contained in:
@ -199,6 +199,59 @@ impl From<application::PluginInstallResult> for PluginInstallResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/// Plugin reload request DTO.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ReloadPluginDto {
|
||||
/// Installed plugin id.
|
||||
pub plugin_id: String,
|
||||
/// Optional installed-hash concurrency guard.
|
||||
pub expected_content_hash: Option<String>,
|
||||
}
|
||||
|
||||
impl From<ReloadPluginDto> for application::ReloadPluginInput {
|
||||
fn from(value: ReloadPluginDto) -> Self {
|
||||
Self {
|
||||
plugin_id: value.plugin_id,
|
||||
expected_content_hash: value.expected_content_hash,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Plugin hot-reload result DTO.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PluginReloadResultDto {
|
||||
/// Reloaded plugin.
|
||||
pub plugin: PluginAdminDto,
|
||||
/// Previous content hash.
|
||||
pub old_content_hash: String,
|
||||
/// New content hash.
|
||||
pub new_content_hash: String,
|
||||
/// Whether the content changed.
|
||||
pub changed: bool,
|
||||
/// Runtime catalogue entry when active.
|
||||
pub runtime_catalog_entry: Option<application::PluginRuntimePlugin>,
|
||||
/// MCP status after reconciliation.
|
||||
pub mcp_statuses: domain::PluginMcpStatusSet,
|
||||
/// Non-fatal warnings.
|
||||
pub warnings: Vec<String>,
|
||||
}
|
||||
|
||||
impl From<application::PluginReloadResult> for PluginReloadResultDto {
|
||||
fn from(value: application::PluginReloadResult) -> Self {
|
||||
Self {
|
||||
plugin: value.plugin.into(),
|
||||
old_content_hash: value.old_content_hash,
|
||||
new_content_hash: value.new_content_hash,
|
||||
changed: value.changed,
|
||||
runtime_catalog_entry: value.runtime_catalog_entry,
|
||||
mcp_statuses: value.mcp_statuses,
|
||||
warnings: value.warnings,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Plugin uninstall result DTO.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
Reference in New Issue
Block a user