Rewrite extension management tools (#5057)

Signed-off-by: Angela Ning <aning@squareup.com>
This commit is contained in:
Angela Ning
2025-10-17 14:22:58 -04:00
committed by GitHub
parent db8fe34ff9
commit bccfa0156c
19 changed files with 926 additions and 354 deletions
+22 -5
View File
@@ -1,3 +1,4 @@
use crate::agents::extension_manager_extension;
use crate::agents::todo_extension;
use std::collections::HashMap;
@@ -34,8 +35,8 @@ impl ProcessExit {
}
}
pub static PLATFORM_EXTENSIONS: Lazy<HashMap<&'static str, PlatformExtensionDef>> =
Lazy::new(|| {
pub static PLATFORM_EXTENSIONS: Lazy<HashMap<&'static str, PlatformExtensionDef>> = Lazy::new(
|| {
let mut map = HashMap::new();
map.insert(
@@ -49,12 +50,28 @@ pub static PLATFORM_EXTENSIONS: Lazy<HashMap<&'static str, PlatformExtensionDef>
},
);
map
});
map.insert(
"extensionmanager",
PlatformExtensionDef {
name: extension_manager_extension::EXTENSION_NAME,
description:
"Enable extension management tools for discovering, enabling, and disabling extensions",
default_enabled: true,
client_factory: |ctx| Box::new(extension_manager_extension::ExtensionManagerClient::new(ctx).unwrap()),
},
);
#[derive(Debug, Clone)]
map
},
);
#[derive(Clone)]
pub struct PlatformExtensionContext {
pub session_id: Option<String>,
pub extension_manager:
Option<std::sync::Weak<crate::agents::extension_manager::ExtensionManager>>,
pub tool_route_manager:
Option<std::sync::Weak<crate::agents::tool_route_manager::ToolRouteManager>>,
}
#[derive(Debug, Clone)]