diff --git a/codex-rs/core-plugins/src/lib.rs b/codex-rs/core-plugins/src/lib.rs index eeed69475c..0f458f163e 100644 --- a/codex-rs/core-plugins/src/lib.rs +++ b/codex-rs/core-plugins/src/lib.rs @@ -43,7 +43,7 @@ pub use manager::PluginRemoteSyncError; pub use manager::PluginUninstallError; pub use manager::PluginsConfigInput; pub use manager::PluginsManager; -pub use manager::PluginsManagerDeps; +pub use manager::PluginsManagerStorageDeps; pub use manager::RemotePluginSyncResult; pub use marketplace_upgrade::ConfiguredMarketplaceUpgradeError as PluginMarketplaceUpgradeError; pub use marketplace_upgrade::ConfiguredMarketplaceUpgradeOutcome as PluginMarketplaceUpgradeOutcome; diff --git a/codex-rs/core-plugins/src/manager.rs b/codex-rs/core-plugins/src/manager.rs index 870ac1f1e0..109a008125 100644 --- a/codex-rs/core-plugins/src/manager.rs +++ b/codex-rs/core-plugins/src/manager.rs @@ -414,11 +414,11 @@ pub struct PluginsManager { /// Dependencies owned by one plugins manager. #[derive(Clone)] -pub struct PluginsManagerDeps { +pub struct PluginsManagerStorageDeps { data_store: Arc, } -impl PluginsManagerDeps { +impl PluginsManagerStorageDeps { /// Creates dependencies backed by the local Codex Home layout. pub fn from_codex_home(codex_home: PathBuf) -> Result { Ok(Self::new(Arc::new(LocalPluginDataStore::from_codex_home( @@ -444,23 +444,34 @@ impl PluginsManager { } /// Creates a plugins manager with injected dependencies. - pub fn new_with_deps(codex_home: PathBuf, deps: PluginsManagerDeps) -> Self { - Self::new_with_restriction_product_and_deps(codex_home, Some(Product::Codex), deps) + pub fn new_with_storage_deps( + codex_home: PathBuf, + storage_deps: PluginsManagerStorageDeps, + ) -> Self { + Self::new_with_restriction_product_and_storage_deps( + codex_home, + Some(Product::Codex), + storage_deps, + ) } pub fn new_with_restriction_product( codex_home: PathBuf, restriction_product: Option, ) -> Self { - let deps = PluginsManagerDeps::from_codex_home(codex_home.clone()) + let storage_deps = PluginsManagerStorageDeps::from_codex_home(codex_home.clone()) .unwrap_or_else(|err| panic!("plugin data root should be absolute: {err}")); - Self::new_with_restriction_product_and_deps(codex_home, restriction_product, deps) + Self::new_with_restriction_product_and_storage_deps( + codex_home, + restriction_product, + storage_deps, + ) } - fn new_with_restriction_product_and_deps( + fn new_with_restriction_product_and_storage_deps( codex_home: PathBuf, restriction_product: Option, - deps: PluginsManagerDeps, + storage_deps: PluginsManagerStorageDeps, ) -> Self { // Product restrictions are enforced at marketplace admission time for a given CODEX_HOME: // listing, install, and curated refresh all consult this restriction context before new @@ -472,7 +483,7 @@ impl PluginsManager { Self { codex_home: codex_home.clone(), store: PluginStore::new(codex_home), - data_store: deps.data_store, + data_store: storage_deps.data_store, featured_plugin_ids_cache: RwLock::new(None), configured_marketplace_upgrade_state: RwLock::new( ConfiguredMarketplaceUpgradeState::default(), diff --git a/codex-rs/core-plugins/src/manager_tests.rs b/codex-rs/core-plugins/src/manager_tests.rs index aae789cdc5..04d1cdd10c 100644 --- a/codex-rs/core-plugins/src/manager_tests.rs +++ b/codex-rs/core-plugins/src/manager_tests.rs @@ -3915,9 +3915,9 @@ async fn plugins_for_layer_stack_uses_injected_plugin_data_store() { /*remote_plugin_enabled*/ false, "https://chatgpt.com/backend-api/".to_string(), ); - let outcome = PluginsManager::new_with_deps( + let outcome = PluginsManager::new_with_storage_deps( codex_home.path().to_path_buf(), - PluginsManagerDeps::new(Arc::new(FakePluginDataStore { + PluginsManagerStorageDeps::new(Arc::new(FakePluginDataStore { root: data_root.clone(), })), )