diff --git a/crates/goose-cli/src/commands/configure.rs b/crates/goose-cli/src/commands/configure.rs index 9e4ed02a6a3..6a1a36728a9 100644 --- a/crates/goose-cli/src/commands/configure.rs +++ b/crates/goose-cli/src/commands/configure.rs @@ -10,6 +10,27 @@ use serde_json::{json, Value}; use std::collections::HashMap; use std::error::Error; +fn get_display_name(extension_id: &str) -> String { + match extension_id { + "developer" => "Developer Tools".to_string(), + "computercontroller" => "Computer Controller".to_string(), + "googledrive" => "Google Drive".to_string(), + "memory" => "Memory".to_string(), + "tutorial" => "Tutorial".to_string(), + "jetbrains" => "JetBrains".to_string(), + // Add other extensions as needed + _ => { + extension_id + .chars() + .next() + .unwrap_or_default() + .to_uppercase() + .collect::() + + &extension_id[1..] + } + } +} + pub async fn handle_configure() -> Result<(), Box> { let config = Config::global(); @@ -39,6 +60,7 @@ pub async fn handle_configure() -> Result<(), Box> { enabled: true, config: ExtensionConfig::Builtin { name: "developer".to_string(), + display_name: Some(goose::config::DEFAULT_DISPLAY_NAME.to_string()), timeout: Some(goose::config::DEFAULT_EXTENSION_TIMEOUT), }, })?; @@ -464,10 +486,13 @@ pub fn configure_extensions_dialog() -> Result<(), Box> { }) .interact()?; + let display_name = get_display_name(&extension); + ExtensionManager::set(ExtensionEntry { enabled: true, config: ExtensionConfig::Builtin { name: extension.clone(), + display_name: Some(display_name), timeout: Some(timeout), }, })?; diff --git a/crates/goose-cli/src/session/mod.rs b/crates/goose-cli/src/session/mod.rs index 196dd6cbfd3..9ff4ed8fc64 100644 --- a/crates/goose-cli/src/session/mod.rs +++ b/crates/goose-cli/src/session/mod.rs @@ -133,6 +133,7 @@ impl Session { for name in builtin_name.split(',') { let config = ExtensionConfig::Builtin { name: name.trim().to_string(), + display_name: None, // TODO: should set a timeout timeout: Some(goose::config::DEFAULT_EXTENSION_TIMEOUT), }; diff --git a/crates/goose-server/src/routes/extension.rs b/crates/goose-server/src/routes/extension.rs index 5be0fb02cd5..c362be69af7 100644 --- a/crates/goose-server/src/routes/extension.rs +++ b/crates/goose-server/src/routes/extension.rs @@ -45,6 +45,7 @@ enum ExtensionConfigRequest { Builtin { /// The name of the built-in extension. name: String, + display_name: Option, timeout: Option, }, } @@ -157,9 +158,15 @@ async fn add_extension( timeout, } } - ExtensionConfigRequest::Builtin { name, timeout } => { - ExtensionConfig::Builtin { name, timeout } - } + ExtensionConfigRequest::Builtin { + name, + display_name, + timeout, + } => ExtensionConfig::Builtin { + name, + display_name, + timeout, + }, }; // Acquire a lock on the agent and attempt to add the extension. diff --git a/crates/goose/src/agents/capabilities.rs b/crates/goose/src/agents/capabilities.rs index 44627b3baff..ba8e5c273fc 100644 --- a/crates/goose/src/agents/capabilities.rs +++ b/crates/goose/src/agents/capabilities.rs @@ -134,7 +134,12 @@ impl Capabilities { ); Box::new(McpClient::new(service)) } - ExtensionConfig::Builtin { name, timeout } => { + #[allow(unused_variables)] + ExtensionConfig::Builtin { + name, + display_name, + timeout, + } => { // For builtin extensions, we run the current executable with mcp and extension name let cmd = std::env::current_exe() .expect("should find the current executable") diff --git a/crates/goose/src/agents/extension.rs b/crates/goose/src/agents/extension.rs index 2887d1321c1..b6472281622 100644 --- a/crates/goose/src/agents/extension.rs +++ b/crates/goose/src/agents/extension.rs @@ -78,6 +78,7 @@ pub enum ExtensionConfig { Builtin { /// The name used to identify this extension name: String, + display_name: Option, // needed for the UI timeout: Option, }, } @@ -86,6 +87,7 @@ impl Default for ExtensionConfig { fn default() -> Self { Self::Builtin { name: config::DEFAULT_EXTENSION.to_string(), + display_name: Some(config::DEFAULT_DISPLAY_NAME.to_string()), timeout: Some(config::DEFAULT_EXTENSION_TIMEOUT), } } diff --git a/crates/goose/src/config/extensions.rs b/crates/goose/src/config/extensions.rs index 5b6db2b69cd..9c31add8228 100644 --- a/crates/goose/src/config/extensions.rs +++ b/crates/goose/src/config/extensions.rs @@ -8,6 +8,7 @@ use utoipa::ToSchema; pub const DEFAULT_EXTENSION: &str = "developer"; pub const DEFAULT_EXTENSION_TIMEOUT: u64 = 300; pub const DEFAULT_EXTENSION_DESCRIPTION: &str = ""; +pub const DEFAULT_DISPLAY_NAME: &str = "Developer"; #[derive(Debug, Deserialize, Serialize, Clone, ToSchema)] pub struct ExtensionEntry { @@ -42,6 +43,7 @@ impl ExtensionManager { enabled: true, config: ExtensionConfig::Builtin { name: DEFAULT_EXTENSION.to_string(), + display_name: Some(DEFAULT_DISPLAY_NAME.to_string()), timeout: Some(DEFAULT_EXTENSION_TIMEOUT), }, }, diff --git a/crates/goose/src/config/mod.rs b/crates/goose/src/config/mod.rs index 54e4b7a6602..b634c0ea281 100644 --- a/crates/goose/src/config/mod.rs +++ b/crates/goose/src/config/mod.rs @@ -7,6 +7,7 @@ pub use base::{Config, ConfigError, APP_STRATEGY}; pub use experiments::ExperimentManager; pub use extensions::{ExtensionEntry, ExtensionManager}; +pub use extensions::DEFAULT_DISPLAY_NAME; pub use extensions::DEFAULT_EXTENSION; pub use extensions::DEFAULT_EXTENSION_DESCRIPTION; pub use extensions::DEFAULT_EXTENSION_TIMEOUT; diff --git a/ui/desktop/openapi.json b/ui/desktop/openapi.json index f0f203b9161..e05b755f438 100644 --- a/ui/desktop/openapi.json +++ b/ui/desktop/openapi.json @@ -10,7 +10,7 @@ "license": { "name": "Apache-2.0" }, - "version": "1.0.14" + "version": "1.0.15" }, "paths": { "/config": { @@ -392,6 +392,10 @@ "type" ], "properties": { + "display_name": { + "type": "string", + "nullable": true + }, "name": { "type": "string", "description": "The name used to identify this extension" diff --git a/ui/desktop/src/api/types.gen.ts b/ui/desktop/src/api/types.gen.ts index dcd2a69296d..06f4901f153 100644 --- a/ui/desktop/src/api/types.gen.ts +++ b/ui/desktop/src/api/types.gen.ts @@ -43,6 +43,7 @@ export type ExtensionConfig = { timeout?: number | null; type: 'stdio'; } | { + display_name?: string | null; /** * The name used to identify this extension */ diff --git a/ui/desktop/src/components/settings_v2/extensions/ExtensionsSection.tsx b/ui/desktop/src/components/settings_v2/extensions/ExtensionsSection.tsx index 78516c9478b..6f86ed8625e 100644 --- a/ui/desktop/src/components/settings_v2/extensions/ExtensionsSection.tsx +++ b/ui/desktop/src/components/settings_v2/extensions/ExtensionsSection.tsx @@ -118,7 +118,7 @@ export default function ExtensionsSection() {