Validates and activates `config` layered on top of the discovered `plugins.toml` configuration, so a direct integration sees the same file layering as the gateway. `config` wins on conflicts; as a typed document its default `version`/`policy`/`enabled` override the file, while `config` bodies merge field-by-field. Delegates to [`initialize_plugins_exact`].
(config: PluginConfig)
| 1087 | /// default `version`/`policy`/`enabled` override the file, while `config` bodies |
| 1088 | /// merge field-by-field. Delegates to [`initialize_plugins_exact`]. |
| 1089 | pub async fn initialize_plugins(config: PluginConfig) -> Result<ConfigReport> { |
| 1090 | let mut base = resolve_default_file_plugin_config()?; |
| 1091 | layer_config(&mut base, serde_json::to_value(config)?); |
| 1092 | let config: PluginConfig = serde_json::from_value(base)?; |
| 1093 | initialize_plugins_exact(config).await |
| 1094 | } |
| 1095 | |
| 1096 | /// Resolves the default `plugins.toml` layering into one JSON document, or an |
| 1097 | /// empty object when no plugin file exists. |