feat(backend): système de plugins — domaine, application, infrastructure (#43)
Lots B1-B4 : modèle de domaine des plugins (manifeste, capacités menus/layouts/MCP), port et registre applicatif, chargement/validation en infrastructure, exposition DTO et commandes Tauri. Tests cargo verts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@ -21,6 +21,7 @@ pub mod events;
|
||||
pub mod mcp_bridge;
|
||||
pub mod mcp_endpoint;
|
||||
pub mod openai_tools;
|
||||
pub mod plugins;
|
||||
pub mod pty;
|
||||
pub mod server;
|
||||
pub mod state;
|
||||
@ -133,6 +134,9 @@ pub fn dispatch() -> ExitCode {
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
.register_uri_scheme_protocol("idea-plugin", |ctx, request| {
|
||||
plugins::plugin_asset_protocol(ctx.app_handle(), request)
|
||||
})
|
||||
.setup(|app| {
|
||||
// Resolve the machine-local IDE data directory (ARCHITECTURE §9.2)
|
||||
// and build the composition root once the app handle exists, so the
|
||||
@ -154,6 +158,7 @@ pub fn run() {
|
||||
events::spawn_relay(app.handle().clone(), &app_state.event_bus);
|
||||
|
||||
let embedded_server = Arc::clone(&app_state.embedded_server);
|
||||
let plugin_mcp_reconcile = Arc::clone(&app_state.reconcile_plugin_mcp_servers);
|
||||
let core = app_state.core();
|
||||
app.manage(app_state);
|
||||
tauri::async_runtime::spawn(async move {
|
||||
@ -165,6 +170,11 @@ pub fn run() {
|
||||
);
|
||||
}
|
||||
});
|
||||
tauri::async_runtime::spawn(async move {
|
||||
if let Err(err) = plugin_mcp_reconcile.execute().await {
|
||||
application::diag!("[plugins] MCP reconcile at boot failed: {err}");
|
||||
}
|
||||
});
|
||||
|
||||
// Kill all live PTYs cleanly when the main window is closing. This is
|
||||
// independent of the per-view (navigation/layout) lifecycle — those
|
||||
@ -334,6 +344,14 @@ pub fn run() {
|
||||
commands::cancel_background_task,
|
||||
commands::retry_background_task,
|
||||
commands::list_background_tasks,
|
||||
plugins::plugin_list_plugins,
|
||||
plugins::plugin_review_package,
|
||||
plugins::plugin_install_from_archive,
|
||||
plugins::plugin_install_from_directory,
|
||||
plugins::plugin_set_enabled,
|
||||
plugins::plugin_uninstall,
|
||||
plugins::plugin_list_runtime_contributions,
|
||||
plugins::plugin_open_plugins_folder,
|
||||
commands::get_server_exposure_settings,
|
||||
commands::save_server_exposure_settings,
|
||||
commands::preview_server_exposure_settings,
|
||||
|
||||
Reference in New Issue
Block a user