feat: non-editable bundled extensions (#2114)

This commit is contained in:
Alex Hancock
2025-04-09 17:27:40 -04:00
committed by GitHub
parent 9610406065
commit 1d74f538ef
12 changed files with 127 additions and 62 deletions
+1
View File
@@ -243,6 +243,7 @@ impl Agent {
name: _,
tools,
instructions,
bundled: _,
} => {
// For frontend tools, just store them in the frontend_tools map
for tool in tools {
+17
View File
@@ -130,6 +130,9 @@ pub enum ExtensionConfig {
// NOTE: set timeout to be optional for compatibility.
// However, new configurations should include this field.
timeout: Option<u64>,
/// Whether this extension is bundled with Goose
#[serde(default)]
bundled: Option<bool>,
},
/// Standard I/O client with command and arguments
#[serde(rename = "stdio")]
@@ -142,6 +145,9 @@ pub enum ExtensionConfig {
envs: Envs,
timeout: Option<u64>,
description: Option<String>,
/// Whether this extension is bundled with Goose
#[serde(default)]
bundled: Option<bool>,
},
/// Built-in extension that is part of the goose binary
#[serde(rename = "builtin")]
@@ -150,6 +156,9 @@ pub enum ExtensionConfig {
name: String,
display_name: Option<String>, // needed for the UI
timeout: Option<u64>,
/// Whether this extension is bundled with Goose
#[serde(default)]
bundled: Option<bool>,
},
/// Frontend-provided tools that will be called through the frontend
#[serde(rename = "frontend")]
@@ -160,6 +169,9 @@ pub enum ExtensionConfig {
tools: Vec<Tool>,
/// Instructions for how to use these tools
instructions: Option<String>,
/// Whether this extension is bundled with Goose
#[serde(default)]
bundled: Option<bool>,
},
}
@@ -169,6 +181,7 @@ impl Default for ExtensionConfig {
name: config::DEFAULT_EXTENSION.to_string(),
display_name: Some(config::DEFAULT_DISPLAY_NAME.to_string()),
timeout: Some(config::DEFAULT_EXTENSION_TIMEOUT),
bundled: Some(true),
}
}
}
@@ -181,6 +194,7 @@ impl ExtensionConfig {
envs: Envs::default(),
description: Some(description.into()),
timeout: Some(timeout.into()),
bundled: None,
}
}
@@ -197,6 +211,7 @@ impl ExtensionConfig {
envs: Envs::default(),
description: Some(description.into()),
timeout: Some(timeout.into()),
bundled: None,
}
}
@@ -212,6 +227,7 @@ impl ExtensionConfig {
envs,
timeout,
description,
bundled,
..
} => Self::Stdio {
name,
@@ -220,6 +236,7 @@ impl ExtensionConfig {
args: args.into_iter().map(Into::into).collect(),
description,
timeout,
bundled,
},
other => other,
}
@@ -146,6 +146,7 @@ impl ExtensionManager {
name,
display_name: _,
timeout,
bundled: _,
} => {
// For builtin extensions, we run the current executable with mcp and extension name
let cmd = std::env::current_exe()
+1
View File
@@ -45,6 +45,7 @@ impl ExtensionConfigManager {
name: DEFAULT_EXTENSION.to_string(),
display_name: Some(DEFAULT_DISPLAY_NAME.to_string()),
timeout: Some(DEFAULT_EXTENSION_TIMEOUT),
bundled: Some(true),
},
},
)]);