feat: mcp router extension discovery and install tool (#1995)

Co-authored-by: Alice Hau <ahau@squareup.com>
This commit is contained in:
Wendy Tang
2025-04-07 14:39:35 -07:00
committed by GitHub
parent 050a8f2f42
commit 7efe06096d
11 changed files with 401 additions and 104 deletions
+18
View File
@@ -642,6 +642,24 @@ impl Session {
principal_type: PrincipalType::Tool,
permission,
},).await;
} else if let Some(MessageContent::EnableExtensionRequest(enable_extension_request)) = message.content.first() {
output::hide_thinking();
let prompt = "Goose would like to install the following extension, do you approve?".to_string();
let confirmed = cliclack::select(prompt)
.item(true, "Yes, for this session", "Enable the extension for this session")
.item(false, "No", "Do not enable the extension")
.interact()?;
let permission = if confirmed {
Permission::AllowOnce
} else {
Permission::DenyOnce
};
self.agent.handle_confirmation(enable_extension_request.id.clone(), PermissionConfirmation {
principal_name: "extension_name_placeholder".to_string(),
principal_type: PrincipalType::Extension,
permission,
},).await;
}
// otherwise we have a model/tool to render
else {