Download codex-rs/app-server/src/plugin_config_reload.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 964 Bytes
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server/src/plugin_config_reload.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/app-server/src/plugin_config_reload.rs
-
curl -L -o plugin_config_reload.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server/src/plugin_config_reload.rs
964 Bytes
| //! Adapts existing config loaders for blocking plugin-upgrade workers. | |
| //! Reloads must use the same normal or fallback entry point as the initial load. | |
| use crate::config_manager::ConfigManager; | |
| use codex_core_plugins::ConfigLayerReload; | |
| use codex_utils_absolute_path::AbsolutePathBuf; | |
| use std::sync::Arc; | |
| /// The config-loading path used to select marketplaces for startup tasks. | |
| pub(crate) enum PluginStartupConfig { | |
| Current, | |
| Defaults, | |
| } | |
| pub(crate) fn for_cwd(manager: ConfigManager, cwd: AbsolutePathBuf) -> ConfigLayerReload { | |
| let runtime = tokio::runtime::Handle::current(); | |
| Arc::new(move || runtime.block_on(manager.load_config_layers_for_cwd(cwd.clone()))) | |
| } | |
| pub(crate) fn defaults(manager: ConfigManager) -> ConfigLayerReload { | |
| let runtime = tokio::runtime::Handle::current(); | |
| Arc::new(move || { | |
| runtime | |
| .block_on(manager.load_default_config()) | |
| .map(|config| config.config_layer_stack) | |
| }) | |
| } | |