mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
perf(skills): batch namespace ancestor searches
This commit is contained in:
@@ -9,6 +9,7 @@ pub mod plugin_namespace;
|
||||
|
||||
pub use plugin_namespace::DISCOVERABLE_PLUGIN_MANIFEST_PATHS;
|
||||
pub use plugin_namespace::find_plugin_manifest_path;
|
||||
pub use plugin_namespace::plugin_namespace_for_manifest_uri;
|
||||
pub use plugin_namespace::plugin_namespace_for_root_uri;
|
||||
pub use plugin_namespace::plugin_namespace_for_skill_path;
|
||||
pub use plugin_namespace::plugin_namespace_for_skill_uri;
|
||||
|
||||
@@ -40,8 +40,17 @@ pub async fn plugin_namespace_for_root_uri(
|
||||
Ok(_) | Err(_) => {}
|
||||
}
|
||||
}
|
||||
plugin_namespace_for_manifest_uri(fs, plugin_root, &manifest_path?).await
|
||||
}
|
||||
|
||||
/// Reads the plugin namespace from an already-discovered manifest path.
|
||||
pub async fn plugin_namespace_for_manifest_uri(
|
||||
fs: &dyn ExecutorFileSystem,
|
||||
plugin_root: &PathUri,
|
||||
manifest_path: &PathUri,
|
||||
) -> Option<String> {
|
||||
let contents = fs
|
||||
.read_file_text(&manifest_path?, /*sandbox*/ None)
|
||||
.read_file_text(manifest_path, /*sandbox*/ None)
|
||||
.await
|
||||
.ok()?;
|
||||
let RawPluginManifestName { name: raw_name } = serde_json::from_str(&contents).ok()?;
|
||||
|
||||
Reference in New Issue
Block a user